use of org.hl7.gravity.refimpl.sdohexchange.fhir.extract.patienttask.PatientSocialRiskTaskPrepareBundleExtractor in project Gravity-SDOH-Exchange-RI by FHIR.
the class PatientTaskService method createSocialRiskTaskBundleFactory.
private PatientSocialRiskTaskBundleFactory createSocialRiskTaskBundleFactory(UserDto user, NewSocialRiskTaskRequestDto socialRiskTaskRequest) {
PatientSocialRiskTaskPrepareBundleFactory taskPrepareBundleFactory = new PatientSocialRiskTaskPrepareBundleFactory(SmartOnFhirContext.get().getPatient(), user.getId(), socialRiskTaskRequest.getQuestionnaireId());
Bundle taskRelatedResources = ehrClient.transaction().withBundle(taskPrepareBundleFactory.createPrepareBundle()).execute();
PatientSocialRiskTaskPrepareBundleExtractor.PatientSocialRiskTaskPrepareInfoHolder taskPrepareInfoHolder = new PatientSocialRiskTaskPrepareBundleExtractor().extract(taskRelatedResources);
PatientSocialRiskTaskBundleFactory taskBundleFactory = new PatientSocialRiskTaskBundleFactory();
taskBundleFactory.setName(socialRiskTaskRequest.getName());
taskBundleFactory.setPatient(taskPrepareInfoHolder.getPatient());
taskBundleFactory.setPriority(socialRiskTaskRequest.getPriority());
taskBundleFactory.setOccurrence(socialRiskTaskRequest.getOccurrence());
taskBundleFactory.setRequester(taskPrepareInfoHolder.getPerformer());
taskBundleFactory.setComment(socialRiskTaskRequest.getComment());
taskBundleFactory.setUser(user);
taskBundleFactory.setQuestionniare(taskPrepareInfoHolder.getQuestionnaire());
return taskBundleFactory;
}
Aggregations