Skip to content

Commit

Permalink
IDPH vaccine ETL debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
paulineribeyre committed Mar 28, 2023
1 parent 8c8b5a6 commit d09c5d2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions covid19-etl/etl/idph_vaccine.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def parse_list_of_counties(self):
into `self.counties_inventory` the data in format:
{ <county name>: { <county properties> } }
"""
print(f"Getting {ROOT_URL}")
response = self.get(ROOT_URL, headers={"content-type": "json"})
assert response, f"No data at {ROOT_URL}"
json_response = json.loads(response.text)
Expand Down Expand Up @@ -111,7 +112,7 @@ def parse_group_clinical_demographic(self, props_mapping, props_value):
if key is not None:
key_props[key] = props_value.get(k)
props_data = {}
for (k, v) in props_mapping.items():
for k, v in props_mapping.items():
if k in props_value:
if k in key_props_name:
value = props_value.get(k)
Expand Down Expand Up @@ -165,7 +166,7 @@ def parse_county_data(self):
illinois_summary_clinical_submitter_id = ""
for i, county in enumerate(self.counties_inventory):
if i % 10 == 0:
print(f"{i} / {len(self.counties_inventory)} counties")
print(f"{i} / {len(self.counties_inventory)} counties ({county})")

county_covid_response = self.get(
COUNTY_COVID_LINK_FORMAT.format(county),
Expand Down Expand Up @@ -224,9 +225,9 @@ def parse_county_data(self):
"date": self.date,
"summary_locations": [{"submitter_id": summary_location_submitter_id}],
}
for (key, value) in county_vaccine_mapping.items():
for key, value in county_vaccine_mapping.items():
if value == "vaccine_persons_fully_vaccinated_pct":
summary_clinical[value] = int(county_covid_data.get(key) * 100)
summary_clinical[value] = int(county_covid_data.get(key, 0) * 100)
elif value == "vaccine_administered_count_roll_avg":
summary_clinical[value] = int(county_covid_data.get(key))
elif value == "date":
Expand All @@ -237,7 +238,7 @@ def parse_county_data(self):
summary_clinical[value] = county_covid_data.get(key)
# for (key, value) in county_demo_mapping.items():
# summary_clinical[value] = county_demo_data.get(key)
for (key, value) in inventory_reported.items():
for key, value in inventory_reported.items():
summary_clinical[value] = (
self.counties_inventory[county].get(key)
if value != "date"
Expand All @@ -254,6 +255,7 @@ def parse_total_state_wide(self, state_summary_clinical_submitter_id):
"""
Parse the Illinois total stats
"""
print(f"Getting {TOTAL_VACCINE_LINK}")
county_covid_response = self.get(
TOTAL_VACCINE_LINK, headers={"content-type": "json"}
)
Expand All @@ -267,7 +269,7 @@ def parse_total_state_wide(self, state_summary_clinical_submitter_id):
"LTC_Administered": "vaccine_long_term_care_administered",
"Report_Date": "date",
}
for (key, value) in total_vaccine_mapping.items():
for key, value in total_vaccine_mapping.items():
if value != "date":
self.summary_clinicals[state_summary_clinical_submitter_id][
value
Expand Down

0 comments on commit d09c5d2

Please sign in to comment.