Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 4.1.36
current_version = 4.1.37
commit = False
tag = False

Expand Down
2 changes: 1 addition & 1 deletion dev/local/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = Delphi Development
version = 4.1.36
version = 4.1.37

[options]
packages =
Expand Down
55 changes: 39 additions & 16 deletions docs/api/flusurv.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,45 @@ If neither is specified, the current issues are used.

## Response

| Field | Description | Type |
|--------------------------|-----------------------------------------------------------------|------------------|
| `result` | result code: 1 = success, 2 = too many results, -2 = no results | integer |
| `epidata` | list of results | array of objects |
| `epidata[].release_date` | | string |
| `epidata[].location` | | string |
| `epidata[].issue` | | integer |
| `epidata[].epiweek` | | integer |
| `epidata[].lag` | | integer |
| `epidata[].rate_age_0` | | float |
| `epidata[].rate_age_1` | | float |
| `epidata[].rate_age_2` | | float |
| `epidata[].rate_age_3` | | float |
| `epidata[].rate_age_4` | | float |
| `epidata[].rate_overall` | | float |
| `message` | `success` or error message | string |
| Field | Description | Type |
|---|---|---|
| `result` | result code: 1 = success, 2 = too many results, -2 = no results | integer |
| `epidata` | list of results | array of objects |
| `epidata[].release_date` | the date when this record was first received by Delphi | string |
| `epidata[].location` | the name of the catchment (e.g. 'network_all', 'CA', 'NY_albany' | string |
| `epidata[].issue` | the epiweek of receipt by Delphi (e.g. issue 201453 includes epiweeks up to and including 2014w53, but not 2015w01 or following) | integer |
| `epidata[].epiweek` | the epiweek during which the data was collected | integer |
| `epidata[].lag` | number of weeks between `epiweek` and `issue` | integer |
| `epidata[].rate_age_0` | hospitalization rate for ages 0-4 | float |
| `epidata[].rate_age_1` | hospitalization rate for ages 5-17 | float |
| `epidata[].rate_age_2` | hospitalization rate for ages 18-49 | float |
| `epidata[].rate_age_3` | hospitalization rate for ages 50-64 | float |
| `epidata[].rate_age_4` | hospitalization rate for ages 65+ | float |
| `epidata[].rate_overall` | overall hospitalization rate | float |
| `epidata[].rate_age_5` | hospitalization rate for ages 65-74 | float |
| `epidata[].rate_age_6` | hospitalization rate for ages 75-84 | float |
| `epidata[].rate_age_7` | hospitalization rate for ages 85+ | float |
| `epidata[].rate_age_18t29` | hospitalization rate for ages 18 to 29 | float |
| `epidata[].rate_age_30t39` | hospitalization rate for ages 30 to 39 | float |
| `epidata[].rate_age_40t49` | hospitalization rate for ages 40 to 49 | float |
| `epidata[].rate_age_5t11` | hospitalization rate for ages 5 to 11 | float |
| `epidata[].rate_age_12t17` | hospitalization rate for ages 12 to 17 | float |
| `epidata[].rate_age_lt18` | hospitalization rate for ages <18 | float |
| `epidata[].rate_age_gte18` | hospitalization rate for ages >=18 | float |
| `epidata[].rate_age_0tlt1` | hospitalization rate for ages 0-1 | float |
| `epidata[].rate_age_1t4` | hospitalization rate for ages 1-4 | float |
| `epidata[].rate_age_gte75` | hospitalization rate for ages >=75 | float |
| `epidata[].rate_race_white` | hospitalization rate for white people | float |
| `epidata[].rate_race_black` | hospitalization rate for black people | float |
| `epidata[].rate_race_hisp` | hospitalization rate for Hispanic/Latino people | float |
| `epidata[].rate_race_asian` | hospitalization rate for Asian people | float |
| `epidata[].rate_race_natamer` | hospitalization rate for American Indian/Alaskan Native people | float |
| `epidata[].rate_sex_male` | hospitalization rate for males | float |
| `epidata[].rate_sex_female` | hospitalization rate for females | float |
| `epidata[].rate_flu_a` | hospitalization rate for inflenza A | float |
| `epidata[].rate_flu_b` | hospitalization rate for inflenza B | float |
| `epidata[].season` | indicates the start and end years of the winter flu season in the format YYYY-YY (e.g. 2022-23 indicates the flu season running late 2022 through early 2023) | string |
| `message` | `success` or error message | string |

Notes:
* The `flusurv` age groups are, in general, not the same as the ILINet
Expand Down
72 changes: 70 additions & 2 deletions integrations/server/test_flusurv.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,54 @@ def localSetUp(self):

def test_flusurv(self):
"""Basic integration test for flusurv endpoint"""
# TODO: Should test out the whole pipeline, where we mock the source
# API by pulling more realistic data from a local JSON.
self.cur.execute(
"INSERT INTO `flusurv`(`release_date`, `issue`, `epiweek`, `location`, `lag`, `rate_age_0`, `rate_age_1`, `rate_age_2`, `rate_age_3`, `rate_age_4`, `rate_overall`, `rate_age_5`, `rate_age_6`, `rate_age_7`) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
("2012-11-02", "201243", "201143", "CA", "52", "0", "0", "0", "0.151", "0", "0.029", "0", "0", "0"),
"""
INSERT INTO `flusurv`(
`release_date`,
`issue`,
`epiweek`,
`location`,
`lag`,
`rate_age_0`,
`rate_age_1`,
`rate_age_2`,
`rate_age_3`,
`rate_age_4`,
`rate_overall`,
`rate_age_5`,
`rate_age_6`,
`rate_age_7`,
`rate_age_18t29`,
`rate_age_30t39`,
`rate_age_40t49`,
`rate_age_5t11`,
`rate_age_12t17`,
`rate_age_lt18`,
`rate_age_gte18`,
`rate_age_1t4`,
`rate_age_gte75`,
`rate_age_0tlt1`,
`rate_race_white`,
`rate_race_black`,
`rate_race_hisp`,
`rate_race_asian`,
`rate_race_natamer`,
`rate_sex_male`,
`rate_sex_female`,
`rate_flu_a`,
`rate_flu_b`,
`season`
) VALUES(
%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s
)
""",
(
"2012-11-02", 201243, 201143, "CA", 52, 0, 0, 0, 0.151, 0, 0.029, 0, 0, 0,
2.54, 0, 1, 0, 0, 0, 0, 0, 0.68, 0.46, 1, 1, 0, 0, 0, 99, 0, 0, 22.2, "2012-13"
),
)
self.cnx.commit()
response = self.epidata_client.flusurv(epiweeks=201143, locations="CA")
Expand All @@ -25,13 +70,36 @@ def test_flusurv(self):
"location": "CA",
"issue": 201243,
"epiweek": 201143,
"season": "2012-13",
"lag": 52,
"rate_age_0": 0.0,
"rate_age_1": 0.0,
"rate_age_2": 0.0,
"rate_age_3": 0.151,
"rate_age_4": 0.0,
"rate_overall": 0.029,
"rate_age_5": 0.0,
"rate_age_6": 0.0,
"rate_age_7": 0.0,
"rate_age_18t29": 2.54,
"rate_age_30t39": 0.0,
"rate_age_40t49": 1.0,
"rate_age_5t11": 0.0,
"rate_age_12t17": 0.0,
"rate_age_lt18": 0.0,
"rate_age_gte18": 0.0,
"rate_age_1t4": 0.0,
"rate_age_gte75": 0.68,
"rate_age_0tlt1": 0.46,
"rate_race_white": 1.0,
"rate_race_black": 1.0,
"rate_race_hisp": 0.0,
"rate_race_asian": 0.0,
"rate_race_natamer": 0.0,
"rate_sex_male": 99.0,
"rate_sex_female": 0.0,
"rate_flu_a": 0.0,
"rate_flu_b": 22.2,
}
],
"result": 1,
Expand Down
Loading