Search in sources :

Example 1 with GoalToInfoDtoConverter

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

the class SupportService method listGoals.

public List<GoalInfoDto> listGoals() {
    Assert.notNull(SmartOnFhirContext.get().getPatient(), "Patient id cannot be null.");
    Bundle goalsBundle = ehrClient.search().forResource(Goal.class).sort().descending(Constants.PARAM_LASTUPDATED).where(Goal.PATIENT.hasId(SmartOnFhirContext.get().getPatient())).where(new StringClientParam(Constants.PARAM_PROFILE).matches().value(SDOHProfiles.GOAL)).where(Goal.LIFECYCLE_STATUS.exactly().code(Goal.GoalLifecycleStatus.ACTIVE.toCode())).returnBundle(Bundle.class).execute();
    return FhirUtil.getFromBundle(goalsBundle, Goal.class).stream().map(goal -> new GoalToInfoDtoConverter().convert(goal)).collect(Collectors.toList());
}
Also used : Constants(ca.uhn.fhir.rest.api.Constants) RequiredArgsConstructor(lombok.RequiredArgsConstructor) Autowired(org.springframework.beans.factory.annotation.Autowired) Condition(org.hl7.fhir.r4.model.Condition) UsCoreConditionCategory(org.hl7.gravity.refimpl.sdohexchange.fhir.UsCoreConditionCategory) IBaseBundle(org.hl7.fhir.instance.model.api.IBaseBundle) GoalToInfoDtoConverter(org.hl7.gravity.refimpl.sdohexchange.dto.converter.GoalToInfoDtoConverter) Task(org.hl7.fhir.r5.model.Task) TaskQueryFactory(org.hl7.gravity.refimpl.sdohexchange.fhir.query.TaskQueryFactory) Strings(com.google.common.base.Strings) GoalInfoDto(org.hl7.gravity.refimpl.sdohexchange.dto.response.GoalInfoDto) Service(org.springframework.stereotype.Service) GoalQueryFactory(org.hl7.gravity.refimpl.sdohexchange.fhir.query.GoalQueryFactory) IGenericClient(ca.uhn.fhir.rest.client.api.IGenericClient) StringClientParam(ca.uhn.fhir.rest.gclient.StringClientParam) HealthcareServiceBundleToDtoConverter(org.hl7.gravity.refimpl.sdohexchange.dto.converter.HealthcareServiceBundleToDtoConverter) SDOHProfiles(org.hl7.gravity.refimpl.sdohexchange.fhir.SDOHProfiles) HealthConcernQueryFactory(org.hl7.gravity.refimpl.sdohexchange.fhir.query.HealthConcernQueryFactory) HealthcareServiceDto(org.hl7.gravity.refimpl.sdohexchange.dto.response.HealthcareServiceDto) OrganizationDto(org.hl7.gravity.refimpl.sdohexchange.dto.response.OrganizationDto) OrganizationToDtoConverter(org.hl7.gravity.refimpl.sdohexchange.dto.converter.OrganizationToDtoConverter) Goal(org.hl7.fhir.r4.model.Goal) IQuery(ca.uhn.fhir.rest.gclient.IQuery) ConditionClinicalStatusCodes(org.hl7.gravity.refimpl.sdohexchange.fhir.ConditionClinicalStatusCodes) ReferenceDto(org.hl7.gravity.refimpl.sdohexchange.dto.response.ReferenceDto) ActiveResourcesDto(org.hl7.gravity.refimpl.sdohexchange.dto.response.ActiveResourcesDto) Collectors(java.util.stream.Collectors) Organization(org.hl7.fhir.r4.model.Organization) List(java.util.List) SmartOnFhirContext(com.healthlx.smartonfhir.core.SmartOnFhirContext) HealthcareService(org.hl7.fhir.r4.model.HealthcareService) ConditionToDtoConverter(org.hl7.gravity.refimpl.sdohexchange.dto.converter.ConditionToDtoConverter) Bundle(org.hl7.fhir.r4.model.Bundle) ConditionDto(org.hl7.gravity.refimpl.sdohexchange.dto.response.ConditionDto) OrganizationTypeCode(org.hl7.gravity.refimpl.sdohexchange.codes.OrganizationTypeCode) ProblemQueryFactory(org.hl7.gravity.refimpl.sdohexchange.fhir.query.ProblemQueryFactory) Questionnaire(org.hl7.fhir.r4.model.Questionnaire) FhirUtil(org.hl7.gravity.refimpl.sdohexchange.util.FhirUtil) Assert(org.springframework.util.Assert) Goal(org.hl7.fhir.r4.model.Goal) StringClientParam(ca.uhn.fhir.rest.gclient.StringClientParam) IBaseBundle(org.hl7.fhir.instance.model.api.IBaseBundle) Bundle(org.hl7.fhir.r4.model.Bundle) GoalToInfoDtoConverter(org.hl7.gravity.refimpl.sdohexchange.dto.converter.GoalToInfoDtoConverter)

Aggregations

Constants (ca.uhn.fhir.rest.api.Constants)1 IGenericClient (ca.uhn.fhir.rest.client.api.IGenericClient)1 IQuery (ca.uhn.fhir.rest.gclient.IQuery)1 StringClientParam (ca.uhn.fhir.rest.gclient.StringClientParam)1 Strings (com.google.common.base.Strings)1 SmartOnFhirContext (com.healthlx.smartonfhir.core.SmartOnFhirContext)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 RequiredArgsConstructor (lombok.RequiredArgsConstructor)1 IBaseBundle (org.hl7.fhir.instance.model.api.IBaseBundle)1 Bundle (org.hl7.fhir.r4.model.Bundle)1 Condition (org.hl7.fhir.r4.model.Condition)1 Goal (org.hl7.fhir.r4.model.Goal)1 HealthcareService (org.hl7.fhir.r4.model.HealthcareService)1 Organization (org.hl7.fhir.r4.model.Organization)1 Questionnaire (org.hl7.fhir.r4.model.Questionnaire)1 Task (org.hl7.fhir.r5.model.Task)1 OrganizationTypeCode (org.hl7.gravity.refimpl.sdohexchange.codes.OrganizationTypeCode)1 ConditionToDtoConverter (org.hl7.gravity.refimpl.sdohexchange.dto.converter.ConditionToDtoConverter)1 GoalToInfoDtoConverter (org.hl7.gravity.refimpl.sdohexchange.dto.converter.GoalToInfoDtoConverter)1