Skip to content

Make CPR hospital admissions header filter more specific #1544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2022

Conversation

nmdefries
Copy link
Contributor

@nmdefries nmdefries commented Mar 2, 2022

Description

The CPR recently changed the column "Confirmed COVID-19 admissions per 100 inpatient beds - last 7 days" to "Confirmed COVID-19 admissions per 100k - last 7 days". Since we were excluding this field by checking whether the header name contained the string "beds", the name change caused the filter to fail and for the column to be reported as hospital admissions (along with the actual hospital admissions).

We just use one column that begins "Confirmed COVID-19 admissions", so we can make the filter for this particular header a lot narrower to avoid future problems from field name changes. Also clean up the retain_overheader logic a bit.

Changelog

  • pull.py

Fixes

Assertion error

@nmdefries nmdefries requested a review from krivard March 2, 2022 23:33
Copy link
Contributor

@krivard krivard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

header.find(" beds") < 0,
])) or (all([
# exclude "Confirmed COVID-19 admissions per 100k - last 7 days"
header == "Confirmed COVID-19 admissions - last 7 days"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have confirmed through exhaustive checking that this is the only header ever used for the column we want, across all sheets and all dates up to 2022-02-24. A refreshing degree of consistency for this report!

@krivard krivard merged commit e8165aa into main Mar 3, 2022
@krivard krivard deleted the ndefries/cpr-update-admissions-header branch March 3, 2022 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants