Skip to content

Commit 13dc15e

Browse files
authored
Merge pull request #758 from cmu-delphi/release/delphi-epidata-0.3.1
Release Delphi Epidata 0.3.1
2 parents 090e49b + 7b0caa0 commit 13dc15e

File tree

11 files changed

+7190
-4842
lines changed

11 files changed

+7190
-4842
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.3.0
2+
current_version = 0.3.1
33
commit = False
44
tag = False
55

docs/api/covidcast-signals/hhs.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ datasets is mirrored in Epidata at the following endpoint:
2424
That dataset contains dozens of columns that break down hospital
2525
resource usage in different ways.
2626

27-
This indicator makes available several commonly-used combinations of
28-
those columns, aggregated geographically. In particular, we include
29-
the sum of all adult and pediatric COVID-19 hospital admissions. This
30-
sum is used as the "ground truth" for hospitalizations by the [COVID-19 Forecast Hub](https://github.com/reichlab/covid19-forecast-hub/blob/master/data-processed/README.md#hospitalizations).
27+
This indicator makes available several commonly-used columns and combinations of
28+
columns, aggregated geographically. In particular, we include the sum of all
29+
adult and pediatric COVID-19 hospital admissions. This sum is used as the
30+
"ground truth" for hospitalizations by the
31+
[COVID-19 Forecast Hub](https://github.com/reichlab/covid19-forecast-hub/blob/master/data-processed/README.md#hospitalizations).
32+
We also include influenza hospital admissions.
3133

3234

3335
| Signal | 7-day average signal | Geography | Resolution | Description |
@@ -36,6 +38,9 @@ sum is used as the "ground truth" for hospitalizations by the [COVID-19 Forecast
3638
| `confirmed_admissions_covid_1d_prop` | `confirmed_admissions_covid_1d_prop_7dav`| state | 1 day | Sum of adult and pediatric confirmed COVID-19 hospital admissions occurring each day, per 100,000 population. <br/> **Earliest date available:** 2019-12-31 |
3739
| `sum_confirmed_suspected_admissions_covid_1d` | `sum_confirmed_suspected_admissions_covid_1d_7dav` | state | 1 day | Sum of adult and pediatric confirmed and suspected COVID-19 hospital admissions occurring each day. <br/> **Earliest date available:** 2019-12-31 |
3840
| `sum_confirmed_suspected_admissions_covid_1d_prop` | `sum_confirmed_suspected_admissions_covid_1d_prop_7dav` | state | 1 day | Sum of adult and pediatric confirmed and suspected COVID-19 hospital admissions occurring each day, per 100,000 population. <br/> **Earliest date available:** 2019-12-31 |
41+
| `confirmed_admissions_influenza_1d` | `confirmed_admissions_influenza_1d_7dav` | state | 1 day | All confirmed influenza hospital admissions occurring each day. We made this signal available November 1, 2021. <br/> **Earliest issue available:** 2021-09-20 <br/> **Earliest date available:** 2020-01-02 |
42+
| `confirmed_admissions_influenza_1d_prop` | `confirmed_admissions_influenza_1d_prop_7dav` | state | 1 day | All confirmed influenza hospital admissions occurring each day, per 100,000 population. We made this signal available November 1, 2021. <br/> **Earliest issue available:** 2021-09-20 <br/> **Earliest date available:** 2020-01-02 |
43+
3944

4045
The 7-day average signals are computed by Delphi by calculating
4146
moving averages of the preceding 7 days, so e.g. the signal for June 7 is the
@@ -49,9 +54,9 @@ average of the underlying data for June 1 through 7, inclusive.
4954

5055
## Estimation
5156

52-
### Statewise, daily resolution
57+
### Statewise, daily resolution, COVID-19
5358

54-
Statewise daily resolution signals use the following four columns from
59+
Statewise daily resolution signals for COVID-19 use the following four columns from
5560
the HHS state timeseries dataset:
5661

5762
* `previous_day_admission_[adult|pediatric]_covid_[confirmed|suspected]`
@@ -72,6 +77,17 @@ The source data specifies that admissions occurred on the previous
7277
day. We automatically adjust the date of each result so that
7378
admissions are incident on that date.
7479

80+
### Statewise, daily resolution, influenza
81+
82+
Statewise daily resolution signals for influenza use the following column from
83+
the HHS state timeseries dataset:
84+
85+
* `previous_day_admission_influenza_confirmed`
86+
87+
The source data specifies that admissions occurred on the previous day. We
88+
automatically adjust the date of each result so that admissions are incident on
89+
that date.
90+
7591
## Limitations
7692

7793
HHS collects data from state and territorial health departments about many, but

docs/symptom-survey/coding.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ your protocol.
301301
Wave 5 was deployed on November 24, 2020. Deployment was phased: a fraction of
302302
users were invited to take Wave 4, while the majority were invited to Wave 5, so
303303
data users can determine if changes in responses are due to survey revisions or
304-
to population changes at the same time. Wave 5 is available in English and all
305-
the languages introduced in Wave 3.
304+
to population changes at the same time. This overlap lasted roughly seven days.
305+
Wave 5 is available in English and all the languages introduced in Wave 3.
306306

307307
Files:
308308

@@ -370,8 +370,9 @@ released:
370370

371371
## Wave 6
372372

373-
Wave 6 was deployed on December 19, 2020. It is available in English and the
374-
languages introduced in Wave 3.
373+
Wave 6 was deployed on December 19, 2020. Deployment was phased: for seven days,
374+
a randomly selected portion of respondents continued to receive Wave 5. Wave 6
375+
is available in English and the languages introduced in Wave 3.
375376

376377
Files:
377378

@@ -405,8 +406,9 @@ when you use responses from multiple waves of this survey.
405406

406407
## Wave 7
407408

408-
Wave 7 was deployed on January 12, 2021. It is available in English and the
409-
languages introduced in Wave 3.
409+
Wave 7 was deployed on January 12, 2021. Because only minor changes were made in
410+
this wave, there was no overlap between waves 6 and 7. It is available in
411+
English and the languages introduced in Wave 3.
410412

411413
Files:
412414

@@ -486,7 +488,7 @@ administered by the University of Maryland](https://covidmap.umd.edu/).
486488

487489
## Wave 10
488490

489-
Wave 10 was deployed on March 2, 2021. For the following 7 days, 15% of
491+
Wave 10 was deployed on March 2, 2021. For the following 7 days, roughly 10% of
490492
respondents (selected at random) continued to receive Wave 8, allowing for
491493
comparisons of responses between the two waves. Wave 10 is available in English
492494
and the languages introduced in Wave 3.
@@ -559,7 +561,7 @@ survey.
559561

560562
## Wave 11
561563

562-
Wave 11 was deployed on May 20, 2021. For the following 14 days, 15% of
564+
Wave 11 was deployed on May 20, 2021. For the following 30 days, about 10% of
563565
respondents (selected at random) continued to receive Wave 10, allowing for
564566
comparisons of responses between the two waves. It is available in English and
565567
the languages introduced in Wave 3.
@@ -790,11 +792,11 @@ are not anticipated to change the respondent’s answer.
790792
Wave 12 was deployed on October 7, 2021. Deployment is in two phases:
791793

792794
* Initially the survey was given only to 15% of survey respondents, the
793-
remainder receiving Wave 11. This phase was used to conduct three experiments
794-
with (1) demographic module placement, (2) vaccination uptake question, and
795-
(3) survey invitation text. Details of these experiments can be found
796-
[below](#experiments). In data files, this is marked as wave "12.5" to
797-
distinguish from the final version.
795+
remainder receiving Wave 11. This phase lasted until October 22. This phase
796+
was used to conduct three experiments with (1) demographic module placement,
797+
(2) vaccination uptake question, and (3) survey invitation text. Details of
798+
these experiments can be found [below](#experiments). In data files, this is
799+
marked as wave "12.5" to distinguish from the final version.
798800
* After results of the experiments are analyzed, a final version will be
799801
deployed using only one demographic module placement and one vaccine uptake
800802
question. This will be marked as wave 12 in the data files.

src/acquisition/covid_hosp/common/utils.py

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -148,25 +148,34 @@ def update_dataset(database, network, newer_than=None, older_than=None):
148148
Whether a new dataset was acquired.
149149
"""
150150
metadata = network.fetch_metadata()
151+
datasets = []
151152
with database.connect() as db:
152153
max_issue = db.get_max_issue()
153-
older_than = datetime.datetime.today().date() if newer_than is None else older_than
154-
newer_than = max_issue if newer_than is None else newer_than
155-
daily_issues = Utils.issues_to_fetch(metadata, newer_than, older_than)
156-
if not daily_issues:
157-
print("no new issues, nothing to do")
158-
return False
159-
for issue, revisions in daily_issues.items():
160-
issue_int = int(issue.strftime("%Y%m%d"))
161-
# download the dataset and add it to the database
162-
dataset = Utils.merge_by_key_cols([network.fetch_dataset(url) for url, _ in revisions],
163-
db.KEY_COLS)
154+
155+
older_than = datetime.datetime.today().date() if newer_than is None else older_than
156+
newer_than = max_issue if newer_than is None else newer_than
157+
daily_issues = Utils.issues_to_fetch(metadata, newer_than, older_than)
158+
if not daily_issues:
159+
print("no new issues, nothing to do")
160+
return False
161+
for issue, revisions in daily_issues.items():
162+
issue_int = int(issue.strftime("%Y%m%d"))
163+
# download the dataset and add it to the database
164+
dataset = Utils.merge_by_key_cols([network.fetch_dataset(url) for url, _ in revisions],
165+
db.KEY_COLS)
166+
# add metadata to the database using the last revision seen.
167+
last_url, last_index = revisions[-1]
168+
metadata_json = metadata.loc[last_index].reset_index().to_json()
169+
datasets.append((
170+
issue_int,
171+
dataset,
172+
last_url,
173+
metadata_json
174+
))
175+
with database.connect() as db:
176+
for issue_int, dataset, last_url, metadata_json in datasets:
164177
db.insert_dataset(issue_int, dataset)
165-
# add metadata to the database using the last revision seen.
166-
last_url, last_index = revisions[-1]
167-
metadata_json = metadata.loc[last_index].reset_index().to_json()
168178
db.insert_metadata(issue_int, last_url, metadata_json)
169-
170179
print(f'successfully acquired {len(dataset)} rows')
171180

172181
# note that the transaction is committed by exiting the `with` block

src/client/delphi_epidata.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Epidata <- (function() {
1515
# API base url
1616
BASE_URL <- 'https://delphi.cmu.edu/epidata/api.php'
1717

18-
client_version <- '0.3.0'
18+
client_version <- '0.3.1'
1919

2020
# Helper function to cast values and/or ranges to strings
2121
.listitem <- function(value) {

src/client/delphi_epidata.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
}
2323
})(this, function (exports, fetchImpl, jQuery) {
2424
const BASE_URL = "https://delphi.cmu.edu/epidata/";
25-
const client_version = "0.3.0";
25+
const client_version = "0.3.1";
2626

2727
// Helper function to cast values and/or ranges to strings
2828
function _listitem(value) {

0 commit comments

Comments
 (0)