Skip to content

Support chng-fips county group reporting in chng for privacy #1883

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion ansible/templates/changehc-params-prod.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"n_waiting_days": 3,
"se": false,
"parallel": false,
"geos": ["state", "msa", "hrr", "county", "hhs", "nation"],
"geos": ["state", "msa", "hrr", "chng-fips", "hhs", "nation"],
"weekday": [true, false],
"types": ["covid","cli","flu"],
"wip_signal": "",
Expand Down
9 changes: 8 additions & 1 deletion ansible/templates/sir_complainsalot-params-prod.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@
"chng": {
"max_age": 6,
"maintainers": ["U01AP8GSWG3","U01069KCRS7"],
"retired-signals": ["smoothed_outpatient_covid", "smoothed_adj_outpatient_covid", "smoothed_outpatient_cli", "smoothed_adj_outpatient_cli"]
"retired-signals": [
["smoothed_outpatient_covid", "county"],
["smoothed_adj_outpatient_covid", "county"],
["smoothed_outpatient_cli", "county"],
["smoothed_adj_outpatient_cli", "county"],
["smoothed_outpatient_flu", "county"],
["smoothed_adj_outpatient_flu", "county"]
]
},
"google-symptoms": {
"max_age": 6,
Expand Down
21 changes: 14 additions & 7 deletions changehc/delphi_changehc/update_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(self,
startdate: first sensor date (YYYY-mm-dd)
enddate: last sensor date (YYYY-mm-dd)
dropdate: data drop date (YYYY-mm-dd)
geo: geographic resolution, one of ["county", "state", "msa", "hrr", "hhs", "nation"]
geo: geographic resolution, one of ["county", "chng-fips", "state", "msa", "hrr", "hhs", "nation"]
parallel: boolean to run the sensor update in parallel
weekday: boolean to adjust for weekday effects
numtype: type of count data used, one of ["covid", "cli"]
Expand Down Expand Up @@ -149,19 +149,26 @@ def geo_reindex(self, data):
# get right geography
geo = self.geo
gmpr = GeoMapper()
if geo not in {"county", "state", "msa", "hrr", "nation", "hhs"}:
self.logger.error("{0} is invalid, pick one of 'county', "
if geo not in {"county", "chng-fips", "state", "msa", "hrr", "nation", "hhs"}:
self.logger.error("{0} is invalid, pick one of 'county', 'chng-fips', "
"'state', 'msa', 'hrr', 'hss','nation'".format(geo))
return False
if geo == "county":
data_frame = gmpr.fips_to_megacounty(data,
if geo == "county" or geo == "chng-fips":
if geo == "chng-fips":
data_frame = gmpr.replace_geocode(data, "fips", geo, new_col="chng-fips-raw", date_col=Config.DATE_COL)
fips_col = "chng-fips-raw"
else:
data_frame = data
fips_col = "fips"
data_frame = gmpr.fips_to_megacounty(data_frame,
Config.MIN_DEN,
Config.MAX_BACKFILL_WINDOW,
thr_col="den",
mega_col=geo,
date_col=Config.DATE_COL)
date_col=Config.DATE_COL,
fips_col=fips_col)
# this line should be removed once the fix is implemented for megacounties
data_frame = data_frame[~((data_frame['county'].str.len() > 5) | (data_frame['county'].str.contains('_')))]
data_frame = data_frame[~((data_frame[geo].str.len() > 5) | (data_frame[geo].str.contains('_')))]
elif geo == "state":
data_frame = gmpr.replace_geocode(data, "fips", "state_id", new_col="state",
date_col=Config.DATE_COL)
Expand Down
4 changes: 2 additions & 2 deletions changehc/params.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"n_waiting_days": 3,
"se": false,
"parallel": false,
"geos": ["state", "msa", "hrr", "county", "nation", "hhs"],
"geos": ["state", "msa", "hrr", "chng-fips", "nation", "hhs"],
"weekday": [true, false],
"types": ["covid","cli"],
"types": ["covid","cli", "flu"],
"wip_signal": "",
"ftp_conn": {
"host": "",
Expand Down
10 changes: 9 additions & 1 deletion sir_complainsalot/params.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@
},
"chng": {
"max_age": 6,
"maintainers": ["U01AP8GSWG3","U01069KCRS7"]
"maintainers": ["U01AP8GSWG3","U01069KCRS7"],
"retired-signals": [
["smoothed_outpatient_covid", "county"],
["smoothed_adj_outpatient_covid", "county"],
["smoothed_outpatient_cli", "county"],
["smoothed_adj_outpatient_cli", "county"],
["smoothed_outpatient_flu", "county"],
["smoothed_adj_outpatient_flu", "county"]
]
},
"google-symptoms": {
"max_age": 6,
Expand Down