Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nhsn indicator #2080

Merged
merged 34 commits into from
Dec 10, 2024
Merged

Nhsn indicator #2080

merged 34 commits into from
Dec 10, 2024

Conversation

aysim319
Copy link
Contributor

Description

Adding new indicator NHSN

Associated Issue(s)

@nmdefries
Copy link
Contributor

nmdefries commented Nov 20, 2024

Waiting on decisions from tooling team on what smoothing and geo aggregations we should do, and if we should include any other metrics (currently generates total flu and covid hospital admissions. Source data also includes metrics by age group, but we aren't ingesting those).

RE geo aggregation, the previous hhs indicator only pulled state and nation data, and didn't do any geo aggregation. This indicator does the same thing.

@dshemetov @brookslogan @dsweber2 for input.

@nmdefries nmdefries marked this pull request as ready for review November 20, 2024 18:14
@nmdefries
Copy link
Contributor

nmdefries commented Nov 20, 2024

Due to production issues, will aim to release this early next week.

@aysim319
Copy link
Contributor Author

aysim319 commented Nov 20, 2024

context from david:

oh, also, dunno if you saw the post from logan, they're doing this really dumb thing of putting the preliminary data in a separate source https://data.cdc.gov/Public-Health-Surveillance/Weekly-Hospital-Respiratory-Data-HRD-Metrics-by-Ju/mpgq-jmmr/about_data
we should probably include those as separate versions in the same indicator
oh er, when I said versions, I meant versions (like the release date) rather than different signals. Definitely not the best wording choice.

Currently have it such that they're seperate signals similar to nssp secondary source to differienate them as a place holder

@dsweber2
Copy link
Contributor

Working through this. I tried a couple of smoothings (3 & 4 weeks, both trailing and centered) to see if that would help tame some of the more extreme data issues, but it didn't really help. I had a use-case where hhs_regions would've been handy, so that's probably worth adding eventually (probably more important to get this live first though).

Copy link
Contributor

@dsweber2 dsweber2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! A few things I'm a bit confused about, and some minor notes, but I would be glad to see what this does on staging.

Dataframe as described above.
"""
# Pull data from Socrata API
df = pull_data(socrata_token, dataset_id="ua7e-t2fy")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's easier to test transform logic if you separate the Extract and Transform steps. Probably fine in this case though, since we're not really transforming it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is holdover from my nssp and nchs dirty code practice. If we aren't doing a full rewrite soon, I would refactor them at some point. For now, they all work (ugly).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I was bouncing back and forth, part of it being what if the other data source has different transformations down the line? maybe better to have a method defined? something along those lines. I did refactor the pull_data, since that doesn't seem like it would change

@@ -0,0 +1,149 @@
import glob
import json
Copy link
Contributor

@dsweber2 dsweber2 Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently json is unused

Suggested change
import json



class TestRun:
# the 14th was a Monday
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure this comment made sense at one point >.<

Copy link
Contributor

@minhkhul minhkhul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just need these and I think we can go to staging:

* Add module name to the `build` job in `.github/workflows/python-ci.yml`.
This allows github actions to run on this indicator code, which includes unit tests and linting.
* Add module name to the ["Copy version to indicator directory" step](https://github.com/cmu-delphi/covidcast-indicators/blob/f01185767a9847d8082baf4f1e17be50a39047c2/.github/workflows/create-release.yml#L64) in `.github/workflows/create-release.yml`.
* Add top-level directory name to [`indicator_list` in `Jenkinsfile`](https://github.com/cmu-delphi/covidcast-indicators/blob/f01185767a9847d8082baf4f1e17be50a39047c2/Jenkinsfile#L13).
This allows your code to be automatically deployed to staging after your branch is merged to main, and deployed to prod after `covidcast-indicators` is released.
* Create `ansible/templates/{top_level_directory_name}-params-prod.json.j2` based on your `params.json.template` with some adjustment:
* "export_dir": "/common/covidcast/receiving/{data-source-name}"
* "log_filename": "/var/log/indicators/{top_level_directory_name}.log"
* Define any sensitive variables as "secrets" in the [Ansible `vars.yaml`](https://github.com/cmu-delphi/covidcast-indicators/blob/main/ansible/vars.yaml) and [vault](https://github.com/cmu-delphi/covidcast-indicators/blob/main/ansible/vault.yaml).
Refer to [this guide](https://docs.google.com/document/d/1Bbuvtoxowt7x2_8USx_JY-yTo-Av3oAFlhyG-vXGG-c/edit#heading=h.8kkoy8sx3t7f) for more vault info.
* Add configs for Sir Complains-a-Lot ("sirCAL") alerting in sirCAL's [local](https://github.com/cmu-delphi/covidcast-indicators/blob/main/sir_complainsalot/params.json.template) and [Ansible](https://github.com/cmu-delphi/covidcast-indicators/blob/main/ansible/templates/sir_complainsalot-params-prod.json.j2) params templates.

@aysim319 aysim319 requested a review from nmdefries December 6, 2024 20:37
@nmdefries
Copy link
Contributor

Plots for statistical review have been approved

@aysim319
Copy link
Contributor Author

aysim319 commented Dec 7, 2024

Waiting for signal name approval

@aysim319
Copy link
Contributor Author

Waiting for signal name approval

new signal name approved

@aysim319 aysim319 merged commit 5ff844a into main Dec 10, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants