use of org.monarchinitiative.loinc2hpocore.codesystems.Outcome in project loinc2hpo by monarch-initiative.
the class Dstu3ObservationTest method testGlucoseLow.
@Test
void testGlucoseLow() throws IOException {
String jsonPath = "json/glucoseLow.fhir";
Observation glucoseAbnormal = importDstu3Observation(jsonPath);
Uberobservation uberobservation = new ObservationDtu3(glucoseAbnormal);
LoincId expectedLoincId = new LoincId("15074-8");
Optional<LoincId> opt = uberobservation.getLoincId();
assertTrue(opt.isPresent());
assertEquals(expectedLoincId, opt.get());
Optional<Outcome> opt2 = uberobservation.getOutcome();
assertTrue(opt2.isPresent());
assertEquals(Outcome.LOW(), opt2.get());
assertNotEquals(Outcome.NORMAL(), opt2.get());
assertNotEquals(Outcome.HIGH(), opt2.get());
}
use of org.monarchinitiative.loinc2hpocore.codesystems.Outcome in project loinc2hpo by monarch-initiative.
the class ObservationR4 method getOutcomeFromCodedValue.
Optional<Outcome> getOutcomeFromCodedValue() {
CodeableConcept codeableConcept = this.observation.getValueCodeableConcept();
if (codeableConcept == null) {
// should never happen
LOGGER.error("Codable concept null in getOutcomeFromCodedValue");
}
List<Coding> codings = codeableConcept != null ? codeableConcept.getCoding() : List.of();
for (Coding coding : codings) {
String code = coding.getCode();
String system = coding.getSystem();
String display = coding.getDisplay();
String outcomeString = code + ":" + system + ":" + display;
Outcome outcome = Outcome.nominal(outcomeString);
return Optional.of(outcome);
}
return Optional.empty();
}
use of org.monarchinitiative.loinc2hpocore.codesystems.Outcome in project loinc2hpo by monarch-initiative.
the class ObservationWithCodedValueTest method testEcoliBloodCulture.
@Test
public void testEcoliBloodCulture() {
Observation ecoliObservation = ecoliNoInterpretationBloodCulture();
Uberobservation uberobservation = new ObservationDtu3(ecoliObservation);
LoincId loincId = new LoincId("600-7");
Optional<LoincId> loincOpt = uberobservation.getLoincId();
assertTrue(loincOpt.isPresent());
assertEquals(loincId, loincOpt.get());
Optional<Outcome> outcomeOpt = uberobservation.getOutcome();
assertTrue(outcomeOpt.isPresent());
Outcome outcome = outcomeOpt.get();
assertTrue(outcome.isNominal());
assertEquals("112283007:http://snomed.info/sct:Escherichia coli", outcome.getOutcome());
}
Aggregations