use of org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus in project openmrs-module-fhir2 by openmrs.
the class ConditionVerificationStatusTranslatorImpl_2_2 method toOpenmrsType.
@Override
public ConditionVerificationStatus toOpenmrsType(@Nonnull CodeableConcept codeableConcept) {
if (codeableConcept == null || codeableConcept.getCoding().isEmpty()) {
return null;
}
Optional<Coding> verificationStatus = codeableConcept.getCoding().stream().filter(c -> c.getSystem().equals(FhirConstants.CONDITION_VERIFICATION_STATUS_SYSTEM_URI)).findFirst();
Coding verificationStatusCode = verificationStatus.orElse(null);
if (verificationStatusCode == null) {
return null;
}
switch(verificationStatusCode.getCode()) {
case "confirmed":
return ConditionVerificationStatus.CONFIRMED;
case "provisional":
return ConditionVerificationStatus.PROVISIONAL;
default:
return null;
}
}
Aggregations