Search in sources :

Example 21 with Observation

use of org.hl7.fhir.dstu3.model.Observation 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());
}
Also used : ObservationDtu3(org.monarchinitiative.loinc2hpofhir.fhir2hpo.ObservationDtu3) Outcome(org.monarchinitiative.loinc2hpocore.codesystems.Outcome) Observation(org.hl7.fhir.dstu3.model.Observation) LoincId(org.monarchinitiative.loinc2hpocore.loinc.LoincId) Uberobservation(org.monarchinitiative.loinc2hpofhir.fhir2hpo.Uberobservation) Test(org.junit.jupiter.api.Test)

Aggregations

Observation (org.hl7.fhir.dstu3.model.Observation)15 Outcome (org.monarchinitiative.loinc2hpocore.codesystems.Outcome)7 Test (org.junit.jupiter.api.Test)6 LoincId (org.monarchinitiative.loinc2hpocore.loinc.LoincId)6 ObservationDtu3 (org.monarchinitiative.loinc2hpofhir.fhir2hpo.ObservationDtu3)6 Uberobservation (org.monarchinitiative.loinc2hpofhir.fhir2hpo.Uberobservation)6 TermId (com.github.phenomics.ontolib.ontology.data.TermId)4 IBaseBundle (org.hl7.fhir.instance.model.api.IBaseBundle)4 BeforeClass (org.junit.BeforeClass)4 HpoOntology (com.github.phenomics.ontolib.formats.hpo.HpoOntology)3 HpoTerm (com.github.phenomics.ontolib.formats.hpo.HpoTerm)3 HpoOboParser (com.github.phenomics.ontolib.io.obo.hpo.HpoOboParser)3 ImmutableMap (com.google.common.collect.ImmutableMap)3 TestBase.importDstu3Observation (fhir.TestBase.importDstu3Observation)3 File (java.io.File)3 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 Code (org.monarchinitiative.loinc2hpo.codesystems.Code)3 Test (org.junit.Test)2 ReferenceClientParam (ca.uhn.fhir.rest.gclient.ReferenceClientParam)1