Jonas commited on
Commit
79d7705
·
1 Parent(s): c6579d1

Remove unnecessary outcome code translation in get_top_adverse_events function of openfda_client.py

Browse files
Files changed (1) hide show
  1. openfda_client.py +1 -6
openfda_client.py CHANGED
@@ -181,12 +181,7 @@ def get_top_adverse_events(drug_name: str, limit: int = 10, patient_sex: Optiona
181
  response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx)
182
 
183
  data = response.json()
184
-
185
- # Translate the outcome codes to human-readable terms
186
- if "results" in data:
187
- for item in data["results"]:
188
- item["term"] = OUTCOME_MAPPING.get(item["term"], f"Unknown ({item['term']})")
189
-
190
  cache[cache_key] = data
191
  return data
192
 
 
181
  response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx)
182
 
183
  data = response.json()
184
+
 
 
 
 
 
185
  cache[cache_key] = data
186
  return data
187