Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#182 - fix to ensure home-setting extension gets added to BP observations before bundling #183

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading