use of org.hl7.fhir.r4.model.Observation in project loinc2hpo by monarch-initiative.
the class ObservationWithInterpretationTest method testLowHemoglobinWithoutInterpretation.
/**
* Low erythrocytes with L interpretation.
*/
@Test
public void testLowHemoglobinWithoutInterpretation() {
Observation lowHb = lowHemoglobinObservation();
Uberobservation uberobservation = new ObservationDtu3(lowHb);
LoincId erysInBlood = new LoincId("789-8");
Optional<LoincId> opt = uberobservation.getLoincId();
assertTrue(opt.isPresent());
assertEquals(erysInBlood, opt.get());
Optional<Outcome> outcomeOpt = uberobservation.getOutcome();
assertTrue(outcomeOpt.isPresent());
assertEquals(Outcome.LOW(), outcomeOpt.get());
}
use of org.hl7.fhir.r4.model.Observation in project bunsen by cerner.
the class TestData method newObservation.
/**
* Returns a FHIR Observation for testing purposes.
*/
public static Observation newObservation() {
// Observation based on https://www.hl7.org/FHIR/observation-example-bloodpressure.json.html
Observation observation = new Observation();
observation.setId("blood-pressure");
Identifier identifier = observation.addIdentifier();
identifier.setSystem("urn:ietf:rfc:3986");
identifier.setValue("urn:uuid:187e0c12-8dd2-67e2-99b2-bf273c878281");
observation.setStatus(Observation.ObservationStatus.FINAL);
Quantity quantity = new Quantity();
quantity.setValue(new java.math.BigDecimal("123.45"));
quantity.setUnit("mm[Hg]");
observation.setValue(quantity);
return observation;
}
use of org.hl7.fhir.r4.model.Observation in project beneficiary-fhir-data by CMSgov.
the class DMEClaimTransformerV2Test method shouldHaveLineHctHgbRsltNumSupInfo.
@Test
public void shouldHaveLineHctHgbRsltNumSupInfo() {
SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("https://bluebutton.cms.gov/resources/variables/line_hct_hgb_rslt_num", eob.getSupportingInfo());
SupportingInformationComponent compare = TransformerTestUtilsV2.createSupportingInfo(// We don't care what the sequence number is here
sic.getSequence(), // Category
Arrays.asList(new Coding("http://terminology.hl7.org/CodeSystem/claiminformationcategory", "info", "Information"), new Coding("https://bluebutton.cms.gov/resources/codesystem/information", "https://bluebutton.cms.gov/resources/variables/line_hct_hgb_rslt_num", "Hematocrit / Hemoglobin Test Results")));
compare.setValue(new Reference("#line-observation-1"));
assertTrue(compare.equalsDeep(sic));
}
use of org.hl7.fhir.r4.model.Observation in project beneficiary-fhir-data by CMSgov.
the class CarrierClaimTransformerV2Test method shouldHaveSupportingInfoListForClaimReceivedDate2.
@Test
public void shouldHaveSupportingInfoListForClaimReceivedDate2() {
SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("info", eob.getSupportingInfo());
SupportingInformationComponent compare = TransformerTestUtilsV2.createSupportingInfo(// We don't care what the sequence number is here
sic.getSequence(), // Category
Arrays.asList(new Coding("http://terminology.hl7.org/CodeSystem/claiminformationcategory", "info", "Information"), new Coding("https://bluebutton.cms.gov/resources/codesystem/information", "https://bluebutton.cms.gov/resources/variables/line_hct_hgb_rslt_num", "Hematocrit / Hemoglobin Test Results")));
compare.setValue(new Reference("#line-observation-6"));
assertTrue(compare.equalsDeep(sic));
}
use of org.hl7.fhir.r4.model.Observation in project beneficiary-fhir-data by CMSgov.
the class TransformerUtilsV2 method findOrCreateContainedObservation.
static Observation findOrCreateContainedObservation(ExplanationOfBenefit eob, String id) {
Optional<Resource> observation = eob.getContained().stream().filter(r -> r.getId() == id).findFirst();
// If it isn't there, add one
if (!observation.isPresent()) {
observation = Optional.of(new Observation().setId(id));
eob.getContained().add(observation.get());
}
// At this point `observation.get()` will always return
if (!Observation.class.isInstance(observation.get())) {
throw new BadCodeMonkeyException();
}
return (Observation) observation.get();
}
Aggregations