use of org.hl7.gravity.refimpl.sdohexchange.dto.converter.ConditionToDtoConverter in project Gravity-SDOH-Exchange-RI by FHIR.
the class SupportService method listProblems.
public List<ConditionDto> listProblems() {
Assert.notNull(SmartOnFhirContext.get().getPatient(), "Patient id cannot be null.");
Bundle conditionsBundle = ehrClient.search().forResource(Condition.class).sort().descending(Constants.PARAM_LASTUPDATED).where(Condition.PATIENT.hasId(SmartOnFhirContext.get().getPatient())).where(new StringClientParam(Constants.PARAM_PROFILE).matches().value(SDOHProfiles.CONDITION)).where(Condition.CLINICAL_STATUS.exactly().code(ConditionClinicalStatusCodes.ACTIVE.toCode())).where(Condition.CATEGORY.exactly().systemAndCode(UsCoreConditionCategory.PROBLEMLISTITEM.getSystem(), UsCoreConditionCategory.PROBLEMLISTITEM.toCode())).returnBundle(Bundle.class).execute();
return FhirUtil.getFromBundle(conditionsBundle, Condition.class).stream().map(condition -> new ConditionToDtoConverter().convert(condition)).collect(Collectors.toList());
}
Aggregations