Skip to content

Commit

Permalink
Add fallback if medication name missing
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-c committed Nov 14, 2024
1 parent 53cb0a8 commit 57b95ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sof_wrapper/rxnav.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def add_drug_classes(med, rxnav_url):
"""Add Drug Classes"""

meds = []
med_text = med["medicationCodeableConcept"]["text"]
med_text = med.get("medicationCodeableConcept", {}).get("text", "")

for med_code in med["medicationCodeableConcept"]["coding"]:
meds.append(f"{med_code['system']}|{med_code['code']}")
Expand Down

0 comments on commit 57b95ce

Please sign in to comment.