Skip to content

Commit

Permalink
fix to ensure that the home-setting extension is added to resources *…
Browse files Browse the repository at this point in the history
…before* getting bundled, for #182
  • Loading branch information
OHSUCMP committed Mar 8, 2024
1 parent 2d2d1a1 commit 9c2e83c
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,14 @@ public Bundle transformOutgoingBloodPressureReading(BloodPressureModel model) th
// ensure BP panel Observations are tagged with the common panel coding
Observation sourceBPObservation = model.getSourceBPObservation().copy();
appendIfMissing(sourceBPObservation, fcm.getBpPanelCommonCoding());
FhirUtil.appendResourceToBundle(bundle, sourceBPObservation);

// CQF Ruler needs to see the Home Setting extension to positively identify the reading as Home
if (model.isHomeReading() && ! FhirUtil.hasHomeSettingExtension(sourceBPObservation)) {
FhirUtil.addHomeSettingExtension(sourceBPObservation);
}

FhirUtil.appendResourceToBundle(bundle, sourceBPObservation);

if (model.getSourceEncounter() != null) {
FhirUtil.appendResourceToBundle(bundle, model.getSourceEncounter().copy());
}
Expand All @@ -126,22 +127,24 @@ public Bundle transformOutgoingBloodPressureReading(BloodPressureModel model) th
// ensure BP systolic and diastolic Observations are tagged with the common systolic and diastolic codings
Observation systolicObservation = model.getSourceSystolicObservation().copy();
appendIfMissing(systolicObservation, fcm.getBpSystolicCommonCoding());
FhirUtil.appendResourceToBundle(bundle,systolicObservation);

// CQF Ruler needs to see the Home Setting extension to positively identify the reading as Home
if (model.isHomeReading() && ! FhirUtil.hasHomeSettingExtension(systolicObservation)) {
FhirUtil.addHomeSettingExtension(systolicObservation);
}

FhirUtil.appendResourceToBundle(bundle, systolicObservation);

Observation diastolicObservation = model.getSourceDiastolicObservation().copy();
appendIfMissing(diastolicObservation, fcm.getBpDiastolicCommonCoding());
FhirUtil.appendResourceToBundle(bundle, diastolicObservation);

// CQF Ruler needs to see the Home Setting extension to positively identify the reading as Home
if (model.isHomeReading() && ! FhirUtil.hasHomeSettingExtension(diastolicObservation)) {
FhirUtil.addHomeSettingExtension(diastolicObservation);
}

FhirUtil.appendResourceToBundle(bundle, diastolicObservation);

if (model.getSourceEncounter() != null) {
FhirUtil.appendResourceToBundle(bundle, model.getSourceEncounter());
}
Expand Down

0 comments on commit 9c2e83c

Please sign in to comment.