Skip to content

Commit

Permalink
Fix/idph etl logs (#261)
Browse files Browse the repository at this point in the history
* Add logs to idph Hospital Util

* Add gender mapping in idph vaccine
  • Loading branch information
nss10 committed Mar 16, 2022
1 parent 00f72dd commit 0cc85ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 1 addition & 3 deletions covid19-etl/etl/idph_vaccine.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ def map_race(self, value, prop_name):
"Middle Eastern or North African*": "Middle Eastern or North African",
"Middle Eastern or North Africa": "Middle Eastern or North African",
}
gender_mapping = {
"Unknown": "Unknown or Left Blank",
}
gender_mapping = {"Unknown": "Unknown or Left Blank", "": None}
age_group_mapping = {"65+": "greater than 65"}
if prop_name == "Race" and value in race_mapping:
return race_mapping.get(value)
Expand Down
9 changes: 7 additions & 2 deletions covid19-etl/utils/metadata_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,14 @@ def get_str_latest_submitted_date_idph(self):
f"Did not receive any data from Guppy. Query result for the query - {query_string} with variables - {variables} is \n\t {query_res}"
)
loc = query_res["data"]["location"]
if len(loc) > 0:
if loc is None:
print(
f"INFO: Invalid response -- {query_res} from query - {self.project_id}"
)
elif len(loc) > 0:
return loc[0]["date"].split("T")[0]
print(f"INFO: no existing location data in Guppy for {self.project_id}")
else:
print(f"INFO: no existing location data in Guppy for {self.project_id}")
return None

def add_record_to_submit(self, record):
Expand Down

0 comments on commit 0cc85ad

Please sign in to comment.