Skip to content

Commit 9dd4451

Browse files
committed
narrow hosp admissions header filter
1 parent 6b5263d commit 9dd4451

File tree

1 file changed

+10
-13
lines changed
  • dsew_community_profile/delphi_dsew_community_profile

1 file changed

+10
-13
lines changed

dsew_community_profile/delphi_dsew_community_profile/pull.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def _parse_times_for_sheet(self, sheet):
252252
@staticmethod
253253
def retain_header(header):
254254
"""Ignore irrelevant headers."""
255-
return ((all([
255+
return all([
256256
# include "Total NAATs - [last|previous] 7 days ..."
257257
# include "Total RT-PCR diagnostic tests - [last|previous] 7 days ..."
258258
# include "NAAT positivity rate - [last|previous] 7 days ..."
@@ -270,17 +270,15 @@ def retain_header(header):
270270
header.find("7 days") > 0,
271271
# exclude "NAAT positivity rate - last 7 days - ages <5"
272272
header.find(" ages") < 0,
273-
]) or all([
273+
]) or (
274274
# include "Confirmed COVID-19 admissions - last 7 days"
275-
header.startswith("Confirmed COVID-19 admissions"),
276275
# exclude "Confirmed COVID-19 admissions - percent change"
277-
header.find("7 days") > 0,
278276
# exclude "Confirmed COVID-19 admissions - last 7 days - ages <18"
279277
# exclude "Confirmed COVID-19 admissions - last 7 days - age unknown"
280-
header.find(" age") < 0,
281278
# exclude "Confirmed COVID-19 admissions per 100 inpatient beds - last 7 days"
282-
header.find(" beds") < 0,
283-
])) or (all([
279+
# exclude "Confirmed COVID-19 admissions per 100k - last 7 days"
280+
header == "Confirmed COVID-19 admissions - last 7 days"
281+
) or all([
284282
# include "People who are fully vaccinated"
285283
# include "People who have received a booster dose since August 13, 2021"
286284
header.startswith("People who"),
@@ -292,13 +290,12 @@ def retain_header(header):
292290
header.find(" age") < 0,
293291
# exclude "People who are fully vaccinated - 12-17" ...
294292
header.find("-") < 0,
295-
296293
]) or all([
297-
# include "People with full course administered"
298-
header.startswith("People with full course"),
299-
# exclude "People with full course administered as % of adult population"
300-
header.find("%") < 0,
301-
])))
294+
# include "People with full course administered"
295+
header.startswith("People with full course"),
296+
# exclude "People with full course administered as % of adult population"
297+
header.find("%") < 0,
298+
])
302299
def _parse_sheet(self, sheet):
303300
"""Extract data frame for this sheet."""
304301
df = pd.read_excel(

0 commit comments

Comments
 (0)