use of org.hl7.gravity.refimpl.sdohexchange.dto.converter.PatientTaskBundleToDtoConverter in project Gravity-SDOH-Exchange-RI by FHIR.
the class PatientTaskService method read.
public PatientTaskDto read(String id) {
Bundle taskBundle = new PatientTaskQueryFactory().query(ehrClient, SmartOnFhirContext.get().getPatient()).include(Task.INCLUDE_PART_OF).where(Task.RES_ID.exactly().code(id)).where(new TokenClientParam("owner:Patient").exactly().code(SmartOnFhirContext.get().getPatient())).returnBundle(Bundle.class).execute();
addQuestionnairesToTaskBundle(taskBundle);
addQuestionnaireResponsesToTaskBundle(taskBundle);
return new PatientTaskBundleToDtoConverter().convert(taskBundle).stream().findFirst().orElseThrow(() -> new ResourceNotFoundException(new IdType(Task.class.getSimpleName(), id)));
}
Aggregations