Search in sources :

Example 1 with PatientTaskBundleToItemDtoConverter

use of org.hl7.gravity.refimpl.sdohexchange.dto.converter.PatientTaskBundleToItemDtoConverter in project Gravity-SDOH-Exchange-RI by FHIR.

the class PatientTaskService method listTasks.

public List<PatientTaskItemDto> listTasks() {
    Assert.notNull(SmartOnFhirContext.get().getPatient(), "Patient id cannot be null.");
    Bundle tasksBundle = new PatientTaskQueryFactory().query(ehrClient, SmartOnFhirContext.get().getPatient()).include(Task.INCLUDE_PART_OF).where(new TokenClientParam("owner:Patient").exactly().code(SmartOnFhirContext.get().getPatient())).returnBundle(Bundle.class).execute();
    addQuestionnairesToTaskBundle(tasksBundle);
    return new PatientTaskBundleToItemDtoConverter().convert(tasksBundle);
}
Also used : PatientTaskBundleToItemDtoConverter(org.hl7.gravity.refimpl.sdohexchange.dto.converter.PatientTaskBundleToItemDtoConverter) TokenClientParam(ca.uhn.fhir.rest.gclient.TokenClientParam) Bundle(org.hl7.fhir.r4.model.Bundle) PatientTaskQueryFactory(org.hl7.gravity.refimpl.sdohexchange.fhir.query.PatientTaskQueryFactory)

Aggregations

TokenClientParam (ca.uhn.fhir.rest.gclient.TokenClientParam)1 Bundle (org.hl7.fhir.r4.model.Bundle)1 PatientTaskBundleToItemDtoConverter (org.hl7.gravity.refimpl.sdohexchange.dto.converter.PatientTaskBundleToItemDtoConverter)1 PatientTaskQueryFactory (org.hl7.gravity.refimpl.sdohexchange.fhir.query.PatientTaskQueryFactory)1