From 5c72cbd9985579382c88be271c2c68699bcd1be8 Mon Sep 17 00:00:00 2001 From: minhkhul <118945681+minhkhul@users.noreply.github.com> Date: Thu, 12 Sep 2024 17:40:54 -0400 Subject: [PATCH 01/15] Correct pypi classifier string (#2055) --- _delphi_utils_python/pyproject.toml | 2 +- _template_python/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_delphi_utils_python/pyproject.toml b/_delphi_utils_python/pyproject.toml index f7f14e8c2..c47590a29 100644 --- a/_delphi_utils_python/pyproject.toml +++ b/_delphi_utils_python/pyproject.toml @@ -13,7 +13,7 @@ classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Programming Language :: Python :: 3.8", - "License :: MIT", + "License :: OSI Approved :: MIT License", ] dependencies = [ "boto3", diff --git a/_template_python/pyproject.toml b/_template_python/pyproject.toml index c29d9650e..2f84aaa00 100644 --- a/_template_python/pyproject.toml +++ b/_template_python/pyproject.toml @@ -13,7 +13,7 @@ classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Programming Language :: Python :: 3.8", - "License :: MIT", + "License :: OSI Approved :: MIT License", ] dependencies = [ "delphi-utils", From 12a97123506ece1f383109b24fb6558655364928 Mon Sep 17 00:00:00 2001 From: aysim319 Date: Wed, 18 Sep 2024 17:41:41 -0400 Subject: [PATCH 02/15] Fix unstructured logging variable formatting (#2029) Co-authored-by: george Co-authored-by: minhkhul <118945681+minhkhul@users.noreply.github.com> --- _delphi_utils_python/README.md | 11 +++++- _delphi_utils_python/delphi_utils/export.py | 6 ++-- .../delphi_utils/flash_eval/eval_day.py | 3 +- _delphi_utils_python/delphi_utils/logger.py | 10 +++--- _delphi_utils_python/delphi_utils/runner.py | 19 +++++++--- _delphi_utils_python/tests/test_export.py | 10 +++--- changehc/delphi_changehc/run.py | 34 +++++++++--------- changehc/delphi_changehc/sensor.py | 14 ++++---- changehc/delphi_changehc/update_sensor.py | 19 +++++----- changehc/tests/test_update_sensor.py | 3 +- .../download_claims_ftp_files.py | 2 +- claims_hosp/delphi_claims_hosp/indicator.py | 11 +++--- .../delphi_claims_hosp/modify_claims_drops.py | 2 +- claims_hosp/delphi_claims_hosp/run.py | 12 +++---- .../delphi_claims_hosp/update_indicator.py | 26 +++++++------- claims_hosp/tests/test_update_indicator.py | 21 ++++++----- .../download_claims_ftp_files.py | 2 +- .../modify_claims_drops.py | 2 +- doctor_visits/delphi_doctor_visits/patch.py | 11 +++--- doctor_visits/delphi_doctor_visits/run.py | 35 ++++++++++--------- doctor_visits/delphi_doctor_visits/sensor.py | 2 +- .../delphi_doctor_visits/update_sensor.py | 6 ++-- .../delphi_google_symptoms/date_utils.py | 2 +- .../delphi_google_symptoms/patch.py | 11 +++--- google_symptoms/delphi_google_symptoms/run.py | 9 ++--- nssp/delphi_nssp/run.py | 2 +- nwss_wastewater/delphi_nwss/run.py | 2 +- .../delphi_quidel_covidtest/pull.py | 6 ++-- .../delphi_quidel_covidtest/run.py | 2 +- 29 files changed, 163 insertions(+), 132 deletions(-) diff --git a/_delphi_utils_python/README.md b/_delphi_utils_python/README.md index 0ac6350bf..e1b091cae 100644 --- a/_delphi_utils_python/README.md +++ b/_delphi_utils_python/README.md @@ -22,13 +22,22 @@ Source code can be found here: ## Logger Usage +To make our structured logging as useful as it can be, particularly within the context of how we use logs in Elastic, the `event` argument (typically the first unnamed arg) should be a static string (to make filtering easier), and each dynamic/varying value should be specified in an individual meaningfully- and consistently-named argument to the logger call (for use in filtering, thresholding, grouping, visualization, etc). + +### Commonly used argument names: +- data_source +- geo_type +- signal +- issue_date +- filename + Single-thread usage. ```py from delphi_utils.logger import get_structured_logger logger = get_structured_logger('my_logger') -logger.info('Hello, world!') +logger.info('Hello', name='World') ``` Multi-thread usage. diff --git a/_delphi_utils_python/delphi_utils/export.py b/_delphi_utils_python/delphi_utils/export.py index 37f8faf98..8ac5de48e 100644 --- a/_delphi_utils_python/delphi_utils/export.py +++ b/_delphi_utils_python/delphi_utils/export.py @@ -22,8 +22,10 @@ def filter_contradicting_missing_codes(df, sensor, metric, date, logger=None): for mask in masks: if not logger is None and df.loc[mask].size > 0: logger.info( - "Filtering contradictory missing code in " + - "{0}_{1}_{2}.".format(sensor, metric, date.strftime(format="%Y-%m-%d")) + "Filtering contradictory missing code", + sensor=sensor, + metric=metric, + date=date.strftime(format="%Y-%m-%d"), ) df = df.loc[~mask] elif logger is None and df.loc[mask].size > 0: diff --git a/_delphi_utils_python/delphi_utils/flash_eval/eval_day.py b/_delphi_utils_python/delphi_utils/flash_eval/eval_day.py index 660fca042..3c8012803 100644 --- a/_delphi_utils_python/delphi_utils/flash_eval/eval_day.py +++ b/_delphi_utils_python/delphi_utils/flash_eval/eval_day.py @@ -153,8 +153,7 @@ def output(evd_ranking, day, lag, signal, logger): p_text += f"\t{start_link}|*{index}*, {'{:.2f}'.format(value)}>\n" else: break - name = f"Signal: {signal} Lag: {lag}" - logger.info(name, payload=p_text) + logger.info("FLaSH: worth inspecting", signal=signal, lag=lag, payload=p_text) def evd_ranking_fn(ts_streams, EVD_max, EVD_min): diff --git a/_delphi_utils_python/delphi_utils/logger.py b/_delphi_utils_python/delphi_utils/logger.py index c0e4502a8..30fd78059 100644 --- a/_delphi_utils_python/delphi_utils/logger.py +++ b/_delphi_utils_python/delphi_utils/logger.py @@ -1,11 +1,11 @@ """Structured logger utility for creating JSON logs. -See the delphi_utils README.md for usage examples. +To make our structured logging as useful as it can be, particularly within the context of how we use logs in Elastic, +the `event` argument (typically the first unnamed arg) should be a static string (to make filtering easier), +and each dynamic/varying value should be specified in an individual meaningfully- and consistently-named argument +to the logger call (for use in filtering, thresholding, grouping, visualization, etc) -The Delphi group uses two ~identical versions of this file. -Try to keep them in sync with edits, for sanity. - https://github.com/cmu-delphi/covidcast-indicators/blob/main/_delphi_utils_python/delphi_utils/logger.py - https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/common/logger.py +See the delphi_utils README.md for usage examples. """ import contextlib diff --git a/_delphi_utils_python/delphi_utils/runner.py b/_delphi_utils_python/delphi_utils/runner.py index abc28ba19..9083371aa 100644 --- a/_delphi_utils_python/delphi_utils/runner.py +++ b/_delphi_utils_python/delphi_utils/runner.py @@ -51,6 +51,7 @@ def run_indicator_pipeline(indicator_fn: Callable[[Params], None], #Get version and indicator name for startup ind_name = indicator_fn.__module__.replace(".run", "") + #Check for version.cfg in indicator directory if os.path.exists("version.cfg"): with open("version.cfg") as ver_file: @@ -59,9 +60,15 @@ def run_indicator_pipeline(indicator_fn: Callable[[Params], None], if "current_version" in line: current_version = str.strip(line) current_version = current_version.replace("current_version = ", "") - #Logging - Starting Indicator - logger.info(f"Started {ind_name} with covidcast-indicators version {current_version}") - else: logger.info(f"Started {ind_name} without version.cfg") + logger.info( + "Started a covidcast-indicator", + indicator_name=ind_name, + current_version=current_version, + ) + else: + logger.info( + "Started a covidcast-indicator without version.cfg", indicator_name=ind_name + ) indicator_fn(params) validator = validator_fn(params) @@ -77,8 +84,10 @@ def run_indicator_pipeline(indicator_fn: Callable[[Params], None], break time.sleep(1) else: - logger.error(f"Flash step timed out ({timer} s), terminating", - elapsed_time_in_seconds = round(time.time() - start, 2)) + logger.error( + "Flash step timed out, terminating", + elapsed_time_in_seconds=round(time.time() - start, 2), + ) t1.terminate() t1.join() if validator: diff --git a/_delphi_utils_python/tests/test_export.py b/_delphi_utils_python/tests/test_export.py index 3e72f1d7f..c9c1f8483 100644 --- a/_delphi_utils_python/tests/test_export.py +++ b/_delphi_utils_python/tests/test_export.py @@ -323,12 +323,13 @@ def test_export_df_with_missingness(self, tmp_path): @mock.patch("delphi_utils.logger") def test_export_df_with_contradictory_missingness(self, mock_logger, tmp_path): - + sensor = "test" + geo_res = "state" create_export_csv( df=self.DF3.copy(), export_dir=tmp_path, - geo_res="state", - sensor="test", + sensor=sensor, + geo_res=geo_res, logger=mock_logger ) assert set(listdir(tmp_path)) == set( @@ -339,8 +340,9 @@ def test_export_df_with_contradictory_missingness(self, mock_logger, tmp_path): ] ) assert pd.read_csv(join(tmp_path, "20200315_state_test.csv")).size > 0 + date_str = datetime.strftime(self.TIMES[0], "%Y-%m-%d") mock_logger.info.assert_called_once_with( - "Filtering contradictory missing code in test_None_2020-02-15." + "Filtering contradictory missing code", sensor=sensor, metric=None, date=date_str ) def test_export_sort(self, tmp_path): diff --git a/changehc/delphi_changehc/run.py b/changehc/delphi_changehc/run.py index 92a03e6c5..9c15b221d 100644 --- a/changehc/delphi_changehc/run.py +++ b/changehc/delphi_changehc/run.py @@ -25,7 +25,7 @@ def retrieve_files(params, filedate, logger): if files["denom"] is None: ## download recent files from FTP server - logger.info("downloading recent files through SFTP") + logger.info("Downloading recent files through SFTP") download_counts(filedate, params["indicator"]["input_cache_dir"], params["indicator"]["ftp_conn"]) denom_file = "%s/%s_Counts_Products_Denom.dat.gz" % (params["indicator"]["input_cache_dir"],filedate) @@ -157,18 +157,20 @@ def run_module(params: Dict[str, Dict[str, Any]]): startdate, enddate = process_dates(params, startdate_dt, enddate_dt) - logger.info("generating signal and exporting to CSV", - first_sensor_date = startdate, - last_sensor_date = enddate, - drop_date = dropdate, - n_backfill_days = n_backfill_days, - n_waiting_days = n_waiting_days, - geos = params["indicator"]["geos"], - export_dir = params["common"]["export_dir"], - parallel = params["indicator"]["parallel"], - weekday = params["indicator"]["weekday"], - types = params["indicator"]["types"], - se = params["indicator"]["se"]) + logger.info( + "Generating signal and exporting to CSV", + first_sensor_date=startdate, + last_sensor_date=enddate, + drop_date=dropdate, + n_backfill_days=n_backfill_days, + n_waiting_days=n_waiting_days, + geos=params["indicator"]["geos"], + export_dir=params["common"]["export_dir"], + parallel=params["indicator"]["parallel"], + weekday=params["indicator"]["weekday"], + types=params["indicator"]["types"], + se=params["indicator"]["se"], + ) ## start generating stats = [] @@ -176,9 +178,9 @@ def run_module(params: Dict[str, Dict[str, Any]]): for numtype in params["indicator"]["types"]: for weekday in params["indicator"]["weekday"]: if weekday: - logger.info("starting weekday adj", geo = geo, numtype = numtype) + logger.info("Starting weekday adj", geo_type=geo, numtype=numtype) else: - logger.info("starting no adj", geo = geo, numtype = numtype) + logger.info("Starting no adj", geo_type=geo, numtype=numtype) su_inst = CHCSensorUpdater( startdate, enddate, @@ -211,7 +213,7 @@ def run_module(params: Dict[str, Dict[str, Any]]): ) stats.extend(more_stats) - logger.info("finished processing", geo = geo) + logger.info("Finished processing", geo_type=geo) elapsed_time_in_seconds = round(time.time() - start_time, 2) min_max_date = stats and min(s[0] for s in stats) diff --git a/changehc/delphi_changehc/sensor.py b/changehc/delphi_changehc/sensor.py index 0449f07df..9a1fd29e0 100644 --- a/changehc/delphi_changehc/sensor.py +++ b/changehc/delphi_changehc/sensor.py @@ -118,10 +118,10 @@ def fit(y_data, first_sensor_date, geo_id, logger, num_col="num", den_col="den") se_valid = valid_rates.eval('sqrt(rate * (1 - rate) / den)') rate_data['se'] = se_valid - logger.debug("{0}: {1:.3f},[{2:.3f}]".format( - geo_id, rate_data['rate'][-1], rate_data['se'][-1] - )) - return {"geo_id": geo_id, - "rate": 100 * rate_data['rate'], - "se": 100 * rate_data['se'], - "incl": include} + logger.debug( + ".fit() DEBUG - last rate/se for geo", + geo_value=geo_id, + value=rate_data["rate"][-1], + se=rate_data["se"][-1], + ) + return {"geo_id": geo_id, "rate": 100 * rate_data["rate"], "se": 100 * rate_data["se"], "incl": include} diff --git a/changehc/delphi_changehc/update_sensor.py b/changehc/delphi_changehc/update_sensor.py index edae85517..7c78dc020 100644 --- a/changehc/delphi_changehc/update_sensor.py +++ b/changehc/delphi_changehc/update_sensor.py @@ -41,7 +41,7 @@ def write_to_csv(df, geo_level, write_se, day_shift, out_name, logger, output_pa assert df[suspicious_se_mask].empty, " se contains suspiciously large values" assert not df["se"].isna().any(), " se contains nan values" if write_se: - logger.info("========= WARNING: WRITING SEs TO {0} =========".format(out_name)) + logger.info("WARNING: WRITING SEs", filename=out_name) else: df["se"] = np.nan @@ -49,9 +49,7 @@ def write_to_csv(df, geo_level, write_se, day_shift, out_name, logger, output_pa suspicious_val_mask = df["val"].gt(90) if not df[suspicious_val_mask].empty: for geo in df.loc[suspicious_val_mask, "geo_id"]: - logger.warning("value suspiciously high, {0}: {1}".format( - geo, out_name - )) + logger.warning("Value suspiciously high", geo_value=geo, filename=out_name) dates = create_export_csv( df, @@ -62,10 +60,8 @@ def write_to_csv(df, geo_level, write_se, day_shift, out_name, logger, output_pa sensor=out_name, write_empty_days=True ) - logger.debug("wrote {0} rows for {1} {2}".format( - df.size, df["geo_id"].unique().size, geo_level - )) - logger.debug("wrote files to {0}".format(output_path)) + logger.debug("Wrote rows", num_rows=df.size, geo_type=geo_level, num_geo_ids=df["geo_id"].unique().size) + logger.debug("Wrote files", export_dir=output_path) return dates @@ -148,8 +144,9 @@ def geo_reindex(self, data): 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', " - "'state', 'msa', 'hrr', 'hss','nation'".format(geo)) + self.logger.error( + "Geo is invalid, pick one of 'county', " "'state', 'msa', 'hrr', 'hss','nation'", geo_type=geo + ) return False if geo == "county": data_frame = gmpr.fips_to_megacounty(data, @@ -224,7 +221,7 @@ def update_sensor(self, dfs.append(res) else: n_cpu = min(10, cpu_count()) - self.logger.debug("starting pool with {0} workers".format(n_cpu)) + self.logger.debug("Starting pool", n_workers=n_cpu) with Pool(n_cpu) as pool: pool_results = [] for geo_id, sub_data in data_frame.groupby(level=0,as_index=False): diff --git a/changehc/tests/test_update_sensor.py b/changehc/tests/test_update_sensor.py index 7ef25a608..d2e7ee2f3 100644 --- a/changehc/tests/test_update_sensor.py +++ b/changehc/tests/test_update_sensor.py @@ -9,6 +9,7 @@ import pandas as pd import numpy as np from boto3 import Session +from delphi_utils import get_structured_logger from moto import mock_s3 import pytest @@ -28,7 +29,7 @@ DENOM_FILEPATH = PARAMS["indicator"]["input_denom_file"] DROP_DATE = pd.to_datetime(PARAMS["indicator"]["drop_date"]) OUTPATH="test_data/" -TEST_LOGGER = logging.getLogger() +TEST_LOGGER = get_structured_logger() class TestCHCSensorUpdater: """Tests for updating the sensors.""" diff --git a/claims_hosp/delphi_claims_hosp/download_claims_ftp_files.py b/claims_hosp/delphi_claims_hosp/download_claims_ftp_files.py index 2ce093488..ee6e98286 100644 --- a/claims_hosp/delphi_claims_hosp/download_claims_ftp_files.py +++ b/claims_hosp/delphi_claims_hosp/download_claims_ftp_files.py @@ -57,7 +57,7 @@ def download(ftp_credentials, out_path, logger): """Pull the latest raw files.""" current_time = datetime.datetime.now() seconds_in_day = 24 * 60 * 60 - logger.info("starting download", time=current_time) + logger.info("Starting download") # open client client = paramiko.SSHClient() diff --git a/claims_hosp/delphi_claims_hosp/indicator.py b/claims_hosp/delphi_claims_hosp/indicator.py index 4ad3ef7df..c5ac4e886 100644 --- a/claims_hosp/delphi_claims_hosp/indicator.py +++ b/claims_hosp/delphi_claims_hosp/indicator.py @@ -143,7 +143,10 @@ def fit(y_data, first_date, geo_id, num_col="num", den_col="den"): se_valid = valid_rates.eval('sqrt(rate * (1 - rate) / den)') rate_data['se'] = se_valid - logging.debug("%s: %05.3f, [%05.3f]", - geo_id, rate_data['rate'][-1], rate_data['se'][-1]) - return {"geo_id": geo_id, "rate": 100 * rate_data['rate'], - "se": 100 * rate_data['se'], "incl": include} + logging.debug( + ".fit() DEBUG - last rate/se for geo", + geo_value=geo_id, + value=rate_data["rate"][-1], + se=rate_data["se"][-1], + ) + return {"geo_id": geo_id, "rate": 100 * rate_data["rate"], "se": 100 * rate_data["se"], "incl": include} diff --git a/claims_hosp/delphi_claims_hosp/modify_claims_drops.py b/claims_hosp/delphi_claims_hosp/modify_claims_drops.py index 0ab93ebcc..19a962884 100644 --- a/claims_hosp/delphi_claims_hosp/modify_claims_drops.py +++ b/claims_hosp/delphi_claims_hosp/modify_claims_drops.py @@ -57,5 +57,5 @@ def modify_and_write(data_path, logger, test_mode=False): dfs_list.append(dfs) else: dfs.to_csv(out_path, index=False) - logger.info(f"Wrote {out_path}") + logger.info("Wrote modified csv", filename=out_path) return files, dfs_list diff --git a/claims_hosp/delphi_claims_hosp/run.py b/claims_hosp/delphi_claims_hosp/run.py index 53c4cd33b..a9752072c 100644 --- a/claims_hosp/delphi_claims_hosp/run.py +++ b/claims_hosp/delphi_claims_hosp/run.py @@ -116,9 +116,9 @@ def run_module(params): for geo in params["indicator"]["geos"]: for weekday in params["indicator"]["weekday"]: if weekday: - logger.info("starting weekday adj", geo = geo) + logger.info("Starting weekday adj", geo_type=geo) else: - logger.info("starting no weekday adj", geo = geo) + logger.info("Starting no weekday adj", geo_type=geo) signal_name = Config.signal_weekday_name if weekday else Config.signal_name if params["indicator"]["write_se"]: @@ -126,7 +126,7 @@ def run_module(params): "supply obfuscated prefix in params.json" signal_name = params["indicator"]["obfuscated_prefix"] + "_" + signal_name - logger.info("Updating signal name", signal_name = signal_name) + logger.info("Updating signal name", signal=signal_name) updater = ClaimsHospIndicatorUpdater( startdate, enddate, @@ -135,16 +135,16 @@ def run_module(params): params["indicator"]["parallel"], weekday, params["indicator"]["write_se"], - signal_name + signal_name, + logger, ) updater.update_indicator( claims_file, params["common"]["export_dir"], - logger, ) max_dates.append(updater.output_dates[-1]) n_csv_export.append(len(updater.output_dates)) - logger.info("finished updating", geo = geo) + logger.info("Finished updating", geo_type=geo) # Remove all the raw files for fn in os.listdir(params["indicator"]["input_dir"]): diff --git a/claims_hosp/delphi_claims_hosp/update_indicator.py b/claims_hosp/delphi_claims_hosp/update_indicator.py index df3f3308f..5ba8ddd22 100644 --- a/claims_hosp/delphi_claims_hosp/update_indicator.py +++ b/claims_hosp/delphi_claims_hosp/update_indicator.py @@ -7,7 +7,6 @@ """ # standard packages -import logging from multiprocessing import Pool, cpu_count # third party @@ -28,8 +27,7 @@ class ClaimsHospIndicatorUpdater: # pylint: disable=too-many-instance-attributes, too-many-arguments # all variables are used - def __init__(self, startdate, enddate, dropdate, geo, parallel, weekday, - write_se, signal_name): + def __init__(self, startdate, enddate, dropdate, geo, parallel, weekday, write_se, signal_name, logger): """ Initialize updater for the claims-based hospitalization indicator. @@ -53,6 +51,7 @@ def __init__(self, startdate, enddate, dropdate, geo, parallel, weekday, # init in shift_dates, declared here for pylint self.burnindate, self.fit_dates, self.burn_in_dates, self.output_dates = \ [None] * 4 + self.logger = logger assert ( self.startdate > (Config.FIRST_DATA_DATE + Config.BURN_IN_PERIOD) @@ -114,9 +113,9 @@ def geo_reindex(self, data): elif self.geo == "hrr": data_frame = data # data is already adjusted in aggregation step above else: - logging.error( - "%s is invalid, pick one of 'county', 'state', 'msa', 'hrr', 'hhs', nation'", - self.geo) + self.logger.error( + "Geo is invalid, pick one of 'county', 'state', 'msa', 'hrr', 'hhs', nation'", geo_type=self.geo + ) return False unique_geo_ids = pd.unique(data_frame[self.geo]) @@ -133,7 +132,7 @@ def geo_reindex(self, data): data_frame.fillna(0, inplace=True) return data_frame - def update_indicator(self, input_filepath, outpath, logger): + def update_indicator(self, input_filepath, outpath): """ Generate and output indicator values. @@ -159,7 +158,7 @@ def update_indicator(self, input_filepath, outpath, logger): ["num"], Config.DATE_COL, [1, 1e5], - logger, + self.logger, ) if self.weekday else None @@ -182,7 +181,7 @@ def update_indicator(self, input_filepath, outpath, logger): valid_inds[geo_id] = np.array(res.loc[final_output_inds, "incl"]) else: n_cpu = min(Config.MAX_CPU_POOL, cpu_count()) - logging.debug("starting pool with %d workers", n_cpu) + self.logger.debug("Starting pool", n_workers=n_cpu) with Pool(n_cpu) as pool: pool_results = [] for geo_id, sub_data in data_frame.groupby(level=0, as_index=False): @@ -217,7 +216,7 @@ def update_indicator(self, input_filepath, outpath, logger): } self.write_to_csv(output_dict, outpath) - logging.debug("wrote files to %s", outpath) + self.logger.debug("Wrote files", export_dir=outpath) def write_to_csv(self, output_dict, output_path="./receiving"): """ @@ -229,8 +228,7 @@ def write_to_csv(self, output_dict, output_path="./receiving"): """ if self.write_se: - logging.info("========= WARNING: WRITING SEs TO %s =========", - self.signal_name) + self.logger.info("WARNING: WRITING SEs", signal=self.signal_name) geo_level = output_dict["geo_level"] dates = output_dict["dates"] @@ -255,7 +253,7 @@ def write_to_csv(self, output_dict, output_path="./receiving"): assert not np.isnan(val), "value for included value is nan" assert not np.isnan(se), "se for included rate is nan" if val > 90: - logging.warning("value suspicious, %s: %d", geo_id, val) + self.logger.warning("Value suspicious", geo_type=geo_level, geo_value=geo_id, value=val) assert se < 5, f"se suspicious, {geo_id}: {se}" if self.write_se: assert val > 0 and se > 0, "p=0, std_err=0 invalid" @@ -267,4 +265,4 @@ def write_to_csv(self, output_dict, output_path="./receiving"): "%s,%f,%s,%s,%s\n" % (geo_id, val, "NA", "NA", "NA")) out_n += 1 - logging.debug("wrote %d rows for %d %s", out_n, len(geo_ids), geo_level) + self.logger.debug("Wrote rows", num_rows=out_n, geo_type=geo_level, num_geo_ids=len(geo_ids)) diff --git a/claims_hosp/tests/test_update_indicator.py b/claims_hosp/tests/test_update_indicator.py index 1471be655..5ca527287 100644 --- a/claims_hosp/tests/test_update_indicator.py +++ b/claims_hosp/tests/test_update_indicator.py @@ -51,7 +51,8 @@ def test_shift_dates(self): self.parallel, self.weekday, self.write_se, - Config.signal_name + Config.signal_name, + TEST_LOGGER ) ## Test init assert updater.startdate.month == 2 @@ -72,7 +73,8 @@ def test_geo_reindex(self): self.parallel, self.weekday, self.write_se, - Config.signal_name + Config.signal_name, + TEST_LOGGER ) updater.shift_dates() data_frame = updater.geo_reindex(self.small_test_data.reset_index()) @@ -90,13 +92,13 @@ def test_update_indicator(self): self.parallel, self.weekday, self.write_se, - Config.signal_name + Config.signal_name, + TEST_LOGGER ) updater.update_indicator( DATA_FILEPATH, - td.name, - TEST_LOGGER + td.name ) assert len(os.listdir(td.name)) == len( @@ -112,7 +114,8 @@ def test_write_to_csv_results(self): self.parallel, self.weekday, self.write_se, - Config.signal_name + Config.signal_name, + TEST_LOGGER ) res0 = { @@ -192,7 +195,8 @@ def test_write_to_csv_with_se_results(self): self.parallel, True, True, - signal_name + signal_name, + TEST_LOGGER ) res0 = { @@ -243,7 +247,8 @@ def test_write_to_csv_wrong_results(self): self.parallel, self.weekday, self.write_se, - Config.signal_name + Config.signal_name, + TEST_LOGGER ) res0 = { diff --git a/doctor_visits/delphi_doctor_visits/download_claims_ftp_files.py b/doctor_visits/delphi_doctor_visits/download_claims_ftp_files.py index 9d51768be..6cb42364a 100644 --- a/doctor_visits/delphi_doctor_visits/download_claims_ftp_files.py +++ b/doctor_visits/delphi_doctor_visits/download_claims_ftp_files.py @@ -59,7 +59,7 @@ def download(ftp_credentials, out_path, logger, issue_date=None): else: current_time = datetime.datetime.strptime(issue_date, "%Y-%m-%d").replace(hour=23, minute=59, second=59) - logger.info("starting download", time=current_time) + logger.info("Starting download") seconds_in_day = 24 * 60 * 60 # open client diff --git a/doctor_visits/delphi_doctor_visits/modify_claims_drops.py b/doctor_visits/delphi_doctor_visits/modify_claims_drops.py index daed93d58..3be9393e4 100644 --- a/doctor_visits/delphi_doctor_visits/modify_claims_drops.py +++ b/doctor_visits/delphi_doctor_visits/modify_claims_drops.py @@ -48,5 +48,5 @@ def modify_and_write(f, logger, test_mode=False): if not test_mode: dfs.to_csv(out_path, index=False) - logger.info(f"Wrote {out_path}") + logger.info("Wrote modified csv", filename=out_path) return dfs diff --git a/doctor_visits/delphi_doctor_visits/patch.py b/doctor_visits/delphi_doctor_visits/patch.py index 32b6d308f..32c62dd6b 100644 --- a/doctor_visits/delphi_doctor_visits/patch.py +++ b/doctor_visits/delphi_doctor_visits/patch.py @@ -45,16 +45,19 @@ def patch(): start_issue = datetime.strptime(params["patch"]["start_issue"], "%Y-%m-%d") end_issue = datetime.strptime(params["patch"]["end_issue"], "%Y-%m-%d") - logger.info(f"""Start patching {params["patch"]["patch_dir"]}""") - logger.info(f"""Start issue: {start_issue.strftime("%Y-%m-%d")}""") - logger.info(f"""End issue: {end_issue.strftime("%Y-%m-%d")}""") + logger.info( + "Starting patching", + patch_directory=params["patch"]["patch_dir"], + start_issue=start_issue.strftime("%Y-%m-%d"), + end_issue=end_issue.strftime("%Y-%m-%d"), + ) makedirs(params["patch"]["patch_dir"], exist_ok=True) current_issue = start_issue while current_issue <= end_issue: - logger.info(f"""Running issue {current_issue.strftime("%Y-%m-%d")}""") + logger.info("Running issue", issue_date=current_issue.strftime("%Y-%m-%d")) params["patch"]["current_issue"] = current_issue.strftime("%Y-%m-%d") diff --git a/doctor_visits/delphi_doctor_visits/run.py b/doctor_visits/delphi_doctor_visits/run.py index 3c941534a..2dccffc8c 100644 --- a/doctor_visits/delphi_doctor_visits/run.py +++ b/doctor_visits/delphi_doctor_visits/run.py @@ -88,32 +88,33 @@ def run_module(params, logger=None): # pylint: disable=too-many-statements startdate_dt = enddate_dt - timedelta(days=n_backfill_days) enddate = str(enddate_dt.date()) startdate = str(startdate_dt.date()) - logger.info("drop date:\t\t%s", dropdate) - logger.info("first sensor date:\t%s", startdate) - logger.info("last sensor date:\t%s", enddate) - logger.info("n_backfill_days:\t%s", n_backfill_days) - logger.info("n_waiting_days:\t%s", n_waiting_days) + + logger.info( + "Using params", + startdate=startdate, + enddate=enddate, + dropdate=dropdate, + n_backfill_days=n_backfill_days, + n_waiting_days=n_waiting_days, + export_dir=export_dir, + parallel=params["indicator"]["parallel"], + weekday=params["indicator"]["weekday"], + write_se=se, + prefix=prefix, + ) ## geographies geos = ["state", "msa", "hrr", "county", "hhs", "nation"] - - ## print out other vars - logger.info("outpath:\t\t%s", export_dir) - logger.info("parallel:\t\t%s", params["indicator"]["parallel"]) - logger.info("weekday:\t\t%s", params["indicator"]["weekday"]) - logger.info("write se:\t\t%s", se) - logger.info("obfuscated prefix:\t%s", prefix) - max_dates = [] n_csv_export = [] ## start generating for geo in geos: for weekday in params["indicator"]["weekday"]: if weekday: - logger.info("starting %s, weekday adj", geo) + logger.info("Starting with weekday adj", geo_type=geo) else: - logger.info("starting %s, no adj", geo) + logger.info("Starting with no adj", geo_type=geo) sensor = update_sensor( filepath=claims_file, startdate=startdate, @@ -137,8 +138,8 @@ def run_module(params, logger=None): # pylint: disable=too-many-statements write_to_csv(sensor, geo, se, out_name, logger, export_dir) max_dates.append(sensor.date.max()) n_csv_export.append(sensor.date.unique().shape[0]) - logger.debug(f"wrote files to {export_dir}") - logger.info("finished updating", geo = geo) + logger.debug("Wrote files", export_dir=export_dir) + logger.info("Finished updating", geo_type=geo) # Remove all the raw files for fn in os.listdir(params["indicator"]["input_dir"]): diff --git a/doctor_visits/delphi_doctor_visits/sensor.py b/doctor_visits/delphi_doctor_visits/sensor.py index b5a645ea8..91faa20cf 100644 --- a/doctor_visits/delphi_doctor_visits/sensor.py +++ b/doctor_visits/delphi_doctor_visits/sensor.py @@ -239,7 +239,7 @@ def fit(y_data, se[include] = np.sqrt( np.divide((new_rates[include] * (1 - new_rates[include])), den[include])) - logger.debug(f"{geo_id}: {new_rates[-1]:.3f},[{se[-1]:.3f}]") + logger.debug(".fit() DEBUG - last rate/se for geo", geo_value=geo_id, value=new_rates[-1], se=se[-1]) included_indices = [x for x in final_sensor_idxs if include[x]] diff --git a/doctor_visits/delphi_doctor_visits/update_sensor.py b/doctor_visits/delphi_doctor_visits/update_sensor.py index 125c0df18..4cac1e81c 100644 --- a/doctor_visits/delphi_doctor_visits/update_sensor.py +++ b/doctor_visits/delphi_doctor_visits/update_sensor.py @@ -34,7 +34,7 @@ def write_to_csv(output_df: pd.DataFrame, geo_level, se, out_name, logger, outpu output_path: outfile path to write the csv (default is current directory) """ if se: - logger.info(f"========= WARNING: WRITING SEs TO {out_name} =========") + logger.info("WARNING: WRITING SEs", filename=out_name) out_n = 0 for d in set(output_df["date"]): @@ -64,7 +64,7 @@ def write_to_csv(output_df: pd.DataFrame, geo_level, se, out_name, logger, outpu outfile.write( "%s,%f,%s,%s,%s\n" % (geo_id, sensor, "NA", "NA", "NA")) out_n += 1 - logger.debug(f"wrote {out_n} rows for {geo_level}") + logger.debug("Wrote rows", num_rows=out_n, geo_type=geo_level) def update_sensor( @@ -177,7 +177,7 @@ def update_sensor( else: n_cpu = min(10, cpu_count()) - logger.debug(f"starting pool with {n_cpu} workers") + logger.debug("Starting pool", n_workers=n_cpu) with Pool(n_cpu) as pool: pool_results = [] diff --git a/google_symptoms/delphi_google_symptoms/date_utils.py b/google_symptoms/delphi_google_symptoms/date_utils.py index ebfe5109a..2ad6244e9 100644 --- a/google_symptoms/delphi_google_symptoms/date_utils.py +++ b/google_symptoms/delphi_google_symptoms/date_utils.py @@ -98,7 +98,7 @@ def generate_num_export_days(params: Dict, logger) -> [int]: expected_date_diff += global_max_expected_lag if latest_date_diff > expected_date_diff: - logger.info(f"Missing dates from: {to_datetime(min(gs_metadata.max_time)).date()}") + logger.info("Missing date", date=to_datetime(min(gs_metadata.max_time)).date()) num_export_days = expected_date_diff diff --git a/google_symptoms/delphi_google_symptoms/patch.py b/google_symptoms/delphi_google_symptoms/patch.py index 01d099c4f..85df89394 100755 --- a/google_symptoms/delphi_google_symptoms/patch.py +++ b/google_symptoms/delphi_google_symptoms/patch.py @@ -58,16 +58,19 @@ def patch(params): issue_date = datetime.strptime(params["patch"]["start_issue"], "%Y-%m-%d") end_issue = datetime.strptime(params["patch"]["end_issue"], "%Y-%m-%d") - logger.info(f"""Start patching {params["patch"]["patch_dir"]}""") - logger.info(f"""Start issue: {issue_date.strftime("%Y-%m-%d")}""") - logger.info(f"""End issue: {end_issue.strftime("%Y-%m-%d")}""") + logger.info( + "Starting patching", + patch_directory=params["patch"]["patch_dir"], + start_issue=issue_date.strftime("%Y-%m-%d"), + end_issue=end_issue.strftime("%Y-%m-%d"), + ) makedirs(params["patch"]["patch_dir"], exist_ok=True) patch_dates = generate_patch_dates(params) while issue_date <= end_issue: - logger.info(f"""Running issue {issue_date.strftime("%Y-%m-%d")}""") + logger.info("Running issue", issue_date=issue_date.strftime("%Y-%m-%d")) # Output dir setup current_issue_yyyymmdd = issue_date.strftime("%Y%m%d") diff --git a/google_symptoms/delphi_google_symptoms/run.py b/google_symptoms/delphi_google_symptoms/run.py index 8303a9a8a..8ad1d6d10 100644 --- a/google_symptoms/delphi_google_symptoms/run.py +++ b/google_symptoms/delphi_google_symptoms/run.py @@ -80,10 +80,8 @@ def run_module(params, logger=None): if len(df_pull) == 0: continue for metric, smoother in product(COMBINED_METRIC, SMOOTHERS): - logger.info("generating signal and exporting to CSV", - geo_res=geo_res, - metric=metric, - smoother=smoother) + sensor_name = "_".join([smoother, "search"]) + logger.info("Generating signal and exporting to CSV", geo_type=geo_res, signal=f"{metric}_{sensor_name}") df = df_pull df["val"] = df[metric].astype(float) df["val"] = df[["geo_id", "val"]].groupby( @@ -94,9 +92,8 @@ def run_module(params, logger=None): # Drop early entries where data insufficient for smoothing df = df.loc[~df["val"].isnull(), :] df = df.reset_index() - sensor_name = "_".join([smoother, "search"]) if len(df) == 0: - logger.info("No data for %s_%s_%s", geo_res, metric.lower(), sensor_name) + logger.info("No data for signal", geo_type=geo_res, signal=f"{metric}_{sensor_name}") continue exported_csv_dates = create_export_csv( df, diff --git a/nssp/delphi_nssp/run.py b/nssp/delphi_nssp/run.py index 931cd7c71..b22d03c20 100644 --- a/nssp/delphi_nssp/run.py +++ b/nssp/delphi_nssp/run.py @@ -90,7 +90,7 @@ def run_module(params): for geo in GEOS: df = df_pull.copy() df["val"] = df[signal] - logger.info("Generating signal and exporting to CSV", metric=signal) + logger.info("Generating signal and exporting to CSV", geo_type=geo, signal=signal) if geo == "nation": df = df[df["geography"] == "United States"] df["geo_id"] = "us" diff --git a/nwss_wastewater/delphi_nwss/run.py b/nwss_wastewater/delphi_nwss/run.py index 378849ba5..60bfc84c7 100644 --- a/nwss_wastewater/delphi_nwss/run.py +++ b/nwss_wastewater/delphi_nwss/run.py @@ -146,7 +146,7 @@ def run_module(params): df = generate_weights(df, sensor) for geo in GEOS: - logger.info("Generating signal and exporting to CSV", metric=sensor) + logger.info("Generating signal and exporting to CSV", geo_type=geo, signal=sensor) if geo == "nation": agg_df = weighted_nation_sum(df, sensor) else: diff --git a/quidel_covidtest/delphi_quidel_covidtest/pull.py b/quidel_covidtest/delphi_quidel_covidtest/pull.py index d9f23f2ec..560f89456 100644 --- a/quidel_covidtest/delphi_quidel_covidtest/pull.py +++ b/quidel_covidtest/delphi_quidel_covidtest/pull.py @@ -56,7 +56,7 @@ def get_from_s3(start_date, end_date, bucket, logger): seen_files = set() for search_date in [start_date + timedelta(days=x) for x in range(n_days)]: if search_date in s3_files.keys(): - logger.info(f"Pulling data received on {search_date.date()}") + logger.info("Pulling data received on date", search_date=search_date.date()) # Fetch data received on the same day for fn in s3_files[search_date]: @@ -110,11 +110,11 @@ def fix_date(df, logger): df.insert(2, "timestamp", df["TestDate"]) mask = df["TestDate"] <= df["StorageDate"] - logger.info(f"Removing {((len(df) - np.sum(mask)) * 100 / len(df)):.2f}% of unusual data") + logger.info("Removing unusual data", percent=round((len(df) - np.sum(mask)) * 100 / len(df), 2)) df = df[mask] mask = df["StorageDate"] - df["TestDate"] > pd.Timedelta(days=90) - logger.info(f"Fixing {(np.sum(mask) * 100 / len(df)):.2f}% of outdated data") + logger.info("Fixing outdated data", percent=round((np.sum(mask) * 100 / len(df)), 2)) df["timestamp"].values[mask] = df["StorageDate"].values[mask] return df diff --git a/quidel_covidtest/delphi_quidel_covidtest/run.py b/quidel_covidtest/delphi_quidel_covidtest/run.py index a59e0c101..e6974b6aa 100644 --- a/quidel_covidtest/delphi_quidel_covidtest/run.py +++ b/quidel_covidtest/delphi_quidel_covidtest/run.py @@ -164,7 +164,7 @@ def run_module(params: Dict[str, Any]): n_cpu = min(8, cpu_count()) # for parallelization with pool_and_threadedlogger(logger, n_cpu) as (pool, threaded_logger): # for using loggers in multiple threads - logger.info("Parallelizing sensor generation", n_cpu=n_cpu) + logger.info("Parallelizing sensor generation", n_workers=n_cpu) pool_results = [] for geo_res in NONPARENT_GEO_RESOLUTIONS: geo_data, res_key = geo_map(geo_res, data) From 9edcc92c8739367c8565a805f51e8e1fdbf5f51e Mon Sep 17 00:00:00 2001 From: Brian Clark Date: Mon, 21 Oct 2024 09:21:59 -0400 Subject: [PATCH 03/15] Update path for pyenv shims --- Jenkinsfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 1b9485ca5..3fcdc904a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,6 +18,10 @@ def deploy_production = [:] pipeline { agent any + environment { + // Set the PATH variable to include the pyenv shims directory. + PATH = "/var/lib/jenkins/.pyenv/shims:${env.PATH}" + } stages { stage('Build dev/feature branch') { when { From 1a03d5676f954553210ac07f7a9ae98a18d5ca70 Mon Sep 17 00:00:00 2001 From: Brian Clark Date: Mon, 21 Oct 2024 16:40:41 -0400 Subject: [PATCH 04/15] Update differ bucket access --- ansible/vault.yaml | 528 ++++++++++++++++++++++----------------------- 1 file changed, 264 insertions(+), 264 deletions(-) diff --git a/ansible/vault.yaml b/ansible/vault.yaml index bf979841a..1a674592b 100644 --- a/ansible/vault.yaml +++ b/ansible/vault.yaml @@ -1,265 +1,265 @@ $ANSIBLE_VAULT;1.1;AES256 -63313737356234663364633839353638393064663937643934333430643832363065646138333038 -3133663766613235613137383736383030636236323166370a366235353833306336336432376333 -61336662656336336530326463663761366232393063326365366561386636636165396430623165 -6131643963386231650a356137646637333266613966343631656136303438303932326638363038 -30653364343436383433663639393633356633393836613263663537366335316130323365653736 -31353831343864383932393661383431346337353863643063636632313666613562306237623930 -63633061343263626139613337376333653562653432363763306535663735373433336636376437 -37646265373831613461363838303635306662633637643535623961376564653265663633656537 -66663134383638636138386137626133613964363333643133356365356237313935363531373066 -61626337396232316535376339306162316266366261383630623466306634643533326166386234 -65323262363337343261633638336364333230343035653032383031333431623032643432353136 -66653865623931313266326161343064383938636435306636383033313731323762383462303238 -34643562306264316130316266623838613361393462663361386234626661353838363036323937 -31653432623236303263643739326561306131316337313030636563363838353638353665343339 -38383938333164383337623634363430366232666231323539373239363266623339306434313162 -66393238663031376231386431666132643139383731323535313839643864633239346364303333 -61623238303038663833396663633963323863636139616631373036376337396262643862633939 -61646662653238396532613962376237623561313461333061356663343664306563386539376633 -32616433333163643066313330666263653939303932653835303562623061363833636435643534 -62336561306335346664333833306335323364613039653263373334616134313962613630386262 -63306630333739616137346338383964346365663836353166653236636663366539396431323032 -33366362346462303865623937363032363233316530656534383164393138323565306139306461 -35656266633636393631353435386337333039303535343233353134333839376163316262316533 -62313764306330316339623033636436313539326664353339326635613462316362333661363635 -66326565636439353466656663303663636237333965393961656637623933636366653562663564 -38373463626139313234623333306261666239303135333965656537393338323763666131366330 -38303435353765366162373430393231656139316238613839353432306231343130373038376135 -33396232636131653534666164313131333861336130636664643730393631626361353739303835 -31666132643830376335343938376338666538663865613132313130323736616237323134333031 -35656663346464383233646362663736633230613437643834383833633637656161303865343362 -64303636616262383865343332353139633432626565666233656436653761626563653639613334 -64313030643363323665613965353565393762323065323735306337373833373035396430376137 -62383063626430313532653261616230336164666461613966623032323965623962373830626236 -37356361326562613634376261336436346535333831643764343932356334616535343364316563 -64333731383831323165663530613736323461643836363438343134633635336431376664366364 -37326565613631613333313632666538383966363739666338626431643734636565616665653938 -37623839313030653733626263656666363362373135623562653462363330366136373938663532 -30343436303863636636353931656562303565626631323238356463373330393161373932373965 -34636638633764616430336131363734323932656135343032636564383231363731663963666663 -38376263333938643933363336373637396237303961653062343866363632663532336434643063 -63353739343033396130643638396365336332626439313231396361383736373036393838623532 -35383566333238626131343530313463326631313462333462396233613438333365613932663237 -35376232383238323636343335643236656135333766386565326337643466363064616131616430 -33643131363639363164316438656364386532626134386666613533643831326162363961666332 -62303938666565393938393133363734613365303136623638613532333033346465633830333164 -30333363376338373063373338393435626566356338393036303939353236633339373538613661 -63653064616338313135373238383432363138356665386638343434326337343862313431333535 -33633761333836376238376530636236613165353266363433663065633038626532343462353164 -61396530373532343831303331316236373834363538333632323664633363636133373438376234 -34343136363734333963383865646361653233393132373938633930366462383632333839353861 -63353030373137633161396165636366613337646461353265616263303663393636303231386234 -39356263323831313439333630376365343530336539663139373933336265303834623734656339 -35326239333163346335316138303831303063613839353164663563363737303834343132393237 -30376132303862386137626333653539303133366233303335356636303737353661306163313165 -35623865336130633366633131343838343830613537626539306566306439393737343438386162 -65393937323337306439663435346132386530353564333730626533373537646461646339323530 -31613033376539653363636332346238316632306463343436346239633364306638663464396639 -30653661616636663762353461366330613337643531336239346163306234313330663435336439 -61333334393937303933393965663030656232336464313135323164323030656134663030346366 -63613638623666363936613065643137636662306662396332643362333439393732326263623461 -37396135353033353832393763356439643566373738336438623234396365613136616432633636 -31363735393664303039333233313636326564363963616365646337373065363937306164643239 -38636131633563616339343734313836613462646636323163336136623034613965633433633035 -33396636323662343638616463303731306665616232643161613937356530303562383033626365 -64393835636365383432653330633538336435373336623833626337363264373665383530663538 -62316266326634376133666334336563656662666536353434306232373465623835346233316664 -63643966613363366363363265626435626132346532333864623834323061383235623034316139 -31386163623133366365353766373764323833363035333835383163656363386338386433323365 -38616437353530643739306365386134376364623665313965656533323334306438393031623434 -62373632633636663832353465353666333362663266623633376337393330353635386533343235 -63633938343062336436356334616633393331666562313165666664343133393935633465393739 -66633031323531346630343265663933666338623765663163336435343632303132313139656637 -64653030633938326439336331393763316161326464303231353066626464633836323431303666 -63316230623539333663623961393434393239373132363935326635383930626436636135386663 -61343433666365336638393639323038333032363462663734353031376463383531393661396333 -32386666316230613463333964323332373765333962383764613931643266313839333639383964 -34663761336166366532383138623230613037646165363039613138316464306135366366373136 -32353937663863333738356166623836303863343665353564326562313937333965646132626664 -62323434313964636564393432636534396261346265353336636564386338363137386632306661 -32653938393831646136613464663532313531636331633264303230306134623431333564666130 -66363330326661393339373235383530656562316531373666656638343038336164323363343637 -61653131313462356538656232643237623038666664663435363134363162306538383930373637 -63633539623265393137393332336463653132363661356365656237663461613764663837323336 -34613732363466353836363064383661626431363061613430616562396161366430363362336338 -35626265336562336134633538326365383365383766663731633738323430633365663266393061 -63396365303462386665343666346133303661616435663566303634363833303663383464623237 -30393364326333393932303462386435616163366165646463383765396132663166316666656462 -36346266636539663336646231366463353839363639613765313663303232633163356565643565 -61633163373335316362343835663364626336656236373361373830303463363965333432363134 -37333961636163373963613263353039636266376265333632363163363334353563323533663064 -33323234623035336232326238623838383533616533626665643133636233313062343137376263 -36653762666562633837356362383662663338616635646535393139356336346639326264643835 -61356531316366373038666166643434656633623635333238303831656338336539313931383762 -63376434373435646562623934346437316465303565313564613365663533303665363662653039 -61343363383438633236643664396533373134633963386638396236386561373161376365303832 -33333563306662623137633231613566353361643735666364653233666136313230633338323764 -65373334633836623666396637363166323631383835356666336461636433653464366138343630 -33323064353661633131303830613534636164643432303165376437346161373739333633616533 -63356331373061663463623435653632353433316261343562303837336135616636353864313432 -34643362303063363861646639336236623533636463306137393034633837643331653739643662 -65613763373665343830363063643738326439306164633533376339366265336466313432643136 -36386561343862376463306438326539393163356165313936323939323831343339393433643135 -38303862393932306161383236663466653933353932616537383965316464643762363331336137 -35663533316466613862373634323535663434303563386232306339613239633732346238323163 -61313330356631396135313765646435336633643038653835363436386363373138666266656162 -39363833396165323236376635626130623034336139336233333931323933306664333533653361 -35646139666131643430353731326137363135316236383833373631396266666463626464353365 -65666630633437343235336561366566366139393965383663623534643333383637646662313134 -30363161613464656632313536373631633166313162303761303835343338643366306330343232 -65656238346132383134626564333336306463643962383530343064343263643435363638366637 -62393337313732353230366536383434386332383837303161366166663430656335333733653738 -34386637353132323939323162323734643936666563663037353832666330366538333138653536 -62343462353835333232376666653538346564343566303135333434303963393032623564303034 -62653732666135383666623061646339366563316564613031303639323732666362326630643931 -35333436313236666563376131336233396336626161313863393962386638656634346137646530 -66376563336432633331643939623834353162613030326163383565396334383839643661363737 -36666363636237366537376565656465663834646665333930653132393461636334303334396161 -30363332303938336462646632303435643635363163333431343032616432646233353463396632 -32303938623263366634376536353764616361393430393361316263336239333633396666666566 -62633032383131636162333336306139356239313732383939323662386333363635663634616633 -61393262616162623966393264323466343738303566653862353939303637303039363136623662 -66336166326336373962306138373137313731656330373036656662363964646665386131656334 -36353432636238636161633131363161316438306430356233383232303163633764633736343264 -62346664663362656634666634353939663937613863383037333861386135353338613461663466 -36386463373938383637653733333637656362663061396466373563653861386630346330626261 -33656164363362306433356137346335363830306461303431333461393238373838336235666463 -33316235363338383435303939656331636639623733636566396536383461353534613331356139 -36333165303562313236623265613136653935346237343361636136343835363162656636313564 -63373063336434376232393662316634343734333534363537373637636264643666383835303536 -65653534393839623063396433663630363263626232613065663031333235636333643062313065 -30333330636339313032653431646639373465633633386166646139343461643964356263623738 -34356661663339386135383732643039613034326436643334656564646564326333323239333235 -38383562353263623265623230323333623536323139366462316665626537656132356561616361 -39313639333638656565393531646564643038336564623635343438376533343732663635653031 -30633231383431663834313066396362636238386332633665663661633733373836656335313239 -33386638393935346361376637663539663832393763343662643363623165316331336463663134 -62633832336236633831653837643764323031663734376262373866643036613931306633343065 -34383637646534373135306230376163356461646136393463623866303834333636633536336263 -33373066366333663063623638643035343161353633633631643461383332353263303962303432 -33303737336137643463343333633065643237333539383563376662373833623931333366373833 -65653733653363613561316365646363353535323838386133646532353364306639646561323937 -66396663383934616665653833646661333630303737666239383365363530393430323439353030 -36393064393163663234393665393233393534376236633139626662666330666461633437646466 -35346262663265386236366431623937396330616230306533616266616265653638643732653164 -39336232376239656134356363636332343631653133653231366338373535313363646430653137 -34653435396338306436346664383932336130393966643561373062396438363839363938313036 -38303761616630303265313665623535633032626333323932386535376166353534663262653130 -39313664616166383530343463633561306137313162346335356562346636383239323765343962 -35393462653034386662306438363533333865343634343565653164613566313331653832613035 -31646462363465316133653433653165633530643666633031643133656638323132653335626431 -37613631366332663165306264373736353532376431326131623764353238623762393763373365 -33663738626263663936373138613764386437656432303135656265636365353834616465633062 -66306435396639663533633465396664303936313936613330646564613630303131373437313538 -31306637643434303635316563323662643433643531626332613437353261313963373933623062 -37303331366561386233353665346236643363326537616532306236646533646163343862386333 -33343335373864636232323538356663343230323362346533323865383630613666366364383964 -65633434353763323033386231623737363033376438616162333339643463323730333435663566 -31323139326465393261653335366330313936383939313735353133393938313066636533336664 -31346166613434326665333866633762663338636335373965613435396539363834326338386564 -37626666653961376265343138323934373234636161373037656530643832663764346632623734 -38306461646231636666623166323334323765373639343665663537356564356332366632623434 -62353666306635393237313838313739313330623466376638653766613734663964666334313834 -32353137333564343334613937353766663532323063663233623865656439323864393838643038 -30613164356138316534643166633834663531653664306563333834636632346635666662323435 -62366662353930373637613032316639323836626166663766396461626130393031383331343734 -61633165663461353336303761613637323435383033363437396531613332323037346562643835 -38643938616436303062323763396338353365653738323838353865313533666639646462633933 -33323235666334623137363331313565366631633533643834323530333462386539626335303935 -37323161613762333932303465656238333435333162383338396565313665373537336439336539 -63326133353762346366313963383636666438633439346436306661366563373934663034653037 -32656463363338656562613332613566323531353964613139376530303437396139656530396166 -61626561663836643333653736316530393566666364633563633336666431616531663233343065 -39353036336566613934316434306261626363636536643265393230623630316562636265373766 -39396166373565616464386234363639323839346234303063666239323337366330663538303532 -32366338323263323530633762336438303037623330316666383836356630346235333065383263 -35333734623461373331393436666164656433646361323638353430373739656338306438333231 -31623632356231616663613734343965326662636330646533363538303562323433643430333565 -61356639383464393538666134396634366264333338396435363336656334376530343162373464 -66396336363136666335613737666330646536663364643733353761306534363863656461383331 -37373061333138373331356535316338626238326134626330356234376133316163663264643333 -38646131323063343032613765663232323164303338303634336366353238663532356335376638 -64323165663261363431646532383037666262626638373131653663303931383535636236316531 -36343736363431316661383031626633343334653164393231303339303564373665623434326639 -64383062373566313562653836326665623531316531303334306431383466313763636338383035 -30383762336666343639623138623961366365303631656438636466613663653537623635636262 -32616662303765343237373936623664383035333437663436333231353239663966343764303761 -30663837356435383333333237393664386631313337366437333735626136313561336465303934 -61623934346330626435303034366636306364376466623364366433326539653466353232616465 -61393632336463383262663235323665353931613065326565656336396261356235303737383662 -62333035316265646533653061363266303037653766366262326631376466343932313530653238 -30323165633338386637333865313761646633633735393238643464653638343934376435343962 -34323934383038323439626239336332653330366263343961356438373939373065393036633536 -64643839636261633234666663303063386438303132633166636631356166316535666132356161 -36333535663235663562383935663463336638383565326630393337663930376632666364353239 -61336233393166623937386666313464626633353430663064366631323831333739356261393837 -35333631383034313463336263353135656234623535303233353465316166623132333063386366 -35393234646139323132326163396632353763353262363139613562346266656266626435336330 -30616566353163326336386266666136643233393662643562376337366433306139393438373130 -37383565643931646632323664353363613763396434646565373333623638646463373639386237 -61616335363936303461326161396662383936336434626562613036633035373062663065356563 -39336233366262666631373439386632396637323737373165353538363335326664316531306261 -39333834383532393431343434396336393731303431336365636434646465613165386561393765 -33386333626366333262356539313134626533356465653239306235366562646533636334366137 -64323735633865343839653136343338313466346639323165663334343534376635656166633236 -37386365643737353361643935663039323537376562336238363937313036623765646538393530 -62353062333630613764633162363836643431373162303065653065666331303065616133323862 -65393731646566343939643031623835663064623561656533303962616335336234643939346165 -62613064373438366535353236346363613964326465333737306163633535653464636632336136 -36386230313931373836663062383164663463616535376431396632386431313161323463336562 -31323334326535613031303431376263356532316461343332376466646639646334353764376637 -34366334306166663030323134616234393665386533663964653538303430333135376234623139 -30353034373636396630396337643637363633306665636161613836343037303462336433643739 -37616635633139323866366138656336653065373437643861323966633639383965666133616236 -61313565383364333337643831313063626662633730343563666631643661623461333961363531 -32646562643130616132306262656536303330363431346562666361653435356138623435346334 -32313036633930323235613133643538393731353438373731306439646430316134313964303933 -63363638313266313532656232323939643031363162373837356230353934666131623436343464 -32643662366638643239363634653338343962326430313034343130323533316466613334393939 -66643131666330306530313635633734633565646336333366643330386262303737363866303037 -31396565303139656164306262666263656262383836313139343735346264616137636261386361 -37636466363865303362636661316436306439613262303933336135306264383262376439643663 -64663934323936353065623736623665643732346238336465656562373433656335313361323565 -37303562363466336139633065636236393236313831306330346234376639373635663638386330 -31653138396437313966353935633633336664333265303137343836653366333263656463623338 -66353061623431656366636137633035333138393135396433633566336435313337313835346130 -35633633323136653263623639613336623430333766666434333663616238306332613062626238 -38346438643638653063643133663962643831353866633434646436316239303030666338396263 -32393266333133616265646661633266393036343833316339633133336637623936306230363536 -33623264653939666466356666313465643863333765313930383761366335646237333735393230 -64353164666238313263373566376131323336636162396664653238306634303330616162333030 -37633561333932316233363666306234656335623033643962653932313266303564316135316334 -31633262646337393565366130656635626637336162366362383533303431396166303338353532 -64363366363961313633646231633165633836663939623039396662643462646431336230366439 -31633061366631353762663538316365616339653333356463336536323737356238383063313161 -34646233646137346362396134333665363230356339663664363538326530663539663436663562 -31303736333964366461386631326535333564336134316365336135326438363436326339333838 -65623039626261623563316537313231643065626136326163373835663536333666613734376337 -39373538656631326533616231653031346563613333663339383663316538663331643430326362 -36653931663732616532363765346537636333613666363137636363613331303639616263373736 -34386364663839613165323037363261656134323439613861623361333761386264303833346133 -39393031616665666133393532633731306662303531313137316266636137353363373835376336 -65323466356639356339326134626234353430623666393731386236366236343861633665616635 -31363761613566303031646535303737623731653834663465343766333939646130316533323536 -39373261363466623166666364366361356535646431643365353832333837333231306465333231 -36613561623535366565313538366232666537633064653838626334303438333662666231333935 -66623166633236393963316564346334663836623437353332346235623062393465326562313932 -34373139306162666163636130386162303538353537313365353133626262303233333064626331 -39386330343364653231363161323336303830303836626461666565333337666239333563636330 -62396463373663646238616536623033373732666130363963646566643963386162616433336631 -30623931666334383761313962626638636562626435333762356335333765373234643936353135 -66396464393161336461363166343639343534633962353130633436626133353736383637353436 -35383931316263373562663731333266393539383631373635633061393638643535643534313636 -33656335386431333337313834373135356538366131646539623963653039383034303563383938 -63363064646134383161326230363361626466393138633865393537663166306238383663383761 -34626639343564646430316133353466306364663464306263353231336566343234383464623566 -39383232633862373163353731653962363963666138656231643364663730386334633938323230 -62363335366539653437323865663535613232343832396138356335373331646435656336323264 -32386261633337323937353862636464346361303432633061653138316466316261363236646537 -65616261626264373464393362376436633865643264316139363866313838343133616230396633 -38643834643734383039653537313366663533646236343632636663616464326433653639646337 -34613161356335636232356436333533303435373161303862356331633132656162653937373936 -32326437323463336563353835313235333731663663303039656166343164356433376438663139 -33313762343737323566353938323836323832393331356530356633366437353265393365623261 -37343034663436303239 +35373831653035353532356664326238343363633038313666363937356535383930386266303436 +6332366333303937343433643364363130613535396162310a356266613334313536396464653165 +65653530383462356536656235396339663937643835313232313132663832373536376330336230 +6135303831393331620a653039326539656335336265383539366462346434633261373938356366 +33363566663565633966303634643565623136376462316638393263623163353433336132303032 +34376361373739643830396466666538323437306661633833616166393238653566616338396433 +39613164383262373236636464316334396264323833626362373938646363623461626637303261 +61623335353836336663343466613033366261326665633739346435323161653334333130633962 +66363436386130633338396662326234633334323461323239356431303434653563353234303236 +38663738656264653237626266636466373630636436336533663063613362633237376265356237 +34653934353532636561396462616361663532613530623766313961383361313635303938633362 +33306566663039373237396234346338613931626665656131356465323831663731303833643933 +66316435393664323166303334346239353030633466633561663431333530613835333337343966 +35663839653730643764323539333065633437333331353665366433386638353961663364633834 +65353166633039623837623939303763633561363931323561346165343437646134336665396264 +38306337613864343534353637376361323034653439663537316363643737316235623534396634 +30636435643464313834316133663764356133353666353036643032323263373439353363383465 +31343163653863633237633132646434663130356538313835663238383535396263616162346564 +61613132366136333436343434633139383536303061366338393637353764363164333761616635 +64316565636666333466313762373361326535383864666364663232643435323331353737316330 +31633738323533636262626264653632313638356239353235623636663638353334363934656264 +61666439623937363464316232343561623634323031326139356434363864323836313138303032 +33663965613961643434376333303332356139373066656163363737313833336634376533636130 +61353463366664356463363336633036386562646539386331633932613935643730636566313466 +31356263666631363635646466386233356133653834666133313136623165353238343731343161 +33326337663235643164663664326638656134663332376136383164336637333033306263396464 +65626431366564653832386462643431303137666532396635323966303734386365343632663733 +30313530323863393737623162646537383864353733633933613336323365363763313832623462 +66363563356462393938376632333338623232656130643666313463313765626431396132613165 +66663433303234383864323632303531616436663461396335333966303932666165353630316461 +39386438353965323036643433613232663935663938653030613662623136376365393666363535 +32333334333161656636343563663732626230353964626433633236396233613362393636343161 +63303863323961323466396532396132616437626365303164303832303834383466383437303966 +33656635623966326662656630363730326664643637383636616334393363636261663465336536 +65346438366165666331386531653835306461636431616539333366393239633536316166373862 +32613339366334343131636163376438646233393137626165383334306133653733646232306339 +66393435663132636235376130356132303037336535386461326365616137363332373262323634 +61303966376364623666366561306364356163353865613466636137323435313165663466366362 +31386462363739303430326438643436333635373236623237656230616631666131366462336561 +31623063393163623238386336336131353437373565333338643031363661366231383932626434 +66663836323666663865303938633338663563643130353334623831363961326435663765313634 +64356430383164636430653765653565653262336565353136633239393666316666633063323234 +66346537316432346531313362386533653765343561663338333734323437343935376239646464 +35336534366331393663663766616365666130353530306331336135373064373833343731643932 +32666362336236643237326636373739653032666165316164633138323233623936366462373964 +32323862633830623261623961316161323430396631633639396332393862363231313361326364 +30376331376238303934386562326266666264663434373564353839363634316664356531356632 +66376264336232346661633133373935633065363930636162326531303438366263346265393634 +61643833373630613836333337623931376231636533653536393563316436366665383030393637 +63373864376535663765313136363134656563303731666633653362366364316139313337633663 +62626139393430326136396331633532613135313762616133323665396531366634643932666266 +30663863653466643765663739666431663838376633316165353637663961376466376265363132 +61656363646534306165376134353265653230643039613964313462336161366636316433333930 +63393264396230363164373437306330346563346164633933393461363035643034346461336466 +38353336303264383166393633306663646265373932323663633032333162643831323331333262 +63313631653031633532626133303537616338306132396664643166333431663434653934383739 +39303738323966616262316164643935393261396361663066643239646638636431356164346635 +30653261656537613733313064643038396133363965656533666134343332663238626665626461 +32636162353337363762343832323234646564383565623065323136363536383766636539346339 +61643537653763383739613036363430316533363531383734633739323765613137623538636133 +31323731393461363765363231373061373831633433663036363539633230653430396335393037 +33646138366462323963653038356239656461323839636332313162333335313461636433653539 +34623161666333313038303934636539343334623730653762346334373533623264323532336433 +32616465353133336361323933393561356238643834646534376265353261316434386638373639 +39356264353833343635386536313961326662623435323236323835323266353131316462613031 +62326238373238633334646134303739386439613566336331623664313139303534303839626564 +36636237396666383966386163346631623534303733313531376432306466393330393061376132 +64303435653935303164336336653132653863366662616163326239383435306639333863616134 +61356164323966626161363864396533363130613434363365383262663937393439346665396134 +63383837643633323234363239626431363835666635366230353464373136336432366564636561 +65663236373664623039356165303365643439656561663236666337366535343731343163646636 +61373463393734313666313932613039336265343132613963373164663932623130333630336562 +32353662353439323338316335346261663831393861393637323734633939666534323532633437 +66626330626634666531346264373561353963636334333139383735666131373265313136396462 +36316266376338363965383731626130666237636638326637303330663535373461363265303239 +35383161326131353534313530623734346334383231373762303739636230613136303166356264 +64303937336461346162393365356436633239306434303163336161383236646265636331363333 +63626332643662613839323036383134346662393565656630656262663061656661663533333763 +63663934666361313961343338616532393661626365636134346331383861336431646662663033 +66316438646463636637656532376366636632326635666134366136656534366339306362383538 +32363763313265303035663436663132383539393166363961316631336464323363353466336161 +61303366306436383266616261316630396563373836663433663366616436613333323365653463 +65373730306234353331626634306162353930313539653738353434613461316665343961613338 +65613864643637363464616664663463303237313238373565393431653632366137366530643836 +61313264383238396430653631353431313562386561653362373830376261386538363666303039 +66316632633665393961346339313338363131373361653638633435383033393239383965636631 +32383865316662643636316362373065323364666262343139656363376265653638383134373837 +35383264633164326533633731306239333837353632326137383237333464356133353462613136 +30646436333935363263626131613864356163363633326662623465336362623061383166326163 +37356430663830366434653131653636626466353665666330343566306364303065393136383331 +34336239646563323664663733643130373463386135626561333361313039343932353530643061 +33323361383337623162363061343632643137623837386433366637356562346561373039666636 +65656534326632666532313333616236613032333536303664353564343962346163636132626130 +32373635323739353231336139643461363962333562316364666161643064356264353762383565 +64666663653761393135343238373064323064383263313330613265313230356133663964383336 +65633761643631656363323732646463623963616466396137383131363532393838376335303362 +31323538333264313163336362306461313538316330393261333061323162303330313536616662 +30373431343761313230616563303565326639353963326666313137633233303034333266613735 +63353835333739356231323538363336346337346236373661633132313331333865623238323436 +63373936356431316136376163383032653733313331666332383135313934336664633263613232 +30626339393365643735653761316636353632613663646539363238356332346230346638383432 +31346133346430306265353064643361396539613938326434366464303537643733613961313163 +33363564646230613865306335306262343735396330653864633039613565323033646436323334 +32393130613864646637616436653965356462636530653961653231383932626263336466613334 +37356132383361313762623637303337633763373363643938623230666230306238313135626434 +62663264373532656430393534643030386162656665323432323238626632363731613061646664 +33333033316664363365666164613333613439376462663565366132623833623432656537373737 +38646238653237633338363935626462383335333637356638396262313461336532646233353733 +39383038643039323062643165333039636233643034653930366133356135653839626136323336 +63646265366537373361386336396137383461336337323562646232653262396437366162383838 +37616330656562323238633362376637613964393630633037303039666663346634343133663831 +34383139656561393363323034343337643935353864343165626563646330656632646135333438 +34306533326364353561623762613162363431306364656634356138306233633565643938353432 +39616165316162383830626436623864316331356263626231376261356235666561323862323962 +38316237613065663233636133323566633335316361353838336466643966303530363163373431 +36613539323066643936353039353430643734303465343866303334366665623134373961346236 +32356137613036313066313864353766623961383738366262356364313061383735666436636430 +66353031323533333832643231343137653061623362306466386239396662383332343838613033 +36653263653038656562636666376663323363323239383630643663313539303461323434636139 +62626333313739336136623962343235636332623065626432326637313538346162663762656632 +61313332323338633938313164383536316161333263643037373863376634366538393065663936 +62623134373132363162386266656164653964353462303339376365316630333461363761643661 +65663064303666303236633630623230356432323931396138623862323863616535316165636463 +63373539396638373463393732653361313331666130636264616665636238623461616238613061 +32333539643961303566383365656165306264653536303365383639663738323666333030323631 +65363531346334386134633137393862316233633864363364376436663165363166366432373334 +64643338373539313131646138633963653033386236313663336266323664363661663535363539 +66373336626265636536313161386366623031633966393832633664313732643164623264373032 +37633666623534613137363765326136363462643735303130333532653433633831643736653763 +34656337656139633837343433663366303737316665613930383139646663373434316437346665 +63616130366232633835303439613638653362633764313333366435363734373536346230343031 +62623564646434396136303062653838616430306335393138316332626436353335393131303235 +33376664613931643536656238343366383332663737383331316339313330306364303861303634 +61356239356437636532623164656430356437396264333034656337366535656232353533623764 +65396639626635363032366232316561393365643737306135343134313032653963376564656265 +33356261643765336463366537643262323934383461613333633931333162313533613030386431 +32353263326537363034663138383163656461623462613738616463363830343138653138386532 +33626631623132313466633664623461643137643734326133353936653735306637343134366262 +35643864663737306230323331383637396165323864636533656331326165353264643061376661 +39313661333361616434333362643936663235363132353834373134303861656138346334613864 +32373163653362326537623335376236363962623561396430623439393038303838336166646234 +30323561333963306239623163373637666231656238623935313766393438646539326233656232 +63373136306635326263343333623461396333303339336561636132383564346163393263633464 +37313030653163643561373937663832613461383338383062636534303137656236323631613233 +62636639386236653737393631666635623832316361306165343035386536376261633636323332 +62383565663735613034323664363364653662393966323463613538393061336535393736663636 +39343939633932656633383030633164356130346138336263666235666632386235383162316161 +63393338313236353565393431623961636462336364313735623235343363373332626535393466 +35613730356164326662393362663735636430666337366633313430643631306462316133366636 +32393262326238656564663963613365613661343166383863623230643336616631656265343133 +33396435353933343963616263663337636264396136373163633865316333663839346665313036 +36353562346334623535653132313666396331383764366462623035333731336639346361333835 +36613435313839623233626633306562363461353036343639633362636537393362613432666232 +31623232653566636261623966356362333532303536353439326439643464623165626635333262 +38643236303534323238626635653332313966616566636331376438613633363432383330663037 +32376330336130653737623535333730643963356264653963313232326564303465323563326131 +38306164333061633033616561376263346635663237383133393961646330373039313265386661 +61326130653736643735646632343635343866346463383236343334653865643365633338303966 +63326536306166373334643662633434323034636538663866383736613736656437343439326237 +66653263613763383933376235636639613930616166313663393130323662636437396461393939 +37313431333237396465393466633835666365333439633266353634306431646564333262656232 +37363534373233646235303937333933346533306637333431396437633438396539313061313338 +35376137666132663566653939666532323232303466333536656364653337653337353063393939 +39343961643337353238383765396337653631396635323564333861366439393938623964363234 +34383262633838646363663738663461396238636661643466323464323732316135663165363236 +64633435393364323734356635323237306536383362613665353531383264386538353263396362 +31353862376166346538663231663732353066393736666266386231353130306232393864316137 +64643666303061653266343437313034633662323335383761386237336435633738646665633931 +36326532613466383365346138323466333432343166343037316663646562336661343739623738 +30326362366437323436376634316664633931646661323937333936666165303630666432353662 +32643931356664643266353530396436343730353766386663323735656132386363373063313936 +37383330623563363763343331623961333238633838616234616134373538636338336437353135 +35356538633239643233353162366530343739653030363365303134343631326265653664313462 +38333530303037303262323466626261313961386233656137376661656663303632666232336537 +36616266646534333238616434383564343938373132663839636165323061376163353536393361 +65653430366333623364343631333961333736633362623934653264323266666666653763363039 +34303966376662626635353839346163633936656366646236313239643239363066636237623832 +64633135356234623161303439373238303361326438656338626432323732316239656664336533 +31353666363131666537386563613062633861376230376339333836383538313666616338333263 +64663365333337626162353831363032326363373064303961303037383565663265386562383663 +34666637666162366337336637666238393561613665643161643564316539333038373839346132 +63303066323832653364623439313631386663653865646565383166336531306332303330666561 +63643933353332623564383933653964643463653930626434326562643230616432666638653665 +31386664643737336262643438353532346632343466646136613232393838363863643833663764 +38346530626339646462343662653863613765633863643564323866363333636431643734356161 +31663837346131646532633838393766336261613061326264333937393334356338383633383961 +37356539663132653166316362303064373431633036366465306263376239313336666361636531 +30633865383535643537333735323662393936613935373539306435653033616133366663623533 +61346630383433633634353431396530343032366535653466383162383134366234653961366634 +31373739333261656165376531616536623032636530303361333266643561333064306334393065 +65303639643137343933653538656336363932333465373432636161386232336339616363343539 +66616132343535323936616438313335313262363963393731336262333764303738316537386661 +36383161616462323431666464633464656561623638326163313132353534643565356635353130 +32653835306237663966376561623233636433613235343761336233643631313235346137316361 +65326338613066653930643065643465343762333661633266393232306563303739333539306463 +64646139623631613863376465616163643862333030373735376331336137613131346133393834 +32636563646664636533646262636532373562366463393633336564373833303337613666336432 +31613038646531663163336437373262396138363764383863633234643762616363643761613835 +30666630313937643833353935306165656435333039306531386365386437656238376339343634 +66626161643335393263336530646166623135623132353432323964376266643161313033626338 +39323832393562613164333538656236663139623633636461323833323236376238393062306263 +36343862623634323332643765663833396437353936393262376531366565393239643837393737 +61636461616166323431393933373537366665363630336635656533623731363132663337663733 +61393936386362373661323931396539393438373330396633326138303237366138613039393032 +33633234623034396231643266653564316138666139343062623361653530633065393736303064 +32643633623939326563363633346331633732616364333236653734626635646665336665393539 +61326363633666326631616436633236363863393364326130313632613064353230353065623965 +37366539346230353665653933653862386330313530353331396637353464633161663064366266 +61303265663237333065376665663138313737363432663839623032636338346533393763666531 +33343162373132623464653763343732653361663366363965353836363939306230656437333965 +31666463383664613966646132666431383665373061326361646463383262373061316636343734 +33633664383633643031383561646139656363653835666234616438626165613731396535333732 +38366136623437356532373436616237396135313732376635643138623537356138653738353537 +33656334616666353836633132303039346532323963363431383339666161623931623563623937 +39303134663565393930613939376564363332373561376534313537646265303239383138663336 +31316133326661303366646261326433363539663365363763643537353165336164333066636431 +33363738376465303435373064643336353962343732376461663638303566356435313935383830 +37653638336338306538383232626231666562333532356532383634313437626466376564303863 +39656333383835393035323966623834326232373136623963323239313134326335323338343661 +34313233323466383262656238623839616636396463616463366666656432643331333761613134 +62366531653639383265393833633132373361613833653239373665373537373231363361333062 +38356238646531383736363530616439363930363733383532303330386330353161643639363934 +66373436613633626139613033633432623766363633646632323632653264393435363336333731 +63366330346530326535663734323066613736383063616337616265396664633938633837636461 +33303633666361313930613866356233373335633066373939643437356537313861323534333735 +37656630653336313139616536363666303737643432316566633962633933656137633061336139 +36623636383237666139623931316535353631306665626131346361303164386663653534613530 +38366130343034313734643735373363643234373839623962653562623932323832386364616138 +63306265616132346330336139306262623435393739643131363639613235366662616266343338 +65323436383137313065303534376236663537376436383133343533663839316561313738376635 +61303965356334326138666165366338663632333366356465313765373165356530303038346565 +37383835636263306438373763393230323231326366333333353762333062373039316661323330 +34313564363766636439636465306133366161313033323331663765626338396138323930306365 +32636432653330383564633464396536333633363831336635386537316334323163656663653532 +36373430373363633333343134323136663361643934363265313464366630346338303535363233 +64353763316133666133656335633466633332353461326538653733666436383261616365363233 +36373139363533343130383734666161616439393539633032636338303636633837393338393366 +62373732303433663039353161356539646539613365616334643530663662363266316163353466 +31633563363966366636616135333831326262666135633464343334343564626538666236393131 +35353564616630653635373964656461376266323361313861663165373766353834313836303866 +61643532303562356135633837323136373432313131393065393531346131663264383966326562 +37643464326430313734653133313264336634363431633136336334333939366666633761386531 +38336664313031636661313837646461653133616139616265336530393531653237316165363062 +35643337393037653665336330666637656532366135613635393431306631393566376561306234 +37623265303633316434613938663366623966663434393161653635303033633862633533366364 +37343737393338323936333035333366613166653165363737343136383036386264613864376365 +30376261303665323439623866326633646337626534663031386164323362333230346134623466 +65323735646465346663643266643564633434316131353561303966653062616332306436343234 +63313131643436646237343231363331356632616234346362383431666566383263383463323734 +64666332363130353332643731623830616430636233366237613139623864646338303561653230 +39663039323939643939303130633333313565366463636232386235363435333534356135666463 +33666436383364376164396266303339393234396538313566316336393264656135613132643366 +63353037306137313436336631303436363665333633623366326538613834663337313462343530 +62333936396232666633303062623934653131616364363139656539386666663063623763643465 +35333035363738663731613637633337346361396363343334393637373434346564393766393633 +62633433346563396163356266366136353965306662316232666261393336626537393130643163 +35656333313864623334306437663537623831656536633232333433653336616464383561303937 +35376466333964396430346161306633393862366262623134333963656234633061356264333235 +34626438326536396663323338613762613536376234376535626134386237373963383865376238 +62396636653437396564303163613366353766333936303438393062646362373535306136316162 +34396136396636326632663033343538323530663764636166306130306164613936626139323939 +39643831613537616263323661336232336661643263383534616535366163323030626261346232 +30633265323734636330383037656638656134323438666339656164306634313364636232353263 +37623364376435363431 From 3450dfc09ff8c4bbc9d89c28ddc78b81f52e2ee6 Mon Sep 17 00:00:00 2001 From: nmdefries <42820733+nmdefries@users.noreply.github.com> Date: Mon, 28 Oct 2024 08:21:11 -0400 Subject: [PATCH 05/15] Add `nchs-mortality` raw data backups and backup export utility (#2065) * add helper fn in utils to save backup data to csv * use helper to save nchs data to disk right after pulling * add backup dir param * import backup utility * update arg name * add gzip + fix old json template log + remove table_name * fix current tests to take backup dirs and custom_run flag into account * add logging * fix log getsize of backup file * lint * lint * lint * lint * add backup test * remove deep copy --------- Co-authored-by: minhkhul Co-authored-by: minhkhul <118945681+minhkhul@users.noreply.github.com> --- _delphi_utils_python/delphi_utils/__init__.py | 13 +- _delphi_utils_python/delphi_utils/export.py | 75 ++++++++++- .../nchs_mortality-params-prod.json.j2 | 1 + nchs_mortality/delphi_nchs_mortality/pull.py | 22 +++- nchs_mortality/delphi_nchs_mortality/run.py | 6 +- nchs_mortality/params.json.template | 3 +- nchs_mortality/raw_data_backups/.gitignore | 120 ++++++++++++++++++ nchs_mortality/tests/conftest.py | 4 +- .../tests/raw_data_backups/.gitignore | 2 + nchs_mortality/tests/test_pull.py | 18 ++- 10 files changed, 245 insertions(+), 19 deletions(-) create mode 100644 nchs_mortality/raw_data_backups/.gitignore create mode 100644 nchs_mortality/tests/raw_data_backups/.gitignore diff --git a/_delphi_utils_python/delphi_utils/__init__.py b/_delphi_utils_python/delphi_utils/__init__.py index 7a418551d..ca5693eaf 100644 --- a/_delphi_utils_python/delphi_utils/__init__.py +++ b/_delphi_utils_python/delphi_utils/__init__.py @@ -4,15 +4,14 @@ from __future__ import absolute_import from .archive import ArchiveDiffer, GitArchiveDiffer, S3ArchiveDiffer -from .export import create_export_csv -from .utils import read_params - -from .slack_notifier import SlackNotifier -from .logger import get_structured_logger +from .export import create_backup_csv, create_export_csv from .geomap import GeoMapper -from .smooth import Smoother -from .signal import add_prefix +from .logger import get_structured_logger from .nancodes import Nans +from .signal import add_prefix +from .slack_notifier import SlackNotifier +from .smooth import Smoother +from .utils import read_params from .weekday import Weekday __version__ = "0.3.25" diff --git a/_delphi_utils_python/delphi_utils/export.py b/_delphi_utils_python/delphi_utils/export.py index 8ac5de48e..82493032e 100644 --- a/_delphi_utils_python/delphi_utils/export.py +++ b/_delphi_utils_python/delphi_utils/export.py @@ -1,16 +1,18 @@ """Export data in the format expected by the Delphi API.""" # -*- coding: utf-8 -*- +import gzip +import logging from datetime import datetime -from os.path import join +from os.path import getsize, join from typing import Optional -import logging -from epiweeks import Week import numpy as np import pandas as pd +from epiweeks import Week from .nancodes import Nans + def filter_contradicting_missing_codes(df, sensor, metric, date, logger=None): """Find values with contradictory missingness codes, filter them, and log.""" columns = ["val", "se", "sample_size"] @@ -132,3 +134,70 @@ def create_export_csv( export_df = export_df.sort_values(by="geo_id") export_df.to_csv(export_file, index=False, na_rep="NA") return dates + + +def create_backup_csv( + df: pd.DataFrame, + backup_dir: str, + custom_run: bool, + issue: Optional[str] = None, + geo_res: Optional[str] = None, + sensor: Optional[str] = None, + metric: Optional[str] = None, + logger: Optional[logging.Logger] = None, +): + """Save data for use as a backup. + + This function is meant to save raw data fetched from data sources. + Therefore, it avoids manipulating the data as much as possible to + preserve the input. + + When only required arguments are passed, data will be saved to a file of + the format `/.csv`. Optional arguments + should be passed if the source data is fetched from different tables or + in batches by signal, geo, etc. + + Parameters + ---------- + df: pd.DataFrame + Columns: geo_id, timestamp, val, se, sample_size + backup_dir: str + Backup directory + custom_run: bool + Flag indicating if the current run is a patch, or other run where + backups aren't needed. If so, don't save any data to disk + issue: Optional[str] + The date the data was fetched, in YYYYMMDD format. Defaults to "today" + if not provided + geo_res: Optional[str] + Geographic resolution of the data + sensor: Optional[str] + Sensor that has been calculated (cumulative_counts vs new_counts) + metric: Optional[str] + Metric we are considering, if any. + logger: Optional[logging.Logger] + Pass a logger object here to log information about name and size of the backup file. + + Returns + --------- + dates: pd.Series[datetime] + Series of dates for which CSV files were exported. + """ + if not custom_run: + # Label the file with today's date (the date the data was fetched). + if not issue: + issue = datetime.today().strftime("%Y%m%d") + + backup_filename = [issue, geo_res, metric, sensor] + backup_filename = "_".join(filter(None, backup_filename)) + ".csv.gz" + backup_file = join(backup_dir, backup_filename) + + with gzip.open(backup_file, "wt", newline="") as f: + df.to_csv(f, index=False, na_rep="NA") + + if logger: + logger.info( + "Backup file created", + backup_file=backup_file, + backup_size=getsize(backup_file), + ) diff --git a/ansible/templates/nchs_mortality-params-prod.json.j2 b/ansible/templates/nchs_mortality-params-prod.json.j2 index dbd39598b..4b0d0c4f7 100644 --- a/ansible/templates/nchs_mortality-params-prod.json.j2 +++ b/ansible/templates/nchs_mortality-params-prod.json.j2 @@ -1,6 +1,7 @@ { "common": { "daily_export_dir": "./daily_receiving", + "backup_dir": "./raw_data_backups", "log_filename": "/var/log/indicators/nchs_mortality.log", "weekly_export_dir": "/common/covidcast/receiving/nchs-mortality" }, diff --git a/nchs_mortality/delphi_nchs_mortality/pull.py b/nchs_mortality/delphi_nchs_mortality/pull.py index 18bbfd59a..ad54e457a 100644 --- a/nchs_mortality/delphi_nchs_mortality/pull.py +++ b/nchs_mortality/delphi_nchs_mortality/pull.py @@ -1,15 +1,17 @@ # -*- coding: utf-8 -*- """Functions for pulling NCHS mortality data API.""" +import logging from typing import Optional import numpy as np import pandas as pd +from delphi_utils import create_backup_csv +from delphi_utils.geomap import GeoMapper from sodapy import Socrata -from delphi_utils.geomap import GeoMapper +from .constants import METRICS, NEWLINE, RENAME -from .constants import METRICS, RENAME, NEWLINE def standardize_columns(df): """Rename columns to comply with a standard set. @@ -22,7 +24,13 @@ def standardize_columns(df): return df.rename(columns=dict(rename_pairs)) -def pull_nchs_mortality_data(socrata_token: str, test_file: Optional[str] = None): +def pull_nchs_mortality_data( + socrata_token: str, + backup_dir: str, + custom_run: bool, + logger: Optional[logging.Logger] = None, + test_file: Optional[str] = None, +): """Pull the latest NCHS Mortality data, and conforms it into a dataset. The output dataset has: @@ -40,6 +48,10 @@ def pull_nchs_mortality_data(socrata_token: str, test_file: Optional[str] = None ---------- socrata_token: str My App Token for pulling the NCHS mortality data + backup_dir: str + Directory to which to save raw backup data + custom_run: bool + Flag indicating if the current run is a patch. If so, don't save any data to disk test_file: Optional[str] When not null, name of file from which to read test data @@ -60,6 +72,10 @@ def pull_nchs_mortality_data(socrata_token: str, test_file: Optional[str] = None client = Socrata("data.cdc.gov", socrata_token) results = client.get("r8kw-7aab", limit=10**10) df = pd.DataFrame.from_records(results) + + create_backup_csv(df, backup_dir, custom_run=custom_run, logger=logger) + + if not test_file: # drop "By Total" rows df = df[df["group"].transform(str.lower) == "by week"] diff --git a/nchs_mortality/delphi_nchs_mortality/run.py b/nchs_mortality/delphi_nchs_mortality/run.py index 50ce46cfb..4e88e9d61 100644 --- a/nchs_mortality/delphi_nchs_mortality/run.py +++ b/nchs_mortality/delphi_nchs_mortality/run.py @@ -59,6 +59,8 @@ def run_module(params: Dict[str, Any]): days=date.today().weekday() + 2) export_start_date = export_start_date.strftime('%Y-%m-%d') daily_export_dir = params["common"]["daily_export_dir"] + backup_dir = params["common"]["backup_dir"] + custom_run = params["common"].get("custom_run", False) socrata_token = params["indicator"]["socrata_token"] test_file = params["indicator"].get("test_file", None) @@ -70,7 +72,9 @@ def run_module(params: Dict[str, Any]): daily_arch_diff.update_cache() stats = [] - df_pull = pull_nchs_mortality_data(socrata_token, test_file) + df_pull = pull_nchs_mortality_data( + socrata_token, backup_dir, custom_run=custom_run, test_file=test_file, logger=logger + ) for metric in METRICS: for geo in ["state", "nation"]: if metric == 'percent_of_expected_deaths': diff --git a/nchs_mortality/params.json.template b/nchs_mortality/params.json.template index ed16c620c..2e829de24 100644 --- a/nchs_mortality/params.json.template +++ b/nchs_mortality/params.json.template @@ -2,7 +2,8 @@ "common": { "daily_export_dir": "./daily_receiving", "weekly_export_dir": "./receiving", - "log_filename": "/var/log/indicators/nchs_mortality.log", + "backup_dir": "./raw_data_backups", + "log_filename": "./nchs_mortality.log", "log_exceptions": false }, "indicator": { diff --git a/nchs_mortality/raw_data_backups/.gitignore b/nchs_mortality/raw_data_backups/.gitignore new file mode 100644 index 000000000..552154e09 --- /dev/null +++ b/nchs_mortality/raw_data_backups/.gitignore @@ -0,0 +1,120 @@ +# You should hard commit a prototype for this file, but we +# want to avoid accidental adding of API tokens and other +# private data parameters +params.json + +# Do not commit output files +receiving/*.csv + +# Remove macOS files +.DS_Store + +# virtual environment +dview/ + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +coverage.xml +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +.static_storage/ +.media/ +local_settings.py + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ diff --git a/nchs_mortality/tests/conftest.py b/nchs_mortality/tests/conftest.py index 6ad0f9c59..383d1c782 100644 --- a/nchs_mortality/tests/conftest.py +++ b/nchs_mortality/tests/conftest.py @@ -14,8 +14,10 @@ PARAMS = { "common": { + "custom_run": True, "daily_export_dir": "./daily_receiving", - "weekly_export_dir": "./receiving" + "weekly_export_dir": "./receiving", + "backup_dir": "./raw_data_backups" }, "indicator": { "export_start_date": "2020-04-11", diff --git a/nchs_mortality/tests/raw_data_backups/.gitignore b/nchs_mortality/tests/raw_data_backups/.gitignore new file mode 100644 index 000000000..2b7efbb36 --- /dev/null +++ b/nchs_mortality/tests/raw_data_backups/.gitignore @@ -0,0 +1,2 @@ +*.csv +*.gz \ No newline at end of file diff --git a/nchs_mortality/tests/test_pull.py b/nchs_mortality/tests/test_pull.py index fa58b04a5..4f18210f6 100644 --- a/nchs_mortality/tests/test_pull.py +++ b/nchs_mortality/tests/test_pull.py @@ -1,3 +1,4 @@ +import os import pytest import pandas as pd @@ -34,7 +35,7 @@ def test_standardize_columns(self): pd.testing.assert_frame_equal(expected, df) def test_good_file(self): - df = pull_nchs_mortality_data(SOCRATA_TOKEN, "test_data.csv") + df = pull_nchs_mortality_data(SOCRATA_TOKEN, backup_dir = "", custom_run = True, test_file = "test_data.csv") # Test columns assert ( @@ -90,9 +91,20 @@ def test_good_file(self): def test_bad_file_with_inconsistent_time_col(self): with pytest.raises(ValueError): pull_nchs_mortality_data( - SOCRATA_TOKEN, "bad_data_with_inconsistent_time_col.csv" + SOCRATA_TOKEN, backup_dir = "", custom_run = True, test_file = "bad_data_with_inconsistent_time_col.csv" ) def test_bad_file_with_missing_cols(self): with pytest.raises(ValueError): - pull_nchs_mortality_data(SOCRATA_TOKEN, "bad_data_with_missing_cols.csv") + pull_nchs_mortality_data(SOCRATA_TOKEN, backup_dir = "", custom_run = True, test_file = "bad_data_with_missing_cols.csv") + + def test_backup_today_data(self): + today = pd.Timestamp.today().strftime("%Y%m%d") + backup_dir = "./raw_data_backups" + pull_nchs_mortality_data(SOCRATA_TOKEN, backup_dir = backup_dir, custom_run = False, test_file = "test_data.csv") + backup_file = f"{backup_dir}/{today}.csv.gz" + backup_df = pd.read_csv(backup_file) + source_df = pd.read_csv("test_data/test_data.csv") + pd.testing.assert_frame_equal(source_df, backup_df) + if os.path.exists(backup_file): + os.remove(backup_file) From 57368e909ff2f68a9d0ceed5fe0bea432a39f665 Mon Sep 17 00:00:00 2001 From: aysim319 Date: Tue, 5 Nov 2024 12:34:24 -0500 Subject: [PATCH 06/15] 2034 add retry loop to Google symptoms data pull (#2057) * first implementation * add testing and more robust conditions * revert unneeded change * only retry once and added other applicable error * lint * fixed test * lint --- .../delphi_google_symptoms/pull.py | 29 +++++++++++--- google_symptoms/tests/test_pull.py | 38 +++++++++++++++++++ 2 files changed, 61 insertions(+), 6 deletions(-) diff --git a/google_symptoms/delphi_google_symptoms/pull.py b/google_symptoms/delphi_google_symptoms/pull.py index 8a485de4f..a8c4cdfde 100644 --- a/google_symptoms/delphi_google_symptoms/pull.py +++ b/google_symptoms/delphi_google_symptoms/pull.py @@ -1,11 +1,14 @@ """Retrieve data and wrangle into appropriate format.""" # -*- coding: utf-8 -*- +import random import re +import time from datetime import date, datetime # pylint: disable=unused-import import numpy as np import pandas as pd import pandas_gbq +from google.api_core.exceptions import BadRequest, InternalServerError, ServerError from google.oauth2 import service_account from .constants import COMBINED_METRIC, DC_FIPS, DTYPE_CONVERSIONS, METRICS, SYMPTOM_SETS @@ -184,16 +187,30 @@ def pull_gs_data_one_geolevel(level, date_range): pd.DataFrame """ query = produce_query(level, date_range) + df = None + + # recommends to only try once for 500/503 error + try: + df = pandas_gbq.read_gbq(query, progress_bar_type=None, dtypes=DTYPE_CONVERSIONS) + # pylint: disable=W0703 + except Exception as e: + # sometimes google throws out 400 error when it's 500 + # https://github.com/googleapis/python-bigquery/issues/23 + if ( + # pylint: disable=E1101 + (isinstance(e, BadRequest) and e.reason == "backendError") + or isinstance(e, (ServerError, InternalServerError)) + ): + time.sleep(2 + random.randint(0, 1000) / 1000.0) + else: + raise e + if df is None: + df = pandas_gbq.read_gbq(query, progress_bar_type=None, dtypes=DTYPE_CONVERSIONS) - df = pandas_gbq.read_gbq(query, progress_bar_type=None, dtypes = DTYPE_CONVERSIONS) if len(df) == 0: - df = pd.DataFrame( - columns=["open_covid_region_code", "date"] + - list(colname_map.keys()) - ) + df = pd.DataFrame(columns=["open_covid_region_code", "date"] + list(colname_map.keys())) df = preprocess(df, level) - return df diff --git a/google_symptoms/tests/test_pull.py b/google_symptoms/tests/test_pull.py index 16792ab16..4367995b8 100644 --- a/google_symptoms/tests/test_pull.py +++ b/google_symptoms/tests/test_pull.py @@ -2,7 +2,10 @@ import mock from freezegun import freeze_time from datetime import date, datetime +from google.api_core.exceptions import BadRequest, ServerError + import pandas as pd +from google.rpc import error_details_pb2 from pandas.testing import assert_frame_equal from delphi_google_symptoms.pull import ( @@ -120,6 +123,41 @@ def test_pull_one_gs_no_dates(self, mock_read_gbq): expected = pd.DataFrame(columns=new_keep_cols) assert_frame_equal(output, expected, check_dtype = False) + def test_pull_one_gs_retry_success(self): + info = error_details_pb2.ErrorInfo( + reason="backendError", + ) + badRequestException = BadRequest(message="message", error_info=info) + serverErrorException = ServerError(message="message") + + with mock.patch("pandas_gbq.read_gbq") as mock_read_gbq: + mock_read_gbq.side_effect = [badRequestException, pd.DataFrame()] + + output = pull_gs_data_one_geolevel("state", ["", ""]) + expected = pd.DataFrame(columns=new_keep_cols) + assert_frame_equal(output, expected, check_dtype = False) + assert mock_read_gbq.call_count == 2 + + def test_pull_one_gs_retry_too_many(self): + info = error_details_pb2.ErrorInfo( + reason="backendError", + ) + badRequestException = BadRequest(message="message", error_info=info) + + with mock.patch("pandas_gbq.read_gbq") as mock_read_gbq: + with pytest.raises(BadRequest): + mock_read_gbq.side_effect = [badRequestException, badRequestException, pd.DataFrame()] + pull_gs_data_one_geolevel("state", ["", ""]) + + + def test_pull_one_gs_retry_bad(self): + badRequestException = BadRequest(message="message", ) + + with mock.patch("pandas_gbq.read_gbq") as mock_read_gbq: + with pytest.raises(BadRequest): + mock_read_gbq.side_effect = [badRequestException,pd.DataFrame()] + pull_gs_data_one_geolevel("state", ["", ""]) + def test_preprocess_no_data(self): output = preprocess(pd.DataFrame(columns=keep_cols), "state") expected = pd.DataFrame(columns=new_keep_cols) From 9dbbc59dbda79720908aab8e105814b7aa9605c6 Mon Sep 17 00:00:00 2001 From: minhkhul <118945681+minhkhul@users.noreply.github.com> Date: Thu, 7 Nov 2024 18:18:08 -0500 Subject: [PATCH 07/15] 2070 add backup of source data to nssp (#2072) * base changes * backup dir * add test * lint * adding tests for create_backup_csv * also writing into parquet * adding pyarrow as dependency * clean test * adjusting logic to match new naming format and chunking * moving dependencies * lint * made test more robust * fix test * clean up * adding parqut into gitignore * placate the linter --------- Co-authored-by: Amaris Sim --- _delphi_utils_python/delphi_utils/export.py | 27 ++-- _delphi_utils_python/pyproject.toml | 1 + _delphi_utils_python/tests/test_export.py | 24 +++- ansible/templates/nssp-params-prod.json.j2 | 1 + .../tests/raw_data_backups/.gitignore | 3 +- nchs_mortality/tests/test_pull.py | 28 +++- nssp/delphi_nssp/pull.py | 17 ++- nssp/delphi_nssp/run.py | 4 +- nssp/params.json.template | 1 + nssp/raw_data_backups/.gitignore | 120 ++++++++++++++++++ nssp/tests/test_pull.py | 51 +++++--- nssp/tests/test_raw_data_backups/.gitignore | 3 + 12 files changed, 236 insertions(+), 44 deletions(-) create mode 100644 nssp/raw_data_backups/.gitignore create mode 100644 nssp/tests/test_raw_data_backups/.gitignore diff --git a/_delphi_utils_python/delphi_utils/export.py b/_delphi_utils_python/delphi_utils/export.py index 82493032e..82a460abe 100644 --- a/_delphi_utils_python/delphi_utils/export.py +++ b/_delphi_utils_python/delphi_utils/export.py @@ -1,6 +1,5 @@ """Export data in the format expected by the Delphi API.""" # -*- coding: utf-8 -*- -import gzip import logging from datetime import datetime from os.path import getsize, join @@ -189,15 +188,21 @@ def create_backup_csv( issue = datetime.today().strftime("%Y%m%d") backup_filename = [issue, geo_res, metric, sensor] - backup_filename = "_".join(filter(None, backup_filename)) + ".csv.gz" + backup_filename = "_".join(filter(None, backup_filename)) backup_file = join(backup_dir, backup_filename) - - with gzip.open(backup_file, "wt", newline="") as f: - df.to_csv(f, index=False, na_rep="NA") - - if logger: - logger.info( - "Backup file created", - backup_file=backup_file, - backup_size=getsize(backup_file), + try: + # defacto data format is csv, but parquet preserved data types (keeping both as intermidary measures) + df.to_csv( + f"{backup_file}.csv.gz", index=False, na_rep="NA", compression="gzip" ) + df.to_parquet(f"{backup_file}.parquet", index=False) + + if logger: + logger.info( + "Backup file created", + backup_file=backup_file, + backup_size=getsize(f"{backup_file}.csv.gz"), + ) + # pylint: disable=W0703 + except Exception as e: + logger.info("Backup file creation failed", msg=e) diff --git a/_delphi_utils_python/pyproject.toml b/_delphi_utils_python/pyproject.toml index c47590a29..9ec3f5fc5 100644 --- a/_delphi_utils_python/pyproject.toml +++ b/_delphi_utils_python/pyproject.toml @@ -23,6 +23,7 @@ dependencies = [ "gitpython", "importlib_resources>=1.3", "numpy", + "pyarrow", "pandas>=1.1.0", "requests", "slackclient", diff --git a/_delphi_utils_python/tests/test_export.py b/_delphi_utils_python/tests/test_export.py index c9c1f8483..1d11b7068 100644 --- a/_delphi_utils_python/tests/test_export.py +++ b/_delphi_utils_python/tests/test_export.py @@ -1,15 +1,16 @@ """Tests for exporting CSV files.""" from datetime import datetime +import logging from os import listdir from os.path import join -from typing import Any, Dict, List +from typing import Any, Dict import mock import numpy as np import pandas as pd from pandas.testing import assert_frame_equal -from delphi_utils import create_export_csv, Nans +from delphi_utils import create_export_csv, Nans, create_backup_csv, get_structured_logger def _set_df_dtypes(df: pd.DataFrame, dtypes: Dict[str, Any]) -> pd.DataFrame: @@ -386,3 +387,22 @@ def test_export_sort(self, tmp_path): }) sorted_csv = _set_df_dtypes(pd.read_csv(join(tmp_path, "20200215_county_test.csv")), dtypes={"geo_id": str}) assert_frame_equal(sorted_csv,expected_df) + + def test_create_backup_regular(self, caplog, tmp_path): + caplog.set_level(logging.INFO) + logger = get_structured_logger() + today = datetime.strftime(datetime.today(), "%Y%m%d") + dtypes = self.DF.dtypes.to_dict() + del dtypes["timestamp"] + geo_res = "county" + metric = "test" + sensor = "deaths" + create_backup_csv(df=self.DF, backup_dir=tmp_path, custom_run=False, issue=None, geo_res=geo_res, metric=metric, sensor=sensor, logger=logger) + assert "Backup file created" in caplog.text + + actual = pd.read_csv(join(tmp_path, f"{today}_{geo_res}_{metric}_{sensor}.csv.gz"), dtype=dtypes, parse_dates=["timestamp"]) + assert self.DF.equals(actual) + + actual_parquet = pd.read_parquet(join(tmp_path, f"{today}_{geo_res}_{metric}_{sensor}.parquet")) + assert actual_parquet.equals(actual) + diff --git a/ansible/templates/nssp-params-prod.json.j2 b/ansible/templates/nssp-params-prod.json.j2 index b131b6130..1ff73d843 100644 --- a/ansible/templates/nssp-params-prod.json.j2 +++ b/ansible/templates/nssp-params-prod.json.j2 @@ -1,6 +1,7 @@ { "common": { "export_dir": "/common/covidcast/receiving/nssp", + "backup_dir": "./raw_data_backups", "log_filename": "/var/log/indicators/nssp.log", "log_exceptions": false }, diff --git a/nchs_mortality/tests/raw_data_backups/.gitignore b/nchs_mortality/tests/raw_data_backups/.gitignore index 2b7efbb36..3d44aa305 100644 --- a/nchs_mortality/tests/raw_data_backups/.gitignore +++ b/nchs_mortality/tests/raw_data_backups/.gitignore @@ -1,2 +1,3 @@ *.csv -*.gz \ No newline at end of file +*.gz +*.parquet \ No newline at end of file diff --git a/nchs_mortality/tests/test_pull.py b/nchs_mortality/tests/test_pull.py index 4f18210f6..39d44d9b3 100644 --- a/nchs_mortality/tests/test_pull.py +++ b/nchs_mortality/tests/test_pull.py @@ -1,7 +1,10 @@ +import glob import os import pytest import pandas as pd + +from delphi_utils import get_structured_logger from delphi_utils.geomap import GeoMapper from delphi_nchs_mortality.pull import pull_nchs_mortality_data, standardize_columns @@ -98,13 +101,30 @@ def test_bad_file_with_missing_cols(self): with pytest.raises(ValueError): pull_nchs_mortality_data(SOCRATA_TOKEN, backup_dir = "", custom_run = True, test_file = "bad_data_with_missing_cols.csv") - def test_backup_today_data(self): + def test_backup_today_data(self, caplog): today = pd.Timestamp.today().strftime("%Y%m%d") backup_dir = "./raw_data_backups" - pull_nchs_mortality_data(SOCRATA_TOKEN, backup_dir = backup_dir, custom_run = False, test_file = "test_data.csv") - backup_file = f"{backup_dir}/{today}.csv.gz" - backup_df = pd.read_csv(backup_file) + logger = get_structured_logger() + pull_nchs_mortality_data(SOCRATA_TOKEN, backup_dir = backup_dir, custom_run = False, test_file = "test_data.csv", logger=logger) + + # Check logger used: + assert "Backup file created" in caplog.text + + # Check that backup file was created + backup_files = glob.glob(f"{backup_dir}/{today}*") + assert len(backup_files) == 2, "Backup file was not created" + source_df = pd.read_csv("test_data/test_data.csv") + for backup_file in backup_files: + if backup_file.endswith(".csv.gz"): + backup_df = pd.read_csv(backup_file) + else: + backup_df = pd.read_parquet(backup_file) + pd.testing.assert_frame_equal(source_df, backup_df) + + backup_file_parquet = f"{backup_dir}/{today}.parquet" + backup_df = pd.read_parquet(backup_file_parquet) pd.testing.assert_frame_equal(source_df, backup_df) + if os.path.exists(backup_file): os.remove(backup_file) diff --git a/nssp/delphi_nssp/pull.py b/nssp/delphi_nssp/pull.py index ece94fab4..de6934bc8 100644 --- a/nssp/delphi_nssp/pull.py +++ b/nssp/delphi_nssp/pull.py @@ -1,9 +1,11 @@ # -*- coding: utf-8 -*- """Functions for pulling NSSP ER data.""" - +import logging import textwrap +from typing import Optional import pandas as pd +from delphi_utils import create_backup_csv from sodapy import Socrata from .constants import NEWLINE, SIGNALS, SIGNALS_MAP, TYPE_DICT @@ -27,7 +29,7 @@ def warn_string(df, type_dict): return warn -def pull_nssp_data(socrata_token: str): +def pull_nssp_data(socrata_token: str, backup_dir: str, custom_run: bool, logger: Optional[logging.Logger] = None): """Pull the latest NSSP ER visits data, and conforms it into a dataset. The output dataset has: @@ -38,9 +40,13 @@ def pull_nssp_data(socrata_token: str): Parameters ---------- socrata_token: str - My App Token for pulling the NWSS data (could be the same as the nchs data) - test_file: Optional[str] - When not null, name of file from which to read test data + My App Token for pulling the NSSP data (could be the same as the nchs data) + backup_dir: str + Directory to which to save raw backup data + custom_run: bool + Flag indicating if the current run is a patch. If so, don't save any data to disk + logger: Optional[logging.Logger] + logger object Returns ------- @@ -59,6 +65,7 @@ def pull_nssp_data(socrata_token: str): results.extend(page) offset += limit df_ervisits = pd.DataFrame.from_records(results) + create_backup_csv(df_ervisits, backup_dir, custom_run, logger=logger) df_ervisits = df_ervisits.rename(columns={"week_end": "timestamp"}) df_ervisits = df_ervisits.rename(columns=SIGNALS_MAP) diff --git a/nssp/delphi_nssp/run.py b/nssp/delphi_nssp/run.py index b22d03c20..b512e8aba 100644 --- a/nssp/delphi_nssp/run.py +++ b/nssp/delphi_nssp/run.py @@ -78,12 +78,14 @@ def run_module(params): log_exceptions=params["common"].get("log_exceptions", True), ) export_dir = params["common"]["export_dir"] + backup_dir = params["common"]["backup_dir"] + custom_run = params["common"].get("custom_run", False) socrata_token = params["indicator"]["socrata_token"] run_stats = [] ## build the base version of the signal at the most detailed geo level you can get. ## compute stuff here or farm out to another function or file - df_pull = pull_nssp_data(socrata_token) + df_pull = pull_nssp_data(socrata_token, backup_dir, custom_run=custom_run, logger=logger) ## aggregate geo_mapper = GeoMapper() for signal in SIGNALS: diff --git a/nssp/params.json.template b/nssp/params.json.template index df989ede7..1805baebb 100644 --- a/nssp/params.json.template +++ b/nssp/params.json.template @@ -1,6 +1,7 @@ { "common": { "export_dir": "./receiving", + "backup_dir": "./raw_data_backups", "log_filename": "./nssp.log", "log_exceptions": false }, diff --git a/nssp/raw_data_backups/.gitignore b/nssp/raw_data_backups/.gitignore new file mode 100644 index 000000000..3c515981b --- /dev/null +++ b/nssp/raw_data_backups/.gitignore @@ -0,0 +1,120 @@ +# You should hard commit a prototype for this file, but we +# want to avoid accidental adding of API tokens and other +# private data parameters +params.json + +# Do not commit output files +receiving/*.csv + +# Remove macOS files +.DS_Store + +# virtual environment +dview/ + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +coverage.xml +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +.static_storage/ +.media/ +local_settings.py + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ \ No newline at end of file diff --git a/nssp/tests/test_pull.py b/nssp/tests/test_pull.py index b356341f6..d0ebbc550 100644 --- a/nssp/tests/test_pull.py +++ b/nssp/tests/test_pull.py @@ -1,29 +1,23 @@ -from datetime import datetime, date +import glob import json -import unittest from unittest.mock import patch, MagicMock -import tempfile import os -import time -from datetime import datetime -import pdb + import pandas as pd -import pandas.api.types as ptypes from delphi_nssp.pull import ( pull_nssp_data, ) -from delphi_nssp.constants import ( - SIGNALS, - NEWLINE, - SIGNALS_MAP, - TYPE_DICT, -) +from delphi_nssp.constants import SIGNALS +from delphi_utils import get_structured_logger -class TestPullNSSPData(unittest.TestCase): +class TestPullNSSPData: @patch("delphi_nssp.pull.Socrata") - def test_pull_nssp_data(self, mock_socrata): + def test_pull_nssp_data(self, mock_socrata, caplog): + today = pd.Timestamp.today().strftime("%Y%m%d") + backup_dir = 'test_raw_data_backups' + # Load test data with open("test_data/page.txt", "r") as f: test_data = json.load(f) @@ -33,10 +27,27 @@ def test_pull_nssp_data(self, mock_socrata): mock_client.get.side_effect = [test_data, []] # Return test data on first call, empty list on second call mock_socrata.return_value = mock_client + custom_run = False + logger = get_structured_logger() # Call function with test token test_token = "test_token" - result = pull_nssp_data(test_token) - print(result) + result = pull_nssp_data(test_token, backup_dir, custom_run, logger) + + # Check logger used: + assert "Backup file created" in caplog.text + + # Check that backup file was created + backup_files = glob.glob(f"{backup_dir}/{today}*") + assert len(backup_files) == 2, "Backup file was not created" + + expected_data = pd.DataFrame(test_data) + for backup_file in backup_files: + if backup_file.endswith(".csv.gz"): + dtypes = expected_data.dtypes.to_dict() + actual_data = pd.read_csv(backup_file, dtype=dtypes) + else: + actual_data = pd.read_parquet(backup_file) + pd.testing.assert_frame_equal(expected_data, actual_data) # Check that Socrata client was initialized with correct arguments mock_socrata.assert_called_once_with("data.cdc.gov", test_token) @@ -55,6 +66,6 @@ def test_pull_nssp_data(self, mock_socrata): for signal in SIGNALS: assert result[signal].notnull().all(), f"{signal} has rogue NaN" - -if __name__ == "__main__": - unittest.main() + # clean up + for file in backup_files: + os.remove(file) \ No newline at end of file diff --git a/nssp/tests/test_raw_data_backups/.gitignore b/nssp/tests/test_raw_data_backups/.gitignore new file mode 100644 index 000000000..4007b678f --- /dev/null +++ b/nssp/tests/test_raw_data_backups/.gitignore @@ -0,0 +1,3 @@ +*.gz +*.csv +*.parquet \ No newline at end of file From e7eccaa30de49d2d9f855c97d68e175c174101d1 Mon Sep 17 00:00:00 2001 From: aysim319 Date: Wed, 13 Nov 2024 13:20:19 -0500 Subject: [PATCH 08/15] more logging and cleaned logic (#2076) * more logging and cleaned logic * changed variable names * lint * add param to test * fix test * consistent location for custom run flag --- .../delphi_google_symptoms/constants.py | 17 +++++++++-------- .../delphi_google_symptoms/date_utils.py | 2 +- google_symptoms/delphi_google_symptoms/patch.py | 2 +- google_symptoms/delphi_google_symptoms/pull.py | 12 +++++++----- google_symptoms/delphi_google_symptoms/run.py | 16 ++++++++++------ google_symptoms/params.json.template | 1 + google_symptoms/tests/test_patch.py | 2 +- google_symptoms/tests/test_pull.py | 14 +++++++++----- 8 files changed, 39 insertions(+), 27 deletions(-) diff --git a/google_symptoms/delphi_google_symptoms/constants.py b/google_symptoms/delphi_google_symptoms/constants.py index 795ac3df7..b4d51af26 100644 --- a/google_symptoms/delphi_google_symptoms/constants.py +++ b/google_symptoms/delphi_google_symptoms/constants.py @@ -30,14 +30,15 @@ METRICS = METRICS + SYMPTOM_SETS[combmetric] SMOOTHERS = ["raw", "smoothed"] -GEO_RESOLUTIONS = [ - "state", - "county", - "msa", - "hrr", - "hhs", - "nation" -] + +GEO_RESOLUTIONS = { + "state": "state", + "county": "county", + "msa": "county", + "hrr": "county", + "hhs": "state", + "nation": "state", +} SMOOTHERS_MAP = { "raw": (Smoother("identity", impute_method=None), diff --git a/google_symptoms/delphi_google_symptoms/date_utils.py b/google_symptoms/delphi_google_symptoms/date_utils.py index 2ad6244e9..1d9de2cd4 100644 --- a/google_symptoms/delphi_google_symptoms/date_utils.py +++ b/google_symptoms/delphi_google_symptoms/date_utils.py @@ -98,7 +98,7 @@ def generate_num_export_days(params: Dict, logger) -> [int]: expected_date_diff += global_max_expected_lag if latest_date_diff > expected_date_diff: - logger.info("Missing date", date=to_datetime(min(gs_metadata.max_time)).date()) + logger.info("Lag is more than expected", expected_lag=expected_date_diff, lag=latest_date_diff) num_export_days = expected_date_diff diff --git a/google_symptoms/delphi_google_symptoms/patch.py b/google_symptoms/delphi_google_symptoms/patch.py index 85df89394..f6782f2e8 100755 --- a/google_symptoms/delphi_google_symptoms/patch.py +++ b/google_symptoms/delphi_google_symptoms/patch.py @@ -78,7 +78,7 @@ def patch(params): makedirs(f"{current_issue_dir}", exist_ok=True) params["common"]["export_dir"] = f"""{current_issue_dir}""" - params["indicator"]["custom_run"] = True + params["common"]["custom_run"] = True date_settings = patch_dates[issue_date] diff --git a/google_symptoms/delphi_google_symptoms/pull.py b/google_symptoms/delphi_google_symptoms/pull.py index a8c4cdfde..22ad29723 100644 --- a/google_symptoms/delphi_google_symptoms/pull.py +++ b/google_symptoms/delphi_google_symptoms/pull.py @@ -158,7 +158,7 @@ def produce_query(level, date_range): return query -def pull_gs_data_one_geolevel(level, date_range): +def pull_gs_data_one_geolevel(level, date_range, logger): """Pull latest data for a single geo level. Fetch data and transform it into the appropriate format, as described in @@ -209,6 +209,9 @@ def pull_gs_data_one_geolevel(level, date_range): if len(df) == 0: df = pd.DataFrame(columns=["open_covid_region_code", "date"] + list(colname_map.keys())) + logger.info( + "No data available for date range", geo_level=level, start_date=date_range[0], end_date=date_range[1] + ) df = preprocess(df, level) return df @@ -232,7 +235,7 @@ def initialize_credentials(credentials): pandas_gbq.context.project = credentials.project_id -def pull_gs_data(credentials, export_start_date, export_end_date, num_export_days, custom_run_flag): +def pull_gs_data(credentials, export_start_date, export_end_date, num_export_days, custom_run_flag, logger): """Pull latest dataset for each geo level and combine. PS: No information for PR @@ -264,10 +267,9 @@ def pull_gs_data(credentials, export_start_date, export_end_date, num_export_day dfs = {} # For state level data - dfs["state"] = pull_gs_data_one_geolevel("state", retrieve_dates) + dfs["state"] = pull_gs_data_one_geolevel("state", retrieve_dates, logger) # For county level data - dfs["county"] = pull_gs_data_one_geolevel("county", retrieve_dates) - + dfs["county"] = pull_gs_data_one_geolevel("county", retrieve_dates, logger) # Add District of Columbia as county try: diff --git a/google_symptoms/delphi_google_symptoms/run.py b/google_symptoms/delphi_google_symptoms/run.py index 8ad1d6d10..00e9d10d8 100644 --- a/google_symptoms/delphi_google_symptoms/run.py +++ b/google_symptoms/delphi_google_symptoms/run.py @@ -58,7 +58,7 @@ def run_module(params, logger=None): num_export_days = generate_num_export_days(params, logger) # safety check for patch parameters exists in file, but not running custom runs/patches custom_run_flag = ( - False if not params["indicator"].get("custom_run", False) else params["indicator"].get("custom_run", False) + False if not params["common"].get("custom_run", False) else params["indicator"].get("custom_run", False) ) # Pull GS data @@ -68,17 +68,21 @@ def run_module(params, logger=None): export_end_date, num_export_days, custom_run_flag, + logger, ) - for geo_res in GEO_RESOLUTIONS: + + for geo_res, mapped_res in GEO_RESOLUTIONS.items(): + df_pull = dfs[mapped_res] + if len(df_pull) == 0: + logger.info("Skipping processing; No data available for geo", geo_type=geo_res) + continue if geo_res == "state": df_pull = dfs["state"] elif geo_res in ["hhs", "nation"]: - df_pull = geo_map(dfs["state"], geo_res) + df_pull = geo_map(dfs[mapped_res], geo_res) else: - df_pull = geo_map(dfs["county"], geo_res) + df_pull = geo_map(dfs[mapped_res], geo_res) - if len(df_pull) == 0: - continue for metric, smoother in product(COMBINED_METRIC, SMOOTHERS): sensor_name = "_".join([smoother, "search"]) logger.info("Generating signal and exporting to CSV", geo_type=geo_res, signal=f"{metric}_{sensor_name}") diff --git a/google_symptoms/params.json.template b/google_symptoms/params.json.template index daa5666f4..537d6e273 100644 --- a/google_symptoms/params.json.template +++ b/google_symptoms/params.json.template @@ -2,6 +2,7 @@ "common": { "export_dir": "./receiving", "log_exceptions": false, + "custom_run": false, "log_filename": "./google-symptoms.log" }, "indicator": { diff --git a/google_symptoms/tests/test_patch.py b/google_symptoms/tests/test_patch.py index 4eb782860..8caef9247 100644 --- a/google_symptoms/tests/test_patch.py +++ b/google_symptoms/tests/test_patch.py @@ -54,7 +54,7 @@ def mocked_patch(self, params_): mock_patch("delphi_google_symptoms.pull.pandas_gbq.read_gbq") as mock_read_gbq, \ mock_patch("delphi_google_symptoms.pull.initialize_credentials", return_value=None), \ mock_patch("delphi_google_symptoms.date_utils.covidcast.metadata", return_value=covidcast_metadata), \ - mock_patch("delphi_google_symptoms.run.GEO_RESOLUTIONS", new=["state"]): + mock_patch("delphi_google_symptoms.run.GEO_RESOLUTIONS", new={"state": "state"}): def side_effect(*args, **kwargs): if "symptom_search_sub_region_1_daily" in args[0]: df = state_data_gap diff --git a/google_symptoms/tests/test_pull.py b/google_symptoms/tests/test_pull.py index 4367995b8..c21be3f48 100644 --- a/google_symptoms/tests/test_pull.py +++ b/google_symptoms/tests/test_pull.py @@ -12,6 +12,7 @@ pull_gs_data, preprocess, format_dates_for_query, pull_gs_data_one_geolevel) from delphi_google_symptoms.constants import METRICS, COMBINED_METRIC from conftest import TEST_DIR +from delphi_utils import get_structured_logger good_input = { "state": f"{TEST_DIR}/test_data/small_states_daily.csv", @@ -30,6 +31,7 @@ class TestPullGoogleSymptoms: + logger = get_structured_logger() @freeze_time("2021-01-05") @mock.patch("pandas_gbq.read_gbq") @mock.patch("delphi_google_symptoms.pull.initialize_credentials") @@ -49,7 +51,9 @@ def test_good_file(self, mock_credentials, mock_read_gbq): end_date = datetime.combine(date.today(), datetime.min.time()) dfs = pull_gs_data("", datetime.strptime( - "20201230", "%Y%m%d"), datetime.combine(date.today(), datetime.min.time()), 0, False) + "20201230", "%Y%m%d"), + datetime.combine(date.today(), datetime.min.time()), + 0, False, self.logger) for level in ["county", "state"]: df = dfs[level] @@ -119,7 +123,7 @@ def test_format_dates_for_query(self): def test_pull_one_gs_no_dates(self, mock_read_gbq): mock_read_gbq.return_value = pd.DataFrame() - output = pull_gs_data_one_geolevel("state", ["", ""]) + output = pull_gs_data_one_geolevel("state", ["", ""], self.logger) expected = pd.DataFrame(columns=new_keep_cols) assert_frame_equal(output, expected, check_dtype = False) @@ -133,7 +137,7 @@ def test_pull_one_gs_retry_success(self): with mock.patch("pandas_gbq.read_gbq") as mock_read_gbq: mock_read_gbq.side_effect = [badRequestException, pd.DataFrame()] - output = pull_gs_data_one_geolevel("state", ["", ""]) + output = pull_gs_data_one_geolevel("state", ["", ""], self.logger) expected = pd.DataFrame(columns=new_keep_cols) assert_frame_equal(output, expected, check_dtype = False) assert mock_read_gbq.call_count == 2 @@ -147,7 +151,7 @@ def test_pull_one_gs_retry_too_many(self): with mock.patch("pandas_gbq.read_gbq") as mock_read_gbq: with pytest.raises(BadRequest): mock_read_gbq.side_effect = [badRequestException, badRequestException, pd.DataFrame()] - pull_gs_data_one_geolevel("state", ["", ""]) + pull_gs_data_one_geolevel("state", ["", ""], self.logger) def test_pull_one_gs_retry_bad(self): @@ -156,7 +160,7 @@ def test_pull_one_gs_retry_bad(self): with mock.patch("pandas_gbq.read_gbq") as mock_read_gbq: with pytest.raises(BadRequest): mock_read_gbq.side_effect = [badRequestException,pd.DataFrame()] - pull_gs_data_one_geolevel("state", ["", ""]) + pull_gs_data_one_geolevel("state", ["", ""], self.logger) def test_preprocess_no_data(self): output = preprocess(pd.DataFrame(columns=keep_cols), "state") From feea58d900cdb2ac4988d4cf1fb9ef96bbb54181 Mon Sep 17 00:00:00 2001 From: minhkhul <118945681+minhkhul@users.noreply.github.com> Date: Sun, 17 Nov 2024 18:10:39 -0500 Subject: [PATCH 09/15] Add NSSP secondary source (#2074) * base changes * lint * lint * add test * fix hhs bug + doc to readme + fix signal grouping * fix weird nan * logging + error details * test data sync * typo in pull.py * region to lower * add log * fix str bug * add backup data mechanism * adjust details.md * appease linter * add tests for secondary source backup * Update signal names to _2023RVR in constants.py * clarify _2023RVR signals in DETAILS.md --- nssp/DETAILS.md | 25 +++++- nssp/README.md | 5 ++ nssp/delphi_nssp/constants.py | 26 ++++++ nssp/delphi_nssp/pull.py | 105 +++++++++++++++++++----- nssp/delphi_nssp/run.py | 53 +++++++++++- nssp/tests/test_data/secondary_page.txt | 73 ++++++++++++++++ nssp/tests/test_pull.py | 59 ++++++++++++- 7 files changed, 318 insertions(+), 28 deletions(-) create mode 100644 nssp/tests/test_data/secondary_page.txt diff --git a/nssp/DETAILS.md b/nssp/DETAILS.md index 539697baa..692d85559 100644 --- a/nssp/DETAILS.md +++ b/nssp/DETAILS.md @@ -2,12 +2,29 @@ We import the NSSP Emergency Department Visit data, including percentage and smoothed percentage of ER visits attributable to a given pathogen, from the CDC website. The data is provided at the county level, state level and national level; we do a population-weighted mean to aggregate from county data up to the HRR and MSA levels. +There are 2 sources we grab data from for nssp: +- Primary source: https://data.cdc.gov/Public-Health-Surveillance/NSSP-Emergency-Department-Visit-Trajectories-by-St/rdmq-nq56/data_preview +- Secondary (2023RVR) source: https://data.cdc.gov/Public-Health-Surveillance/2023-Respiratory-Virus-Response-NSSP-Emergency-Dep/7mra-9cq9/data_preview +There are 8 signals output from the primary source and 4 output from secondary. There are no smoothed signals from secondary source. + +Note that the data produced from secondary source are mostly the same as their primary source equivalent, with past analysis shows around 95% of datapoints having less than 0.1 value difference and the other 5% having a 0.1 to 1.2 value difference. + ## Geographical Levels -* `state`: reported using two-letter postal code -* `county`: reported using fips code -* `national`: just `us` for now +Primary source: +* `state`: reported from source using two-letter postal code +* `county`: reported from source using fips code +* `national`: just `us` for now, reported from source +* `hhs`, `hrr`, `msa`: not reported from source, so we computed them from county-level data using a weighted mean. Each county is assigned a weight equal to its population in the last census (2020). + +Secondary (2023RVR) source: +* `state`: reported from source +* `hhs`: reported from source +* `national`: reported from source + ## Metrics * `percent_visits_covid`, `percent_visits_rsv`, `percent_visits_influenza`: percentage of emergency department patient visits for specified pathogen. * `percent_visits_combined`: sum of the three percentages of visits for flu, rsv and covid. * `smoothed_percent_visits_covid`, `smoothed_percent_visits_rsv`, `smoothed_percent_visits_influenza`: 3 week moving average of the percentage of emergency department patient visits for specified pathogen. -* `smoothed_percent_visits_combined`: 3 week moving average of the sum of the three percentages of visits for flu, rsv and covid. \ No newline at end of file +* `smoothed_percent_visits_combined`: 3 week moving average of the sum of the three percentages of visits for flu, rsv and covid. +* `percent_visits_covid_2023RVR`, `percent_visits_rsv_2023RVR`, `percent_visits_influenza_2023RVR`: Taken from secondary source, percentage of emergency department patient visits for specified pathogen. +* `percent_visits_combined_2023RVR`: Taken from secondary source, sum of the three percentages of visits for flu, rsv and covid. diff --git a/nssp/README.md b/nssp/README.md index 4bba6f626..c3f57b94b 100644 --- a/nssp/README.md +++ b/nssp/README.md @@ -1,6 +1,11 @@ # NSSP Emergency Department Visit data We import the NSSP Emergency Department Visit data, currently only the smoothed concentration, from the CDC website, aggregate to the state and national level from the wastewater sample site level, and export the aggregated data. + +There are 2 sources we grab data from for nssp: +- Primary source: https://data.cdc.gov/Public-Health-Surveillance/NSSP-Emergency-Department-Visit-Trajectories-by-St/rdmq-nq56/data_preview +- Secondary source: https://data.cdc.gov/Public-Health-Surveillance/2023-Respiratory-Virus-Response-NSSP-Emergency-Dep/7mra-9cq9/data_preview + For details see the `DETAILS.md` file in this directory. ## Create a MyAppToken diff --git a/nssp/delphi_nssp/constants.py b/nssp/delphi_nssp/constants.py index 9b98d2012..76d51b927 100644 --- a/nssp/delphi_nssp/constants.py +++ b/nssp/delphi_nssp/constants.py @@ -41,3 +41,29 @@ "fips": str, } ) + +SECONDARY_COLS_MAP = { + "week_end": "timestamp", + "geography": "geo_value", + "percent_visits": "val", + "pathogen": "signal", +} + +SECONDARY_SIGNALS_MAP = { + "COVID-19": "pct_ed_visits_covid_2023RVR", + "Influenza": "pct_ed_visits_influenza_2023RVR", + "RSV": "pct_ed_visits_rsv_2023RVR", + "Combined": "pct_ed_visits_combined_2023RVR", +} + +SECONDARY_SIGNALS = [val for (key, val) in SECONDARY_SIGNALS_MAP.items()] +SECONDARY_GEOS = ["state", "nation", "hhs"] + +SECONDARY_TYPE_DICT = { + "timestamp": "datetime64[ns]", + "geo_value": str, + "val": float, + "geo_type": str, + "signal": str, +} +SECONDARY_KEEP_COLS = [key for (key, val) in SECONDARY_TYPE_DICT.items()] diff --git a/nssp/delphi_nssp/pull.py b/nssp/delphi_nssp/pull.py index de6934bc8..94058dea8 100644 --- a/nssp/delphi_nssp/pull.py +++ b/nssp/delphi_nssp/pull.py @@ -8,7 +8,16 @@ from delphi_utils import create_backup_csv from sodapy import Socrata -from .constants import NEWLINE, SIGNALS, SIGNALS_MAP, TYPE_DICT +from .constants import ( + NEWLINE, + SECONDARY_COLS_MAP, + SECONDARY_KEEP_COLS, + SECONDARY_SIGNALS_MAP, + SECONDARY_TYPE_DICT, + SIGNALS, + SIGNALS_MAP, + TYPE_DICT, +) def warn_string(df, type_dict): @@ -29,42 +38,50 @@ def warn_string(df, type_dict): return warn -def pull_nssp_data(socrata_token: str, backup_dir: str, custom_run: bool, logger: Optional[logging.Logger] = None): - """Pull the latest NSSP ER visits data, and conforms it into a dataset. - - The output dataset has: - - - Each row corresponds to a single observation - - Each row additionally has columns for the signals in SIGNALS +def pull_with_socrata_api(socrata_token: str, dataset_id: str): + """Pull data from Socrata API. Parameters ---------- socrata_token: str My App Token for pulling the NSSP data (could be the same as the nchs data) - backup_dir: str - Directory to which to save raw backup data - custom_run: bool - Flag indicating if the current run is a patch. If so, don't save any data to disk - logger: Optional[logging.Logger] - logger object + dataset_id: str + The dataset id to pull data from Returns ------- - pd.DataFrame - Dataframe as described above. + list of dictionaries, each representing a row in the dataset """ - # Pull data from Socrata API client = Socrata("data.cdc.gov", socrata_token) results = [] offset = 0 limit = 50000 # maximum limit allowed by SODA 2.0 while True: - page = client.get("rdmq-nq56", limit=limit, offset=offset) + page = client.get(dataset_id, limit=limit, offset=offset) if not page: break # exit the loop if no more results results.extend(page) offset += limit - df_ervisits = pd.DataFrame.from_records(results) + return results + + +def pull_nssp_data(socrata_token: str, backup_dir: str, custom_run: bool, logger: Optional[logging.Logger] = None): + """Pull the latest NSSP ER visits primary dataset. + + https://data.cdc.gov/Public-Health-Surveillance/NSSP-Emergency-Department-Visit-Trajectories-by-St/rdmq-nq56/data_preview + + Parameters + ---------- + socrata_token: str + My App Token for pulling the NSSP data (could be the same as the nchs data) + + Returns + ------- + pd.DataFrame + Dataframe as described above. + """ + socrata_results = pull_with_socrata_api(socrata_token, "rdmq-nq56") + df_ervisits = pd.DataFrame.from_records(socrata_results) create_backup_csv(df_ervisits, backup_dir, custom_run, logger=logger) df_ervisits = df_ervisits.rename(columns={"week_end": "timestamp"}) df_ervisits = df_ervisits.rename(columns=SIGNALS_MAP) @@ -79,3 +96,53 @@ def pull_nssp_data(socrata_token: str, backup_dir: str, custom_run: bool, logger keep_columns = ["timestamp", "geography", "county", "fips"] return df_ervisits[SIGNALS + keep_columns] + + +def secondary_pull_nssp_data( + socrata_token: str, backup_dir: str, custom_run: bool, logger: Optional[logging.Logger] = None +): + """Pull the latest NSSP ER visits secondary dataset. + + https://data.cdc.gov/Public-Health-Surveillance/2023-Respiratory-Virus-Response-NSSP-Emergency-Dep/7mra-9cq9/data_preview + + The output dataset has: + + - Each row corresponds to a single observation + + Parameters + ---------- + socrata_token: str + My App Token for pulling the NSSP data (could be the same as the nchs data) + + Returns + ------- + pd.DataFrame + Dataframe as described above. + """ + socrata_results = pull_with_socrata_api(socrata_token, "7mra-9cq9") + df_ervisits = pd.DataFrame.from_records(socrata_results) + create_backup_csv(df_ervisits, backup_dir, custom_run, sensor="secondary", logger=logger) + df_ervisits = df_ervisits.rename(columns=SECONDARY_COLS_MAP) + + # geo_type is not provided in the dataset, so we infer it from the geo_value + # which is either state names, "National" or hhs region numbers + df_ervisits["geo_type"] = "state" + + df_ervisits.loc[df_ervisits["geo_value"] == "National", "geo_type"] = "nation" + + hhs_region_mask = df_ervisits["geo_value"].str.lower().str.startswith("region ") + df_ervisits.loc[hhs_region_mask, "geo_value"] = df_ervisits.loc[hhs_region_mask, "geo_value"].str.replace( + "Region ", "" + ) + df_ervisits.loc[hhs_region_mask, "geo_type"] = "hhs" + + df_ervisits["signal"] = df_ervisits["signal"].map(SECONDARY_SIGNALS_MAP) + + df_ervisits = df_ervisits[SECONDARY_KEEP_COLS] + + try: + df_ervisits = df_ervisits.astype(SECONDARY_TYPE_DICT) + except KeyError as exc: + raise ValueError(warn_string(df_ervisits, SECONDARY_TYPE_DICT)) from exc + + return df_ervisits diff --git a/nssp/delphi_nssp/run.py b/nssp/delphi_nssp/run.py index b512e8aba..417c49ab2 100644 --- a/nssp/delphi_nssp/run.py +++ b/nssp/delphi_nssp/run.py @@ -31,8 +31,8 @@ from delphi_utils.geomap import GeoMapper from delphi_utils.nancodes import add_default_nancodes -from .constants import AUXILIARY_COLS, CSV_COLS, GEOS, SIGNALS -from .pull import pull_nssp_data +from .constants import AUXILIARY_COLS, CSV_COLS, GEOS, SECONDARY_GEOS, SECONDARY_SIGNALS, SIGNALS +from .pull import pull_nssp_data, secondary_pull_nssp_data def add_needed_columns(df, col_names=None): @@ -83,6 +83,8 @@ def run_module(params): socrata_token = params["indicator"]["socrata_token"] run_stats = [] + + logger.info("Generating primary signals") ## build the base version of the signal at the most detailed geo level you can get. ## compute stuff here or farm out to another function or file df_pull = pull_nssp_data(socrata_token, backup_dir, custom_run=custom_run, logger=logger) @@ -139,5 +141,52 @@ def run_module(params): if len(dates) > 0: run_stats.append((max(dates), len(dates))) + logger.info("Generating secondary signals") + secondary_df_pull = secondary_pull_nssp_data(socrata_token, backup_dir, custom_run, logger) + for signal in SECONDARY_SIGNALS: + secondary_df_pull_signal = secondary_df_pull[secondary_df_pull["signal"] == signal] + if secondary_df_pull_signal.empty: + logger.warning("No data found for signal", signal=signal) + continue + for geo in SECONDARY_GEOS: + df = secondary_df_pull_signal.copy() + logger.info("Generating signal and exporting to CSV", geo_type=geo, signal=signal) + if geo == "state": + df = df[(df["geo_type"] == "state")] + df["geo_id"] = df["geo_value"].apply( + lambda x: ( + us.states.lookup(x).abbr.lower() + if us.states.lookup(x) + else ("dc" if x == "District of Columbia" else x) + ) + ) + unexpected_state_names = df[df["geo_id"] == df["geo_value"]] + if unexpected_state_names.shape[0] > 0: + logger.error( + "Unexpected state names", + unexpected_state_names=unexpected_state_names["geo_value"].unique(), + ) + raise RuntimeError + elif geo == "nation": + df = df[(df["geo_type"] == "nation")] + df["geo_id"] = "us" + elif geo == "hhs": + df = df[(df["geo_type"] == "hhs")] + df["geo_id"] = df["geo_value"] + # add se, sample_size, and na codes + missing_cols = set(CSV_COLS) - set(df.columns) + df = add_needed_columns(df, col_names=list(missing_cols)) + df_csv = df[CSV_COLS + ["timestamp"]] + # actual export + dates = create_export_csv( + df_csv, + geo_res=geo, + export_dir=export_dir, + sensor=signal, + weekly_dates=True, + ) + if len(dates) > 0: + run_stats.append((max(dates), len(dates))) + ## log this indicator run logging(start_time, run_stats, logger) diff --git a/nssp/tests/test_data/secondary_page.txt b/nssp/tests/test_data/secondary_page.txt new file mode 100644 index 000000000..4b4aaaca7 --- /dev/null +++ b/nssp/tests/test_data/secondary_page.txt @@ -0,0 +1,73 @@ +[ + { + "week_end": "2022-10-01T00:00:00.000", + "pathogen": "COVID-19", "geography": "National", + "percent_visits": "1.8", + "status": "Reporting", + "trend_on_date": "Decreasing", + "recent_trend": "Decreasing" + }, + { + "week_end": "2022-10-01T00:00:00.000", + "pathogen": "Influenza", + "geography": "National", + "percent_visits": "0.5", + "status": "Reporting", + "trend_on_date": "Increasing", + "recent_trend": "Increasing" + }, + { + "week_end": "2022-10-01T00:00:00.000", + "pathogen": "RSV", + "geography": "National", + "percent_visits": "0.5", + "status": "Reporting", + "trend_on_date": "Increasing", + "recent_trend": "Increasing" + }, + { + "week_end": "2022-10-01T00:00:00.000", + "pathogen": "Combined", + "geography": "National", + "percent_visits": "2.8", + "status": "Reporting", + "trend_on_date": "Decreasing", + "recent_trend": "Decreasing" + }, + { + "week_end": "2022-10-15T00:00:00.000", + "pathogen": "COVID-19", + "geography": "National", + "percent_visits": "1.6", + "status": "Reporting", + "trend_on_date": "Decreasing", + "recent_trend": "Decreasing" + }, + { + "week_end": "2022-10-15T00:00:00.000", + "pathogen": "Influenza", + "geography": "National", + "percent_visits": "0.9", + "status": "Reporting", + "trend_on_date": "Increasing", + "recent_trend": "Increasing" + }, + { + "week_end": "2022-10-15T00:00:00.000", + "pathogen": "RSV", + "geography": "National", + "percent_visits": "0.7", + "status": "Reporting", + "trend_on_date": "Increasing", + "recent_trend": "Increasing" + }, + { + "week_end": "2022-10-15T00:00:00.000", + "pathogen": "Combined", + "geography": "National", + "percent_visits": "3.2", + "status": "Reporting", + "trend_on_date": "Increasing", + "recent_trend": "Decreasing" + } +] \ No newline at end of file diff --git a/nssp/tests/test_pull.py b/nssp/tests/test_pull.py index d0ebbc550..30debd6cd 100644 --- a/nssp/tests/test_pull.py +++ b/nssp/tests/test_pull.py @@ -7,8 +7,20 @@ from delphi_nssp.pull import ( pull_nssp_data, + secondary_pull_nssp_data, + pull_with_socrata_api, +) + +from delphi_nssp.constants import ( + NEWLINE, + SECONDARY_COLS_MAP, + SECONDARY_KEEP_COLS, + SECONDARY_SIGNALS_MAP, + SECONDARY_TYPE_DICT, + SIGNALS, + SIGNALS_MAP, + TYPE_DICT, ) -from delphi_nssp.constants import SIGNALS from delphi_utils import get_structured_logger @@ -66,6 +78,47 @@ def test_pull_nssp_data(self, mock_socrata, caplog): for signal in SIGNALS: assert result[signal].notnull().all(), f"{signal} has rogue NaN" - # clean up for file in backup_files: - os.remove(file) \ No newline at end of file + os.remove(file) + + @patch("delphi_nssp.pull.Socrata") + def test_secondary_pull_nssp_data(self, mock_socrata): + today = pd.Timestamp.today().strftime("%Y%m%d") + backup_dir = 'test_raw_data_backups' + + # Load test data + with open("test_data/secondary_page.txt", "r") as f: + test_data = json.load(f) + + # Mock Socrata client and its get method + mock_client = MagicMock() + mock_client.get.side_effect = [test_data, []] # Return test data on first call, empty list on second call + mock_socrata.return_value = mock_client + + custom_run = False + logger = get_structured_logger() + # Call function with test token + test_token = "test_token" + result = secondary_pull_nssp_data(test_token, backup_dir, custom_run, logger) + # print(result) + + # Check that Socrata client was initialized with correct arguments + mock_socrata.assert_called_once_with("data.cdc.gov", test_token) + + # Check that get method was called with correct arguments + mock_client.get.assert_any_call("7mra-9cq9", limit=50000, offset=0) + + for col in SECONDARY_KEEP_COLS: + assert result[col].notnull().all(), f"{col} has rogue NaN" + + assert result[result['geo_value'].str.startswith('Region') ].empty, "'Region ' need to be removed from geo_value for geo_type 'hhs'" + assert (result[result['geo_type'] == 'nation']['geo_value'] == 'National').all(), "All rows with geo_type 'nation' must have geo_value 'National'" + + # Check that backup file was created + backup_files = glob.glob(f"{backup_dir}/{today}*") + assert len(backup_files) == 2, "Backup file was not created" + for file in backup_files: + os.remove(file) + +if __name__ == "__main__": + unittest.main() From 9f1d4a0c6b4d120da7055b09e415ce9eba0c0b54 Mon Sep 17 00:00:00 2001 From: minhkhul <118945681+minhkhul@users.noreply.github.com> Date: Mon, 25 Nov 2024 17:17:47 -0500 Subject: [PATCH 10/15] Update create-release.yml (#2083) --- .github/workflows/create-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index a8cb6c3bb..229f284b6 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -61,7 +61,7 @@ jobs: bump2version --list ${{ github.event.inputs.versionName }} | grep ^new_version | sed -r s,"^.*=",, - name: Copy version to indicator directory run: | - indicator_list=("changehc" "claims_hosp" "doctor_visits" "google_symptoms" "hhs_hosp" "nchs_mortality" "quidel_covidtest" "sir_complainsalot") + indicator_list=("changehc" "claims_hosp" "doctor_visits" "google_symptoms" "hhs_hosp" "nchs_mortality" "nssp" "quidel_covidtest" "sir_complainsalot") for path in ${indicator_list[@]}; do echo "current_version = ${{ steps.indicators.outputs.version }}" > $path/version.cfg done From 5ff844a8187484ee7c293c02f274790af72ef70b Mon Sep 17 00:00:00 2001 From: aysim319 Date: Tue, 10 Dec 2024 10:58:20 -0500 Subject: [PATCH 11/15] Nhsn indicator (#2080) * first implimentation * figuring out metric/sensor to use * first take * working on test * added preliminary data source * adding indicator for gitaction * lint * replace with setup.py * more lint * fixed date range for test * lint * Update DETAILS.md * fix output data * analysis in progress * lint and suggestions * more analysis * add hhs geo aggregate * more analysis * update DETAILS.md * Update nhsn/params.json.template Co-authored-by: minhkhul <118945681+minhkhul@users.noreply.github.com> * Update nhsn/params.json.template Co-authored-by: minhkhul <118945681+minhkhul@users.noreply.github.com> * cleaning up anaylsis * rename geo_id column name * suggested / needed to deploy * adding default locations for deployment * fix geo aggregation for hhs Co-authored-by: minhkhul <118945681+minhkhul@users.noreply.github.com> * Update nhsn/params.json.template Co-authored-by: minhkhul <118945681+minhkhul@users.noreply.github.com> * lint * needed to add hhs in to geo for tests * fixed and added more plots * cleaning up notebook and adding details * new signal name * needed to update the type dict also --------- Co-authored-by: minhkhul <118945681+minhkhul@users.noreply.github.com> --- .github/workflows/python-ci.yml | 2 + Jenkinsfile | 2 +- ansible/templates/nhsn-params-prod.json.j2 | 30 + .../sir_complainsalot-params-prod.json.j2 | 4 + ansible/vars.yaml | 3 + nhsn/DETAILS.md | 30 + nhsn/Makefile | 32 + nhsn/delphi_nhsn/__init__.py | 13 + nhsn/delphi_nhsn/__main__.py | 13 + nhsn/delphi_nhsn/constants.py | 31 + nhsn/delphi_nhsn/pull.py | 123 + nhsn/delphi_nhsn/run.py | 102 + nhsn/notebook/analysis.ipynb | 7931 +++++++++++++++++ nhsn/params.json.template | 30 + nhsn/raw_data_backups/.gitignore | 0 nhsn/receiving/.gitignore | 0 nhsn/setup.py | 32 + nhsn/static/.gitignore | 0 nhsn/tests/backups/.gitignore | 0 nhsn/tests/conftest.py | 73 + nhsn/tests/receiving/.gitignore | 0 nhsn/tests/test_data/page.json | 2126 +++++ nhsn/tests/test_data/prelim_page.json | 2126 +++++ nhsn/tests/test_pull.py | 148 + nhsn/tests/test_run.py | 49 + 25 files changed, 12899 insertions(+), 1 deletion(-) create mode 100644 ansible/templates/nhsn-params-prod.json.j2 create mode 100644 nhsn/DETAILS.md create mode 100644 nhsn/Makefile create mode 100644 nhsn/delphi_nhsn/__init__.py create mode 100644 nhsn/delphi_nhsn/__main__.py create mode 100644 nhsn/delphi_nhsn/constants.py create mode 100644 nhsn/delphi_nhsn/pull.py create mode 100644 nhsn/delphi_nhsn/run.py create mode 100644 nhsn/notebook/analysis.ipynb create mode 100644 nhsn/params.json.template create mode 100644 nhsn/raw_data_backups/.gitignore create mode 100644 nhsn/receiving/.gitignore create mode 100644 nhsn/setup.py create mode 100644 nhsn/static/.gitignore create mode 100644 nhsn/tests/backups/.gitignore create mode 100644 nhsn/tests/conftest.py create mode 100644 nhsn/tests/receiving/.gitignore create mode 100644 nhsn/tests/test_data/page.json create mode 100644 nhsn/tests/test_data/prelim_page.json create mode 100644 nhsn/tests/test_pull.py create mode 100644 nhsn/tests/test_run.py diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index 6e23c61d2..498a9555c 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -39,6 +39,8 @@ jobs: dir: "delphi_quidel_covidtest" - package: "sir_complainsalot" dir: "delphi_sir_complainsalot" + - package: "nhsn" + dir: "delphi_nhsn" defaults: run: working-directory: ${{ matrix.package }} diff --git a/Jenkinsfile b/Jenkinsfile index 3fcdc904a..35d6788ae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ - TODO: #527 Get this list automatically from python-ci.yml at runtime. */ -def indicator_list = ['backfill_corrections', 'changehc', 'claims_hosp', 'google_symptoms', 'hhs_hosp', 'nchs_mortality', 'quidel_covidtest', 'sir_complainsalot', 'doctor_visits', 'nwss_wastewater', 'nssp'] +def indicator_list = ['backfill_corrections', 'changehc', 'claims_hosp', 'google_symptoms', 'hhs_hosp', 'nchs_mortality', 'quidel_covidtest', 'sir_complainsalot', 'doctor_visits', 'nwss_wastewater', 'nssp', 'nhsn'] def build_package_main = [:] def build_package_prod = [:] def deploy_staging = [:] diff --git a/ansible/templates/nhsn-params-prod.json.j2 b/ansible/templates/nhsn-params-prod.json.j2 new file mode 100644 index 000000000..436017ba9 --- /dev/null +++ b/ansible/templates/nhsn-params-prod.json.j2 @@ -0,0 +1,30 @@ +{ + "common": { + "export_dir": "/common/covidcast/receiving/nhsn", + "backup_dir": "./raw_data_backups", + "log_filename": "/var/log/indicators/nhsn.log", + "log_exceptions": false + }, + "indicator": { + "wip_signal": true, + "static_file_dir": "./static", + "socrata_token": "{{ nhsn_token }}" + }, + "validation": { + "common": { + "data_source": "nhsn", + "api_credentials": "{{ validation_api_key }}", + "span_length": 15, + "min_expected_lag": {"all": "7"}, + "max_expected_lag": {"all": "13"}, + "dry_run": true, + "suppressed_errors": [] + }, + "static": { + "minimum_sample_size": 0, + "missing_se_allowed": true, + "missing_sample_size_allowed": true + }, + "dynamic": {} + } +} diff --git a/ansible/templates/sir_complainsalot-params-prod.json.j2 b/ansible/templates/sir_complainsalot-params-prod.json.j2 index 324728767..7bb2d179a 100644 --- a/ansible/templates/sir_complainsalot-params-prod.json.j2 +++ b/ansible/templates/sir_complainsalot-params-prod.json.j2 @@ -45,6 +45,10 @@ "nssp": { "max_age":19, "maintainers": [] + }, + "nhsn": { + "max_age":19, + "maintainers": [] } } } diff --git a/ansible/vars.yaml b/ansible/vars.yaml index ff9ba135c..a50cda37b 100644 --- a/ansible/vars.yaml +++ b/ansible/vars.yaml @@ -59,6 +59,9 @@ nwss_wastewater_token: "{{ vault_cdc_socrata_token }}" # nssp nssp_token: "{{ vault_cdc_socrata_token }}" +# nhsn +nhsn_token: "{{ vault_cdc_socrata_token }}" + # SirCAL sir_complainsalot_api_key: "{{ vault_sir_complainsalot_api_key }}" sir_complainsalot_slack_token: "{{ vault_sir_complainsalot_slack_token }}" diff --git a/nhsn/DETAILS.md b/nhsn/DETAILS.md new file mode 100644 index 000000000..900f2f62e --- /dev/null +++ b/nhsn/DETAILS.md @@ -0,0 +1,30 @@ +# NHSN data + +We import the NHSN Weekly Hospital Respiratory Data + +There are 2 sources we grab data from for nhsn: +Note that they are from the same source, but with different cadence and one reporting preliminary data for the previous reporting week + +Primary source: https://data.cdc.gov/Public-Health-Surveillance/Weekly-Hospital-Respiratory-Data-HRD-Metrics-by-Ju/ua7e-t2fy/about_data +Secondary (preliminary source): https://data.cdc.gov/Public-Health-Surveillance/Weekly-Hospital-Respiratory-Data-HRD-Metrics-by-Ju/mpgq-jmmr/about_data + +## Geographical Levels +* `state`: reported using two-letter postal code +* `national`: just `us` for now +* `hhs`: reporting using Geomapper with state level + +## Metrics +* `confirmed_admissions_covid`: total number of confirmed admission for covid +* `confirmed_admissions_flu`: total number of confirmed admission for flu +* `prelim_confirmed_admissions_covid`: total number of confirmed admission for covid from preliminary source +* `prelim_confirmed_admissions_flu`: total number of confirmed admission for flu from preliminary source + +## Additional Notes +HHS dataset and NHSN dataset covers the equivalent data of hospital admission for covid and flu. +As a general trend, HHS and NHSN data matches pretty well. +However, there are differences between some of the states, notably for GA (untill 2023), LA, NV, PR (late 2020-early 2021), TN all have HHS substantially lower, HHS is substantially lower than NHSN. + +Some states have this spike in NHSN or hhs where the other source doesn't have a spike and spikes don't happen at the same time_values across states + +More details regarding the analysis is available in the [analysis.ipynb](notebook%2Fanalysis.ipynb) +(may require installing additional packages to work) \ No newline at end of file diff --git a/nhsn/Makefile b/nhsn/Makefile new file mode 100644 index 000000000..390113eef --- /dev/null +++ b/nhsn/Makefile @@ -0,0 +1,32 @@ +.PHONY = venv, lint, test, clean + +dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1) +venv: + python3.8 -m venv env + +install: venv + . env/bin/activate; \ + pip install wheel ; \ + pip install -e ../_delphi_utils_python ;\ + pip install -e . + +install-ci: venv + . env/bin/activate; \ + pip install wheel ; \ + pip install ../_delphi_utils_python ;\ + pip install . + +lint: + . env/bin/activate; pylint $(dir) --rcfile=../pyproject.toml + . env/bin/activate; pydocstyle $(dir) + +format: + . env/bin/activate; darker $(dir) + +test: + . env/bin/activate ;\ + (cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing) + +clean: + rm -rf env + rm -f params.json diff --git a/nhsn/delphi_nhsn/__init__.py b/nhsn/delphi_nhsn/__init__.py new file mode 100644 index 000000000..52a507259 --- /dev/null +++ b/nhsn/delphi_nhsn/__init__.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +"""Module to pull and clean indicators from the XXXXX source. + +This file defines the functions that are made public by the module. As the +module is intended to be executed though the main method, these are primarily +for testing. +""" + +from __future__ import absolute_import + +from . import run + +__version__ = "0.1.0" diff --git a/nhsn/delphi_nhsn/__main__.py b/nhsn/delphi_nhsn/__main__.py new file mode 100644 index 000000000..67d95f968 --- /dev/null +++ b/nhsn/delphi_nhsn/__main__.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +"""Call the function run_module when executed. + +This file indicates that calling the module (`python -m MODULE_NAME`) will +call the function `run_module` found within the run.py file. There should be +no need to change this template. +""" + +from delphi_utils import read_params + +from .run import run_module # pragma: no cover + +run_module(read_params()) # pragma: no cover diff --git a/nhsn/delphi_nhsn/constants.py b/nhsn/delphi_nhsn/constants.py new file mode 100644 index 000000000..e6e6e4359 --- /dev/null +++ b/nhsn/delphi_nhsn/constants.py @@ -0,0 +1,31 @@ +"""Registry for signal names.""" + +GEOS = ["state", "nation", "hhs"] + +# column name from socrata +TOTAL_ADMISSION_COVID_API = "totalconfc19newadm" +TOTAL_ADMISSION_FLU_API = "totalconfflunewadm" + +SIGNALS_MAP = { + "confirmed_admissions_covid_ew": TOTAL_ADMISSION_COVID_API, + "confirmed_admissions_flu_ew": TOTAL_ADMISSION_FLU_API, +} + +TYPE_DICT = { + "timestamp": "datetime64[ns]", + "geo_id": str, + "confirmed_admissions_covid_ew": float, + "confirmed_admissions_flu_ew": float, +} + +# signal mapping for secondary, preliminary source +PRELIM_SIGNALS_MAP = { + "confirmed_admissions_covid_ew_prelim": TOTAL_ADMISSION_COVID_API, + "confirmed_admissions_flu_ew_prelim": TOTAL_ADMISSION_FLU_API, +} +PRELIM_TYPE_DICT = { + "timestamp": "datetime64[ns]", + "geo_id": str, + "confirmed_admissions_covid_ew_prelim": float, + "confirmed_admissions_flu_ew_prelim": float, +} diff --git a/nhsn/delphi_nhsn/pull.py b/nhsn/delphi_nhsn/pull.py new file mode 100644 index 000000000..7c200bf3a --- /dev/null +++ b/nhsn/delphi_nhsn/pull.py @@ -0,0 +1,123 @@ +# -*- coding: utf-8 -*- +"""Functions for pulling NSSP ER data.""" +import logging +from typing import Optional + +import pandas as pd +from delphi_utils import create_backup_csv +from sodapy import Socrata + +from .constants import PRELIM_SIGNALS_MAP, PRELIM_TYPE_DICT, SIGNALS_MAP, TYPE_DICT + + +def pull_data(socrata_token: str, dataset_id: str): + """Pull data from Socrata API.""" + client = Socrata("data.cdc.gov", socrata_token) + results = [] + offset = 0 + limit = 50000 # maximum limit allowed by SODA 2.0 + while True: + page = client.get(dataset_id, limit=limit, offset=offset) + if not page: + break # exit the loop if no more results + results.extend(page) + offset += limit + + df = pd.DataFrame.from_records(results) + return df + + +def pull_nhsn_data(socrata_token: str, backup_dir: str, custom_run: bool, logger: Optional[logging.Logger] = None): + """Pull the latest NSSP ER visits data, and conforms it into a dataset. + + The output dataset has: + + - Each row corresponds to a single observation + - Each row additionally has columns for the signals in SIGNALS + + Parameters + ---------- + socrata_token: str + My App Token for pulling the NHSN data + backup_dir: str + Directory to which to save raw backup data + custom_run: bool + Flag indicating if the current run is a patch. If so, don't save any data to disk + logger: Optional[logging.Logger] + logger object + + Returns + ------- + pd.DataFrame + Dataframe as described above. + """ + # Pull data from Socrata API + df = pull_data(socrata_token, dataset_id="ua7e-t2fy") + + keep_columns = list(TYPE_DICT.keys()) + + if not df.empty: + create_backup_csv(df, backup_dir, custom_run, logger=logger) + + df = df.rename(columns={"weekendingdate": "timestamp", "jurisdiction": "geo_id"}) + + for signal, col_name in SIGNALS_MAP.items(): + df[signal] = df[col_name] + + df = df[keep_columns] + df["geo_id"] = df["geo_id"].str.lower() + df.loc[df["geo_id"] == "usa", "geo_id"] = "us" + df = df.astype(TYPE_DICT) + else: + df = pd.DataFrame(columns=keep_columns) + + return df + + +def pull_preliminary_nhsn_data( + socrata_token: str, backup_dir: str, custom_run: bool, logger: Optional[logging.Logger] = None +): + """Pull the latest NSSP ER visits data, and conforms it into a dataset. + + The output dataset has: + + - Each row corresponds to a single observation + - Each row additionally has columns for the signals in SIGNALS + + Parameters + ---------- + socrata_token: str + My App Token for pulling the NHSN data + backup_dir: str + Directory to which to save raw backup data + custom_run: bool + Flag indicating if the current run is a patch. If so, don't save any data to disk + logger: Optional[logging.Logger] + logger object + + Returns + ------- + pd.DataFrame + Dataframe as described above. + """ + # Pull data from Socrata API + df = pull_data(socrata_token, dataset_id="mpgq-jmmr") + + keep_columns = list(PRELIM_TYPE_DICT.keys()) + + if not df.empty: + create_backup_csv(df, backup_dir, custom_run, sensor="prelim", logger=logger) + + df = df.rename(columns={"weekendingdate": "timestamp", "jurisdiction": "geo_id"}) + + for signal, col_name in PRELIM_SIGNALS_MAP.items(): + df[signal] = df[col_name] + + df = df[keep_columns] + df = df.astype(PRELIM_TYPE_DICT) + df["geo_id"] = df["geo_id"].str.lower() + df.loc[df["geo_id"] == "usa", "geo_id"] = "us" + else: + df = pd.DataFrame(columns=keep_columns) + + return df diff --git a/nhsn/delphi_nhsn/run.py b/nhsn/delphi_nhsn/run.py new file mode 100644 index 000000000..80f7cab47 --- /dev/null +++ b/nhsn/delphi_nhsn/run.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +"""Functions to call when running the function. + +This module should contain a function called `run_module`, that is executed +when the module is run with `python -m MODULE_NAME`. `run_module`'s lone argument should be a +nested dictionary of parameters loaded from the params.json file. We expect the `params` to have +the following structure: + - "common": + - "export_dir": str, directory to which the results are exported + - "log_filename": (optional) str, path to log file + - "indicator": (optional) + - "wip_signal": (optional) Any[str, bool], list of signals that are works in progress, or + True if all signals in the registry are works in progress, or False if only + unpublished signals are. See `delphi_utils.add_prefix()` + - Any other indicator-specific settings +""" +import time +from datetime import date, datetime, timedelta + +import numpy as np +from delphi_utils import GeoMapper, get_structured_logger +from delphi_utils.export import create_export_csv + +from .constants import GEOS, PRELIM_SIGNALS_MAP, SIGNALS_MAP +from .pull import pull_nhsn_data, pull_preliminary_nhsn_data + + +def run_module(params): + """ + Run the indicator. + + Arguments + -------- + params: Dict[str, Any] + Nested dictionary of parameters. + """ + start_time = time.time() + logger = get_structured_logger( + __name__, + filename=params["common"].get("log_filename"), + log_exceptions=params["common"].get("log_exceptions", True), + ) + export_dir = params["common"]["export_dir"] + backup_dir = params["common"]["backup_dir"] + custom_run = params["common"].get("custom_run", False) + socrata_token = params["indicator"]["socrata_token"] + export_start_date = params["indicator"]["export_start_date"] + run_stats = [] + + if export_start_date == "latest": # Find the previous Saturday + export_start_date = date.today() - timedelta(days=date.today().weekday() + 2) + export_start_date = export_start_date.strftime("%Y-%m-%d") + + nhsn_df = pull_nhsn_data(socrata_token, backup_dir, custom_run=custom_run, logger=logger) + preliminary_nhsn_df = pull_preliminary_nhsn_data(socrata_token, backup_dir, custom_run=custom_run, logger=logger) + + geo_mapper = GeoMapper() + signal_df_dict = {signal: nhsn_df for signal in SIGNALS_MAP} + signal_df_dict.update({signal: preliminary_nhsn_df for signal in PRELIM_SIGNALS_MAP}) + + for signal, df_pull in signal_df_dict.items(): + for geo in GEOS: + df = df_pull.copy() + df = df[["timestamp", "geo_id", signal]] + df.rename({signal: "val"}, axis=1, inplace=True) + if geo == "nation": + df = df[df["geo_id"] == "us"] + elif geo == "hhs": + df = df[df["geo_id"] != "us"] + df.rename(columns={"geo_id": "state_id"}, inplace=True) + df = geo_mapper.add_geocode(df, "state_id", "state_code", from_col="state_id") + df = geo_mapper.add_geocode(df, "state_code", "hhs", from_col="state_code", new_col="hhs") + df = geo_mapper.replace_geocode( + df, from_col="state_code", from_code="state_code", new_col="geo_id", new_code="hhs" + ) + else: + df = df[df_pull["geo_id"] != "us"] + df["se"] = np.nan + df["sample_size"] = np.nan + dates = create_export_csv( + df, + geo_res=geo, + export_dir=export_dir, + start_date=datetime.strptime(export_start_date, "%Y-%m-%d"), + sensor=signal, + weekly_dates=True, + ) + if len(dates) > 0: + run_stats.append((max(dates), len(dates))) + + elapsed_time_in_seconds = round(time.time() - start_time, 2) + min_max_date = run_stats and min(s[0] for s in run_stats) + csv_export_count = sum(s[-1] for s in run_stats) + max_lag_in_days = min_max_date and (datetime.now() - min_max_date).days + formatted_min_max_date = min_max_date and min_max_date.strftime("%Y-%m-%d") + logger.info( + "Completed indicator run", + elapsed_time_in_seconds=elapsed_time_in_seconds, + csv_export_count=csv_export_count, + max_lag_in_days=max_lag_in_days, + oldest_final_export_date=formatted_min_max_date, + ) diff --git a/nhsn/notebook/analysis.ipynb b/nhsn/notebook/analysis.ipynb new file mode 100644 index 000000000..a679e6d78 --- /dev/null +++ b/nhsn/notebook/analysis.ipynb @@ -0,0 +1,7931 @@ +{ + "cells": [ + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "# Setup\n", + "install plotly\n", + "locally run nhsn indicator in order to generate the data\n", + "get api key for epidata and fill in the API_KEY \n" + ], + "id": "ac71b219bacb886e" + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-12-06T21:05:46.881968Z", + "start_time": "2024-12-06T21:05:46.869306Z" + } + }, + "cell_type": "code", + "source": [ + "from pathlib import Path\n", + "import pandas as pd\n", + "import os\n", + "\n", + "from delphi_nhsn.constants import SIGNALS_MAP, PRELIM_SIGNALS_MAP\n", + "from delphi_epidata import Epidata\n", + "from epiweeks import Week\n", + "API_KEY = os.environ.get('DELPHI_API_KEY')\n", + "\n", + "CSV_PATH = Path(os.path.abspath('')).parent.joinpath('receiving')\n", + "SIGNALS = list(SIGNALS_MAP.keys()) + list(PRELIM_SIGNALS_MAP.keys())\n", + "Epidata.auth = (\"epidata\", API_KEY)\n" + ], + "id": "initial_id", + "outputs": [], + "execution_count": 106 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-12-06T19:45:52.690687Z", + "start_time": "2024-12-06T19:45:52.686556Z" + } + }, + "cell_type": "code", + "source": [ + "def get_nhsn_df(geo, pathogen, prelim=False):\n", + " lst = []\n", + " geo_filter = f'*{geo}'\n", + " pathogen_filter = f'confirmed_admissions_{pathogen}.csv'\n", + " prelim_filter = f'prelim_' if prelim else \"\"\n", + " filter = f\"{geo_filter}_{prelim_filter}{pathogen_filter}\"\n", + " for files in Path(CSV_PATH).glob(filter):\n", + " filename_parts = files.name.split('_')\n", + " signal = \"_\".join(filename_parts[3:]).replace('.csv', '')\n", + " time_value = filename_parts[1]\n", + " df = pd.read_csv(files)\n", + " df['signal'] = signal\n", + " df['time_value'] = time_value\n", + " df[\"geo_id\"] = df[\"geo_id\"].astype(str)\n", + " if geo == \"nation\":\n", + " df[\"geo_id\"] = \"US\"\n", + " elif geo == \"state\":\n", + " df[\"geo_id\"] = df[\"geo_id\"].str.upper()\n", + " df.time_value = df.time_value.astype(str)\n", + " lst.append(df)\n", + " df = pd.concat(lst)\n", + " df = df.drop(columns=['se','sample_size'], axis=1)\n", + " return df" + ], + "id": "fd6cc0b834450ccc", + "outputs": [], + "execution_count": 95 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-12-06T19:45:54.311661Z", + "start_time": "2024-12-06T19:45:54.307487Z" + } + }, + "cell_type": "code", + "source": [ + "def get_hhs_df(geo, pathogen):\n", + " response = Epidata.covidcast(\"hhs\", f\"confirmed_admissions_{pathogen}_1d\",\n", + " geo_type=geo, time_values=Epidata.range(\"20200808\", \"20240426\"),\n", + " geo_value=\"*\", as_of=None, time_type=\"day\")\n", + " df = pd.DataFrame.from_dict(response[\"epidata\"])\n", + " df.rename(columns={\"geo_value\": \"geo_id\", \"value\": \"val\", \"stderr\": \"se\"}, inplace=True)\n", + " df = df[[\"geo_id\", \"time_value\", \"val\", \"signal\"]]\n", + " df[\"time_value\"] = pd.to_datetime(df[\"time_value\"], format=\"%Y%m%d\")\n", + " # aggregating over 7 days matching epiweek for nhsn\n", + " df[\"week_time\"] = df[\"time_value\"].apply(lambda x: Week.fromdate(x))\n", + " df = df.groupby([\"geo_id\", \"signal\", \"week_time\"]).val.sum().reset_index()\n", + " df[\"geo_id\"] = df[\"geo_id\"].astype(str)\n", + " if geo != \"hhs\":\n", + " df[\"geo_id\"] = df[\"geo_id\"].str.upper()\n", + " df.rename({\"week_time\": \"time_value\"}, axis=1, inplace=True)\n", + " df.time_value = df.time_value.astype(str)\n", + " return df\n" + ], + "id": "c2b36cc1a6812be3", + "outputs": [], + "execution_count": 96 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-12-06T19:45:55.884628Z", + "start_time": "2024-12-06T19:45:55.881237Z" + } + }, + "cell_type": "code", + "source": [ + "def generate_spearman(nhsn_df, hhs_df, slice_col):\n", + " \n", + " joined = pd.merge(nhsn_df, hhs_df, on=[\"geo_id\", \"time_value\"], how=\"left\", suffixes=[\"_nhsn\", \"_hhs\"])\n", + " \n", + " spearmanr_df = joined.groupby(slice_col)[[\"val_nhsn\", \"val_hhs\"]].corr(\"spearman\").iloc[0::2,-1].reset_index()\n", + " spearmanr_df.rename({\"val_hhs\": \"correlation\"}, axis=1, inplace=True)\n", + " spearmanr_df = spearmanr_df[[slice_col, \"correlation\"]]\n", + " spearmanr_df[slice_col] = spearmanr_df[slice_col].str.upper()\n", + " return spearmanr_df\n", + " " + ], + "id": "a21bf17412d82522", + "outputs": [], + "execution_count": 97 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-12-06T19:45:57.349603Z", + "start_time": "2024-12-06T19:45:57.344672Z" + } + }, + "cell_type": "code", + "source": [ + "from plotly.offline import init_notebook_mode\n", + "\n", + "init_notebook_mode(connected=True)\n", + "\n", + "def plot_spearman_choropleth(nhsn_df, hhs_df, pathogen, prelim_flag, geo_val, download=False):\n", + " spearmanr = generate_spearman(nhsn_df, hhs_df, \"geo_id\")\n", + " title = f'Spearman Correlations between {geo_val} HHS {pathogen} admission and NHSN {pathogen} admission'\n", + " filename = f'spearman_choropleth_{pathogen}_{geo_val}'\n", + " \n", + " if prelim_flag:\n", + " title = f\"{title} (prelim data)\"\n", + " filename = f\"{filename}_prelim\"\n", + " \n", + " filename = filename + \".pdf\"\n", + " \n", + " fig = go.Figure(data=go.Choropleth(\n", + " locations=spearmanr['geo_id'], # Spatial coordinates\n", + " z = spearmanr['correlation'].astype(float), # Data to be color-coded\n", + " locationmode = 'USA-states', # set of locations match entries in `locations`\n", + " colorscale = 'Viridis',\n", + " colorbar_title = \"spearman rank\",\n", + " ))\n", + " \n", + " fig.update_layout(\n", + " title_text = title,\n", + " geo_scope='usa', # limite map scope to USA\n", + " )\n", + " \n", + " if download:\n", + " pio.write_image(fig, filename, format='pdf')\n", + " \n", + " else:\n", + " fig.show()\n" + ], + "id": "e7e54b9bd736a29d", + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " " + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "execution_count": 98 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-12-06T19:45:59.173894Z", + "start_time": "2024-12-06T19:45:59.168723Z" + } + }, + "cell_type": "code", + "source": [ + "from plotly.offline import init_notebook_mode\n", + "\n", + "init_notebook_mode(connected=True)\n", + "\n", + "def plot_timeplot(df, pathogen, prelim_flag, geo_val, y_col,download=False):\n", + " df.sort_values(\"time_value\", inplace=True)\n", + "\n", + " if y_col == \"correlation\":\n", + " title = f'Spearman Correlations between {pathogen} {geo_val} HHS and NHSN over time'\n", + " filename = f'spearman_timeplot_{pathogen}_{geo_val}'\n", + " elif y_col == \"count\":\n", + " title = f'{geo_val} NHSN count over time'\n", + " filename = f'{geo_val}_{pathogen}_nhsn_row_count_timeplot'\n", + " elif y_col == \"diff_percentage\":\n", + " title = f'{geo_val} proportion between nhsn vs hhs ((nhsn-hhs)/hhs)'\n", + " filename = f'{geo_val}_{pathogen}_nhsn_diff_percentage_timeplot'\n", + " df.to_csv(f\"{filename}.csv\", index=False)\n", + " elif y_col == \"val\":\n", + " title = f'{geo_val} NHSN value over time'\n", + " filename = f'{geo_val}_{pathogen}_nhsn_timeplot'\n", + " df.to_csv(f\"{filename}.csv\", index=False)\n", + " elif y_col == \"val_hhs\":\n", + " title = f'{geo_val} HHS value over time'\n", + " filename = f'{geo_val}_{pathogen}_hhs_timeplot'\n", + " y_col = \"val\"\n", + "\n", + " \n", + " if prelim_flag:\n", + " filename = f\"{filename}_prelim\"\n", + " title = f\"{title} (prelim data)\"\n", + " \n", + " filename = filename + \".pdf\"\n", + " \n", + " fig = go.Figure()\n", + " fig.add_trace(go.Scatter(x=df['time_value'], y=df[y_col], mode='lines', name='Time Series'))\n", + " fig.update_layout(title=title)\n", + "\n", + " if download:\n", + " pio.write_image(fig, filename, format='pdf')\n", + " else:\n", + " fig.show()" + ], + "id": "7c1338ae44f73d22", + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " " + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "execution_count": 99 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-12-06T19:46:01.622458Z", + "start_time": "2024-12-06T19:46:01.397580Z" + } + }, + "cell_type": "code", + "source": [ + "import pandas as pd\n", + "from plotly.offline import init_notebook_mode\n", + "\n", + "init_notebook_mode(connected=True)\n", + "\n", + "geo_type = \"state\"\n", + "pathogen = \"covid\"\n", + "nhsn_df = get_nhsn_df(geo_type, pathogen)\n", + "\n", + "def plot_choropleth_overtime(df, pathogen, prelim_flag, geo_val, z_col):\n", + " color_bar_title = \"\"\n", + " layout_title = \"\" \n", + " if z_col == \"val\" :\n", + " color_bar_title = f'{geo_val} Total Confirmed {pathogen} Cases'\n", + " layout_title = f'{geo_val} NHSN total confirmed {pathogen} cases' \n", + "\n", + " elif z_col == \"diff_percentage\":\n", + " color_bar_title = f\"{geo_val} difference in percentage ((nhsn-hhs)/hhs)\"\n", + " layout_title = f'Proportion between NHSN and HHS for {geo_val} confirmed {pathogen} over time'\n", + " \n", + " if prelim_flag:\n", + " layout_title = f'{layout_title} (prelim data)'\n", + " \n", + " df[\"time_value\"] = pd.to_datetime(df.time_value.map(lambda x: str(x)+'-0'), format=\"%Y%W-%w\")\n", + " \n", + " data_slider = []\n", + " \n", + " for time_value in df['time_value'].unique():\n", + " df_segmented = df[(df['time_value']== time_value)]\n", + " \n", + " data_each_yr = dict(\n", + " type='choropleth',\n", + " locations = df_segmented['geo_id'],\n", + " z=df_segmented[z_col].astype(float),\n", + " locationmode='USA-states',\n", + " colorscale = 'Viridis',\n", + " colorbar= {'title': color_bar_title},)\n", + " \n", + " data_slider.append(data_each_yr)\n", + " \n", + " steps = []\n", + " for idx, time_value in enumerate(sorted(df['time_value'].unique())):\n", + " step = {\n", + " \"method\":'restyle',\n", + " \"args\":[\n", + " {'visible': [False] * len(data_slider)}\n", + " ],\n", + " \"label\": f\"Epiweek {Week.fromdate(pd.to_datetime(time_value))}\"\n", + " }\n", + " step['args'][0][\"visible\"][idx] = True\n", + " steps.append(step)\n", + " \n", + " sliders = [dict(active=0, pad={\"t\": 1}, steps=steps)]\n", + " \n", + " layout = dict(title =layout_title, geo=dict(scope='usa',\n", + " projection={'type': 'albers usa'}),\n", + " sliders=sliders)\n", + " \n", + " fig = go.Figure(data=data_slider, layout=layout)\n", + " \n", + " fig.show()\n" + ], + "id": "7a077af8d4d1caed", + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " " + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "execution_count": 100 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-12-06T19:46:03.864513Z", + "start_time": "2024-12-06T19:46:03.857987Z" + } + }, + "cell_type": "code", + "source": [ + "from plotly.offline import init_notebook_mode\n", + "\n", + "init_notebook_mode(connected=True)\n", + "\n", + "def plot_compare_timeplot(nhsn_df, hhs_df, pathogen, prelim_flag=\"False\", geo_val=\"\", download=False, val_cutoff=100, percent_cutoff=20):\n", + " \"\"\"\n", + " \n", + " Parameters\n", + " ----------\n", + " nhsn_df\n", + " hhs_df\n", + " pathogen\n", + " geo_val\n", + " download\n", + " val_cutoff: min value to consider for suspicous\n", + " percent_cutoff: min percentage of difference between NHSN and HHS to consider for suspicous\n", + "\n", + " Returns\n", + " -------\n", + "\n", + " \"\"\"\n", + " title = f'{geo_val} NHSN vs HHS value over time with (diff > {percent_cutoff}% and val > {val_cutoff}) markers'\n", + " filename = f'nhsn_vs_hhs_timeplot_{geo_val}_{pathogen}'\n", + " \n", + " if prelim_flag:\n", + " title = f\"{title} (prelim data)\"\n", + " filename = f\"{filename}_prelim\"\n", + "\n", + " fig = go.Figure()\n", + " fig.add_trace(go.Scatter(x=nhsn_df['time_value'], y=nhsn_df[\"val\"], mode='lines', name='NHSN Time Series'))\n", + " fig.add_trace(go.Scatter(x=hhs_df['time_value'], y=hhs_df[\"val\"], mode='lines', name='HHS Time Series'))\n", + " \n", + " joined = pd.merge(nhsn_df, hhs_df, on=[\"geo_id\", \"time_value\"], how=\"left\", suffixes=[\"_nhsn\", \"_hhs\"])\n", + " joined = joined[[\"geo_id\", \"time_value\", \"val_nhsn\", \"val_hhs\"]]\n", + " joined[\"diff_percentage\"] = ((joined[\"val_nhsn\"] - joined[\"val_hhs\"]) / joined[\"val_hhs\"]) * 100\n", + " joined.sort_values(by=\"time_value\", inplace=True)\n", + " percent_filter = (abs(joined[\"diff_percentage\"]) > percent_cutoff)\n", + " num_filter = (joined['val_nhsn'] > val_cutoff)\n", + " sus_data = joined[(percent_filter & num_filter)]\n", + " sus_data.sort_values(by=\"time_value\", inplace=True)\n", + " if len(sus_data) > 0:\n", + " sus_data.to_csv(f\"{filename}.csv\", index=False)\n", + " \n", + " fig.add_trace(go.Scatter(x=sus_data['time_value'], y=sus_data[\"val_nhsn\"] , mode='markers', name=f'NHSN points', marker={\"color\":\"green\"}))\n", + " fig.add_trace(go.Scatter(x=sus_data['time_value'], y=sus_data[\"val_hhs\"] , mode='markers', name=f'HHS points', marker={\"color\":\"green\"}))\n", + "\n", + " fig.update_layout(title=title)\n", + " \n", + " if download:\n", + " pio.write_image(fig, f\"{filename}.pdf\", format='pdf')\n", + " else:\n", + " fig.show()\n" + ], + "id": "3bf257e9913f5742", + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " " + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "execution_count": 101 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-12-06T19:46:15.969120Z", + "start_time": "2024-12-06T19:46:15.964371Z" + } + }, + "cell_type": "code", + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.offline import init_notebook_mode\n", + "import plotly.io as pio\n", + "\n", + "init_notebook_mode(connected=True)\n", + "\n", + "def plot_count_overtime(df, pathogen, prelim_flag, geo_val, y_col, download=False):\n", + "\n", + " title = f'{geo_val} NHSN row count over time'\n", + " filename = f'{geo_val}_{pathogen}_nhsn_rowcount_overtime'\n", + "\n", + " if prelim_flag:\n", + " filename = f\"{filename}_prelim\"\n", + " title = f\"{title} (prelim data)\"\n", + " \n", + " \n", + " df.sort_values(\"time_value\", inplace=True)\n", + " fig = go.Figure()\n", + " for geo_id in df[\"geo_id\"].unique():\n", + " partial_df = df[df[\"geo_id\"] == geo_id]\n", + " partial_df.sort_values(\"time_value\", inplace=True)\n", + " if any(partial_df[\"count\"] == 0):\n", + " partial_df.to_csv(f\"{geo_id}_{filename}_missing.csv\", index=False)\n", + " fig.add_trace(go.Histogram(x=partial_df['time_value'], y=partial_df[y_col], name=geo_id))\n", + " fig.update_layout(title=title, barmode='stack')\n", + "\n", + " \n", + " if download:\n", + " pio.write_image(fig, f\"{filename}.pdf\", format='pdf')\n", + " else:\n", + " fig.show()\n", + " " + ], + "id": "d3b6e9396c9b1723", + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " " + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "execution_count": 102 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "# all analysis download", + "id": "2e81b397bdd67170" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "", + "id": "1b935bb75e8e37cf" + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-12-06T19:53:47.785286Z", + "start_time": "2024-12-06T19:53:19.199988Z" + } + }, + "cell_type": "code", + "source": [ + "from itertools import product\n", + "geos = [\"nation\", \"state\", \"hhs\"]\n", + "hhs_pathogen_mapping = {\"flu\": \"influenza\", \"covid\": \"covid\"}\n", + "geo_pathogen_flag_combo = list(product(geos, hhs_pathogen_mapping.keys(), [True, False]))\n", + "percent_cutoff = 30\n", + "val_cutoff = 100\n", + "\n", + "for geo, pathogen, prelim_flag in geo_pathogen_flag_combo:\n", + " nhsn_df = get_nhsn_df(geo, pathogen, prelim_flag)\n", + " hhs_df = get_hhs_df(geo, hhs_pathogen_mapping[pathogen])\n", + " spearmanr = generate_spearman(nhsn_df, hhs_df, \"time_value\")\n", + " joined = pd.merge(nhsn_df, hhs_df, on=[\"geo_id\", \"time_value\"], how=\"left\", suffixes=[\"_nhsn\", \"_hhs\"])\n", + " joined = joined[[\"geo_id\", \"time_value\", \"val_nhsn\", \"val_hhs\"]]\n", + " joined[\"diff_percentage\"] = ((joined[\"val_nhsn\"] - joined[\"val_hhs\"]) / joined[\"val_hhs\"]) * 100\n", + " row_count_df = nhsn_df[[\"geo_id\",\"time_value\"]].value_counts().reset_index(name=\"count\")\n", + " if geo == \"state\":\n", + " # plot_timeplot(spearmanr, pathogen, prelim_flag, geo, y_col=\"correlation\", download=True)\n", + " pass\n", + " else:\n", + " plot_timeplot(joined, pathogen, prelim_flag, geo, y_col=\"diff_percentage\", download=True)\n", + "\n", + " if geo != \"state\":\n", + " plot_timeplot(nhsn_df, pathogen, prelim_flag, geo, y_col=\"val\", download=True)\n", + " plot_timeplot(hhs_df, pathogen, prelim_flag, geo, y_col=\"val_hhs\", download=True)\n", + "\n", + " plot_count_overtime(row_count_df, pathogen, prelim_flag, geo, y_col=\"count\", download=True)\n", + " # \n", + " # if geo == \"state\":\n", + " # plot_spearman_choropleth(nhsn_df, hhs_df, pathogen, prelim_flag, geo, download=True)\n", + " # \n", + " if geo == \"hhs\":\n", + " geos = list(nhsn_df.geo_id.unique())\n", + " for geo_val in geos:\n", + " part_nhsn_df = nhsn_df[nhsn_df[\"geo_id\"] == geo_val].sort_values(by=\"time_value\")\n", + " part_hhs_df = hhs_df[hhs_df[\"geo_id\"] == geo_val].sort_values(by=\"time_value\")\n", + "\n", + " plot_compare_timeplot(part_nhsn_df, part_hhs_df, pathogen, prelim_flag, geo_val=geo_val, val_cutoff=val_cutoff, percent_cutoff=percent_cutoff, download=True)\n", + " elif geo == \"nation\":\n", + " plot_compare_timeplot(nhsn_df, hhs_df, pathogen, prelim_flag, geo_val=\"us\", val_cutoff=val_cutoff, percent_cutoff=percent_cutoff, download=True)" + ], + "id": "2efa75ca5d6496c5", + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/3735297055.py:21: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/3735297055.py:21: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/3735297055.py:21: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/3735297055.py:21: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/3735297055.py:21: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/3735297055.py:21: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/3735297055.py:21: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/3735297055.py:21: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/832067892.py:42: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n" + ] + } + ], + "execution_count": 105 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "# Spearman over time example", + "id": "f9979b019260fb75" + }, + { + "metadata": {}, + "cell_type": "code", + "source": [ + "pathogen_mapping = {\"flu\": \"influenza\", \"covid\": \"covid\"}\n", + "pathogen = \"covid\"\n", + "prelim_flag = False\n", + "geo = \"state\"\n", + "\n", + "nhsn_df = get_nhsn_df(geo, pathogen, prelim_flag)\n", + "hhs_df = get_hhs_df(geo, pathogen_mapping[pathogen])\n", + "spearmanr = generate_spearman(nhsn_df, hhs_df, \"time_value\")\n", + "plot_timeplot(spearmanr, pathogen, prelim_flag, geo, y_col=\"correlation\", download=True)\n" + ], + "id": "3c13ddde889337dd", + "outputs": [], + "execution_count": null + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "# Spearman over geo", + "id": "389ff20f354256f0" + }, + { + "metadata": {}, + "cell_type": "code", + "source": [ + "pathogen_mapping = {\"flu\": \"influenza\", \"covid\": \"covid\"}\n", + "pathogen = \"covid\"\n", + "prelim_flag = False\n", + "geo = \"state\"\n", + "\n", + "nhsn_df = get_nhsn_df(geo, pathogen, prelim_flag)\n", + "hhs_df = get_hhs_df(geo, pathogen_mapping[pathogen])\n", + "plot_spearman_choropleth(nhsn_df, hhs_df, pathogen, prelim_flag, geo, download=True)\n" + ], + "id": "e134e9da693e3be1", + "outputs": [], + "execution_count": null + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "# comparison over time across geo", + "id": "a5c34a5e6c662b36" + }, + { + "metadata": {}, + "cell_type": "code", + "source": [ + "pathogen_mapping = {\"flu\": \"influenza\", \"covid\": \"covid\"}\n", + "pathogen = \"covid\"\n", + "prelim_flag = False\n", + "geo = \"state\"\n", + "\n", + "nhsn_df = get_nhsn_df(geo, pathogen, prelim_flag)\n", + "hhs_df = get_hhs_df(geo, pathogen_mapping[pathogen])\n", + "joined = pd.merge(nhsn_df, hhs_df, on=[\"geo_id\", \"time_value\"], how=\"left\", suffixes=[\"_nhsn\", \"_hhs\"])\n", + "joined = joined[[\"geo_id\", \"time_value\", \"val_nhsn\", \"val_hhs\"]]\n", + "joined[\"diff_percentage\"] = ((joined[\"val_nhsn\"] - joined[\"val_hhs\"]) / joined[\"val_hhs\"]) * 100\n", + "plot_choropleth_overtime(joined, pathogen, prelim_flag, geo, z_col=\"diff_percentage\")" + ], + "id": "aa8d00e6d6c8e888", + "outputs": [], + "execution_count": null + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "# compare count over time", + "id": "291a7b1da3535a4c" + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-12-06T17:28:43.754542Z", + "start_time": "2024-12-06T17:28:42.709301Z" + } + }, + "cell_type": "code", + "source": [ + "pathogen_mapping = {\"flu\": \"influenza\", \"covid\": \"covid\"}\n", + "pathogen = \"covid\"\n", + "prelim_flag = False\n", + "geo = \"hhs\"\n", + "val_cutoff = 100\n", + "percent_cutoff = 30\n", + "\n", + "\n", + "nhsn_df = get_nhsn_df(geo, pathogen).sort_values(by=\"time_value\")\n", + "hhs_df = get_hhs_df(geo, pathogen_mapping[pathogen]).sort_values(by=\"time_value\")\n", + "\n", + "row_count_df = nhsn_df[[\"geo_id\",\"time_value\"]].value_counts().reset_index(name=\"count\")\n", + "plot_count_overtime(row_count_df, pathogen, prelim_flag, geo, y_col=\"count\", download=False)\n" + ], + "id": "d6a49cb0a01eeb93", + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/var/folders/s6/ytv8f9z11q32lhh5ksxrp_tm0000gn/T/ipykernel_91259/3450248032.py:22: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n" + ] + }, + { + "data": { + "application/vnd.plotly.v1+json": { + "data": [ + { + "name": "1", + "x": [ + "202032", + "202033", + "202034", + "202035", + "202036", + "202037", + "202038", + "202039", + "202040", + "202041", + "202042", + "202043", + "202044", + "202045", + "202046", + "202047", + "202048", + "202049", + "202050", + "202051", + "202052", + "202053", + "202101", + "202102", + "202103", + "202104", + "202105", + "202106", + "202107", + "202108", + "202109", + "202110", + "202111", + "202112", + "202113", + "202114", + "202115", + "202116", + "202117", + "202118", + "202119", + "202120", + "202121", + "202122", + "202123", + "202124", + "202125", + "202126", + "202127", + "202128", + "202129", + "202130", + "202131", + "202132", + "202133", + "202134", + "202135", + "202136", + "202137", + "202138", + "202139", + "202140", + "202141", + "202142", + "202143", + "202144", + "202145", + "202146", + "202147", + "202148", + "202149", + "202150", + "202151", + "202152", + "202201", + "202202", + "202203", + "202204", + "202205", + "202206", + "202207", + "202208", + "202209", + "202210", + "202211", + "202212", + "202213", + "202214", + "202215", + "202216", + "202217", + "202218", + "202219", + "202220", + "202221", + "202222", + "202223", + "202224", + "202225", + "202226", + "202227", + "202228", + "202229", + "202230", + "202231", + "202232", + "202233", + "202234", + "202235", + "202236", + "202237", + "202238", + "202239", + "202240", + "202241", + "202242", + "202243", + "202244", + "202245", + "202246", + "202247", + "202248", + "202249", + "202250", + "202251", + "202252", + "202301", + "202302", + "202303", + "202304", + "202305", + "202306", + "202307", + "202308", + "202309", + "202310", + "202311", + "202312", + "202313", + "202314", + "202315", + "202316", + "202317", + "202318", + "202319", + "202320", + "202321", + "202322", + "202323", + "202324", + "202325", + "202326", + "202327", + "202328", + "202329", + "202330", + "202331", + "202332", + "202333", + "202334", + "202335", + "202336", + "202337", + "202338", + "202339", + "202340", + "202341", + "202342", + "202343", + "202344", + "202345", + "202346", + "202347", + "202348", + "202349", + "202350", + "202351", + "202352", + "202401", + "202402", + "202403", + "202404", + "202405", + "202406", + "202407", + "202408", + "202409", + "202410", + "202411", + "202412", + "202413", + "202414", + "202415", + "202416", + "202417", + "202418", + "202419", + "202420", + "202421", + "202422", + "202423", + "202424", + "202425", + "202426", + "202427", + "202428", + "202429", + "202430", + "202431", + "202432", + "202433", + "202434", + "202435", + "202436", + "202437", + "202438", + "202439", + "202440", + "202441", + "202442", + "202443", + "202444", + "202445", + "202446", + "202447" + ], + "y": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + "type": "histogram" + }, + { + "name": "6", + "x": [ + "202032", + "202033", + "202034", + "202035", + "202036", + "202037", + "202038", + "202039", + "202040", + "202041", + "202042", + "202043", + "202044", + "202045", + "202046", + "202047", + "202048", + "202049", + "202050", + "202051", + "202052", + "202053", + "202101", + "202102", + "202103", + "202104", + "202105", + "202106", + "202107", + "202108", + "202109", + "202110", + "202111", + "202112", + "202113", + "202114", + "202115", + "202116", + "202117", + "202118", + "202119", + "202120", + "202121", + "202122", + "202123", + "202124", + "202125", + "202126", + "202127", + "202128", + "202129", + "202130", + "202131", + "202132", + "202133", + "202134", + "202135", + "202136", + "202137", + "202138", + "202139", + "202140", + "202141", + "202142", + "202143", + "202144", + "202145", + "202146", + "202147", + "202148", + "202149", + "202150", + "202151", + "202152", + "202201", + "202202", + "202203", + "202204", + "202205", + "202206", + "202207", + "202208", + "202209", + "202210", + "202211", + "202212", + "202213", + "202214", + "202215", + "202216", + "202217", + "202218", + "202219", + "202220", + "202221", + "202222", + "202223", + "202224", + "202225", + "202226", + "202227", + "202228", + "202229", + "202230", + "202231", + "202232", + "202233", + "202234", + "202235", + "202236", + "202237", + "202238", + "202239", + "202240", + "202241", + "202242", + "202243", + "202244", + "202245", + "202246", + "202247", + "202248", + "202249", + "202250", + "202251", + "202252", + "202301", + "202302", + "202303", + "202304", + "202305", + "202306", + "202307", + "202308", + "202309", + "202310", + "202311", + "202312", + "202313", + "202314", + "202315", + "202316", + "202317", + "202318", + "202319", + "202320", + "202321", + "202322", + "202323", + "202324", + "202325", + "202326", + "202327", + "202328", + "202329", + "202330", + "202331", + "202332", + "202333", + "202334", + "202335", + "202336", + "202337", + "202338", + "202339", + "202340", + "202341", + "202342", + "202343", + "202344", + "202345", + "202346", + "202347", + "202348", + "202349", + "202350", + "202351", + "202352", + "202401", + "202402", + "202403", + "202404", + "202405", + "202406", + "202407", + "202408", + "202409", + "202410", + "202411", + "202412", + "202413", + "202414", + "202415", + "202416", + "202417", + "202418", + "202419", + "202420", + "202421", + "202422", + "202423", + "202424", + "202425", + "202426", + "202427", + "202428", + "202429", + "202430", + "202431", + "202432", + "202433", + "202434", + "202435", + "202436", + "202437", + "202438", + "202439", + "202440", + "202441", + "202442", + "202443", + "202444", + "202445", + "202446", + "202447" + ], + "y": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + "type": "histogram" + }, + { + "name": "9", + "x": [ + "202032", + "202033", + "202034", + "202035", + "202036", + "202037", + "202038", + "202039", + "202040", + "202041", + "202042", + "202043", + "202044", + "202045", + "202046", + "202047", + "202048", + "202049", + "202050", + "202051", + "202052", + "202053", + "202101", + "202102", + "202103", + "202104", + "202105", + "202106", + "202107", + "202108", + "202109", + "202110", + "202111", + "202112", + "202113", + "202114", + "202115", + "202116", + "202117", + "202118", + "202119", + "202120", + "202121", + "202122", + "202123", + "202124", + "202125", + "202126", + "202127", + "202128", + "202129", + "202130", + "202131", + "202132", + "202133", + "202134", + "202135", + "202136", + "202137", + "202138", + "202139", + "202140", + "202141", + "202142", + "202143", + "202144", + "202145", + "202146", + "202147", + "202148", + "202149", + "202150", + "202151", + "202152", + "202201", + "202202", + "202203", + "202204", + "202205", + "202206", + "202207", + "202208", + "202209", + "202210", + "202211", + "202212", + "202213", + "202214", + "202215", + "202216", + "202217", + "202218", + "202219", + "202220", + "202221", + "202222", + "202223", + "202224", + "202225", + "202226", + "202227", + "202228", + "202229", + "202230", + "202231", + "202232", + "202233", + "202234", + "202235", + "202236", + "202237", + "202238", + "202239", + "202240", + "202241", + "202242", + "202243", + "202244", + "202245", + "202246", + "202247", + "202248", + "202249", + "202250", + "202251", + "202252", + "202301", + "202302", + "202303", + "202304", + "202305", + "202306", + "202307", + "202308", + "202309", + "202310", + "202311", + "202312", + "202313", + "202314", + "202315", + "202316", + "202317", + "202318", + "202319", + "202320", + "202321", + "202322", + "202323", + "202324", + "202325", + "202326", + "202327", + "202328", + "202329", + "202330", + "202331", + "202332", + "202333", + "202334", + "202335", + "202336", + "202337", + "202338", + "202339", + "202340", + "202341", + "202342", + "202343", + "202344", + "202345", + "202346", + "202347", + "202348", + "202349", + "202350", + "202351", + "202352", + "202401", + "202402", + "202403", + "202404", + "202405", + "202406", + "202407", + "202408", + "202409", + "202410", + "202411", + "202412", + "202413", + "202414", + "202415", + "202416", + "202417", + "202418", + "202419", + "202420", + "202421", + "202422", + "202423", + "202424", + "202425", + "202426", + "202427", + "202428", + "202429", + "202430", + "202431", + "202432", + "202433", + "202434", + "202435", + "202436", + "202437", + "202438", + "202439", + "202440", + "202441", + "202442", + "202443", + "202444", + "202445", + "202446", + "202447" + ], + "y": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + "type": "histogram" + }, + { + "name": "8", + "x": [ + "202032", + "202033", + "202034", + "202035", + "202036", + "202037", + "202038", + "202039", + "202040", + "202041", + "202042", + "202043", + "202044", + "202045", + "202046", + "202047", + "202048", + "202049", + "202050", + "202051", + "202052", + "202053", + "202101", + "202102", + "202103", + "202104", + "202105", + "202106", + "202107", + "202108", + "202109", + "202110", + "202111", + "202112", + "202113", + "202114", + "202115", + "202116", + "202117", + "202118", + "202119", + "202120", + "202121", + "202122", + "202123", + "202124", + "202125", + "202126", + "202127", + "202128", + "202129", + "202130", + "202131", + "202132", + "202133", + "202134", + "202135", + "202136", + "202137", + "202138", + "202139", + "202140", + "202141", + "202142", + "202143", + "202144", + "202145", + "202146", + "202147", + "202148", + "202149", + "202150", + "202151", + "202152", + "202201", + "202202", + "202203", + "202204", + "202205", + "202206", + "202207", + "202208", + "202209", + "202210", + "202211", + "202212", + "202213", + "202214", + "202215", + "202216", + "202217", + "202218", + "202219", + "202220", + "202221", + "202222", + "202223", + "202224", + "202225", + "202226", + "202227", + "202228", + "202229", + "202230", + "202231", + "202232", + "202233", + "202234", + "202235", + "202236", + "202237", + "202238", + "202239", + "202240", + "202241", + "202242", + "202243", + "202244", + "202245", + "202246", + "202247", + "202248", + "202249", + "202250", + "202251", + "202252", + "202301", + "202302", + "202303", + "202304", + "202305", + "202306", + "202307", + "202308", + "202309", + "202310", + "202311", + "202312", + "202313", + "202314", + "202315", + "202316", + "202317", + "202318", + "202319", + "202320", + "202321", + "202322", + "202323", + "202324", + "202325", + "202326", + "202327", + "202328", + "202329", + "202330", + "202331", + "202332", + "202333", + "202334", + "202335", + "202336", + "202337", + "202338", + "202339", + "202340", + "202341", + "202342", + "202343", + "202344", + "202345", + "202346", + "202347", + "202348", + "202349", + "202350", + "202351", + "202352", + "202401", + "202402", + "202403", + "202404", + "202405", + "202406", + "202407", + "202408", + "202409", + "202410", + "202411", + "202412", + "202413", + "202414", + "202415", + "202416", + "202417", + "202418", + "202419", + "202420", + "202421", + "202422", + "202423", + "202424", + "202425", + "202426", + "202427", + "202428", + "202429", + "202430", + "202431", + "202432", + "202433", + "202434", + "202435", + "202436", + "202437", + "202438", + "202439", + "202440", + "202441", + "202442", + "202443", + "202444", + "202445", + "202446", + "202447" + ], + "y": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + "type": "histogram" + }, + { + "name": "2", + "x": [ + "202032", + "202033", + "202034", + "202035", + "202036", + "202037", + "202038", + "202039", + "202040", + "202041", + "202042", + "202043", + "202044", + "202045", + "202046", + "202047", + "202048", + "202049", + "202050", + "202051", + "202052", + "202053", + "202101", + "202102", + "202103", + "202104", + "202105", + "202106", + "202107", + "202108", + "202109", + "202110", + "202111", + "202112", + "202113", + "202114", + "202115", + "202116", + "202117", + "202118", + "202119", + "202120", + "202121", + "202122", + "202123", + "202124", + "202125", + "202126", + "202127", + "202128", + "202129", + "202130", + "202131", + "202132", + "202133", + "202134", + "202135", + "202136", + "202137", + "202138", + "202139", + "202140", + "202141", + "202142", + "202143", + "202144", + "202145", + "202146", + "202147", + "202148", + "202149", + "202150", + "202151", + "202152", + "202201", + "202202", + "202203", + "202204", + "202205", + "202206", + "202207", + "202208", + "202209", + "202210", + "202211", + "202212", + "202213", + "202214", + "202215", + "202216", + "202217", + "202218", + "202219", + "202220", + "202221", + "202222", + "202223", + "202224", + "202225", + "202226", + "202227", + "202228", + "202229", + "202230", + "202231", + "202232", + "202233", + "202234", + "202235", + "202236", + "202237", + "202238", + "202239", + "202240", + "202241", + "202242", + "202243", + "202244", + "202245", + "202246", + "202247", + "202248", + "202249", + "202250", + "202251", + "202252", + "202301", + "202302", + "202303", + "202304", + "202305", + "202306", + "202307", + "202308", + "202309", + "202310", + "202311", + "202312", + "202313", + "202314", + "202315", + "202316", + "202317", + "202318", + "202319", + "202320", + "202321", + "202322", + "202323", + "202324", + "202325", + "202326", + "202327", + "202328", + "202329", + "202330", + "202331", + "202332", + "202333", + "202334", + "202335", + "202336", + "202337", + "202338", + "202339", + "202340", + "202341", + "202342", + "202343", + "202344", + "202345", + "202346", + "202347", + "202348", + "202349", + "202350", + "202351", + "202352", + "202401", + "202402", + "202403", + "202404", + "202405", + "202406", + "202407", + "202408", + "202409", + "202410", + "202411", + "202412", + "202413", + "202414", + "202415", + "202416", + "202417", + "202418", + "202419", + "202420", + "202421", + "202422", + "202423", + "202424", + "202425", + "202426", + "202427", + "202428", + "202429", + "202430", + "202431", + "202432", + "202433", + "202434", + "202435", + "202436", + "202437", + "202438", + "202439", + "202440", + "202441", + "202442", + "202443", + "202444", + "202445", + "202446", + "202447" + ], + "y": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + "type": "histogram" + }, + { + "name": "5", + "x": [ + "202032", + "202033", + "202034", + "202035", + "202036", + "202037", + "202038", + "202039", + "202040", + "202041", + "202042", + "202043", + "202044", + "202045", + "202046", + "202047", + "202048", + "202049", + "202050", + "202051", + "202052", + "202053", + "202101", + "202102", + "202103", + "202104", + "202105", + "202106", + "202107", + "202108", + "202109", + "202110", + "202111", + "202112", + "202113", + "202114", + "202115", + "202116", + "202117", + "202118", + "202119", + "202120", + "202121", + "202122", + "202123", + "202124", + "202125", + "202126", + "202127", + "202128", + "202129", + "202130", + "202131", + "202132", + "202133", + "202134", + "202135", + "202136", + "202137", + "202138", + "202139", + "202140", + "202141", + "202142", + "202143", + "202144", + "202145", + "202146", + "202147", + "202148", + "202149", + "202150", + "202151", + "202152", + "202201", + "202202", + "202203", + "202204", + "202205", + "202206", + "202207", + "202208", + "202209", + "202210", + "202211", + "202212", + "202213", + "202214", + "202215", + "202216", + "202217", + "202218", + "202219", + "202220", + "202221", + "202222", + "202223", + "202224", + "202225", + "202226", + "202227", + "202228", + "202229", + "202230", + "202231", + "202232", + "202233", + "202234", + "202235", + "202236", + "202237", + "202238", + "202239", + "202240", + "202241", + "202242", + "202243", + "202244", + "202245", + "202246", + "202247", + "202248", + "202249", + "202250", + "202251", + "202252", + "202301", + "202302", + "202303", + "202304", + "202305", + "202306", + "202307", + "202308", + "202309", + "202310", + "202311", + "202312", + "202313", + "202314", + "202315", + "202316", + "202317", + "202318", + "202319", + "202320", + "202321", + "202322", + "202323", + "202324", + "202325", + "202326", + "202327", + "202328", + "202329", + "202330", + "202331", + "202332", + "202333", + "202334", + "202335", + "202336", + "202337", + "202338", + "202339", + "202340", + "202341", + "202342", + "202343", + "202344", + "202345", + "202346", + "202347", + "202348", + "202349", + "202350", + "202351", + "202352", + "202401", + "202402", + "202403", + "202404", + "202405", + "202406", + "202407", + "202408", + "202409", + "202410", + "202411", + "202412", + "202413", + "202414", + "202415", + "202416", + "202417", + "202418", + "202419", + "202420", + "202421", + "202422", + "202423", + "202424", + "202425", + "202426", + "202427", + "202428", + "202429", + "202430", + "202431", + "202432", + "202433", + "202434", + "202435", + "202436", + "202437", + "202438", + "202439", + "202440", + "202441", + "202442", + "202443", + "202444", + "202445", + "202446", + "202447" + ], + "y": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + "type": "histogram" + }, + { + "name": "4", + "x": [ + "202032", + "202033", + "202034", + "202035", + "202036", + "202037", + "202038", + "202039", + "202040", + "202041", + "202042", + "202043", + "202044", + "202045", + "202046", + "202047", + "202048", + "202049", + "202050", + "202051", + "202052", + "202053", + "202101", + "202102", + "202103", + "202104", + "202105", + "202106", + "202107", + "202108", + "202109", + "202110", + "202111", + "202112", + "202113", + "202114", + "202115", + "202116", + "202117", + "202118", + "202119", + "202120", + "202121", + "202122", + "202123", + "202124", + "202125", + "202126", + "202127", + "202128", + "202129", + "202130", + "202131", + "202132", + "202133", + "202134", + "202135", + "202136", + "202137", + "202138", + "202139", + "202140", + "202141", + "202142", + "202143", + "202144", + "202145", + "202146", + "202147", + "202148", + "202149", + "202150", + "202151", + "202152", + "202201", + "202202", + "202203", + "202204", + "202205", + "202206", + "202207", + "202208", + "202209", + "202210", + "202211", + "202212", + "202213", + "202214", + "202215", + "202216", + "202217", + "202218", + "202219", + "202220", + "202221", + "202222", + "202223", + "202224", + "202225", + "202226", + "202227", + "202228", + "202229", + "202230", + "202231", + "202232", + "202233", + "202234", + "202235", + "202236", + "202237", + "202238", + "202239", + "202240", + "202241", + "202242", + "202243", + "202244", + "202245", + "202246", + "202247", + "202248", + "202249", + "202250", + "202251", + "202252", + "202301", + "202302", + "202303", + "202304", + "202305", + "202306", + "202307", + "202308", + "202309", + "202310", + "202311", + "202312", + "202313", + "202314", + "202315", + "202316", + "202317", + "202318", + "202319", + "202320", + "202321", + "202322", + "202323", + "202324", + "202325", + "202326", + "202327", + "202328", + "202329", + "202330", + "202331", + "202332", + "202333", + "202334", + "202335", + "202336", + "202337", + "202338", + "202339", + "202340", + "202341", + "202342", + "202343", + "202344", + "202345", + "202346", + "202347", + "202348", + "202349", + "202350", + "202351", + "202352", + "202401", + "202402", + "202403", + "202404", + "202405", + "202406", + "202407", + "202408", + "202409", + "202410", + "202411", + "202412", + "202413", + "202414", + "202415", + "202416", + "202417", + "202418", + "202419", + "202420", + "202421", + "202422", + "202423", + "202424", + "202425", + "202426", + "202427", + "202428", + "202429", + "202430", + "202431", + "202432", + "202433", + "202434", + "202435", + "202436", + "202437", + "202438", + "202439", + "202440", + "202441", + "202442", + "202443", + "202444", + "202445", + "202446", + "202447" + ], + "y": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + "type": "histogram" + }, + { + "name": "3", + "x": [ + "202032", + "202033", + "202034", + "202035", + "202036", + "202037", + "202038", + "202039", + "202040", + "202041", + "202042", + "202043", + "202044", + "202045", + "202046", + "202047", + "202048", + "202049", + "202050", + "202051", + "202052", + "202053", + "202101", + "202102", + "202103", + "202104", + "202105", + "202106", + "202107", + "202108", + "202109", + "202110", + "202111", + "202112", + "202113", + "202114", + "202115", + "202116", + "202117", + "202118", + "202119", + "202120", + "202121", + "202122", + "202123", + "202124", + "202125", + "202126", + "202127", + "202128", + "202129", + "202130", + "202131", + "202132", + "202133", + "202134", + "202135", + "202136", + "202137", + "202138", + "202139", + "202140", + "202141", + "202142", + "202143", + "202144", + "202145", + "202146", + "202147", + "202148", + "202149", + "202150", + "202151", + "202152", + "202201", + "202202", + "202203", + "202204", + "202205", + "202206", + "202207", + "202208", + "202209", + "202210", + "202211", + "202212", + "202213", + "202214", + "202215", + "202216", + "202217", + "202218", + "202219", + "202220", + "202221", + "202222", + "202223", + "202224", + "202225", + "202226", + "202227", + "202228", + "202229", + "202230", + "202231", + "202232", + "202233", + "202234", + "202235", + "202236", + "202237", + "202238", + "202239", + "202240", + "202241", + "202242", + "202243", + "202244", + "202245", + "202246", + "202247", + "202248", + "202249", + "202250", + "202251", + "202252", + "202301", + "202302", + "202303", + "202304", + "202305", + "202306", + "202307", + "202308", + "202309", + "202310", + "202311", + "202312", + "202313", + "202314", + "202315", + "202316", + "202317", + "202318", + "202319", + "202320", + "202321", + "202322", + "202323", + "202324", + "202325", + "202326", + "202327", + "202328", + "202329", + "202330", + "202331", + "202332", + "202333", + "202334", + "202335", + "202336", + "202337", + "202338", + "202339", + "202340", + "202341", + "202342", + "202343", + "202344", + "202345", + "202346", + "202347", + "202348", + "202349", + "202350", + "202351", + "202352", + "202401", + "202402", + "202403", + "202404", + "202405", + "202406", + "202407", + "202408", + "202409", + "202410", + "202411", + "202412", + "202413", + "202414", + "202415", + "202416", + "202417", + "202418", + "202419", + "202420", + "202421", + "202422", + "202423", + "202424", + "202425", + "202426", + "202427", + "202428", + "202429", + "202430", + "202431", + "202432", + "202433", + "202434", + "202435", + "202436", + "202437", + "202438", + "202439", + "202440", + "202441", + "202442", + "202443", + "202444", + "202445", + "202446", + "202447" + ], + "y": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + "type": "histogram" + }, + { + "name": "10", + "x": [ + "202032", + "202033", + "202034", + "202035", + "202036", + "202037", + "202038", + "202039", + "202040", + "202041", + "202042", + "202043", + "202044", + "202045", + "202046", + "202047", + "202048", + "202049", + "202050", + "202051", + "202052", + "202053", + "202101", + "202102", + "202103", + "202104", + "202105", + "202106", + "202107", + "202108", + "202109", + "202110", + "202111", + "202112", + "202113", + "202114", + "202115", + "202116", + "202117", + "202118", + "202119", + "202120", + "202121", + "202122", + "202123", + "202124", + "202125", + "202126", + "202127", + "202128", + "202129", + "202130", + "202131", + "202132", + "202133", + "202134", + "202135", + "202136", + "202137", + "202138", + "202139", + "202140", + "202141", + "202142", + "202143", + "202144", + "202145", + "202146", + "202147", + "202148", + "202149", + "202150", + "202151", + "202152", + "202201", + "202202", + "202203", + "202204", + "202205", + "202206", + "202207", + "202208", + "202209", + "202210", + "202211", + "202212", + "202213", + "202214", + "202215", + "202216", + "202217", + "202218", + "202219", + "202220", + "202221", + "202222", + "202223", + "202224", + "202225", + "202226", + "202227", + "202228", + "202229", + "202230", + "202231", + "202232", + "202233", + "202234", + "202235", + "202236", + "202237", + "202238", + "202239", + "202240", + "202241", + "202242", + "202243", + "202244", + "202245", + "202246", + "202247", + "202248", + "202249", + "202250", + "202251", + "202252", + "202301", + "202302", + "202303", + "202304", + "202305", + "202306", + "202307", + "202308", + "202309", + "202310", + "202311", + "202312", + "202313", + "202314", + "202315", + "202316", + "202317", + "202318", + "202319", + "202320", + "202321", + "202322", + "202323", + "202324", + "202325", + "202326", + "202327", + "202328", + "202329", + "202330", + "202331", + "202332", + "202333", + "202334", + "202335", + "202336", + "202337", + "202338", + "202339", + "202340", + "202341", + "202342", + "202343", + "202344", + "202345", + "202346", + "202347", + "202348", + "202349", + "202350", + "202351", + "202352", + "202401", + "202402", + "202403", + "202404", + "202405", + "202406", + "202407", + "202408", + "202409", + "202410", + "202411", + "202412", + "202413", + "202414", + "202415", + "202416", + "202417", + "202418", + "202419", + "202420", + "202421", + "202422", + "202423", + "202424", + "202425", + "202426", + "202427", + "202428", + "202429", + "202430", + "202431", + "202432", + "202433", + "202434", + "202435", + "202436", + "202437", + "202438", + "202439", + "202440", + "202441", + "202442", + "202443", + "202444", + "202445", + "202446", + "202447" + ], + "y": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + "type": "histogram" + }, + { + "name": "7", + "x": [ + "202032", + "202033", + "202034", + "202035", + "202036", + "202037", + "202038", + "202039", + "202040", + "202041", + "202042", + "202043", + "202044", + "202045", + "202046", + "202047", + "202048", + "202049", + "202050", + "202051", + "202052", + "202053", + "202101", + "202102", + "202103", + "202104", + "202105", + "202106", + "202107", + "202108", + "202109", + "202110", + "202111", + "202112", + "202113", + "202114", + "202115", + "202116", + "202117", + "202118", + "202119", + "202120", + "202121", + "202122", + "202123", + "202124", + "202125", + "202126", + "202127", + "202128", + "202129", + "202130", + "202131", + "202132", + "202133", + "202134", + "202135", + "202136", + "202137", + "202138", + "202139", + "202140", + "202141", + "202142", + "202143", + "202144", + "202145", + "202146", + "202147", + "202148", + "202149", + "202150", + "202151", + "202152", + "202201", + "202202", + "202203", + "202204", + "202205", + "202206", + "202207", + "202208", + "202209", + "202210", + "202211", + "202212", + "202213", + "202214", + "202215", + "202216", + "202217", + "202218", + "202219", + "202220", + "202221", + "202222", + "202223", + "202224", + "202225", + "202226", + "202227", + "202228", + "202229", + "202230", + "202231", + "202232", + "202233", + "202234", + "202235", + "202236", + "202237", + "202238", + "202239", + "202240", + "202241", + "202242", + "202243", + "202244", + "202245", + "202246", + "202247", + "202248", + "202249", + "202250", + "202251", + "202252", + "202301", + "202302", + "202303", + "202304", + "202305", + "202306", + "202307", + "202308", + "202309", + "202310", + "202311", + "202312", + "202313", + "202314", + "202315", + "202316", + "202317", + "202318", + "202319", + "202320", + "202321", + "202322", + "202323", + "202324", + "202325", + "202326", + "202327", + "202328", + "202329", + "202330", + "202331", + "202332", + "202333", + "202334", + "202335", + "202336", + "202337", + "202338", + "202339", + "202340", + "202341", + "202342", + "202343", + "202344", + "202345", + "202346", + "202347", + "202348", + "202349", + "202350", + "202351", + "202352", + "202401", + "202402", + "202403", + "202404", + "202405", + "202406", + "202407", + "202408", + "202409", + "202410", + "202411", + "202412", + "202413", + "202414", + "202415", + "202416", + "202417", + "202418", + "202419", + "202420", + "202421", + "202422", + "202423", + "202424", + "202425", + "202426", + "202427", + "202428", + "202429", + "202430", + "202431", + "202432", + "202433", + "202434", + "202435", + "202436", + "202437", + "202438", + "202439", + "202440", + "202441", + "202442", + "202443", + "202444", + "202445", + "202446", + "202447" + ], + "y": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + "type": "histogram" + } + ], + "layout": { + "template": { + "data": { + "histogram2dcontour": [ + { + "type": "histogram2dcontour", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0.0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1.0, + "#f0f921" + ] + ] + } + ], + "choropleth": [ + { + "type": "choropleth", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + ], + "histogram2d": [ + { + "type": "histogram2d", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0.0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1.0, + "#f0f921" + ] + ] + } + ], + "heatmap": [ + { + "type": "heatmap", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0.0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1.0, + "#f0f921" + ] + ] + } + ], + "heatmapgl": [ + { + "type": "heatmapgl", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0.0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1.0, + "#f0f921" + ] + ] + } + ], + "contourcarpet": [ + { + "type": "contourcarpet", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + ], + "contour": [ + { + "type": "contour", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0.0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1.0, + "#f0f921" + ] + ] + } + ], + "surface": [ + { + "type": "surface", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0.0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1.0, + "#f0f921" + ] + ] + } + ], + "mesh3d": [ + { + "type": "mesh3d", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + ], + "scatter": [ + { + "marker": { + "line": { + "color": "#283442" + } + }, + "type": "scatter" + } + ], + "parcoords": [ + { + "type": "parcoords", + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + } + ], + "scatterpolargl": [ + { + "type": "scatterpolargl", + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + } + ], + "bar": [ + { + "error_x": { + "color": "#f2f5fa" + }, + "error_y": { + "color": "#f2f5fa" + }, + "marker": { + "line": { + "color": "rgb(17,17,17)", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "scattergeo": [ + { + "type": "scattergeo", + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + } + ], + "scatterpolar": [ + { + "type": "scatterpolar", + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + } + ], + "histogram": [ + { + "marker": { + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "histogram" + } + ], + "scattergl": [ + { + "marker": { + "line": { + "color": "#283442" + } + }, + "type": "scattergl" + } + ], + "scatter3d": [ + { + "type": "scatter3d", + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + } + ], + "scattermapbox": [ + { + "type": "scattermapbox", + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + } + ], + "scatterternary": [ + { + "type": "scatterternary", + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + } + ], + "scattercarpet": [ + { + "type": "scattercarpet", + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "#A2B1C6", + "gridcolor": "#506784", + "linecolor": "#506784", + "minorgridcolor": "#506784", + "startlinecolor": "#A2B1C6" + }, + "baxis": { + "endlinecolor": "#A2B1C6", + "gridcolor": "#506784", + "linecolor": "#506784", + "minorgridcolor": "#506784", + "startlinecolor": "#A2B1C6" + }, + "type": "carpet" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "#506784" + }, + "line": { + "color": "rgb(17,17,17)" + } + }, + "header": { + "fill": { + "color": "#2a3f5f" + }, + "line": { + "color": "rgb(17,17,17)" + } + }, + "type": "table" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "rgb(17,17,17)", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ] + }, + "layout": { + "autotypenumbers": "strict", + "colorway": [ + "#636efa", + "#EF553B", + "#00cc96", + "#ab63fa", + "#FFA15A", + "#19d3f3", + "#FF6692", + "#B6E880", + "#FF97FF", + "#FECB52" + ], + "font": { + "color": "#f2f5fa" + }, + "hovermode": "closest", + "hoverlabel": { + "align": "left" + }, + "paper_bgcolor": "rgb(17,17,17)", + "plot_bgcolor": "rgb(17,17,17)", + "polar": { + "bgcolor": "rgb(17,17,17)", + "angularaxis": { + "gridcolor": "#506784", + "linecolor": "#506784", + "ticks": "" + }, + "radialaxis": { + "gridcolor": "#506784", + "linecolor": "#506784", + "ticks": "" + } + }, + "ternary": { + "bgcolor": "rgb(17,17,17)", + "aaxis": { + "gridcolor": "#506784", + "linecolor": "#506784", + "ticks": "" + }, + "baxis": { + "gridcolor": "#506784", + "linecolor": "#506784", + "ticks": "" + }, + "caxis": { + "gridcolor": "#506784", + "linecolor": "#506784", + "ticks": "" + } + }, + "coloraxis": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "colorscale": { + "sequential": [ + [ + 0.0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1.0, + "#f0f921" + ] + ], + "sequentialminus": [ + [ + 0.0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1.0, + "#f0f921" + ] + ], + "diverging": [ + [ + 0, + "#8e0152" + ], + [ + 0.1, + "#c51b7d" + ], + [ + 0.2, + "#de77ae" + ], + [ + 0.3, + "#f1b6da" + ], + [ + 0.4, + "#fde0ef" + ], + [ + 0.5, + "#f7f7f7" + ], + [ + 0.6, + "#e6f5d0" + ], + [ + 0.7, + "#b8e186" + ], + [ + 0.8, + "#7fbc41" + ], + [ + 0.9, + "#4d9221" + ], + [ + 1, + "#276419" + ] + ] + }, + "xaxis": { + "gridcolor": "#283442", + "linecolor": "#506784", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "#283442", + "automargin": true, + "zerolinewidth": 2 + }, + "yaxis": { + "gridcolor": "#283442", + "linecolor": "#506784", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "#283442", + "automargin": true, + "zerolinewidth": 2 + }, + "scene": { + "xaxis": { + "backgroundcolor": "rgb(17,17,17)", + "gridcolor": "#506784", + "linecolor": "#506784", + "showbackground": true, + "ticks": "", + "zerolinecolor": "#C8D4E3", + "gridwidth": 2 + }, + "yaxis": { + "backgroundcolor": "rgb(17,17,17)", + "gridcolor": "#506784", + "linecolor": "#506784", + "showbackground": true, + "ticks": "", + "zerolinecolor": "#C8D4E3", + "gridwidth": 2 + }, + "zaxis": { + "backgroundcolor": "rgb(17,17,17)", + "gridcolor": "#506784", + "linecolor": "#506784", + "showbackground": true, + "ticks": "", + "zerolinecolor": "#C8D4E3", + "gridwidth": 2 + } + }, + "shapedefaults": { + "line": { + "color": "#f2f5fa" + } + }, + "annotationdefaults": { + "arrowcolor": "#f2f5fa", + "arrowhead": 0, + "arrowwidth": 1 + }, + "geo": { + "bgcolor": "rgb(17,17,17)", + "landcolor": "rgb(17,17,17)", + "subunitcolor": "#506784", + "showland": true, + "showlakes": true, + "lakecolor": "rgb(17,17,17)" + }, + "title": { + "x": 0.05 + }, + "updatemenudefaults": { + "bgcolor": "#506784", + "borderwidth": 0 + }, + "sliderdefaults": { + "bgcolor": "#C8D4E3", + "borderwidth": 1, + "bordercolor": "rgb(17,17,17)", + "tickwidth": 0 + }, + "mapbox": { + "style": "dark" + } + } + }, + "title": { + "text": "hhs NHSN row count over time" + }, + "barmode": "stack" + }, + "config": { + "plotlyServerURL": "https://plot.ly" + } + }, + "text/html": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "execution_count": 52 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-12-06T17:35:17.610585Z", + "start_time": "2024-12-06T17:35:17.110549Z" + } + }, + "cell_type": "code", + "source": [ + "pathogen_mapping = {\"flu\": \"influenza\", \"covid\": \"covid\"}\n", + "pathogen = \"covid\"\n", + "prelim_flag = False\n", + "geo = \"nation\"\n", + "val_cutoff = 100\n", + "percent_cutoff = 30\n", + "\n", + "\n", + "nhsn_df = get_nhsn_df(geo, pathogen).sort_values(by=\"time_value\")\n", + "hhs_df = get_hhs_df(geo, pathogen_mapping[pathogen]).sort_values(by=\"time_value\")\n", + "\n", + "plot_timeplot(nhsn_df, pathogen, prelim_flag, geo, y_col=\"val\", download=False)\n" + ], + "id": "8b2d28e0592f8398", + "outputs": [ + { + "data": { + "application/vnd.plotly.v1+json": { + "data": [ + { + "mode": "lines", + "name": "Time Series", + "x": [ + "202032", + "202033", + "202034", + "202035", + "202036", + "202037", + "202038", + "202039", + "202040", + "202041", + "202042", + "202043", + "202044", + "202045", + "202046", + "202047", + "202048", + "202049", + "202050", + "202051", + "202052", + "202053", + "202101", + "202102", + "202103", + "202104", + "202105", + "202106", + "202107", + "202108", + "202109", + "202110", + "202111", + "202112", + "202113", + "202114", + "202115", + "202116", + "202117", + "202118", + "202119", + "202120", + "202121", + "202122", + "202123", + "202124", + "202125", + "202126", + "202127", + "202128", + "202129", + "202130", + "202131", + "202132", + "202133", + "202134", + "202135", + "202136", + "202137", + "202138", + "202139", + "202140", + "202141", + "202142", + "202143", + "202144", + "202145", + "202146", + "202147", + "202148", + "202149", + "202150", + "202151", + "202152", + "202201", + "202202", + "202203", + "202204", + "202205", + "202206", + "202207", + "202208", + "202209", + "202210", + "202211", + "202212", + "202213", + "202214", + "202215", + "202216", + "202217", + "202218", + "202219", + "202220", + "202221", + "202222", + "202223", + "202224", + "202225", + "202226", + "202227", + "202228", + "202229", + "202230", + "202231", + "202232", + "202233", + "202234", + "202235", + "202236", + "202237", + "202238", + "202239", + "202240", + "202241", + "202242", + "202243", + "202244", + "202245", + "202246", + "202247", + "202248", + "202249", + "202250", + "202251", + "202252", + "202301", + "202302", + "202303", + "202304", + "202305", + "202306", + "202307", + "202308", + "202309", + "202310", + "202311", + "202312", + "202313", + "202314", + "202315", + "202316", + "202317", + "202318", + "202319", + "202320", + "202321", + "202322", + "202323", + "202324", + "202325", + "202326", + "202327", + "202328", + "202329", + "202330", + "202331", + "202332", + "202333", + "202334", + "202335", + "202336", + "202337", + "202338", + "202339", + "202340", + "202341", + "202342", + "202343", + "202344", + "202345", + "202346", + "202347", + "202348", + "202349", + "202350", + "202351", + "202352", + "202401", + "202402", + "202403", + "202404", + "202405", + "202406", + "202407", + "202408", + "202409", + "202410", + "202411", + "202412", + "202413", + "202414", + "202415", + "202416", + "202417", + "202418", + "202419", + "202420", + "202421", + "202422", + "202423", + "202424", + "202425", + "202426", + "202427", + "202428", + "202429", + "202430", + "202431", + "202432", + "202433", + "202434", + "202435", + "202436", + "202437", + "202438", + "202439", + "202440", + "202441", + "202442", + "202443", + "202444", + "202445", + "202446", + "202447" + ], + "y": [ + 39044.0, + 36630.0, + 36884.0, + 35479.0, + 32862.0, + 29806.0, + 27753.0, + 27983.0, + 31764.0, + 37341.0, + 40762.0, + 45768.0, + 50681.0, + 59181.0, + 74354.0, + 86620.0, + 91099.0, + 101861.0, + 108114.0, + 112537.0, + 113135.0, + 120582.0, + 127805.0, + 119444.0, + 105947.0, + 90412.0, + 77985.0, + 63688.0, + 51376.0, + 46648.0, + 39252.0, + 37692.0, + 36491.0, + 37993.0, + 39616.0, + 42289.0, + 44057.0, + 41785.0, + 37591.0, + 33309.0, + 28365.0, + 25158.0, + 22611.0, + 18465.0, + 16434.0, + 14744.0, + 13889.0, + 15195.0, + 18552.0, + 25131.0, + 36160.0, + 52828.0, + 70899.0, + 85855.0, + 92944.0, + 94588.0, + 93239.0, + 88158.0, + 79162.0, + 67736.0, + 58072.0, + 51742.0, + 45975.0, + 41499.0, + 38325.0, + 36374.0, + 39216.0, + 42109.0, + 44641.0, + 51335.0, + 56785.0, + 56180.0, + 62906.0, + 101068.0, + 141463.0, + 156308.0, + 146731.0, + 129555.0, + 100498.0, + 74568.0, + 51731.0, + 36090.0, + 26373.0, + 19997.0, + 15090.0, + 12245.0, + 11223.0, + 10749.0, + 11510.0, + 13057.0, + 15164.0, + 18535.0, + 21401.0, + 25345.0, + 27447.0, + 29181.0, + 30750.0, + 31794.0, + 34117.0, + 37635.0, + 40932.0, + 44777.0, + 47330.0, + 46511.0, + 46285.0, + 43438.0, + 40569.0, + 39210.0, + 36675.0, + 33410.0, + 30546.0, + 28167.0, + 26185.0, + 24808.0, + 24056.0, + 24129.0, + 24409.0, + 25577.0, + 29429.0, + 25298.0, + 27713.0, + 35801.0, + 36585.0, + 38964.0, + 40405.0, + 45810.0, + 45571.0, + 38762.0, + 32565.0, + 29089.0, + 27269.0, + 26945.0, + 26105.0, + 24737.0, + 23149.0, + 20871.0, + 18987.0, + 17906.0, + 16399.0, + 14934.0, + 13794.0, + 12262.0, + 10475.0, + 10190.0, + 10159.0, + 8827.0, + 8197.0, + 7822.0, + 7472.0, + 7005.0, + 6716.0, + 6853.0, + 6990.0, + 7624.0, + 8394.0, + 9501.0, + 11190.0, + 13533.0, + 16686.0, + 19694.0, + 21025.0, + 22621.0, + 21897.0, + 20754.0, + 19618.0, + 18362.0, + 17516.0, + 16756.0, + 16613.0, + 15797.0, + 18182.0, + 18949.0, + 20720.0, + 24502.0, + 25121.0, + 26842.0, + 31196.0, + 36633.0, + 37777.0, + 33734.0, + 28270.0, + 25254.0, + 23070.0, + 22341.0, + 21358.0, + 19539.0, + 17167.0, + 14900.0, + 12001.0, + 10386.0, + 8946.0, + 8209.0, + 7286.0, + 6414.0, + 5803.0, + 3842.0, + 2408.0, + 2231.0, + 2291.0, + 2358.0, + 2590.0, + 2943.0, + 3473.0, + 3848.0, + 5042.0, + 5669.0, + 6261.0, + 7047.0, + 7417.0, + 7767.0, + 7978.0, + 8008.0, + 7757.0, + 7327.0, + 6894.0, + 6184.0, + 5339.0, + 4197.0, + 1955.0, + 2064.0, + 2928.0, + 4612.0, + 7694.0, + 7574.0, + 7653.0 + ], + "type": "scatter" + } + ], + "layout": { + "template": { + "data": { + "histogram2dcontour": [ + { + "type": "histogram2dcontour", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0.0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1.0, + "#f0f921" + ] + ] + } + ], + "choropleth": [ + { + "type": "choropleth", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + ], + "histogram2d": [ + { + "type": "histogram2d", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0.0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1.0, + "#f0f921" + ] + ] + } + ], + "heatmap": [ + { + "type": "heatmap", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0.0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1.0, + "#f0f921" + ] + ] + } + ], + "heatmapgl": [ + { + "type": "heatmapgl", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0.0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1.0, + "#f0f921" + ] + ] + } + ], + "contourcarpet": [ + { + "type": "contourcarpet", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + ], + "contour": [ + { + "type": "contour", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0.0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1.0, + "#f0f921" + ] + ] + } + ], + "surface": [ + { + "type": "surface", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0.0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1.0, + "#f0f921" + ] + ] + } + ], + "mesh3d": [ + { + "type": "mesh3d", + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + ], + "scatter": [ + { + "marker": { + "line": { + "color": "#283442" + } + }, + "type": "scatter" + } + ], + "parcoords": [ + { + "type": "parcoords", + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + } + ], + "scatterpolargl": [ + { + "type": "scatterpolargl", + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + } + ], + "bar": [ + { + "error_x": { + "color": "#f2f5fa" + }, + "error_y": { + "color": "#f2f5fa" + }, + "marker": { + "line": { + "color": "rgb(17,17,17)", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "scattergeo": [ + { + "type": "scattergeo", + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + } + ], + "scatterpolar": [ + { + "type": "scatterpolar", + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + } + ], + "histogram": [ + { + "marker": { + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "histogram" + } + ], + "scattergl": [ + { + "marker": { + "line": { + "color": "#283442" + } + }, + "type": "scattergl" + } + ], + "scatter3d": [ + { + "type": "scatter3d", + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + } + ], + "scattermapbox": [ + { + "type": "scattermapbox", + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + } + ], + "scatterternary": [ + { + "type": "scatterternary", + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + } + ], + "scattercarpet": [ + { + "type": "scattercarpet", + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + } + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "#A2B1C6", + "gridcolor": "#506784", + "linecolor": "#506784", + "minorgridcolor": "#506784", + "startlinecolor": "#A2B1C6" + }, + "baxis": { + "endlinecolor": "#A2B1C6", + "gridcolor": "#506784", + "linecolor": "#506784", + "minorgridcolor": "#506784", + "startlinecolor": "#A2B1C6" + }, + "type": "carpet" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "#506784" + }, + "line": { + "color": "rgb(17,17,17)" + } + }, + "header": { + "fill": { + "color": "#2a3f5f" + }, + "line": { + "color": "rgb(17,17,17)" + } + }, + "type": "table" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "rgb(17,17,17)", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ] + }, + "layout": { + "autotypenumbers": "strict", + "colorway": [ + "#636efa", + "#EF553B", + "#00cc96", + "#ab63fa", + "#FFA15A", + "#19d3f3", + "#FF6692", + "#B6E880", + "#FF97FF", + "#FECB52" + ], + "font": { + "color": "#f2f5fa" + }, + "hovermode": "closest", + "hoverlabel": { + "align": "left" + }, + "paper_bgcolor": "rgb(17,17,17)", + "plot_bgcolor": "rgb(17,17,17)", + "polar": { + "bgcolor": "rgb(17,17,17)", + "angularaxis": { + "gridcolor": "#506784", + "linecolor": "#506784", + "ticks": "" + }, + "radialaxis": { + "gridcolor": "#506784", + "linecolor": "#506784", + "ticks": "" + } + }, + "ternary": { + "bgcolor": "rgb(17,17,17)", + "aaxis": { + "gridcolor": "#506784", + "linecolor": "#506784", + "ticks": "" + }, + "baxis": { + "gridcolor": "#506784", + "linecolor": "#506784", + "ticks": "" + }, + "caxis": { + "gridcolor": "#506784", + "linecolor": "#506784", + "ticks": "" + } + }, + "coloraxis": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "colorscale": { + "sequential": [ + [ + 0.0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1.0, + "#f0f921" + ] + ], + "sequentialminus": [ + [ + 0.0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1.0, + "#f0f921" + ] + ], + "diverging": [ + [ + 0, + "#8e0152" + ], + [ + 0.1, + "#c51b7d" + ], + [ + 0.2, + "#de77ae" + ], + [ + 0.3, + "#f1b6da" + ], + [ + 0.4, + "#fde0ef" + ], + [ + 0.5, + "#f7f7f7" + ], + [ + 0.6, + "#e6f5d0" + ], + [ + 0.7, + "#b8e186" + ], + [ + 0.8, + "#7fbc41" + ], + [ + 0.9, + "#4d9221" + ], + [ + 1, + "#276419" + ] + ] + }, + "xaxis": { + "gridcolor": "#283442", + "linecolor": "#506784", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "#283442", + "automargin": true, + "zerolinewidth": 2 + }, + "yaxis": { + "gridcolor": "#283442", + "linecolor": "#506784", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "#283442", + "automargin": true, + "zerolinewidth": 2 + }, + "scene": { + "xaxis": { + "backgroundcolor": "rgb(17,17,17)", + "gridcolor": "#506784", + "linecolor": "#506784", + "showbackground": true, + "ticks": "", + "zerolinecolor": "#C8D4E3", + "gridwidth": 2 + }, + "yaxis": { + "backgroundcolor": "rgb(17,17,17)", + "gridcolor": "#506784", + "linecolor": "#506784", + "showbackground": true, + "ticks": "", + "zerolinecolor": "#C8D4E3", + "gridwidth": 2 + }, + "zaxis": { + "backgroundcolor": "rgb(17,17,17)", + "gridcolor": "#506784", + "linecolor": "#506784", + "showbackground": true, + "ticks": "", + "zerolinecolor": "#C8D4E3", + "gridwidth": 2 + } + }, + "shapedefaults": { + "line": { + "color": "#f2f5fa" + } + }, + "annotationdefaults": { + "arrowcolor": "#f2f5fa", + "arrowhead": 0, + "arrowwidth": 1 + }, + "geo": { + "bgcolor": "rgb(17,17,17)", + "landcolor": "rgb(17,17,17)", + "subunitcolor": "#506784", + "showland": true, + "showlakes": true, + "lakecolor": "rgb(17,17,17)" + }, + "title": { + "x": 0.05 + }, + "updatemenudefaults": { + "bgcolor": "#506784", + "borderwidth": 0 + }, + "sliderdefaults": { + "bgcolor": "#C8D4E3", + "borderwidth": 1, + "bordercolor": "rgb(17,17,17)", + "tickwidth": 0 + }, + "mapbox": { + "style": "dark" + } + } + }, + "title": { + "text": "nation NHSN value over time" + } + }, + "config": { + "plotlyServerURL": "https://plot.ly" + } + }, + "text/html": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "execution_count": 55 + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/nhsn/params.json.template b/nhsn/params.json.template new file mode 100644 index 000000000..0c9d42f66 --- /dev/null +++ b/nhsn/params.json.template @@ -0,0 +1,30 @@ +{ + "common": { + "export_dir": "./receiving", + "log_filename": "nhsn.log", + "backup_dir": "./raw_data_backups" + + }, + "indicator": { + "wip_signal": true, + "export_start_date": "2020-08-01", + "static_file_dir": "./static", + "socrata_token": "" + }, + "validation": { + "common": { + "data_source": "nhsn", + "span_length": 14, + "min_expected_lag": {"all": "1"}, + "max_expected_lag": {"all": "3"}, + "dry_run": true, + "suppressed_errors": [] + }, + "static": { + "minimum_sample_size": 0, + "missing_se_allowed": true, + "missing_sample_size_allowed": true + }, + "dynamic": {} + } +} diff --git a/nhsn/raw_data_backups/.gitignore b/nhsn/raw_data_backups/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/nhsn/receiving/.gitignore b/nhsn/receiving/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/nhsn/setup.py b/nhsn/setup.py new file mode 100644 index 000000000..d7dabe241 --- /dev/null +++ b/nhsn/setup.py @@ -0,0 +1,32 @@ +from setuptools import setup +from setuptools import find_packages + +required = [ + "numpy", + "pandas", + "pydocstyle", + "pytest", + "pytest-cov", + "pylint==2.8.3", + "delphi-utils", + "sodapy", + "epiweeks", + "freezegun", + "us", +] + +setup( + name="delphi_nhsn", + version="0.1.0", + description="Indicators NHSN Hospital Respiratory Data", + author="", + author_email="", + url="https://github.com/cmu-delphi/covidcast-indicators", + install_requires=required, + classifiers=[ + "Development Status :: 1 - Planning", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3.8", + ], + packages=find_packages(), +) diff --git a/nhsn/static/.gitignore b/nhsn/static/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/nhsn/tests/backups/.gitignore b/nhsn/tests/backups/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/nhsn/tests/conftest.py b/nhsn/tests/conftest.py new file mode 100644 index 000000000..525d8ae7e --- /dev/null +++ b/nhsn/tests/conftest.py @@ -0,0 +1,73 @@ +import copy +import json +from unittest.mock import patch + +import pytest +from pathlib import Path + +from delphi_nhsn.run import run_module + +TEST_DIR = Path(__file__).parent + +# test data generated with following url with socrata: +# https://data.cdc.gov/resource/ua7e-t2fy.json?$where=weekendingdate%20between%20%272021-08-19T00:00:00.000%27%20and%20%272021-10-19T00:00:00.000%27%20and%20jurisdiction%20in(%27CO%27,%27USA%27) +# preliminary source +# https://data.cdc.gov/resource/mpgq-jmmr.json?$where=weekendingdate%20between%20%272021-08-19T00:00:00.000%27%20and%20%272021-10-19T00:00:00.000%27%20and%20jurisdiction%20in(%27CO%27,%27USA%27) +# queries the nhsn data with timestamp (2021-08-19, 2021-10-19) with CO and USA data + + +with open("test_data/page.json", "r") as f: + TEST_DATA = json.load(f) + +with open("test_data/prelim_page.json", "r") as f: + PRELIM_TEST_DATA = json.load(f) + +@pytest.fixture(scope="session") +def params(): + params = { + "common": { + "export_dir": f"{TEST_DIR}/receiving", + "log_filename": f"{TEST_DIR}/test.log", + "backup_dir": f"{TEST_DIR}/backups", + "custom_run": False + }, + "indicator": { + "wip_signal": True, + "export_start_date": "2020-08-01", + "static_file_dir": "./static", + "socrata_token": "test_token" + }, + "validation": { + "common": { + "span_length": 14, + "min_expected_lag": {"all": "3"}, + "max_expected_lag": {"all": "4"}, + } + } + } + return copy.deepcopy(params) + +@pytest.fixture +def params_w_patch(params): + params_copy = copy.deepcopy(params) + params_copy["patch"] = { + "start_issue": "2024-06-27", + "end_issue": "2024-06-29", + "patch_dir": "./patch_dir" + } + return params_copy + +@pytest.fixture(scope="function") +def run_as_module(params): + with patch('sodapy.Socrata.get') as mock_get: + def side_effect(*args, **kwargs): + if kwargs['offset'] == 0: + if "ua7e-t2fy" in args[0]: + return TEST_DATA + if "mpgq-jmmr" in args[0]: + return PRELIM_TEST_DATA + else: + return [] + mock_get.side_effect = side_effect + run_module(params) + diff --git a/nhsn/tests/receiving/.gitignore b/nhsn/tests/receiving/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/nhsn/tests/test_data/page.json b/nhsn/tests/test_data/page.json new file mode 100644 index 000000000..749147244 --- /dev/null +++ b/nhsn/tests/test_data/page.json @@ -0,0 +1,2126 @@ +[ + { + "weekendingdate": "2021-08-21T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10282.71", + "numinptbedsadult": "9090.29", + "numinptbedsped": "742.29", + "numinptbedsocc": "7004.43", + "numinptbedsoccadult": "6343.0", + "numinptbedsoccped": "247.71", + "numicubeds": "1868.0", + "numicubedsadult": "1336.71", + "numicubedsped": "366.71", + "numicubedsocc": "1253.14", + "numicubedsoccadult": "961.0", + "numicubedsoccped": "135.29", + "numconfc19hosppatsadult": "590.71", + "numconfc19hosppatsped": "9.43", + "totalconfc19hosppats": "600.14", + "totalconffluhosppats": "0.0", + "numconfc19icupatsadult": "232.43", + "totalconfc19icupats": "232.43", + "totalconffluicupats": "0.0", + "totalconfc19newadmped": "34.0", + "numconfc19newadmadult18to49": "291.0", + "totalconfc19newadmadult": "818.0", + "numconfc19newadmunk": "2.0", + "totalconfc19newadm": "852.0", + "totalconfflunewadm": "0.0", + "pctinptbedsocc": "0.6812", + "pctconfc19inptbeds": "0.0584", + "pctconffluinptbeds": "0.0", + "pcticubedsocc": "0.6708", + "pctconfc19icubeds": "0.1244", + "pctconffluicubeds": "0.0", + "pctconfc19newadmadult": "0.9601", + "pctconfc19newadmped": "0.0399", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "92.93", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "78.79", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-08-21T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "750150.99", + "numinptbedsadult": "679540.51", + "numinptbedsped": "51335.02", + "numinptbedsocc": "572345.09", + "numinptbedsoccadult": "526399.17", + "numinptbedsoccped": "32810.36", + "numicubeds": "120768.79", + "numicubedsadult": "91030.4", + "numicubedsped": "21419.35", + "numicubedsocc": "89853.28", + "numicubedsoccadult": "70595.31", + "numicubedsoccped": "14112.02", + "numconfc19hosppatsadult": "92782.24", + "numconfc19hosppatsped": "1268.64", + "totalconfc19hosppats": "94050.88", + "totalconffluhosppats": "292.67", + "numconfc19icupatsadult": "24692.91", + "totalconfc19icupats": "24692.91", + "totalconffluicupats": "45.57", + "totalconfc19newadmped": "2170.0", + "numconfc19newadmadult18to49": "27365.0", + "totalconfc19newadmadult": "90776.0", + "numconfc19newadmunk": "4827.0", + "totalconfc19newadm": "92946.0", + "totalconfflunewadm": "280.0", + "pctinptbedsocc": "0.763", + "pctconfc19inptbeds": "0.1254", + "pctconffluinptbeds": "0.0004", + "pcticubedsocc": "0.744", + "pctconfc19icubeds": "0.2045", + "pctconffluicubeds": "0.0004", + "pctconfc19newadmadult": "0.9767", + "pctconfc19newadmped": "0.0233", + "numinptbedshosprep": "5396", + "numinptbedsocchosprep": "5396", + "numicubedshosprep": "5396", + "numicubedsocchosprep": "5396", + "totalconfc19hosppatshosprep": "5393", + "totalconffluhosppatshosprep": "4417", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5393", + "totalconffluicupatshosprep": "4415", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5276", + "totalconfc19newadmadulthosprep": "5392", + "totalconfc19newadmhosprep": "5392", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4415", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5396", + "pcticubedsocchosprep": "5396", + "pctconfc19inptbedshosprep": "5393", + "pctconffluinptbedshosprep": "4417", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5393", + "pctconffluicubedshosprep": "4415", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9492", + "numinptbedsoccperchosprep": "0.9492", + "numicubedsperchosprep": "0.9492", + "numicubedsoccperchosprep": "0.9492", + "totalconfc19hosppatsperc": "0.9486", + "totalconffluhosppatsperc": "0.777", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9486", + "totalconffluicupatsperchosprep": "0.7766", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9281", + "totalconfc19newadmadultp": "0.9485", + "totalconfc19newadmperchosprep": "94.85", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "77.66", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9492", + "pcticubedsoccperchosprep": "0.9492", + "pctconfc19inptbedsperchosprep": "0.9486", + "pctconffluinptbedsperchosprep": "0.777", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9486", + "pctconffluicubedsperchosprep": "0.7766", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.07", + "numinptbedsoccperchospre": "0.07", + "numicubedsperchosprepabschg": "0.07", + "numicubedsoccperchosprepabschg": "0.07", + "totalconfc19hosppatsperc_1": "0.07", + "totalconffluhosppatsperc_1": "0.14", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.07", + "totalconffluicupatsperch": "0.19", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.07", + "totalconfc19newadmadultp_1": "0.07", + "totalconfc19newadmpercho": "0.07", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.16", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0007", + "pcticubedsoccperchosprepabschg": "0.0007", + "pctconfc19inptbedspercho": "0.0007", + "pctconffluinptbedspercho": "0.0014", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0007", + "pctconffluicubedsperchos": "0.0019", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-08-28T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10325.86", + "numinptbedsadult": "9081.29", + "numinptbedsped": "792.14", + "numinptbedsocc": "7014.88", + "numinptbedsoccadult": "6343.88", + "numinptbedsoccped": "267.14", + "numicubeds": "1871.43", + "numicubedsadult": "1332.57", + "numicubedsped": "372.71", + "numicubedsocc": "1271.07", + "numicubedsoccadult": "974.21", + "numicubedsoccped": "135.14", + "numconfc19hosppatsadult": "667.52", + "numconfc19hosppatsped": "13.57", + "totalconfc19hosppats": "681.1", + "totalconffluhosppats": "0.14", + "numconfc19icupatsadult": "270.48", + "totalconfc19icupats": "270.48", + "totalconffluicupats": "0.0", + "totalconfc19newadmped": "29.0", + "numconfc19newadmadult18to49": "303.0", + "totalconfc19newadmadult": "806.0", + "numconfc19newadmunk": "3.0", + "totalconfc19newadm": "835.0", + "totalconfflunewadm": "1.0", + "pctinptbedsocc": "0.6794", + "pctconfc19inptbeds": "0.066", + "pctconffluinptbeds": "0.0", + "pcticubedsocc": "0.6792", + "pctconfc19icubeds": "0.1445", + "pctconffluicubeds": "0.0", + "pctconfc19newadmadult": "0.9653", + "pctconfc19newadmped": "0.0347", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "92.93", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "78.79", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-08-28T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "746800.48", + "numinptbedsadult": "675884.36", + "numinptbedsped": "51791.88", + "numinptbedsocc": "573492.92", + "numinptbedsoccadult": "527355.92", + "numinptbedsoccped": "33078.85", + "numicubeds": "119528.11", + "numicubedsadult": "91033.85", + "numicubedsped": "21257.74", + "numicubedsocc": "91262.45", + "numicubedsoccadult": "72164.42", + "numicubedsoccped": "13993.38", + "numconfc19hosppatsadult": "101087.27", + "numconfc19hosppatsped": "1396.21", + "totalconfc19hosppats": "102483.48", + "totalconffluhosppats": "288.3", + "numconfc19icupatsadult": "27299.54", + "totalconfc19icupats": "27299.54", + "totalconffluicupats": "57.86", + "totalconfc19newadmped": "2427.0", + "numconfc19newadmadult18to49": "27003.0", + "totalconfc19newadmadult": "92169.0", + "numconfc19newadmunk": "5004.0", + "totalconfc19newadm": "94596.0", + "totalconfflunewadm": "262.0", + "pctinptbedsocc": "0.7679", + "pctconfc19inptbeds": "0.1372", + "pctconffluinptbeds": "0.0004", + "pcticubedsocc": "0.7635", + "pctconfc19icubeds": "0.2284", + "pctconffluicubeds": "0.0005", + "pctconfc19newadmadult": "0.9743", + "pctconfc19newadmped": "0.0257", + "numinptbedshosprep": "5395", + "numinptbedsocchosprep": "5395", + "numicubedshosprep": "5395", + "numicubedsocchosprep": "5395", + "totalconfc19hosppatshosprep": "5392", + "totalconffluhosppatshosprep": "4401", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5392", + "totalconffluicupatshosprep": "4398", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5275", + "totalconfc19newadmadulthosprep": "5391", + "totalconfc19newadmhosprep": "5391", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4397", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5395", + "pcticubedsocchosprep": "5395", + "pctconfc19inptbedshosprep": "5392", + "pctconffluinptbedshosprep": "4401", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5392", + "pctconffluicubedshosprep": "4398", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.949", + "numinptbedsoccperchosprep": "0.949", + "numicubedsperchosprep": "0.949", + "numicubedsoccperchosprep": "0.949", + "totalconfc19hosppatsperc": "0.9485", + "totalconffluhosppatsperc": "0.7741", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9485", + "totalconffluicupatsperchosprep": "0.7736", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9279", + "totalconfc19newadmadultp": "0.9483", + "totalconfc19newadmperchosprep": "94.83", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "77.34", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.949", + "pcticubedsoccperchosprep": "0.949", + "pctconfc19inptbedsperchosprep": "0.9485", + "pctconffluinptbedsperchosprep": "0.7741", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9485", + "pctconffluicubedsperchosprep": "0.7736", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "-0.02", + "numinptbedsoccperchospre": "-0.02", + "numicubedsperchosprepabschg": "-0.02", + "numicubedsoccperchosprepabschg": "-0.02", + "totalconfc19hosppatsperc_1": "-0.02", + "totalconffluhosppatsperc_1": "-0.28", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "-0.02", + "totalconffluicupatsperch": "-0.3", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "-0.02", + "totalconfc19newadmadultp_1": "-0.02", + "totalconfc19newadmpercho": "-0.02", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "-0.32", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "-0.0002", + "pcticubedsoccperchosprepabschg": "-0.0002", + "pctconfc19inptbedspercho": "-0.0002", + "pctconffluinptbedspercho": "-0.0028", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "-0.0002", + "pctconffluicubedsperchos": "-0.003", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-09-04T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10361.86", + "numinptbedsadult": "9163.57", + "numinptbedsped": "744.43", + "numinptbedsocc": "7160.86", + "numinptbedsoccadult": "6415.29", + "numinptbedsoccped": "328.0", + "numicubeds": "1939.71", + "numicubedsadult": "1400.0", + "numicubedsped": "370.43", + "numicubedsocc": "1307.29", + "numicubedsoccadult": "983.71", + "numicubedsoccped": "154.29", + "numconfc19hosppatsadult": "795.29", + "numconfc19hosppatsped": "16.43", + "totalconfc19hosppats": "811.71", + "totalconffluhosppats": "0.86", + "numconfc19icupatsadult": "303.14", + "totalconfc19icupats": "303.14", + "totalconffluicupats": "0.43", + "totalconfc19newadmped": "38.0", + "numconfc19newadmadult18to49": "346.0", + "totalconfc19newadmadult": "962.0", + "numconfc19newadmunk": "1.0", + "totalconfc19newadm": "1000.0", + "totalconfflunewadm": "3.0", + "pctinptbedsocc": "0.6911", + "pctconfc19inptbeds": "0.0783", + "pctconffluinptbeds": "0.0001", + "pcticubedsocc": "0.674", + "pctconfc19icubeds": "0.1563", + "pctconffluicubeds": "0.0002", + "pctconfc19newadmadult": "0.962", + "pctconfc19newadmped": "0.038", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "92.93", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "78.79", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-09-04T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "744845.48", + "numinptbedsadult": "674286.14", + "numinptbedsped": "49228.93", + "numinptbedsocc": "571971.34", + "numinptbedsoccadult": "525311.57", + "numinptbedsoccped": "32162.6", + "numicubeds": "119670.24", + "numicubedsadult": "91266.24", + "numicubedsped": "20645.68", + "numicubedsocc": "92231.82", + "numicubedsoccadult": "72946.77", + "numicubedsoccped": "13867.3", + "numconfc19hosppatsadult": "103092.79", + "numconfc19hosppatsped": "1521.71", + "totalconfc19hosppats": "104614.5", + "totalconffluhosppats": "330.64", + "numconfc19icupatsadult": "28298.92", + "totalconfc19icupats": "28298.92", + "totalconffluicupats": "57.45", + "totalconfc19newadmped": "2667.0", + "numconfc19newadmadult18to49": "26689.0", + "totalconfc19newadmadult": "90574.0", + "numconfc19newadmunk": "4902.0", + "totalconfc19newadm": "93241.0", + "totalconfflunewadm": "282.0", + "pctinptbedsocc": "0.7679", + "pctconfc19inptbeds": "0.1405", + "pctconffluinptbeds": "0.0004", + "pcticubedsocc": "0.7707", + "pctconfc19icubeds": "0.2365", + "pctconffluicubeds": "0.0005", + "pctconfc19newadmadult": "0.9714", + "pctconfc19newadmped": "0.0286", + "numinptbedshosprep": "5396", + "numinptbedsocchosprep": "5396", + "numicubedshosprep": "5396", + "numicubedsocchosprep": "5396", + "totalconfc19hosppatshosprep": "5393", + "totalconffluhosppatshosprep": "4398", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5393", + "totalconffluicupatshosprep": "4395", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5276", + "totalconfc19newadmadulthosprep": "5392", + "totalconfc19newadmhosprep": "5392", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4396", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5396", + "pcticubedsocchosprep": "5396", + "pctconfc19inptbedshosprep": "5393", + "pctconffluinptbedshosprep": "4398", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5393", + "pctconffluicubedshosprep": "4395", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9492", + "numinptbedsoccperchosprep": "0.9492", + "numicubedsperchosprep": "0.9492", + "numicubedsoccperchosprep": "0.9492", + "totalconfc19hosppatsperc": "0.9486", + "totalconffluhosppatsperc": "0.7736", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9486", + "totalconffluicupatsperchosprep": "0.7731", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9281", + "totalconfc19newadmadultp": "0.9485", + "totalconfc19newadmperchosprep": "94.85", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "77.33", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9492", + "pcticubedsoccperchosprep": "0.9492", + "pctconfc19inptbedsperchosprep": "0.9486", + "pctconffluinptbedsperchosprep": "0.7736", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9486", + "pctconffluicubedsperchosprep": "0.7731", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.02", + "numinptbedsoccperchospre": "0.02", + "numicubedsperchosprepabschg": "0.02", + "numicubedsoccperchosprepabschg": "0.02", + "totalconfc19hosppatsperc_1": "0.02", + "totalconffluhosppatsperc_1": "-0.05", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.02", + "totalconffluicupatsperch": "-0.05", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.02", + "totalconfc19newadmadultp_1": "0.02", + "totalconfc19newadmpercho": "0.02", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "-0.02", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0002", + "pcticubedsoccperchosprepabschg": "0.0002", + "pctconfc19inptbedspercho": "0.0002", + "pctconffluinptbedspercho": "-0.0005", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0002", + "pctconffluicubedsperchos": "-0.0005", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-09-11T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10395.29", + "numinptbedsadult": "9181.14", + "numinptbedsped": "757.43", + "numinptbedsocc": "7102.86", + "numinptbedsoccadult": "6390.29", + "numinptbedsoccped": "319.29", + "numicubeds": "1878.0", + "numicubedsadult": "1334.43", + "numicubedsped": "397.14", + "numicubedsocc": "1322.0", + "numicubedsoccadult": "999.14", + "numicubedsoccped": "179.29", + "numconfc19hosppatsadult": "855.86", + "numconfc19hosppatsped": "18.0", + "totalconfc19hosppats": "873.86", + "totalconffluhosppats": "0.29", + "numconfc19icupatsadult": "335.0", + "totalconfc19icupats": "335.0", + "totalconffluicupats": "0.29", + "totalconfc19newadmped": "41.0", + "numconfc19newadmadult18to49": "347.0", + "totalconfc19newadmadult": "941.0", + "numconfc19newadmunk": "4.0", + "totalconfc19newadm": "982.0", + "totalconfflunewadm": "2.0", + "pctinptbedsocc": "0.6833", + "pctconfc19inptbeds": "0.0841", + "pctconffluinptbeds": "0.0", + "pcticubedsocc": "0.7039", + "pctconfc19icubeds": "0.1784", + "pctconffluicubeds": "0.0002", + "pctconfc19newadmadult": "0.9582", + "pctconfc19newadmped": "0.0418", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "92.93", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "78.79", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-09-11T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "742400.99", + "numinptbedsadult": "672327.6", + "numinptbedsped": "51767.94", + "numinptbedsocc": "568865.8", + "numinptbedsoccadult": "522555.9", + "numinptbedsoccped": "33668.85", + "numicubeds": "119269.2", + "numicubedsadult": "91001.5", + "numicubedsped": "21275.26", + "numicubedsocc": "92364.54", + "numicubedsoccadult": "73185.37", + "numicubedsoccped": "14285.86", + "numconfc19hosppatsadult": "101186.65", + "numconfc19hosppatsped": "1542.21", + "totalconfc19hosppats": "102728.87", + "totalconffluhosppats": "309.41", + "numconfc19icupatsadult": "28185.24", + "totalconfc19icupats": "28185.24", + "totalconffluicupats": "55.3", + "totalconfc19newadmped": "2476.0", + "numconfc19newadmadult18to49": "24765.0", + "totalconfc19newadmadult": "85686.0", + "numconfc19newadmunk": "4480.0", + "totalconfc19newadm": "88162.0", + "totalconfflunewadm": "247.0", + "pctinptbedsocc": "0.7663", + "pctconfc19inptbeds": "0.1384", + "pctconffluinptbeds": "0.0004", + "pcticubedsocc": "0.7744", + "pctconfc19icubeds": "0.2363", + "pctconffluicubeds": "0.0005", + "pctconfc19newadmadult": "0.9719", + "pctconfc19newadmped": "0.0281", + "numinptbedshosprep": "5395", + "numinptbedsocchosprep": "5395", + "numicubedshosprep": "5395", + "numicubedsocchosprep": "5395", + "totalconfc19hosppatshosprep": "5392", + "totalconffluhosppatshosprep": "4379", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5392", + "totalconffluicupatshosprep": "4376", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5274", + "totalconfc19newadmadulthosprep": "5391", + "totalconfc19newadmhosprep": "5391", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4377", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5395", + "pcticubedsocchosprep": "5395", + "pctconfc19inptbedshosprep": "5392", + "pctconffluinptbedshosprep": "4379", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5392", + "pctconffluicubedshosprep": "4376", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.949", + "numinptbedsoccperchosprep": "0.949", + "numicubedsperchosprep": "0.949", + "numicubedsoccperchosprep": "0.949", + "totalconfc19hosppatsperc": "0.9485", + "totalconffluhosppatsperc": "0.7703", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9485", + "totalconffluicupatsperchosprep": "0.7697", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9277", + "totalconfc19newadmadultp": "0.9483", + "totalconfc19newadmperchosprep": "94.83", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "76.99", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.949", + "pcticubedsoccperchosprep": "0.949", + "pctconfc19inptbedsperchosprep": "0.9485", + "pctconffluinptbedsperchosprep": "0.7703", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9485", + "pctconffluicubedsperchosprep": "0.7697", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "-0.02", + "numinptbedsoccperchospre": "-0.02", + "numicubedsperchosprepabschg": "-0.02", + "numicubedsoccperchosprepabschg": "-0.02", + "totalconfc19hosppatsperc_1": "-0.02", + "totalconffluhosppatsperc_1": "-0.33", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "-0.02", + "totalconffluicupatsperch": "-0.33", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "-0.04", + "totalconfc19newadmadultp_1": "-0.02", + "totalconfc19newadmpercho": "-0.02", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "-0.33", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "-0.0002", + "pcticubedsoccperchosprepabschg": "-0.0002", + "pctconfc19inptbedspercho": "-0.0002", + "pctconffluinptbedspercho": "-0.0033", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "-0.0002", + "pctconffluicubedsperchos": "-0.0033", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-09-18T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10476.14", + "numinptbedsadult": "9251.14", + "numinptbedsped": "750.0", + "numinptbedsocc": "7340.38", + "numinptbedsoccadult": "6605.38", + "numinptbedsoccped": "356.29", + "numicubeds": "1812.43", + "numicubedsadult": "1331.29", + "numicubedsped": "417.14", + "numicubedsocc": "1282.05", + "numicubedsoccadult": "1015.62", + "numicubedsoccped": "217.14", + "numconfc19hosppatsadult": "886.76", + "numconfc19hosppatsped": "14.43", + "totalconfc19hosppats": "901.19", + "totalconffluhosppats": "0.0", + "numconfc19icupatsadult": "355.07", + "totalconfc19icupats": "355.07", + "totalconffluicupats": "0.0", + "totalconfc19newadmped": "24.0", + "numconfc19newadmadult18to49": "336.0", + "totalconfc19newadmadult": "931.0", + "numconfc19newadmunk": "4.0", + "totalconfc19newadm": "955.0", + "totalconfflunewadm": "0.0", + "pctinptbedsocc": "0.7007", + "pctconfc19inptbeds": "0.086", + "pctconffluinptbeds": "0.0", + "pcticubedsocc": "0.7074", + "pctconfc19icubeds": "0.1959", + "pctconffluicubeds": "0.0", + "pctconfc19newadmadult": "0.9749", + "pctconfc19newadmped": "0.0251", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "92.93", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "78.79", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-09-18T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "743361.31", + "numinptbedsadult": "672737.5", + "numinptbedsped": "51159.55", + "numinptbedsocc": "577511.09", + "numinptbedsoccadult": "530000.29", + "numinptbedsoccped": "34247.45", + "numicubeds": "119256.47", + "numicubedsadult": "90798.21", + "numicubedsped": "20908.8", + "numicubedsocc": "92343.47", + "numicubedsoccadult": "73185.44", + "numicubedsoccped": "14310.5", + "numconfc19hosppatsadult": "94483.65", + "numconfc19hosppatsped": "1412.23", + "totalconfc19hosppats": "95895.88", + "totalconffluhosppats": "284.98", + "numconfc19icupatsadult": "27151.26", + "totalconfc19icupats": "27151.26", + "totalconffluicupats": "67.43", + "totalconfc19newadmped": "2379.0", + "numconfc19newadmadult18to49": "21561.0", + "totalconfc19newadmadult": "76790.0", + "numconfc19newadmunk": "4010.0", + "totalconfc19newadm": "79169.0", + "totalconfflunewadm": "261.0", + "pctinptbedsocc": "0.7769", + "pctconfc19inptbeds": "0.129", + "pctconffluinptbeds": "0.0004", + "pcticubedsocc": "0.7743", + "pctconfc19icubeds": "0.2277", + "pctconffluicubeds": "0.0006", + "pctconfc19newadmadult": "0.97", + "pctconfc19newadmped": "0.03", + "numinptbedshosprep": "5398", + "numinptbedsocchosprep": "5398", + "numicubedshosprep": "5398", + "numicubedsocchosprep": "5398", + "totalconfc19hosppatshosprep": "5395", + "totalconffluhosppatshosprep": "4366", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5395", + "totalconffluicupatshosprep": "4361", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5278", + "totalconfc19newadmadulthosprep": "5394", + "totalconfc19newadmhosprep": "5394", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4362", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5398", + "pcticubedsocchosprep": "5398", + "pctconfc19inptbedshosprep": "5395", + "pctconffluinptbedshosprep": "4366", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5395", + "pctconffluicubedshosprep": "4361", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9495", + "numinptbedsoccperchosprep": "0.9495", + "numicubedsperchosprep": "0.9495", + "numicubedsoccperchosprep": "0.9495", + "totalconfc19hosppatsperc": "0.949", + "totalconffluhosppatsperc": "0.768", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.949", + "totalconffluicupatsperchosprep": "0.7671", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9284", + "totalconfc19newadmadultp": "0.9488", + "totalconfc19newadmperchosprep": "94.88", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "76.73", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9495", + "pcticubedsoccperchosprep": "0.9495", + "pctconfc19inptbedsperchosprep": "0.949", + "pctconffluinptbedsperchosprep": "0.768", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.949", + "pctconffluicubedsperchosprep": "0.7671", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.05", + "numinptbedsoccperchospre": "0.05", + "numicubedsperchosprepabschg": "0.05", + "numicubedsoccperchosprepabschg": "0.05", + "totalconfc19hosppatsperc_1": "0.05", + "totalconffluhosppatsperc_1": "-0.23", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.05", + "totalconffluicupatsperch": "-0.26", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.07", + "totalconfc19newadmadultp_1": "0.05", + "totalconfc19newadmpercho": "0.05", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "-0.26", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0005", + "pcticubedsoccperchosprepabschg": "0.0005", + "pctconfc19inptbedspercho": "0.0005", + "pctconffluinptbedspercho": "-0.0023", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0005", + "pctconffluicubedsperchos": "-0.0026", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-09-25T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10463.14", + "numinptbedsadult": "9234.71", + "numinptbedsped": "660.71", + "numinptbedsocc": "7255.57", + "numinptbedsoccadult": "6512.71", + "numinptbedsoccped": "301.43", + "numicubeds": "1803.43", + "numicubedsadult": "1322.29", + "numicubedsped": "306.14", + "numicubedsocc": "1263.0", + "numicubedsoccadult": "996.71", + "numicubedsoccped": "157.71", + "numconfc19hosppatsadult": "881.43", + "numconfc19hosppatsped": "14.43", + "totalconfc19hosppats": "895.86", + "totalconffluhosppats": "0.0", + "numconfc19icupatsadult": "337.0", + "totalconfc19icupats": "337.0", + "totalconffluicupats": "0.0", + "totalconfc19newadmped": "31.0", + "numconfc19newadmadult18to49": "274.0", + "totalconfc19newadmadult": "962.0", + "numconfc19newadmunk": "9.0", + "totalconfc19newadm": "993.0", + "totalconfflunewadm": "0.0", + "pctinptbedsocc": "0.6934", + "pctconfc19inptbeds": "0.0856", + "pctconffluinptbeds": "0.0", + "pcticubedsocc": "0.7003", + "pctconfc19icubeds": "0.1869", + "pctconffluicubeds": "0.0", + "pctconfc19newadmadult": "0.9688", + "pctconfc19newadmped": "0.0312", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "92.93", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "78.79", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-09-25T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "741350.4", + "numinptbedsadult": "671327.23", + "numinptbedsped": "50705.01", + "numinptbedsocc": "571176.7", + "numinptbedsoccadult": "524034.78", + "numinptbedsoccped": "34189.04", + "numicubeds": "118806.55", + "numicubedsadult": "90455.86", + "numicubedsped": "21079.05", + "numicubedsocc": "91121.6", + "numicubedsoccadult": "72020.5", + "numicubedsoccped": "14283.63", + "numconfc19hosppatsadult": "84589.63", + "numconfc19hosppatsped": "1299.24", + "totalconfc19hosppats": "85888.87", + "totalconffluhosppats": "272.38", + "numconfc19icupatsadult": "24967.04", + "totalconfc19icupats": "24967.04", + "totalconffluicupats": "56.14", + "totalconfc19newadmped": "1949.0", + "numconfc19newadmadult18to49": "18280.0", + "totalconfc19newadmadult": "65791.0", + "numconfc19newadmunk": "3675.0", + "totalconfc19newadm": "67740.0", + "totalconfflunewadm": "234.0", + "pctinptbedsocc": "0.7705", + "pctconfc19inptbeds": "0.1159", + "pctconffluinptbeds": "0.0004", + "pcticubedsocc": "0.767", + "pctconfc19icubeds": "0.2101", + "pctconffluicubeds": "0.0005", + "pctconfc19newadmadult": "0.9712", + "pctconfc19newadmped": "0.0288", + "numinptbedshosprep": "5397", + "numinptbedsocchosprep": "5397", + "numicubedshosprep": "5397", + "numicubedsocchosprep": "5397", + "totalconfc19hosppatshosprep": "5394", + "totalconffluhosppatshosprep": "4372", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5394", + "totalconffluicupatshosprep": "4366", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5277", + "totalconfc19newadmadulthosprep": "5393", + "totalconfc19newadmhosprep": "5393", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4368", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5397", + "pcticubedsocchosprep": "5397", + "pctconfc19inptbedshosprep": "5394", + "pctconffluinptbedshosprep": "4372", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5394", + "pctconffluicubedshosprep": "4366", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9493", + "numinptbedsoccperchosprep": "0.9493", + "numicubedsperchosprep": "0.9493", + "numicubedsoccperchosprep": "0.9493", + "totalconfc19hosppatsperc": "0.9488", + "totalconffluhosppatsperc": "0.769", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9488", + "totalconffluicupatsperchosprep": "0.768", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9282", + "totalconfc19newadmadultp": "0.9486", + "totalconfc19newadmperchosprep": "94.86", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "76.83", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9493", + "pcticubedsoccperchosprep": "0.9493", + "pctconfc19inptbedsperchosprep": "0.9488", + "pctconffluinptbedsperchosprep": "0.769", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9488", + "pctconffluicubedsperchosprep": "0.768", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "-0.02", + "numinptbedsoccperchospre": "-0.02", + "numicubedsperchosprepabschg": "-0.02", + "numicubedsoccperchosprepabschg": "-0.02", + "totalconfc19hosppatsperc_1": "-0.02", + "totalconffluhosppatsperc_1": "0.11", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "-0.02", + "totalconffluicupatsperch": "0.09", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "-0.02", + "totalconfc19newadmadultp_1": "-0.02", + "totalconfc19newadmpercho": "-0.02", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.11", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "-0.0002", + "pcticubedsoccperchosprepabschg": "-0.0002", + "pctconfc19inptbedspercho": "-0.0002", + "pctconffluinptbedspercho": "0.0011", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "-0.0002", + "pctconffluicubedsperchos": "0.0009", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-10-02T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10417.57", + "numinptbedsadult": "9192.71", + "numinptbedsped": "657.71", + "numinptbedsocc": "7275.74", + "numinptbedsoccadult": "6520.74", + "numinptbedsoccped": "317.86", + "numicubeds": "1807.71", + "numicubedsadult": "1331.57", + "numicubedsped": "301.14", + "numicubedsocc": "1314.93", + "numicubedsoccadult": "1039.21", + "numicubedsoccped": "176.14", + "numconfc19hosppatsadult": "860.76", + "numconfc19hosppatsped": "23.43", + "totalconfc19hosppats": "884.19", + "totalconffluhosppats": "0.0", + "numconfc19icupatsadult": "310.26", + "totalconfc19icupats": "310.26", + "totalconffluicupats": "0.0", + "totalconfc19newadmped": "49.0", + "numconfc19newadmadult18to49": "274.0", + "totalconfc19newadmadult": "921.0", + "numconfc19newadmunk": "0.0", + "totalconfc19newadm": "970.0", + "totalconfflunewadm": "0.0", + "pctinptbedsocc": "0.6984", + "pctconfc19inptbeds": "0.0849", + "pctconffluinptbeds": "0.0", + "pcticubedsocc": "0.7274", + "pctconfc19icubeds": "0.1716", + "pctconffluicubeds": "0.0", + "pctconfc19newadmadult": "0.9495", + "pctconfc19newadmped": "0.0505", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "92.93", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "78.79", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-10-02T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "740148.71", + "numinptbedsadult": "669456.02", + "numinptbedsped": "50239.71", + "numinptbedsocc": "565301.31", + "numinptbedsoccadult": "518444.26", + "numinptbedsoccped": "33398.35", + "numicubeds": "118016.14", + "numicubedsadult": "89835.76", + "numicubedsped": "20933.11", + "numicubedsocc": "89779.08", + "numicubedsoccadult": "70591.46", + "numicubedsoccped": "14267.9", + "numconfc19hosppatsadult": "73540.56", + "numconfc19hosppatsped": "1161.02", + "totalconfc19hosppats": "74701.58", + "totalconffluhosppats": "253.17", + "numconfc19icupatsadult": "21970.69", + "totalconfc19icupats": "21970.69", + "totalconffluicupats": "51.0", + "totalconfc19newadmped": "1642.0", + "numconfc19newadmadult18to49": "15107.0", + "totalconfc19newadmadult": "56434.0", + "numconfc19newadmunk": "3264.0", + "totalconfc19newadm": "58076.0", + "totalconfflunewadm": "253.0", + "pctinptbedsocc": "0.7638", + "pctconfc19inptbeds": "0.1009", + "pctconffluinptbeds": "0.0003", + "pcticubedsocc": "0.7607", + "pctconfc19icubeds": "0.1862", + "pctconffluicubeds": "0.0004", + "pctconfc19newadmadult": "0.9717", + "pctconfc19newadmped": "0.0283", + "numinptbedshosprep": "5399", + "numinptbedsocchosprep": "5399", + "numicubedshosprep": "5399", + "numicubedsocchosprep": "5399", + "totalconfc19hosppatshosprep": "5396", + "totalconffluhosppatshosprep": "4397", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5396", + "totalconffluicupatshosprep": "4388", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5279", + "totalconfc19newadmadulthosprep": "5395", + "totalconfc19newadmhosprep": "5395", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4391", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5399", + "pcticubedsocchosprep": "5399", + "pctconfc19inptbedshosprep": "5396", + "pctconffluinptbedshosprep": "4397", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5396", + "pctconffluicubedshosprep": "4388", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9497", + "numinptbedsoccperchosprep": "0.9497", + "numicubedsperchosprep": "0.9497", + "numicubedsoccperchosprep": "0.9497", + "totalconfc19hosppatsperc": "0.9492", + "totalconffluhosppatsperc": "0.7734", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9492", + "totalconffluicupatsperchosprep": "0.7719", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9286", + "totalconfc19newadmadultp": "0.949", + "totalconfc19newadmperchosprep": "94.9", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "77.24", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9497", + "pcticubedsoccperchosprep": "0.9497", + "pctconfc19inptbedsperchosprep": "0.9492", + "pctconffluinptbedsperchosprep": "0.7734", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9492", + "pctconffluicubedsperchosprep": "0.7719", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.04", + "numinptbedsoccperchospre": "0.04", + "numicubedsperchosprepabschg": "0.04", + "numicubedsoccperchosprepabschg": "0.04", + "totalconfc19hosppatsperc_1": "0.04", + "totalconffluhosppatsperc_1": "0.44", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.04", + "totalconffluicupatsperch": "0.39", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.04", + "totalconfc19newadmadultp_1": "0.04", + "totalconfc19newadmpercho": "0.04", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.4", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0004", + "pcticubedsoccperchosprepabschg": "0.0004", + "pctconfc19inptbedspercho": "0.0004", + "pctconffluinptbedspercho": "0.0044", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0004", + "pctconffluicubedsperchos": "0.0039", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-10-09T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10435.0", + "numinptbedsadult": "9200.71", + "numinptbedsped": "667.14", + "numinptbedsocc": "7363.83", + "numinptbedsoccadult": "6586.98", + "numinptbedsoccped": "324.86", + "numicubeds": "1801.14", + "numicubedsadult": "1326.29", + "numicubedsped": "299.86", + "numicubedsocc": "1378.29", + "numicubedsoccadult": "1100.29", + "numicubedsoccped": "181.0", + "numconfc19hosppatsadult": "902.43", + "numconfc19hosppatsped": "21.43", + "totalconfc19hosppats": "923.86", + "totalconffluhosppats": "0.14", + "numconfc19icupatsadult": "313.57", + "totalconfc19icupats": "313.57", + "totalconffluicupats": "0.0", + "totalconfc19newadmped": "36.0", + "numconfc19newadmadult18to49": "318.0", + "totalconfc19newadmadult": "1043.0", + "numconfc19newadmunk": "4.0", + "totalconfc19newadm": "1079.0", + "totalconfflunewadm": "1.0", + "pctinptbedsocc": "0.7057", + "pctconfc19inptbeds": "0.0885", + "pctconffluinptbeds": "0.0", + "pcticubedsocc": "0.7652", + "pctconfc19icubeds": "0.1741", + "pctconffluicubeds": "0.0", + "pctconfc19newadmadult": "0.9666", + "pctconfc19newadmped": "0.0334", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "92.93", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "78.79", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-10-09T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "733424.54", + "numinptbedsadult": "664396.0", + "numinptbedsped": "49907.38", + "numinptbedsocc": "559358.6", + "numinptbedsoccadult": "512696.2", + "numinptbedsoccped": "33474.79", + "numicubeds": "116653.35", + "numicubedsadult": "88638.07", + "numicubedsped": "20853.11", + "numicubedsocc": "87458.7", + "numicubedsoccadult": "68650.56", + "numicubedsoccped": "13957.53", + "numconfc19hosppatsadult": "63806.61", + "numconfc19hosppatsped": "1008.47", + "totalconfc19hosppats": "64815.08", + "totalconffluhosppats": "275.72", + "numconfc19icupatsadult": "19250.85", + "totalconfc19icupats": "19250.85", + "totalconffluicupats": "57.57", + "totalconfc19newadmped": "1373.0", + "numconfc19newadmadult18to49": "13335.0", + "totalconfc19newadmadult": "50371.0", + "numconfc19newadmunk": "2933.0", + "totalconfc19newadm": "51744.0", + "totalconfflunewadm": "341.0", + "pctinptbedsocc": "0.7627", + "pctconfc19inptbeds": "0.0884", + "pctconffluinptbeds": "0.0004", + "pcticubedsocc": "0.7497", + "pctconfc19icubeds": "0.165", + "pctconffluicubeds": "0.0005", + "pctconfc19newadmadult": "0.9735", + "pctconfc19newadmped": "0.0265", + "numinptbedshosprep": "5400", + "numinptbedsocchosprep": "5400", + "numicubedshosprep": "5400", + "numicubedsocchosprep": "5400", + "totalconfc19hosppatshosprep": "5397", + "totalconffluhosppatshosprep": "4387", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5397", + "totalconffluicupatshosprep": "4374", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5280", + "totalconfc19newadmadulthosprep": "5396", + "totalconfc19newadmhosprep": "5396", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4379", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5400", + "pcticubedsocchosprep": "5400", + "pctconfc19inptbedshosprep": "5397", + "pctconffluinptbedshosprep": "4387", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5397", + "pctconffluicubedshosprep": "4374", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9499", + "numinptbedsoccperchosprep": "0.9499", + "numicubedsperchosprep": "0.9499", + "numicubedsoccperchosprep": "0.9499", + "totalconfc19hosppatsperc": "0.9493", + "totalconffluhosppatsperc": "0.7717", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9493", + "totalconffluicupatsperchosprep": "0.7694", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9288", + "totalconfc19newadmadultp": "0.9492", + "totalconfc19newadmperchosprep": "94.92", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "77.03", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9499", + "pcticubedsoccperchosprep": "0.9499", + "pctconfc19inptbedsperchosprep": "0.9493", + "pctconffluinptbedsperchosprep": "0.7717", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9493", + "pctconffluicubedsperchosprep": "0.7694", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.02", + "numinptbedsoccperchospre": "0.02", + "numicubedsperchosprepabschg": "0.02", + "numicubedsoccperchosprepabschg": "0.02", + "totalconfc19hosppatsperc_1": "0.02", + "totalconffluhosppatsperc_1": "-0.18", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.02", + "totalconffluicupatsperch": "-0.25", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.02", + "totalconfc19newadmadultp_1": "0.02", + "totalconfc19newadmpercho": "0.02", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "-0.21", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0002", + "pcticubedsoccperchosprepabschg": "0.0002", + "pctconfc19inptbedspercho": "0.0002", + "pctconffluinptbedspercho": "-0.0018", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0002", + "pctconffluicubedsperchos": "-0.0025", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-10-16T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10426.29", + "numinptbedsadult": "9195.0", + "numinptbedsped": "664.14", + "numinptbedsocc": "7365.71", + "numinptbedsoccadult": "6590.86", + "numinptbedsoccped": "322.71", + "numicubeds": "1820.57", + "numicubedsadult": "1345.29", + "numicubedsped": "300.29", + "numicubedsocc": "1362.0", + "numicubedsoccadult": "1088.0", + "numicubedsoccped": "176.71", + "numconfc19hosppatsadult": "996.86", + "numconfc19hosppatsped": "19.57", + "totalconfc19hosppats": "1016.43", + "totalconffluhosppats": "0.86", + "numconfc19icupatsadult": "346.14", + "totalconfc19icupats": "346.14", + "totalconffluicupats": "0.0", + "totalconfc19newadmped": "38.0", + "numconfc19newadmadult18to49": "332.0", + "totalconfc19newadmadult": "1193.0", + "numconfc19newadmunk": "8.0", + "totalconfc19newadm": "1231.0", + "totalconfflunewadm": "0.0", + "pctinptbedsocc": "0.7065", + "pctconfc19inptbeds": "0.0975", + "pctconffluinptbeds": "0.0001", + "pcticubedsocc": "0.7481", + "pctconfc19icubeds": "0.1901", + "pctconffluicubeds": "0.0", + "pctconfc19newadmadult": "0.9691", + "pctconfc19newadmped": "0.0309", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "92.93", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "78.79", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-10-16T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "729772.05", + "numinptbedsadult": "660758.41", + "numinptbedsped": "53387.68", + "numinptbedsocc": "556817.29", + "numinptbedsoccadult": "510524.46", + "numinptbedsoccped": "35679.97", + "numicubeds": "114471.4", + "numicubedsadult": "86925.11", + "numicubedsped": "21902.45", + "numicubedsocc": "85344.84", + "numicubedsoccadult": "66877.69", + "numicubedsoccped": "14657.22", + "numconfc19hosppatsadult": "55448.05", + "numconfc19hosppatsped": "847.15", + "totalconfc19hosppats": "56295.2", + "totalconffluhosppats": "259.85", + "numconfc19icupatsadult": "18104.6", + "totalconfc19icupats": "18104.6", + "totalconffluicupats": "39.33", + "totalconfc19newadmped": "1301.0", + "numconfc19newadmadult18to49": "11532.0", + "totalconfc19newadmadult": "44677.0", + "numconfc19newadmunk": "1982.0", + "totalconfc19newadm": "45978.0", + "totalconfflunewadm": "266.0", + "pctinptbedsocc": "0.763", + "pctconfc19inptbeds": "0.0771", + "pctconffluinptbeds": "0.0004", + "pcticubedsocc": "0.7456", + "pctconfc19icubeds": "0.1582", + "pctconffluicubeds": "0.0003", + "pctconfc19newadmadult": "0.9717", + "pctconfc19newadmped": "0.0283", + "numinptbedshosprep": "5396", + "numinptbedsocchosprep": "5396", + "numicubedshosprep": "5396", + "numicubedsocchosprep": "5396", + "totalconfc19hosppatshosprep": "5396", + "totalconffluhosppatshosprep": "4317", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5396", + "totalconffluicupatshosprep": "4306", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5278", + "totalconfc19newadmadulthosprep": "5394", + "totalconfc19newadmhosprep": "5394", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4307", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5396", + "pcticubedsocchosprep": "5396", + "pctconfc19inptbedshosprep": "5396", + "pctconffluinptbedshosprep": "4317", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5396", + "pctconffluicubedshosprep": "4306", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9492", + "numinptbedsoccperchosprep": "0.9492", + "numicubedsperchosprep": "0.9492", + "numicubedsoccperchosprep": "0.9492", + "totalconfc19hosppatsperc": "0.9492", + "totalconffluhosppatsperc": "0.7594", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9492", + "totalconffluicupatsperchosprep": "0.7574", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9284", + "totalconfc19newadmadultp": "0.9488", + "totalconfc19newadmperchosprep": "94.88", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "75.76", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9492", + "pcticubedsoccperchosprep": "0.9492", + "pctconfc19inptbedsperchosprep": "0.9492", + "pctconffluinptbedsperchosprep": "0.7594", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9492", + "pctconffluicubedsperchosprep": "0.7574", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "-0.07", + "numinptbedsoccperchospre": "-0.07", + "numicubedsperchosprepabschg": "-0.07", + "numicubedsoccperchosprepabschg": "-0.07", + "totalconfc19hosppatsperc_1": "-0.02", + "totalconffluhosppatsperc_1": "-1.23", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "-0.02", + "totalconffluicupatsperch": "-1.2", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "-0.04", + "totalconfc19newadmadultp_1": "-0.04", + "totalconfc19newadmpercho": "-0.04", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "-1.27", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "-0.0007", + "pcticubedsoccperchosprepabschg": "-0.0007", + "pctconfc19inptbedspercho": "-0.0002", + "pctconffluinptbedspercho": "-0.0123", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "-0.0002", + "pctconffluicubedsperchos": "-0.012", + "pctconfrsvicubedsperchos": "0.0" + } +] \ No newline at end of file diff --git a/nhsn/tests/test_data/prelim_page.json b/nhsn/tests/test_data/prelim_page.json new file mode 100644 index 000000000..374639f14 --- /dev/null +++ b/nhsn/tests/test_data/prelim_page.json @@ -0,0 +1,2126 @@ +[ + { + "weekendingdate": "2021-08-21T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10282.71", + "numinptbedsadult": "9090.29", + "numinptbedsped": "742.29", + "numinptbedsocc": "7004.43", + "numinptbedsoccadult": "6343.0", + "numinptbedsoccped": "247.71", + "numicubeds": "1868.0", + "numicubedsadult": "1336.71", + "numicubedsped": "366.71", + "numicubedsocc": "1253.14", + "numicubedsoccadult": "961.0", + "numicubedsoccped": "135.29", + "numconfc19hosppatsadult": "590.71", + "numconfc19hosppatsped": "9.43", + "totalconfc19hosppats": "600.14", + "totalconffluhosppats": "0.0", + "numconfc19icupatsadult": "232.43", + "totalconfc19icupats": "232.43", + "totalconffluicupats": "0.0", + "totalconfc19newadmped": "34.0", + "numconfc19newadmadult18to49": "291.0", + "totalconfc19newadmadult": "818.0", + "numconfc19newadmunk": "2.0", + "totalconfc19newadm": "852.0", + "totalconfflunewadm": "0.0", + "pctinptbedsocc": "0.6812", + "pctconfc19inptbeds": "0.0584", + "pctconffluinptbeds": "0.0", + "pcticubedsocc": "0.6708", + "pctconfc19icubeds": "0.1244", + "pctconffluicubeds": "0.0", + "pctconfc19newadmadult": "0.9601", + "pctconfc19newadmped": "0.0399", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "0.9293", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.7879", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-08-21T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "750150.99", + "numinptbedsadult": "679540.51", + "numinptbedsped": "51335.02", + "numinptbedsocc": "572345.09", + "numinptbedsoccadult": "526399.17", + "numinptbedsoccped": "32810.36", + "numicubeds": "120768.79", + "numicubedsadult": "91030.4", + "numicubedsped": "21419.35", + "numicubedsocc": "89853.28", + "numicubedsoccadult": "70595.31", + "numicubedsoccped": "14112.02", + "numconfc19hosppatsadult": "92782.24", + "numconfc19hosppatsped": "1268.64", + "totalconfc19hosppats": "94050.88", + "totalconffluhosppats": "292.67", + "numconfc19icupatsadult": "24692.91", + "totalconfc19icupats": "24692.91", + "totalconffluicupats": "45.57", + "totalconfc19newadmped": "2170.0", + "numconfc19newadmadult18to49": "27365.0", + "totalconfc19newadmadult": "90776.0", + "numconfc19newadmunk": "4827.0", + "totalconfc19newadm": "92946.0", + "totalconfflunewadm": "280.0", + "pctinptbedsocc": "0.763", + "pctconfc19inptbeds": "0.1254", + "pctconffluinptbeds": "0.0004", + "pcticubedsocc": "0.744", + "pctconfc19icubeds": "0.2045", + "pctconffluicubeds": "0.0004", + "pctconfc19newadmadult": "0.9767", + "pctconfc19newadmped": "0.0233", + "numinptbedshosprep": "5396", + "numinptbedsocchosprep": "5396", + "numicubedshosprep": "5396", + "numicubedsocchosprep": "5396", + "totalconfc19hosppatshosprep": "5393", + "totalconffluhosppatshosprep": "4417", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5393", + "totalconffluicupatshosprep": "4415", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5276", + "totalconfc19newadmadulthosprep": "5392", + "totalconfc19newadmhosprep": "5392", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4415", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5396", + "pcticubedsocchosprep": "5396", + "pctconfc19inptbedshosprep": "5393", + "pctconffluinptbedshosprep": "4417", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5393", + "pctconffluicubedshosprep": "4415", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9477", + "numinptbedsoccperchosprep": "0.9477", + "numicubedsperchosprep": "0.9477", + "numicubedsoccperchosprep": "0.9477", + "totalconfc19hosppatsperc": "0.9471", + "totalconffluhosppatsperc": "0.7757", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9471", + "totalconffluicupatsperchosprep": "0.7754", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9266", + "totalconfc19newadmadultp": "0.947", + "totalconfc19newadmperchosprep": "0.947", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.7754", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9477", + "pcticubedsoccperchosprep": "0.9477", + "pctconfc19inptbedsperchosprep": "0.9471", + "pctconffluinptbedsperchosprep": "0.7757", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9471", + "pctconffluicubedsperchosprep": "0.7754", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0007", + "numinptbedsoccperchospre": "0.0007", + "numicubedsperchosprepabschg": "0.0007", + "numicubedsoccperchosprepabschg": "0.0007", + "totalconfc19hosppatsperc_1": "0.0007", + "totalconffluhosppatsperc_1": "0.0014", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0007", + "totalconffluicupatsperch": "0.0019", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0007", + "totalconfc19newadmadultp_1": "0.0007", + "totalconfc19newadmpercho": "0.0007", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0016", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0007", + "pcticubedsoccperchosprepabschg": "0.0007", + "pctconfc19inptbedspercho": "0.0007", + "pctconffluinptbedspercho": "0.0014", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0007", + "pctconffluicubedsperchos": "0.0019", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-08-28T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10325.86", + "numinptbedsadult": "9081.29", + "numinptbedsped": "792.14", + "numinptbedsocc": "7014.88", + "numinptbedsoccadult": "6343.88", + "numinptbedsoccped": "267.14", + "numicubeds": "1871.43", + "numicubedsadult": "1332.57", + "numicubedsped": "372.71", + "numicubedsocc": "1271.07", + "numicubedsoccadult": "974.21", + "numicubedsoccped": "135.14", + "numconfc19hosppatsadult": "667.52", + "numconfc19hosppatsped": "13.57", + "totalconfc19hosppats": "681.1", + "totalconffluhosppats": "0.14", + "numconfc19icupatsadult": "270.48", + "totalconfc19icupats": "270.48", + "totalconffluicupats": "0.0", + "totalconfc19newadmped": "29.0", + "numconfc19newadmadult18to49": "303.0", + "totalconfc19newadmadult": "806.0", + "numconfc19newadmunk": "3.0", + "totalconfc19newadm": "835.0", + "totalconfflunewadm": "1.0", + "pctinptbedsocc": "0.6794", + "pctconfc19inptbeds": "0.066", + "pctconffluinptbeds": "0.0", + "pcticubedsocc": "0.6792", + "pctconfc19icubeds": "0.1445", + "pctconffluicubeds": "0.0", + "pctconfc19newadmadult": "0.9653", + "pctconfc19newadmped": "0.0347", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "0.9293", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.7879", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-08-28T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "746800.48", + "numinptbedsadult": "675884.36", + "numinptbedsped": "51791.88", + "numinptbedsocc": "573492.92", + "numinptbedsoccadult": "527355.92", + "numinptbedsoccped": "33078.85", + "numicubeds": "119528.11", + "numicubedsadult": "91033.85", + "numicubedsped": "21257.74", + "numicubedsocc": "91262.45", + "numicubedsoccadult": "72164.42", + "numicubedsoccped": "13993.38", + "numconfc19hosppatsadult": "101087.27", + "numconfc19hosppatsped": "1396.21", + "totalconfc19hosppats": "102483.48", + "totalconffluhosppats": "288.3", + "numconfc19icupatsadult": "27299.54", + "totalconfc19icupats": "27299.54", + "totalconffluicupats": "57.86", + "totalconfc19newadmped": "2427.0", + "numconfc19newadmadult18to49": "27003.0", + "totalconfc19newadmadult": "92169.0", + "numconfc19newadmunk": "5004.0", + "totalconfc19newadm": "94596.0", + "totalconfflunewadm": "262.0", + "pctinptbedsocc": "0.7679", + "pctconfc19inptbeds": "0.1372", + "pctconffluinptbeds": "0.0004", + "pcticubedsocc": "0.7635", + "pctconfc19icubeds": "0.2284", + "pctconffluicubeds": "0.0005", + "pctconfc19newadmadult": "0.9743", + "pctconfc19newadmped": "0.0257", + "numinptbedshosprep": "5395", + "numinptbedsocchosprep": "5395", + "numicubedshosprep": "5395", + "numicubedsocchosprep": "5395", + "totalconfc19hosppatshosprep": "5392", + "totalconffluhosppatshosprep": "4401", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5392", + "totalconffluicupatshosprep": "4398", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5275", + "totalconfc19newadmadulthosprep": "5391", + "totalconfc19newadmhosprep": "5391", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4397", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5395", + "pcticubedsocchosprep": "5395", + "pctconfc19inptbedshosprep": "5392", + "pctconffluinptbedshosprep": "4401", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5392", + "pctconffluicubedshosprep": "4398", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9475", + "numinptbedsoccperchosprep": "0.9475", + "numicubedsperchosprep": "0.9475", + "numicubedsoccperchosprep": "0.9475", + "totalconfc19hosppatsperc": "0.947", + "totalconffluhosppatsperc": "0.7729", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.947", + "totalconffluicupatsperchosprep": "0.7724", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9264", + "totalconfc19newadmadultp": "0.9468", + "totalconfc19newadmperchosprep": "0.9468", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.7722", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9475", + "pcticubedsoccperchosprep": "0.9475", + "pctconfc19inptbedsperchosprep": "0.947", + "pctconffluinptbedsperchosprep": "0.7729", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.947", + "pctconffluicubedsperchosprep": "0.7724", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "-0.0002", + "numinptbedsoccperchospre": "-0.0002", + "numicubedsperchosprepabschg": "-0.0002", + "numicubedsoccperchosprepabschg": "-0.0002", + "totalconfc19hosppatsperc_1": "-0.0002", + "totalconffluhosppatsperc_1": "-0.0028", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "-0.0002", + "totalconffluicupatsperch": "-0.003", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "-0.0002", + "totalconfc19newadmadultp_1": "-0.0002", + "totalconfc19newadmpercho": "-0.0002", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "-0.0032", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "-0.0002", + "pcticubedsoccperchosprepabschg": "-0.0002", + "pctconfc19inptbedspercho": "-0.0002", + "pctconffluinptbedspercho": "-0.0028", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "-0.0002", + "pctconffluicubedsperchos": "-0.003", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-09-04T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10361.86", + "numinptbedsadult": "9163.57", + "numinptbedsped": "744.43", + "numinptbedsocc": "7160.86", + "numinptbedsoccadult": "6415.29", + "numinptbedsoccped": "328.0", + "numicubeds": "1939.71", + "numicubedsadult": "1400.0", + "numicubedsped": "370.43", + "numicubedsocc": "1307.29", + "numicubedsoccadult": "983.71", + "numicubedsoccped": "154.29", + "numconfc19hosppatsadult": "795.29", + "numconfc19hosppatsped": "16.43", + "totalconfc19hosppats": "811.71", + "totalconffluhosppats": "0.86", + "numconfc19icupatsadult": "303.14", + "totalconfc19icupats": "303.14", + "totalconffluicupats": "0.43", + "totalconfc19newadmped": "38.0", + "numconfc19newadmadult18to49": "346.0", + "totalconfc19newadmadult": "962.0", + "numconfc19newadmunk": "1.0", + "totalconfc19newadm": "1000.0", + "totalconfflunewadm": "3.0", + "pctinptbedsocc": "0.6911", + "pctconfc19inptbeds": "0.0783", + "pctconffluinptbeds": "0.0001", + "pcticubedsocc": "0.674", + "pctconfc19icubeds": "0.1563", + "pctconffluicubeds": "0.0002", + "pctconfc19newadmadult": "0.962", + "pctconfc19newadmped": "0.038", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "0.9293", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.7879", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-09-04T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "744845.48", + "numinptbedsadult": "674286.14", + "numinptbedsped": "49228.93", + "numinptbedsocc": "571971.34", + "numinptbedsoccadult": "525311.57", + "numinptbedsoccped": "32162.6", + "numicubeds": "119670.24", + "numicubedsadult": "91266.24", + "numicubedsped": "20645.68", + "numicubedsocc": "92231.82", + "numicubedsoccadult": "72946.77", + "numicubedsoccped": "13867.3", + "numconfc19hosppatsadult": "103092.79", + "numconfc19hosppatsped": "1521.71", + "totalconfc19hosppats": "104614.5", + "totalconffluhosppats": "330.64", + "numconfc19icupatsadult": "28298.92", + "totalconfc19icupats": "28298.92", + "totalconffluicupats": "57.45", + "totalconfc19newadmped": "2667.0", + "numconfc19newadmadult18to49": "26689.0", + "totalconfc19newadmadult": "90574.0", + "numconfc19newadmunk": "4902.0", + "totalconfc19newadm": "93241.0", + "totalconfflunewadm": "282.0", + "pctinptbedsocc": "0.7679", + "pctconfc19inptbeds": "0.1405", + "pctconffluinptbeds": "0.0004", + "pcticubedsocc": "0.7707", + "pctconfc19icubeds": "0.2365", + "pctconffluicubeds": "0.0005", + "pctconfc19newadmadult": "0.9714", + "pctconfc19newadmped": "0.0286", + "numinptbedshosprep": "5396", + "numinptbedsocchosprep": "5396", + "numicubedshosprep": "5396", + "numicubedsocchosprep": "5396", + "totalconfc19hosppatshosprep": "5393", + "totalconffluhosppatshosprep": "4398", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5393", + "totalconffluicupatshosprep": "4395", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5276", + "totalconfc19newadmadulthosprep": "5392", + "totalconfc19newadmhosprep": "5392", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4396", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5396", + "pcticubedsocchosprep": "5396", + "pctconfc19inptbedshosprep": "5393", + "pctconffluinptbedshosprep": "4398", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5393", + "pctconffluicubedshosprep": "4395", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9477", + "numinptbedsoccperchosprep": "0.9477", + "numicubedsperchosprep": "0.9477", + "numicubedsoccperchosprep": "0.9477", + "totalconfc19hosppatsperc": "0.9471", + "totalconffluhosppatsperc": "0.7724", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9471", + "totalconffluicupatsperchosprep": "0.7719", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9266", + "totalconfc19newadmadultp": "0.947", + "totalconfc19newadmperchosprep": "0.947", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.772", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9477", + "pcticubedsoccperchosprep": "0.9477", + "pctconfc19inptbedsperchosprep": "0.9471", + "pctconffluinptbedsperchosprep": "0.7724", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9471", + "pctconffluicubedsperchosprep": "0.7719", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0002", + "numinptbedsoccperchospre": "0.0002", + "numicubedsperchosprepabschg": "0.0002", + "numicubedsoccperchosprepabschg": "0.0002", + "totalconfc19hosppatsperc_1": "0.0002", + "totalconffluhosppatsperc_1": "-0.0005", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0002", + "totalconffluicupatsperch": "-0.0005", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0002", + "totalconfc19newadmadultp_1": "0.0002", + "totalconfc19newadmpercho": "0.0002", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "-0.0002", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0002", + "pcticubedsoccperchosprepabschg": "0.0002", + "pctconfc19inptbedspercho": "0.0002", + "pctconffluinptbedspercho": "-0.0005", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0002", + "pctconffluicubedsperchos": "-0.0005", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-09-11T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10395.29", + "numinptbedsadult": "9181.14", + "numinptbedsped": "757.43", + "numinptbedsocc": "7102.86", + "numinptbedsoccadult": "6390.29", + "numinptbedsoccped": "319.29", + "numicubeds": "1878.0", + "numicubedsadult": "1334.43", + "numicubedsped": "397.14", + "numicubedsocc": "1322.0", + "numicubedsoccadult": "999.14", + "numicubedsoccped": "179.29", + "numconfc19hosppatsadult": "855.86", + "numconfc19hosppatsped": "18.0", + "totalconfc19hosppats": "873.86", + "totalconffluhosppats": "0.29", + "numconfc19icupatsadult": "335.0", + "totalconfc19icupats": "335.0", + "totalconffluicupats": "0.29", + "totalconfc19newadmped": "41.0", + "numconfc19newadmadult18to49": "347.0", + "totalconfc19newadmadult": "941.0", + "numconfc19newadmunk": "4.0", + "totalconfc19newadm": "982.0", + "totalconfflunewadm": "2.0", + "pctinptbedsocc": "0.6833", + "pctconfc19inptbeds": "0.0841", + "pctconffluinptbeds": "0.0", + "pcticubedsocc": "0.7039", + "pctconfc19icubeds": "0.1784", + "pctconffluicubeds": "0.0002", + "pctconfc19newadmadult": "0.9582", + "pctconfc19newadmped": "0.0418", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "0.9293", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.7879", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-09-11T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "742400.99", + "numinptbedsadult": "672327.6", + "numinptbedsped": "51767.94", + "numinptbedsocc": "568865.8", + "numinptbedsoccadult": "522555.9", + "numinptbedsoccped": "33668.85", + "numicubeds": "119269.2", + "numicubedsadult": "91001.5", + "numicubedsped": "21275.26", + "numicubedsocc": "92364.54", + "numicubedsoccadult": "73185.37", + "numicubedsoccped": "14285.86", + "numconfc19hosppatsadult": "101186.65", + "numconfc19hosppatsped": "1542.21", + "totalconfc19hosppats": "102728.87", + "totalconffluhosppats": "309.41", + "numconfc19icupatsadult": "28185.24", + "totalconfc19icupats": "28185.24", + "totalconffluicupats": "55.3", + "totalconfc19newadmped": "2476.0", + "numconfc19newadmadult18to49": "24765.0", + "totalconfc19newadmadult": "85686.0", + "numconfc19newadmunk": "4480.0", + "totalconfc19newadm": "88162.0", + "totalconfflunewadm": "247.0", + "pctinptbedsocc": "0.7663", + "pctconfc19inptbeds": "0.1384", + "pctconffluinptbeds": "0.0004", + "pcticubedsocc": "0.7744", + "pctconfc19icubeds": "0.2363", + "pctconffluicubeds": "0.0005", + "pctconfc19newadmadult": "0.9719", + "pctconfc19newadmped": "0.0281", + "numinptbedshosprep": "5395", + "numinptbedsocchosprep": "5395", + "numicubedshosprep": "5395", + "numicubedsocchosprep": "5395", + "totalconfc19hosppatshosprep": "5392", + "totalconffluhosppatshosprep": "4379", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5392", + "totalconffluicupatshosprep": "4376", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5274", + "totalconfc19newadmadulthosprep": "5391", + "totalconfc19newadmhosprep": "5391", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4377", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5395", + "pcticubedsocchosprep": "5395", + "pctconfc19inptbedshosprep": "5392", + "pctconffluinptbedshosprep": "4379", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5392", + "pctconffluicubedshosprep": "4376", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9475", + "numinptbedsoccperchosprep": "0.9475", + "numicubedsperchosprep": "0.9475", + "numicubedsoccperchosprep": "0.9475", + "totalconfc19hosppatsperc": "0.947", + "totalconffluhosppatsperc": "0.7691", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.947", + "totalconffluicupatsperchosprep": "0.7685", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9262", + "totalconfc19newadmadultp": "0.9468", + "totalconfc19newadmperchosprep": "0.9468", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.7687", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9475", + "pcticubedsoccperchosprep": "0.9475", + "pctconfc19inptbedsperchosprep": "0.947", + "pctconffluinptbedsperchosprep": "0.7691", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.947", + "pctconffluicubedsperchosprep": "0.7685", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "-0.0002", + "numinptbedsoccperchospre": "-0.0002", + "numicubedsperchosprepabschg": "-0.0002", + "numicubedsoccperchosprepabschg": "-0.0002", + "totalconfc19hosppatsperc_1": "-0.0002", + "totalconffluhosppatsperc_1": "-0.0033", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "-0.0002", + "totalconffluicupatsperch": "-0.0033", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "-0.0004", + "totalconfc19newadmadultp_1": "-0.0002", + "totalconfc19newadmpercho": "-0.0002", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "-0.0033", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "-0.0002", + "pcticubedsoccperchosprepabschg": "-0.0002", + "pctconfc19inptbedspercho": "-0.0002", + "pctconffluinptbedspercho": "-0.0033", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "-0.0002", + "pctconffluicubedsperchos": "-0.0033", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-09-18T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10476.14", + "numinptbedsadult": "9251.14", + "numinptbedsped": "750.0", + "numinptbedsocc": "7340.38", + "numinptbedsoccadult": "6605.38", + "numinptbedsoccped": "356.29", + "numicubeds": "1812.43", + "numicubedsadult": "1331.29", + "numicubedsped": "417.14", + "numicubedsocc": "1282.05", + "numicubedsoccadult": "1015.62", + "numicubedsoccped": "217.14", + "numconfc19hosppatsadult": "886.76", + "numconfc19hosppatsped": "14.43", + "totalconfc19hosppats": "901.19", + "totalconffluhosppats": "0.0", + "numconfc19icupatsadult": "355.07", + "totalconfc19icupats": "355.07", + "totalconffluicupats": "0.0", + "totalconfc19newadmped": "24.0", + "numconfc19newadmadult18to49": "336.0", + "totalconfc19newadmadult": "931.0", + "numconfc19newadmunk": "4.0", + "totalconfc19newadm": "955.0", + "totalconfflunewadm": "0.0", + "pctinptbedsocc": "0.7007", + "pctconfc19inptbeds": "0.086", + "pctconffluinptbeds": "0.0", + "pcticubedsocc": "0.7074", + "pctconfc19icubeds": "0.1959", + "pctconffluicubeds": "0.0", + "pctconfc19newadmadult": "0.9749", + "pctconfc19newadmped": "0.0251", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "0.9293", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.7879", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-09-18T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "743361.31", + "numinptbedsadult": "672737.5", + "numinptbedsped": "51159.55", + "numinptbedsocc": "577511.09", + "numinptbedsoccadult": "530000.29", + "numinptbedsoccped": "34247.45", + "numicubeds": "119256.47", + "numicubedsadult": "90798.21", + "numicubedsped": "20908.8", + "numicubedsocc": "92343.47", + "numicubedsoccadult": "73185.44", + "numicubedsoccped": "14310.5", + "numconfc19hosppatsadult": "94483.65", + "numconfc19hosppatsped": "1412.23", + "totalconfc19hosppats": "95895.88", + "totalconffluhosppats": "284.98", + "numconfc19icupatsadult": "27151.26", + "totalconfc19icupats": "27151.26", + "totalconffluicupats": "67.43", + "totalconfc19newadmped": "2379.0", + "numconfc19newadmadult18to49": "21561.0", + "totalconfc19newadmadult": "76790.0", + "numconfc19newadmunk": "4010.0", + "totalconfc19newadm": "79169.0", + "totalconfflunewadm": "261.0", + "pctinptbedsocc": "0.7769", + "pctconfc19inptbeds": "0.129", + "pctconffluinptbeds": "0.0004", + "pcticubedsocc": "0.7743", + "pctconfc19icubeds": "0.2277", + "pctconffluicubeds": "0.0006", + "pctconfc19newadmadult": "0.97", + "pctconfc19newadmped": "0.03", + "numinptbedshosprep": "5398", + "numinptbedsocchosprep": "5398", + "numicubedshosprep": "5398", + "numicubedsocchosprep": "5398", + "totalconfc19hosppatshosprep": "5395", + "totalconffluhosppatshosprep": "4366", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5395", + "totalconffluicupatshosprep": "4361", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5278", + "totalconfc19newadmadulthosprep": "5394", + "totalconfc19newadmhosprep": "5394", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4362", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5398", + "pcticubedsocchosprep": "5398", + "pctconfc19inptbedshosprep": "5395", + "pctconffluinptbedshosprep": "4366", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5395", + "pctconffluicubedshosprep": "4361", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.948", + "numinptbedsoccperchosprep": "0.948", + "numicubedsperchosprep": "0.948", + "numicubedsoccperchosprep": "0.948", + "totalconfc19hosppatsperc": "0.9475", + "totalconffluhosppatsperc": "0.7668", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9475", + "totalconffluicupatsperchosprep": "0.7659", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9269", + "totalconfc19newadmadultp": "0.9473", + "totalconfc19newadmperchosprep": "0.9473", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.7661", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.948", + "pcticubedsoccperchosprep": "0.948", + "pctconfc19inptbedsperchosprep": "0.9475", + "pctconffluinptbedsperchosprep": "0.7668", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9475", + "pctconffluicubedsperchosprep": "0.7659", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0005", + "numinptbedsoccperchospre": "0.0005", + "numicubedsperchosprepabschg": "0.0005", + "numicubedsoccperchosprepabschg": "0.0005", + "totalconfc19hosppatsperc_1": "0.0005", + "totalconffluhosppatsperc_1": "-0.0023", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0005", + "totalconffluicupatsperch": "-0.0026", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0007", + "totalconfc19newadmadultp_1": "0.0005", + "totalconfc19newadmpercho": "0.0005", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "-0.0026", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0005", + "pcticubedsoccperchosprepabschg": "0.0005", + "pctconfc19inptbedspercho": "0.0005", + "pctconffluinptbedspercho": "-0.0023", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0005", + "pctconffluicubedsperchos": "-0.0026", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-09-25T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10463.14", + "numinptbedsadult": "9234.71", + "numinptbedsped": "660.71", + "numinptbedsocc": "7255.57", + "numinptbedsoccadult": "6512.71", + "numinptbedsoccped": "301.43", + "numicubeds": "1803.43", + "numicubedsadult": "1322.29", + "numicubedsped": "306.14", + "numicubedsocc": "1263.0", + "numicubedsoccadult": "996.71", + "numicubedsoccped": "157.71", + "numconfc19hosppatsadult": "881.43", + "numconfc19hosppatsped": "14.43", + "totalconfc19hosppats": "895.86", + "totalconffluhosppats": "0.0", + "numconfc19icupatsadult": "337.0", + "totalconfc19icupats": "337.0", + "totalconffluicupats": "0.0", + "totalconfc19newadmped": "31.0", + "numconfc19newadmadult18to49": "274.0", + "totalconfc19newadmadult": "962.0", + "numconfc19newadmunk": "9.0", + "totalconfc19newadm": "993.0", + "totalconfflunewadm": "0.0", + "pctinptbedsocc": "0.6934", + "pctconfc19inptbeds": "0.0856", + "pctconffluinptbeds": "0.0", + "pcticubedsocc": "0.7003", + "pctconfc19icubeds": "0.1869", + "pctconffluicubeds": "0.0", + "pctconfc19newadmadult": "0.9688", + "pctconfc19newadmped": "0.0312", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "0.9293", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.7879", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-09-25T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "741350.4", + "numinptbedsadult": "671327.23", + "numinptbedsped": "50705.01", + "numinptbedsocc": "571176.7", + "numinptbedsoccadult": "524034.78", + "numinptbedsoccped": "34189.04", + "numicubeds": "118806.55", + "numicubedsadult": "90455.86", + "numicubedsped": "21079.05", + "numicubedsocc": "91121.6", + "numicubedsoccadult": "72020.5", + "numicubedsoccped": "14283.63", + "numconfc19hosppatsadult": "84589.63", + "numconfc19hosppatsped": "1299.24", + "totalconfc19hosppats": "85888.87", + "totalconffluhosppats": "272.38", + "numconfc19icupatsadult": "24967.04", + "totalconfc19icupats": "24967.04", + "totalconffluicupats": "56.14", + "totalconfc19newadmped": "1949.0", + "numconfc19newadmadult18to49": "18280.0", + "totalconfc19newadmadult": "65791.0", + "numconfc19newadmunk": "3675.0", + "totalconfc19newadm": "67740.0", + "totalconfflunewadm": "234.0", + "pctinptbedsocc": "0.7705", + "pctconfc19inptbeds": "0.1159", + "pctconffluinptbeds": "0.0004", + "pcticubedsocc": "0.767", + "pctconfc19icubeds": "0.2101", + "pctconffluicubeds": "0.0005", + "pctconfc19newadmadult": "0.9712", + "pctconfc19newadmped": "0.0288", + "numinptbedshosprep": "5397", + "numinptbedsocchosprep": "5397", + "numicubedshosprep": "5397", + "numicubedsocchosprep": "5397", + "totalconfc19hosppatshosprep": "5394", + "totalconffluhosppatshosprep": "4372", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5394", + "totalconffluicupatshosprep": "4366", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5277", + "totalconfc19newadmadulthosprep": "5393", + "totalconfc19newadmhosprep": "5393", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4368", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5397", + "pcticubedsocchosprep": "5397", + "pctconfc19inptbedshosprep": "5394", + "pctconffluinptbedshosprep": "4372", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5394", + "pctconffluicubedshosprep": "4366", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9478", + "numinptbedsoccperchosprep": "0.9478", + "numicubedsperchosprep": "0.9478", + "numicubedsoccperchosprep": "0.9478", + "totalconfc19hosppatsperc": "0.9473", + "totalconffluhosppatsperc": "0.7678", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9473", + "totalconffluicupatsperchosprep": "0.7668", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9268", + "totalconfc19newadmadultp": "0.9471", + "totalconfc19newadmperchosprep": "0.9471", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.7671", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9478", + "pcticubedsoccperchosprep": "0.9478", + "pctconfc19inptbedsperchosprep": "0.9473", + "pctconffluinptbedsperchosprep": "0.7678", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9473", + "pctconffluicubedsperchosprep": "0.7668", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "-0.0002", + "numinptbedsoccperchospre": "-0.0002", + "numicubedsperchosprepabschg": "-0.0002", + "numicubedsoccperchosprepabschg": "-0.0002", + "totalconfc19hosppatsperc_1": "-0.0002", + "totalconffluhosppatsperc_1": "0.0011", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "-0.0002", + "totalconffluicupatsperch": "0.0009", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "-0.0002", + "totalconfc19newadmadultp_1": "-0.0002", + "totalconfc19newadmpercho": "-0.0002", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0011", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "-0.0002", + "pcticubedsoccperchosprepabschg": "-0.0002", + "pctconfc19inptbedspercho": "-0.0002", + "pctconffluinptbedspercho": "0.0011", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "-0.0002", + "pctconffluicubedsperchos": "0.0009", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-10-02T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10417.57", + "numinptbedsadult": "9192.71", + "numinptbedsped": "657.71", + "numinptbedsocc": "7275.74", + "numinptbedsoccadult": "6520.74", + "numinptbedsoccped": "317.86", + "numicubeds": "1807.71", + "numicubedsadult": "1331.57", + "numicubedsped": "301.14", + "numicubedsocc": "1314.93", + "numicubedsoccadult": "1039.21", + "numicubedsoccped": "176.14", + "numconfc19hosppatsadult": "860.76", + "numconfc19hosppatsped": "23.43", + "totalconfc19hosppats": "884.19", + "totalconffluhosppats": "0.0", + "numconfc19icupatsadult": "310.26", + "totalconfc19icupats": "310.26", + "totalconffluicupats": "0.0", + "totalconfc19newadmped": "49.0", + "numconfc19newadmadult18to49": "274.0", + "totalconfc19newadmadult": "921.0", + "numconfc19newadmunk": "0.0", + "totalconfc19newadm": "970.0", + "totalconfflunewadm": "0.0", + "pctinptbedsocc": "0.6984", + "pctconfc19inptbeds": "0.0849", + "pctconffluinptbeds": "0.0", + "pcticubedsocc": "0.7274", + "pctconfc19icubeds": "0.1716", + "pctconffluicubeds": "0.0", + "pctconfc19newadmadult": "0.9495", + "pctconfc19newadmped": "0.0505", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "0.9293", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.7879", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-10-02T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "740148.71", + "numinptbedsadult": "669456.02", + "numinptbedsped": "50239.71", + "numinptbedsocc": "565301.31", + "numinptbedsoccadult": "518444.26", + "numinptbedsoccped": "33398.35", + "numicubeds": "118016.14", + "numicubedsadult": "89835.76", + "numicubedsped": "20933.11", + "numicubedsocc": "89779.08", + "numicubedsoccadult": "70591.46", + "numicubedsoccped": "14267.9", + "numconfc19hosppatsadult": "73540.56", + "numconfc19hosppatsped": "1161.02", + "totalconfc19hosppats": "74701.58", + "totalconffluhosppats": "253.17", + "numconfc19icupatsadult": "21970.69", + "totalconfc19icupats": "21970.69", + "totalconffluicupats": "51.0", + "totalconfc19newadmped": "1642.0", + "numconfc19newadmadult18to49": "15107.0", + "totalconfc19newadmadult": "56434.0", + "numconfc19newadmunk": "3264.0", + "totalconfc19newadm": "58076.0", + "totalconfflunewadm": "253.0", + "pctinptbedsocc": "0.7638", + "pctconfc19inptbeds": "0.1009", + "pctconffluinptbeds": "0.0003", + "pcticubedsocc": "0.7607", + "pctconfc19icubeds": "0.1862", + "pctconffluicubeds": "0.0004", + "pctconfc19newadmadult": "0.9717", + "pctconfc19newadmped": "0.0283", + "numinptbedshosprep": "5399", + "numinptbedsocchosprep": "5399", + "numicubedshosprep": "5399", + "numicubedsocchosprep": "5399", + "totalconfc19hosppatshosprep": "5396", + "totalconffluhosppatshosprep": "4397", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5396", + "totalconffluicupatshosprep": "4388", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5279", + "totalconfc19newadmadulthosprep": "5395", + "totalconfc19newadmhosprep": "5395", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4391", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5399", + "pcticubedsocchosprep": "5399", + "pctconfc19inptbedshosprep": "5396", + "pctconffluinptbedshosprep": "4397", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5396", + "pctconffluicubedshosprep": "4388", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9482", + "numinptbedsoccperchosprep": "0.9482", + "numicubedsperchosprep": "0.9482", + "numicubedsoccperchosprep": "0.9482", + "totalconfc19hosppatsperc": "0.9477", + "totalconffluhosppatsperc": "0.7722", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9477", + "totalconffluicupatsperchosprep": "0.7706", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9271", + "totalconfc19newadmadultp": "0.9475", + "totalconfc19newadmperchosprep": "0.9475", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.7712", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9482", + "pcticubedsoccperchosprep": "0.9482", + "pctconfc19inptbedsperchosprep": "0.9477", + "pctconffluinptbedsperchosprep": "0.7722", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9477", + "pctconffluicubedsperchosprep": "0.7706", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0004", + "numinptbedsoccperchospre": "0.0004", + "numicubedsperchosprepabschg": "0.0004", + "numicubedsoccperchosprepabschg": "0.0004", + "totalconfc19hosppatsperc_1": "0.0004", + "totalconffluhosppatsperc_1": "0.0044", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0004", + "totalconffluicupatsperch": "0.0039", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0004", + "totalconfc19newadmadultp_1": "0.0004", + "totalconfc19newadmpercho": "0.0004", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.004", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0004", + "pcticubedsoccperchosprepabschg": "0.0004", + "pctconfc19inptbedspercho": "0.0004", + "pctconffluinptbedspercho": "0.0044", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0004", + "pctconffluicubedsperchos": "0.0039", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-10-09T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10435.0", + "numinptbedsadult": "9200.71", + "numinptbedsped": "667.14", + "numinptbedsocc": "7363.83", + "numinptbedsoccadult": "6586.98", + "numinptbedsoccped": "324.86", + "numicubeds": "1801.14", + "numicubedsadult": "1326.29", + "numicubedsped": "299.86", + "numicubedsocc": "1378.29", + "numicubedsoccadult": "1100.29", + "numicubedsoccped": "181.0", + "numconfc19hosppatsadult": "902.43", + "numconfc19hosppatsped": "21.43", + "totalconfc19hosppats": "923.86", + "totalconffluhosppats": "0.14", + "numconfc19icupatsadult": "313.57", + "totalconfc19icupats": "313.57", + "totalconffluicupats": "0.0", + "totalconfc19newadmped": "36.0", + "numconfc19newadmadult18to49": "318.0", + "totalconfc19newadmadult": "1043.0", + "numconfc19newadmunk": "4.0", + "totalconfc19newadm": "1079.0", + "totalconfflunewadm": "1.0", + "pctinptbedsocc": "0.7057", + "pctconfc19inptbeds": "0.0885", + "pctconffluinptbeds": "0.0", + "pcticubedsocc": "0.7652", + "pctconfc19icubeds": "0.1741", + "pctconffluicubeds": "0.0", + "pctconfc19newadmadult": "0.9666", + "pctconfc19newadmped": "0.0334", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "0.9293", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.7879", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-10-09T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "733424.54", + "numinptbedsadult": "664396.0", + "numinptbedsped": "49907.38", + "numinptbedsocc": "559358.6", + "numinptbedsoccadult": "512696.2", + "numinptbedsoccped": "33474.79", + "numicubeds": "116653.35", + "numicubedsadult": "88638.07", + "numicubedsped": "20853.11", + "numicubedsocc": "87458.7", + "numicubedsoccadult": "68650.56", + "numicubedsoccped": "13957.53", + "numconfc19hosppatsadult": "63806.61", + "numconfc19hosppatsped": "1008.47", + "totalconfc19hosppats": "64815.08", + "totalconffluhosppats": "275.72", + "numconfc19icupatsadult": "19250.85", + "totalconfc19icupats": "19250.85", + "totalconffluicupats": "57.57", + "totalconfc19newadmped": "1373.0", + "numconfc19newadmadult18to49": "13335.0", + "totalconfc19newadmadult": "50371.0", + "numconfc19newadmunk": "2933.0", + "totalconfc19newadm": "51744.0", + "totalconfflunewadm": "341.0", + "pctinptbedsocc": "0.7627", + "pctconfc19inptbeds": "0.0884", + "pctconffluinptbeds": "0.0004", + "pcticubedsocc": "0.7497", + "pctconfc19icubeds": "0.165", + "pctconffluicubeds": "0.0005", + "pctconfc19newadmadult": "0.9735", + "pctconfc19newadmped": "0.0265", + "numinptbedshosprep": "5400", + "numinptbedsocchosprep": "5400", + "numicubedshosprep": "5400", + "numicubedsocchosprep": "5400", + "totalconfc19hosppatshosprep": "5397", + "totalconffluhosppatshosprep": "4387", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5397", + "totalconffluicupatshosprep": "4374", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5280", + "totalconfc19newadmadulthosprep": "5396", + "totalconfc19newadmhosprep": "5396", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4379", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5400", + "pcticubedsocchosprep": "5400", + "pctconfc19inptbedshosprep": "5397", + "pctconffluinptbedshosprep": "4387", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5397", + "pctconffluicubedshosprep": "4374", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9484", + "numinptbedsoccperchosprep": "0.9484", + "numicubedsperchosprep": "0.9484", + "numicubedsoccperchosprep": "0.9484", + "totalconfc19hosppatsperc": "0.9478", + "totalconffluhosppatsperc": "0.7705", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9478", + "totalconffluicupatsperchosprep": "0.7682", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9273", + "totalconfc19newadmadultp": "0.9477", + "totalconfc19newadmperchosprep": "0.9477", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.7691", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9484", + "pcticubedsoccperchosprep": "0.9484", + "pctconfc19inptbedsperchosprep": "0.9478", + "pctconffluinptbedsperchosprep": "0.7705", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9478", + "pctconffluicubedsperchosprep": "0.7682", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0002", + "numinptbedsoccperchospre": "0.0002", + "numicubedsperchosprepabschg": "0.0002", + "numicubedsoccperchosprepabschg": "0.0002", + "totalconfc19hosppatsperc_1": "0.0002", + "totalconffluhosppatsperc_1": "-0.0018", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0002", + "totalconffluicupatsperch": "-0.0025", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0002", + "totalconfc19newadmadultp_1": "0.0002", + "totalconfc19newadmpercho": "0.0002", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "-0.0021", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0002", + "pcticubedsoccperchosprepabschg": "0.0002", + "pctconfc19inptbedspercho": "0.0002", + "pctconffluinptbedspercho": "-0.0018", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0002", + "pctconffluicubedsperchos": "-0.0025", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-10-16T00:00:00.000", + "jurisdiction": "CO", + "numinptbeds": "10426.29", + "numinptbedsadult": "9195.0", + "numinptbedsped": "664.14", + "numinptbedsocc": "7365.71", + "numinptbedsoccadult": "6590.86", + "numinptbedsoccped": "322.71", + "numicubeds": "1820.57", + "numicubedsadult": "1345.29", + "numicubedsped": "300.29", + "numicubedsocc": "1362.0", + "numicubedsoccadult": "1088.0", + "numicubedsoccped": "176.71", + "numconfc19hosppatsadult": "996.86", + "numconfc19hosppatsped": "19.57", + "totalconfc19hosppats": "1016.43", + "totalconffluhosppats": "0.86", + "numconfc19icupatsadult": "346.14", + "totalconfc19icupats": "346.14", + "totalconffluicupats": "0.0", + "totalconfc19newadmped": "38.0", + "numconfc19newadmadult18to49": "332.0", + "totalconfc19newadmadult": "1193.0", + "numconfc19newadmunk": "8.0", + "totalconfc19newadm": "1231.0", + "totalconfflunewadm": "0.0", + "pctinptbedsocc": "0.7065", + "pctconfc19inptbeds": "0.0975", + "pctconffluinptbeds": "0.0001", + "pcticubedsocc": "0.7481", + "pctconfc19icubeds": "0.1901", + "pctconffluicubeds": "0.0", + "pctconfc19newadmadult": "0.9691", + "pctconfc19newadmped": "0.0309", + "numinptbedshosprep": "92", + "numinptbedsocchosprep": "92", + "numicubedshosprep": "92", + "numicubedsocchosprep": "92", + "totalconfc19hosppatshosprep": "92", + "totalconffluhosppatshosprep": "78", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "92", + "totalconffluicupatshosprep": "78", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "90", + "totalconfc19newadmadulthosprep": "92", + "totalconfc19newadmhosprep": "92", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "78", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "92", + "pcticubedsocchosprep": "92", + "pctconfc19inptbedshosprep": "92", + "pctconffluinptbedshosprep": "78", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "92", + "pctconffluicubedshosprep": "78", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9293", + "numinptbedsoccperchosprep": "0.9293", + "numicubedsperchosprep": "0.9293", + "numicubedsoccperchosprep": "0.9293", + "totalconfc19hosppatsperc": "0.9293", + "totalconffluhosppatsperc": "0.7879", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9293", + "totalconffluicupatsperchosprep": "0.7879", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9091", + "totalconfc19newadmadultp": "0.9293", + "totalconfc19newadmperchosprep": "0.9293", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.7879", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9293", + "pcticubedsoccperchosprep": "0.9293", + "pctconfc19inptbedsperchosprep": "0.9293", + "pctconffluinptbedsperchosprep": "0.7879", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9293", + "pctconffluicubedsperchosprep": "0.7879", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "0.0", + "numinptbedsoccperchospre": "0.0", + "numicubedsperchosprepabschg": "0.0", + "numicubedsoccperchosprepabschg": "0.0", + "totalconfc19hosppatsperc_1": "0.0", + "totalconffluhosppatsperc_1": "0.0", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "0.0", + "totalconffluicupatsperch": "0.0", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "0.0", + "totalconfc19newadmadultp_1": "0.0", + "totalconfc19newadmpercho": "0.0", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "0.0", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "0.0", + "pcticubedsoccperchosprepabschg": "0.0", + "pctconfc19inptbedspercho": "0.0", + "pctconffluinptbedspercho": "0.0", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "0.0", + "pctconffluicubedsperchos": "0.0", + "pctconfrsvicubedsperchos": "0.0" + }, + { + "weekendingdate": "2021-10-16T00:00:00.000", + "jurisdiction": "USA", + "numinptbeds": "729772.05", + "numinptbedsadult": "660758.41", + "numinptbedsped": "53387.68", + "numinptbedsocc": "556817.29", + "numinptbedsoccadult": "510524.46", + "numinptbedsoccped": "35679.97", + "numicubeds": "114471.4", + "numicubedsadult": "86925.11", + "numicubedsped": "21902.45", + "numicubedsocc": "85344.84", + "numicubedsoccadult": "66877.69", + "numicubedsoccped": "14657.22", + "numconfc19hosppatsadult": "55448.05", + "numconfc19hosppatsped": "847.15", + "totalconfc19hosppats": "56295.2", + "totalconffluhosppats": "259.85", + "numconfc19icupatsadult": "18104.6", + "totalconfc19icupats": "18104.6", + "totalconffluicupats": "39.33", + "totalconfc19newadmped": "1301.0", + "numconfc19newadmadult18to49": "11532.0", + "totalconfc19newadmadult": "44677.0", + "numconfc19newadmunk": "1982.0", + "totalconfc19newadm": "45978.0", + "totalconfflunewadm": "266.0", + "pctinptbedsocc": "0.763", + "pctconfc19inptbeds": "0.0771", + "pctconffluinptbeds": "0.0004", + "pcticubedsocc": "0.7456", + "pctconfc19icubeds": "0.1582", + "pctconffluicubeds": "0.0003", + "pctconfc19newadmadult": "0.9717", + "pctconfc19newadmped": "0.0283", + "numinptbedshosprep": "5396", + "numinptbedsocchosprep": "5396", + "numicubedshosprep": "5396", + "numicubedsocchosprep": "5396", + "totalconfc19hosppatshosprep": "5396", + "totalconffluhosppatshosprep": "4317", + "totalconfrsvhosppatshosprep": "0", + "totalconfc19icupatshosprep": "5396", + "totalconffluicupatshosprep": "4306", + "totalconfrsvicupatshosprep": "0", + "totalconfc19newadmpedhosprep": "5278", + "totalconfc19newadmadulthosprep": "5394", + "totalconfc19newadmhosprep": "5394", + "totalconfflunewadmpedhosprep": "0", + "totalconfflunewadmadulthosprep": "0", + "totalconfflunewadmhosprep": "4307", + "totalconfrsvnewadmpedhosprep": "0", + "totalconfrsvnewadmadulthosprep": "0", + "totalconfrsvnewadmhosprep": "0", + "pctinptbedsocchosprep": "5396", + "pcticubedsocchosprep": "5396", + "pctconfc19inptbedshosprep": "5396", + "pctconffluinptbedshosprep": "4317", + "pctconfrsvinptbedshosprep": "0", + "pctconfc19icubedshosprep": "5396", + "pctconffluicubedshosprep": "4306", + "pctconfrsvicubedshosprep": "0", + "numinptbedsperchosprep": "0.9477", + "numinptbedsoccperchosprep": "0.9477", + "numicubedsperchosprep": "0.9477", + "numicubedsoccperchosprep": "0.9477", + "totalconfc19hosppatsperc": "0.9477", + "totalconffluhosppatsperc": "0.7582", + "totalconfrsvhosppatsperc": "0.0", + "totalconfc19icupatsperchosprep": "0.9477", + "totalconffluicupatsperchosprep": "0.7562", + "totalconfrsvicupatsperchosprep": "0.0", + "totalconfc19newadmpedper": "0.9269", + "totalconfc19newadmadultp": "0.9473", + "totalconfc19newadmperchosprep": "0.9473", + "totalconfflunewadmpedper": "0.0", + "totalconfflunewadmadultp": "0.0", + "totalconfflunewadmperchosprep": "0.7564", + "totalconfrsvnewadmpedper": "0.0", + "totalconfrsvnewadmadultp": "0.0", + "totalconfrsvnewadmperchosprep": "0.0", + "pctinptbedsoccperchosprep": "0.9477", + "pcticubedsoccperchosprep": "0.9477", + "pctconfc19inptbedsperchosprep": "0.9477", + "pctconffluinptbedsperchosprep": "0.7582", + "pctconfrsvinptbedsperchosprep": "0.0", + "pctconfc19icubedsperchosprep": "0.9477", + "pctconffluicubedsperchosprep": "0.7562", + "pctconfrsvicubedsperchosprep": "0.0", + "numinptbedsperchosprepabschg": "-0.0007", + "numinptbedsoccperchospre": "-0.0007", + "numicubedsperchosprepabschg": "-0.0007", + "numicubedsoccperchosprepabschg": "-0.0007", + "totalconfc19hosppatsperc_1": "-0.0002", + "totalconffluhosppatsperc_1": "-0.0123", + "totalconfrsvhosppatsperc_1": "0.0", + "totalconfc19icupatsperch": "-0.0002", + "totalconffluicupatsperch": "-0.0119", + "totalconfrsvicupatsperch": "0.0", + "totalconfc19newadmpedper_1": "-0.0004", + "totalconfc19newadmadultp_1": "-0.0004", + "totalconfc19newadmpercho": "-0.0004", + "totalconfflunewadmpedper_1": "0.0", + "totalconfflunewadmadultp_1": "0.0", + "totalconfflunewadmpercho": "-0.0126", + "totalconfrsvnewadmpedper_1": "0.0", + "totalconfrsvnewadmadultp_1": "0.0", + "totalconfrsvnewadmpercho": "0.0", + "pctinptbedsoccperchospre": "-0.0007", + "pcticubedsoccperchosprepabschg": "-0.0007", + "pctconfc19inptbedspercho": "-0.0002", + "pctconffluinptbedspercho": "-0.0123", + "pctconfrsvinptbedspercho": "0.0", + "pctconfc19icubedsperchos": "-0.0002", + "pctconffluicubedsperchos": "-0.0119", + "pctconfrsvicubedsperchos": "0.0" + } +] \ No newline at end of file diff --git a/nhsn/tests/test_pull.py b/nhsn/tests/test_pull.py new file mode 100644 index 000000000..c09c838d7 --- /dev/null +++ b/nhsn/tests/test_pull.py @@ -0,0 +1,148 @@ +import glob +from unittest.mock import patch, MagicMock +import os +import pytest + +import pandas as pd + +from delphi_nhsn.pull import ( + pull_nhsn_data, + pull_data, + pull_preliminary_nhsn_data +) +from delphi_nhsn.constants import SIGNALS_MAP, PRELIM_SIGNALS_MAP + +from delphi_utils import get_structured_logger +from conftest import TEST_DATA, PRELIM_TEST_DATA + + +DATASETS = [{"id":"ua7e-t2fy", + "test_data": TEST_DATA}, + {"id":"mpgq-jmmr", + "test_data":PRELIM_TEST_DATA} + ] + + +class TestPullNHSNData: + @patch("delphi_nhsn.pull.Socrata") + @pytest.mark.parametrize('dataset', DATASETS, ids=["data", "prelim_data"]) + def test_socrata_call(self, mock_socrata, dataset, params): + test_token = params["indicator"]["socrata_token"] + + # Mock Socrata client and its get method + mock_client = MagicMock() + mock_socrata.return_value = mock_client + mock_client.get.side_effect = [[]] + + pull_data(test_token, dataset["id"]) + + # Check that Socrata client was initialized with correct arguments + mock_socrata.assert_called_once_with("data.cdc.gov", test_token) + + # Check that get method was called with correct arguments + mock_client.get.assert_any_call(dataset["id"], limit=50000, offset=0) + + def test_pull_nhsn_data_output(self, caplog, params): + with patch('sodapy.Socrata.get') as mock_get: + mock_get.side_effect = [TEST_DATA, []] + backup_dir = params["common"]["backup_dir"] + test_token = params["indicator"]["socrata_token"] + custom_run = True + + logger = get_structured_logger() + + result = pull_nhsn_data(test_token, backup_dir, custom_run, logger) + + # Check result + assert result["timestamp"].notnull().all(), "timestamp has rogue NaN" + assert result["geo_id"].notnull().all(), "geography has rogue NaN" + + # Check for each signal in SIGNALS + for signal in SIGNALS_MAP.keys(): + assert result[signal].notnull().all(), f"{signal} has rogue NaN" + def test_pull_nhsn_data_backup(self, caplog, params): + with patch('sodapy.Socrata.get') as mock_get: + mock_get.side_effect = [TEST_DATA, []] + + today = pd.Timestamp.today().strftime("%Y%m%d") + backup_dir = params["common"]["backup_dir"] + custom_run = params["common"]["custom_run"] + test_token = params["indicator"]["socrata_token"] + + # Load test data + expected_data = pd.DataFrame(TEST_DATA) + + logger = get_structured_logger() + # Call function with test token + pull_nhsn_data(test_token, backup_dir, custom_run, logger) + + # Check logger used: + assert "Backup file created" in caplog.text + + # Check that backup file was created + backup_files = glob.glob(f"{backup_dir}/{today}*") + assert len(backup_files) == 2, "Backup file was not created" + + for backup_file in backup_files: + if backup_file.endswith(".csv.gz"): + dtypes = expected_data.dtypes.to_dict() + actual_data = pd.read_csv(backup_file, dtype=dtypes) + else: + actual_data = pd.read_parquet(backup_file) + pd.testing.assert_frame_equal(expected_data, actual_data) + + # clean up + for file in backup_files: + os.remove(file) + def test_pull_prelim_nhsn_data_output(self, caplog, params): + with patch('sodapy.Socrata.get') as mock_get: + mock_get.side_effect = [PRELIM_TEST_DATA, []] + backup_dir = params["common"]["backup_dir"] + test_token = params["indicator"]["socrata_token"] + custom_run = True + + logger = get_structured_logger() + + result = pull_preliminary_nhsn_data(test_token, backup_dir, custom_run, logger) + + # Check result + assert result["timestamp"].notnull().all(), "timestamp has rogue NaN" + assert result["geo_id"].notnull().all(), "geography has rogue NaN" + + # Check for each signal in SIGNALS + for signal in PRELIM_SIGNALS_MAP.keys(): + assert result[signal].notnull().all(), f"{signal} has rogue NaN" + def test_pull_prelim_nhsn_data_backup(self, caplog, params): + with patch('sodapy.Socrata.get') as mock_get: + mock_get.side_effect = [PRELIM_TEST_DATA, []] + + today = pd.Timestamp.today().strftime("%Y%m%d") + backup_dir = params["common"]["backup_dir"] + custom_run = params["common"]["custom_run"] + test_token = params["indicator"]["socrata_token"] + + # Load test data + expected_data = pd.DataFrame(PRELIM_TEST_DATA) + + logger = get_structured_logger() + # Call function with test token + pull_preliminary_nhsn_data(test_token, backup_dir, custom_run, logger) + + # Check logger used: + assert "Backup file created" in caplog.text + + # Check that backup file was created + backup_files = glob.glob(f"{backup_dir}/{today}*") + assert len(backup_files) == 2, "Backup file was not created" + + for backup_file in backup_files: + if backup_file.endswith(".csv.gz"): + dtypes = expected_data.dtypes.to_dict() + actual_data = pd.read_csv(backup_file, dtype=dtypes) + else: + actual_data = pd.read_parquet(backup_file) + pd.testing.assert_frame_equal(expected_data, actual_data) + + # clean up + for file in backup_files: + os.remove(file) \ No newline at end of file diff --git a/nhsn/tests/test_run.py b/nhsn/tests/test_run.py new file mode 100644 index 000000000..cfc47e50f --- /dev/null +++ b/nhsn/tests/test_run.py @@ -0,0 +1,49 @@ +import os +from pathlib import Path + +import pandas as pd +from epiweeks import Week + +from delphi_nhsn.constants import SIGNALS_MAP, PRELIM_SIGNALS_MAP + + +class TestRun: + def generate_week_file_prefix(self, dates): + + epiweeks_lst = [ Week.fromdate(pd.to_datetime(str(date))) for date in dates ] + date_prefix = [ + str(t.year) + str(t.week).zfill(2) + for t in epiweeks_lst + ] + return date_prefix + + def test_output_files_exist(self, params, run_as_module): + export_dir = params["common"]["export_dir"] + csv_files = [f.name for f in Path(export_dir).glob("*.csv")] + geos = ["nation", "state", "hhs"] + metrics = list(SIGNALS_MAP.keys()) + list(PRELIM_SIGNALS_MAP.keys()) + dates = [ + "2021-08-21", "2021-08-28", "2021-09-04", + "2021-09-11", "2021-09-18", "2021-09-25", + "2021-10-02", "2021-10-09", "2021-10-16" + ] + date_prefix = self.generate_week_file_prefix(dates) + + expected_files = [] + for geo in geos: + for d in date_prefix: + for metric in metrics: + expected_files += [f"weekly_{d}_{geo}_{metric}.csv"] + assert set(csv_files).issubset(set(expected_files)) + + for geo in geos: + df = pd.read_csv( + f"{export_dir}/weekly_{date_prefix[3]}_{geo}_{metrics[0]}.csv") + + expected_columns = [ + "geo_id", "val", "se", "sample_size", + ] + assert (df.columns.values == expected_columns).all() + + for file in Path(export_dir).glob("*.csv"): + os.remove(file) From 0cd6b18329bb9501fc48bdd15fe3d09a3b4afcf9 Mon Sep 17 00:00:00 2001 From: aysim319 Date: Tue, 10 Dec 2024 15:47:22 -0500 Subject: [PATCH 12/15] adding missing param and fixing typo (#2084) --- ansible/templates/nhsn-params-prod.json.j2 | 3 ++- nhsn/delphi_nhsn/pull.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ansible/templates/nhsn-params-prod.json.j2 b/ansible/templates/nhsn-params-prod.json.j2 index 436017ba9..97ad4b0ff 100644 --- a/ansible/templates/nhsn-params-prod.json.j2 +++ b/ansible/templates/nhsn-params-prod.json.j2 @@ -8,7 +8,8 @@ "indicator": { "wip_signal": true, "static_file_dir": "./static", - "socrata_token": "{{ nhsn_token }}" + "socrata_token": "{{ nhsn_token }}", + "export_start_date": "2020-08-08" }, "validation": { "common": { diff --git a/nhsn/delphi_nhsn/pull.py b/nhsn/delphi_nhsn/pull.py index 7c200bf3a..2e1114142 100644 --- a/nhsn/delphi_nhsn/pull.py +++ b/nhsn/delphi_nhsn/pull.py @@ -28,7 +28,7 @@ def pull_data(socrata_token: str, dataset_id: str): def pull_nhsn_data(socrata_token: str, backup_dir: str, custom_run: bool, logger: Optional[logging.Logger] = None): - """Pull the latest NSSP ER visits data, and conforms it into a dataset. + """Pull the latest NHSN hospital admission data, and conforms it into a dataset. The output dataset has: @@ -77,7 +77,7 @@ def pull_nhsn_data(socrata_token: str, backup_dir: str, custom_run: bool, logger def pull_preliminary_nhsn_data( socrata_token: str, backup_dir: str, custom_run: bool, logger: Optional[logging.Logger] = None ): - """Pull the latest NSSP ER visits data, and conforms it into a dataset. + """Pull the latest preliminary NHSN hospital admission data, and conforms it into a dataset. The output dataset has: From df0c7bd4bd8a012d82781aac1271a5e8de26231c Mon Sep 17 00:00:00 2001 From: Delphi Deploy Bot Date: Wed, 11 Dec 2024 16:34:32 +0000 Subject: [PATCH 13/15] chore: bump delphi_utils to 0.3.26 --- _delphi_utils_python/.bumpversion.cfg | 2 +- _delphi_utils_python/delphi_utils/__init__.py | 2 +- _delphi_utils_python/pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/_delphi_utils_python/.bumpversion.cfg b/_delphi_utils_python/.bumpversion.cfg index 08040f0ec..72694edd8 100644 --- a/_delphi_utils_python/.bumpversion.cfg +++ b/_delphi_utils_python/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.3.25 +current_version = 0.3.26 commit = True message = chore: bump delphi_utils to {new_version} tag = False diff --git a/_delphi_utils_python/delphi_utils/__init__.py b/_delphi_utils_python/delphi_utils/__init__.py index ca5693eaf..76fe90490 100644 --- a/_delphi_utils_python/delphi_utils/__init__.py +++ b/_delphi_utils_python/delphi_utils/__init__.py @@ -14,4 +14,4 @@ from .utils import read_params from .weekday import Weekday -__version__ = "0.3.25" +__version__ = "0.3.26" diff --git a/_delphi_utils_python/pyproject.toml b/_delphi_utils_python/pyproject.toml index 9ec3f5fc5..e27b79e27 100644 --- a/_delphi_utils_python/pyproject.toml +++ b/_delphi_utils_python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "delphi-utils" -version = "0.3.25" +version = "0.3.26" description = "Shared Utility Functions for Indicators" readme = "README.md" requires-python = "== 3.8.*" From 1ed64d03d8b13ca77d0f88f5c5bd839969f0ae93 Mon Sep 17 00:00:00 2001 From: Delphi Deploy Bot Date: Wed, 11 Dec 2024 16:34:32 +0000 Subject: [PATCH 14/15] chore: bump covidcast-indicators to 0.3.57 --- .bumpversion.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 547bad12d..ca0bfeb0b 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.3.56 +current_version = 0.3.57 commit = True message = chore: bump covidcast-indicators to {new_version} tag = False From 98d12ae15c45e7df4c61e819f215afe088f21e35 Mon Sep 17 00:00:00 2001 From: minhkhul Date: Wed, 11 Dec 2024 16:34:33 +0000 Subject: [PATCH 15/15] [create-pull-request] automated change --- changehc/version.cfg | 2 +- claims_hosp/version.cfg | 2 +- doctor_visits/version.cfg | 2 +- google_symptoms/version.cfg | 2 +- hhs_hosp/version.cfg | 2 +- nchs_mortality/version.cfg | 2 +- nssp/version.cfg | 1 + quidel_covidtest/version.cfg | 2 +- sir_complainsalot/version.cfg | 2 +- 9 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 nssp/version.cfg diff --git a/changehc/version.cfg b/changehc/version.cfg index ed4b085f1..6fa3a2551 100644 --- a/changehc/version.cfg +++ b/changehc/version.cfg @@ -1 +1 @@ -current_version = 0.3.56 +current_version = 0.3.57 diff --git a/claims_hosp/version.cfg b/claims_hosp/version.cfg index ed4b085f1..6fa3a2551 100644 --- a/claims_hosp/version.cfg +++ b/claims_hosp/version.cfg @@ -1 +1 @@ -current_version = 0.3.56 +current_version = 0.3.57 diff --git a/doctor_visits/version.cfg b/doctor_visits/version.cfg index ed4b085f1..6fa3a2551 100644 --- a/doctor_visits/version.cfg +++ b/doctor_visits/version.cfg @@ -1 +1 @@ -current_version = 0.3.56 +current_version = 0.3.57 diff --git a/google_symptoms/version.cfg b/google_symptoms/version.cfg index ed4b085f1..6fa3a2551 100644 --- a/google_symptoms/version.cfg +++ b/google_symptoms/version.cfg @@ -1 +1 @@ -current_version = 0.3.56 +current_version = 0.3.57 diff --git a/hhs_hosp/version.cfg b/hhs_hosp/version.cfg index ed4b085f1..6fa3a2551 100644 --- a/hhs_hosp/version.cfg +++ b/hhs_hosp/version.cfg @@ -1 +1 @@ -current_version = 0.3.56 +current_version = 0.3.57 diff --git a/nchs_mortality/version.cfg b/nchs_mortality/version.cfg index ed4b085f1..6fa3a2551 100644 --- a/nchs_mortality/version.cfg +++ b/nchs_mortality/version.cfg @@ -1 +1 @@ -current_version = 0.3.56 +current_version = 0.3.57 diff --git a/nssp/version.cfg b/nssp/version.cfg new file mode 100644 index 000000000..6fa3a2551 --- /dev/null +++ b/nssp/version.cfg @@ -0,0 +1 @@ +current_version = 0.3.57 diff --git a/quidel_covidtest/version.cfg b/quidel_covidtest/version.cfg index ed4b085f1..6fa3a2551 100644 --- a/quidel_covidtest/version.cfg +++ b/quidel_covidtest/version.cfg @@ -1 +1 @@ -current_version = 0.3.56 +current_version = 0.3.57 diff --git a/sir_complainsalot/version.cfg b/sir_complainsalot/version.cfg index ed4b085f1..6fa3a2551 100644 --- a/sir_complainsalot/version.cfg +++ b/sir_complainsalot/version.cfg @@ -1 +1 @@ -current_version = 0.3.56 +current_version = 0.3.57