use of org.hl7.gravity.refimpl.sdohexchange.dto.converter.AssessmentBundleToDtoConverter in project Gravity-SDOH-Exchange-RI by FHIR.
the class AssessmentService method search.
public AssessmentDto search(String questionnaireUrl) {
Assert.notNull(SmartOnFhirContext.get().getPatient(), "Patient id cannot be null.");
Bundle responseBundle = searchAssessmentQuery().where(QuestionnaireResponse.QUESTIONNAIRE.hasId(questionnaireUrl)).returnBundle(Bundle.class).execute();
responseBundle = addQuestionnairesToAssessmentBundle(responseBundle);
return new AssessmentBundleToDtoConverter().convert(responseBundle).stream().findFirst().orElseThrow(() -> new ResourceNotFoundException(String.format("Resource of type QuestionnaireResponse with " + "questionnaire url '%s' is not known", questionnaireUrl)));
}
use of org.hl7.gravity.refimpl.sdohexchange.dto.converter.AssessmentBundleToDtoConverter in project Gravity-SDOH-Exchange-RI by FHIR.
the class AssessmentService method listCompleted.
public List<AssessmentDto> listCompleted() {
Assert.notNull(SmartOnFhirContext.get().getPatient(), "Patient id cannot be null.");
Bundle responseBundle = searchAssessmentQuery().where(QuestionnaireResponse.STATUS.exactly().code(QuestionnaireResponseStatus.COMPLETED.toCode())).returnBundle(Bundle.class).execute();
responseBundle = addQuestionnairesToAssessmentBundle(responseBundle);
return new AssessmentBundleToDtoConverter().convert(responseBundle);
}
Aggregations