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;
}
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;
}
Aggregations