Skip to content

Commit f9be532

Browse files
authored
Merge pull request #1008 from cmu-delphi/krivard/covid_hosp-docs-update
Update covid_hosp endpoint documentation with August 2022 limitations
2 parents 4ec482c + 9d97492 commit f9be532

File tree

3 files changed

+45
-10
lines changed

3 files changed

+45
-10
lines changed

docs/api/covid_hosp.md

+23-6
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,22 @@ Hospital Capacity by State" datasets provided by the US Department of
1111
Health & Human Services via healthdata.gov. The latter provides more frequent updates,
1212
so it is combined with the former to create a single dataset which is as recent as possible.
1313

14+
HHS performs up to four days of forward-fill for missing values in the
15+
[facility-level data](covid_hosp_facility.md) which are aggregated to make this
16+
state-level dataset. This sometimes results in repeated values in the state-level data.
17+
A sequence of two repeated values is extremely common, and longer sequences are rare.
18+
Repeated values added in this way are sometimes updated if the underlying missing data can
19+
be completed at a later date.
20+
21+
Starting October 1, 2022, some facilities are only required to report annually.
22+
1423
For more information, see the
1524
[official description and data dictionary at healthdata.gov](https://healthdata.gov/Hospital/COVID-19-Reported-Patient-Impact-and-Hospital-Capa/g62h-syeh)
1625
for "COVID-19 Reported Patient Impact and Hospital Capacity by State Timeseries,"
1726
as well as the [official description](https://healthdata.gov/dataset/COVID-19-Reported-Patient-Impact-and-Hospital-Capa/6xf2-c3ie)
18-
for "COVID-19 Reported Patient Impact and Hospital Capacity by State."
27+
for "COVID-19 Reported Patient Impact and Hospital Capacity by State." The data elements,
28+
cadence, and how the data are being used in the federal response are documented in
29+
[a FAQ published by Health & Human Services](https://www.hhs.gov/sites/default/files/covid-19-faqs-hospitals-hospital-laboratory-acute-care-facility-data-reporting.pdf).
1930

2031
General topics not specific to any particular data source are discussed in the
2132
[API overview](README.md). Such topics include:
@@ -65,7 +76,7 @@ If `issues` is not specified, then the most recent issue is used by default.
6576
| `epidata[].state` | state pertaining to this row | string |
6677
| `epidata[].date` | date pertaining to this row | integer |
6778
| `epidata[].issue` | the date on which the dataset containing this row was published | integer |
68-
| `epidata[].*` | see the [data dictionary](https://healthdata.gov/covid-19-reported-patient-impact-and-hospital-capacity-state-data-dictionary) | |
79+
| `epidata[].*` | see the [data dictionary](https://healthdata.gov/Hospital/COVID-19-Reported-Patient-Impact-and-Hospital-Capa/g62h-syeh). Last synced: 2021-10-21 | |
6980
| `message` | `success` or error message | string |
7081

7182
# Example URLs
@@ -149,25 +160,31 @@ The following sample shows how to import the library and fetch MA on 2020-05-10
149160
### Python
150161

151162
Optionally install the package using pip(env):
152-
````bash
163+
```bash
153164
pip install delphi-epidata
154-
````
165+
```
155166

156167
Otherwise, place `delphi_epidata.py` from this repo next to your python script.
157168

158-
````python
169+
```python
159170
# Import
160171
from delphi_epidata import Epidata
161172
# Fetch data
162173
res = Epidata.covid_hosp('MA', 20200510)
163174
print(res['result'], res['message'], len(res['epidata']))
164-
````
175+
```
165176

166177
# Repair Log
167178

168179
If we ever need to repair the data record due to a bug in our code (not at the
169180
source), we will update the list below.
170181

182+
## October 21, 2021
183+
184+
All issues between 20210430 and 20211021 were re-uploaded to include new columns added by
185+
HHS. If you pulled these issues before October 21, the data you received was correct, but
186+
was missing the added columns.
187+
171188
## January 22, 2021
172189

173190
The following issues were repaired:

docs/api/covid_hosp_facility.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@ This data source is a mirror of the "COVID-19 Reported Patient Impact and
99
Hospital Capacity by Facility" dataset provided by the US Department of Health
1010
& Human Services via healthdata.gov.
1111

12+
HHS performs up to four days of forward-fill for missing values.
13+
14+
Starting October 1, 2022, some facilities are only required to report annually.
15+
1216
See the
1317
[official description and data dictionary at healthdata.gov](https://healthdata.gov/Hospital/COVID-19-Reported-Patient-Impact-and-Hospital-Capa/anag-cw7u)
14-
for more information.
18+
for more information. The data elements, cadence, and how the data are being used in the
19+
federal response are documented in
20+
[a FAQ published by Health & Human Services](https://www.hhs.gov/sites/default/files/covid-19-faqs-hospitals-hospital-laboratory-acute-care-facility-data-reporting.pdf).
21+
1522

1623
General topics not specific to any particular data source are discussed in the
1724
[API overview](README.md). Such topics include:
@@ -74,7 +81,7 @@ has been renamed here for clarity.
7481
| `epidata[].hospital_pk` | facility identified by this row | string |
7582
| `epidata[].collection_week` | Friday's date in the week pertaining to this row | integer |
7683
| `epidata[].publication_date` | the date on which the dataset containing this row was published | integer |
77-
| `epidata[].*` | see the [data dictionary](https://healthdata.gov/covid-19-reported-patient-impact-and-hospital-capacity-facility-data-dictionary) | |
84+
| `epidata[].*` | see the [data dictionary](https://healthdata.gov/Hospital/COVID-19-Reported-Patient-Impact-and-Hospital-Capa/anag-cw7u) | |
7885
| `message` | `success` or error message | string |
7986

8087
# Example URLs

docs/api/covid_hosp_facility_lookup.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,21 @@ supported.
5454
| --- | --- | --- |
5555
| `result` | result code: 1 = success, 2 = too many results, -2 = no results | integer |
5656
| `epidata` | list of results | array of objects |
57-
| `epidata[].hospital_pk` | facility identified by this row | string |
58-
| `epidata[].*` | see the [data dictionary](https://healthdata.gov/covid-19-reported-patient-impact-and-hospital-capacity-facility-data-dictionary) | |
57+
| `epidata[].hospital_pk` | unique identifier for this facility (will match CCN if CCN exists) | string |
58+
| `epidata[].state` | two-letter state code | string |
59+
| `epidata[].ccn` | CMS Certification Number for this facility | string |
60+
| `epidata[].hospital_name` | facility name | string |
61+
| `epidata[].address` | facility address | string |
62+
| `epidata[].city` | facility city | string |
63+
| `epidata[].zip` | 5-digit ZIP code | string |
64+
| `epidata[].hospital_subtype` | one of: Childrens Hospitals, Critical Access Hospitals, Long Term, Psychiatric, Rehabilitation, Short Term | string |
65+
| `epidata[].fips_code` | 5-digit FIPS county code | string |
66+
| `epidata[].is_metro_micro` | 1 if this facility serves a metropolitan or micropolitan area, 0 otherwise | integer |
5967
| `message` | `success` or error message | string |
6068

69+
Use the `hospital_pk` value when querying
70+
[the COVID-19 Reported Patient Impact and Hospital Capacity by Facility endpoint](covid_hosp_facility.md).
71+
6172
# Example URLs
6273

6374
### Lookup facilities in the city of Southlake (TX)

0 commit comments

Comments
 (0)