Search in sources :

Example 6 with ObservationComponentComponent

use of org.hl7.fhir.dstu3.model.Observation.ObservationComponentComponent in project himss_2021_sepsis_detection by redhat-na-ssa.

the class GetObservationsSignalEventCommand method buildPatientVitals.

private PatientVitals buildPatientVitals(Patient patient, List<Observation> timeBoxedObservations) {
    String obsId = timeBoxedObservations.get(0).getId().split("/")[timeBoxedObservations.get(0).getId().split("/").length - 1];
    PatientVitals vitals = new PatientVitals();
    vitals.setObservationId(obsId);
    for (Observation observation : timeBoxedObservations) {
        for (Coding coding : observation.getCode().getCoding()) {
            log.info("Coding Display : " + coding.getDisplay());
            if (coding.getDisplay().equals(FHIRUtil.TEMP_CODE_STRING))
                vitals.setTemp(observation.getValueQuantity().getValue().doubleValue());
            if (coding.getDisplay().equals(FHIRUtil.HR_CODE_STRING))
                vitals.setHr(observation.getValueQuantity().getValue().doubleValue());
            if (coding.getDisplay().equals(FHIRUtil.BLOOD_PRESSURE_STRING)) {
                for (ObservationComponentComponent component : observation.getComponent()) {
                    for (Coding code : component.getCode().getCoding()) {
                        if (code.getDisplay().equals(FHIRUtil.SBP_CODE_STRING))
                            vitals.setSbp(component.getValueQuantity().getValue().doubleValue());
                        if (code.getDisplay().equals(FHIRUtil.DBP_CODE_STRING))
                            vitals.setDbp(component.getValueQuantity().getValue().doubleValue());
                    }
                }
            }
            if (coding.getDisplay().equals(FHIRUtil.RESPRATE_CODE_STRING))
                vitals.setResp(observation.getValueQuantity().getValue().doubleValue());
            if (coding.getDisplay().equals(FHIRUtil.O2SAT_CODE_STRING))
                vitals.setO2Sat(observation.getValueQuantity().getValue().doubleValue());
        }
    }
    return vitals;
}
Also used : Coding(org.hl7.fhir.r4.model.Coding) ObservationComponentComponent(org.hl7.fhir.r4.model.Observation.ObservationComponentComponent) PatientVitals(com.redhat.naps.process.model.PatientVitals) Observation(org.hl7.fhir.r4.model.Observation)

Example 7 with ObservationComponentComponent

use of org.hl7.fhir.dstu3.model.Observation.ObservationComponentComponent in project org.hl7.fhir.core by hapifhir.

the class ObservationStatsBuilder method component.

private static ObservationComponentComponent component(Observation obs, String lCode, String text) {
    ObservationComponentComponent comp = obs.addComponent();
    comp.getCode().setText(text).addCoding().setCode(lCode).setSystem("http://loinc.org");
    return comp;
}
Also used : ObservationComponentComponent(org.hl7.fhir.dstu3.model.Observation.ObservationComponentComponent)

Aggregations

ObservationComponentComponent (org.hl7.fhir.r4.model.Observation.ObservationComponentComponent)5 Observation (org.hl7.fhir.r4.model.Observation)3 Date (java.util.Date)2 ObservationComponentComponent (org.hl7.fhir.dstu3.model.Observation.ObservationComponentComponent)2 Coding (org.hl7.fhir.r4.model.Coding)2 IntegerType (org.hl7.fhir.r4.model.IntegerType)2 Type (org.hl7.fhir.r4.model.Type)2 NodeType (org.hl7.fhir.utilities.xhtml.NodeType)2 Code (org.mitre.synthea.world.concepts.HealthRecord.Code)2 EncounterType (org.mitre.synthea.world.concepts.HealthRecord.EncounterType)2 Observation (org.mitre.synthea.world.concepts.HealthRecord.Observation)2 PatientVitals (com.redhat.naps.process.model.PatientVitals)1 ItemData (de.difuture.uds.odm2fhir.odm.model.ItemData)1 Locale (java.util.Locale)1 AllergyIntoleranceType (org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceType)1 BooleanType (org.hl7.fhir.dstu3.model.BooleanType)1 BundleEntryComponent (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent)1 BundleType (org.hl7.fhir.dstu3.model.Bundle.BundleType)1 CodeType (org.hl7.fhir.dstu3.model.CodeType)1 DateTimeType (org.hl7.fhir.dstu3.model.DateTimeType)1