Skip to content

Commit

Permalink
Fixup FHIR compliance; add missing resource nesting (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-c authored Nov 21, 2024
1 parent ea70080 commit d829f5d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sof_wrapper/api/fhir.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ def annotate_meds(med_bundle):
annotated_bundle = med_bundle.copy()
annotated_bundle['entry'] = []

for med in med_bundle['entry']:
annotated_bundle['entry'].append(add_drug_classes(med, rxnav_url=current_app.config["RXNAV_URL"]))
for resource in med_bundle['entry']:
annotated_bundle['entry'].append(
{"resource": add_drug_classes(resource["resource"], rxnav_url=current_app.config["RXNAV_URL"])}
)
return annotated_bundle


Expand Down Expand Up @@ -147,7 +149,7 @@ def pdmp_meds(pdmp_url, params):
len(response.json().get("entry", [])),
response.elapsed.total_seconds(),
),
extra={'tags': ['PDMP', 'MedicationRequest'], 'meds': [e for e in response.json().get("entry", [])]}
extra={'tags': ['PDMP', 'MedicationRequest']}
)
return response.json()

Expand Down

0 comments on commit d829f5d

Please sign in to comment.