Skip to content
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

leap year fixes for claims_hosp and quidel_covidtest #1947

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion claims_hosp/delphi_claims_hosp/backfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ def store_backfill_file(claims_filepath, _end_date, backfill_dir):
backfilldata = gmpr.add_geocode(backfilldata, from_code="fips", new_code="state_id",
from_col="fips", new_col="state_id")
#Store one year's backfill data
_start_date = _end_date.replace(year=_end_date.year-1)
if _end_date.day == 29 and _end_date.month == 2:
_start_date = datetime(_end_date.year-1, 2, 28)
else:
_start_date = _end_date.replace(year=_end_date.year-1)
selected_columns = ['time_value', 'fips', 'state_id',
'den', 'num']
backfilldata = backfilldata.loc[(backfilldata["time_value"] >= _start_date)
Expand Down
5 changes: 4 additions & 1 deletion quidel_covidtest/delphi_quidel_covidtest/backfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ def store_backfill_file(df, _end_date, backfill_dir):
"totalTest_age_0_17": "den_age_0_17"},
axis=1, inplace=True)
#Store one year's backfill data
_start_date = _end_date.replace(year=_end_date.year-1)
if _end_date.day == 29 and _end_date.month == 2:
_start_date = datetime(_end_date.year-1, 2, 28)
else:
_start_date = _end_date.replace(year=_end_date.year-1)
selected_columns = ['time_value', 'fips', 'state_id',
'den_total', 'num_total',
'num_age_0_4', 'den_age_0_4',
Expand Down
Loading