Skip to content

Commit

Permalink
Fixup FHIR compliance; add missing resource nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-c committed Nov 18, 2024
1 parent 53f852e commit fc989d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion script_facade/models/r1/bundle.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
def as_bundle(fhir_resources, bundle_type='collection'):
entries = []
for fhir_resource in fhir_resources:
entries.append(fhir_resource)
entries.append({"resource": fhir_resource})

bundle_fhir = {
"resourceType": 'Bundle',
Expand Down
2 changes: 1 addition & 1 deletion script_facade/rxnav/transcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def add_rxnorm_coding(medication_order_bundle, rxnav_url):
"""Add rxnorm codings to each MedicationOrder in given FHIR bundle"""
medication_order_bundle = medication_order_bundle.copy()
for medication_order in medication_order_bundle['entry']:
medication = medication_order['medicationCodeableConcept']
medication = medication_order['resource']['medicationCodeableConcept']
rxnorm_codings = []
for coding in medication['coding']:
# skip non-NDC codings
Expand Down

0 comments on commit fc989d8

Please sign in to comment.