|
| 1 | +# Change Healthcare Indicator |
| 2 | + |
| 3 | +COVID-19 indicator using outpatient visits from Change Healthcare claims data. |
| 4 | +Reads claims data into pandas dataframe. |
| 5 | +Makes appropriate date shifts, adjusts for backfilling, and smooths estimates. |
| 6 | +Writes results to csvs. |
| 7 | + |
| 8 | + |
| 9 | +## Running the Indicator |
| 10 | + |
| 11 | +The indicator is run by directly executing the Python module contained in this |
| 12 | +directory. The safest way to do this is to create a virtual environment, |
| 13 | +installed the common DELPHI tools, and then install the module and its |
| 14 | +dependencies. To do this, run the following code from this directory: |
| 15 | + |
| 16 | +``` |
| 17 | +python -m venv env |
| 18 | +source env/bin/activate |
| 19 | +pip install ../_delphi_utils_python/. |
| 20 | +pip install . |
| 21 | +``` |
| 22 | + |
| 23 | +*Note*: you may need to install blas, in Ubuntu do |
| 24 | +``` |
| 25 | +sudo apt-get install libatlas-base-dev gfortran |
| 26 | +``` |
| 27 | + |
| 28 | +All of the user-changable parameters are stored in `params.json`. To execute |
| 29 | +the module and produce the output datasets (by default, in `receiving`), run |
| 30 | +the following: |
| 31 | + |
| 32 | +``` |
| 33 | +env/bin/python -m delphi_changehc |
| 34 | +``` |
| 35 | + |
| 36 | +Once you are finished with the code, you can deactivate the virtual environment |
| 37 | +and (optionally) remove the environment itself. |
| 38 | + |
| 39 | +``` |
| 40 | +deactivate |
| 41 | +rm -r env |
| 42 | +``` |
| 43 | + |
| 44 | +## Testing the code |
| 45 | + |
| 46 | +To do a static test of the code style, it is recommended to run **pylint** on |
| 47 | +the module. To do this, run the following from the main module directory: |
| 48 | + |
| 49 | +``` |
| 50 | +env/bin/pylint delphi_changehc |
| 51 | +``` |
| 52 | + |
| 53 | +The most aggressive checks are turned off; only relatively important issues |
| 54 | +should be raised and they should be manually checked (or better, fixed). |
| 55 | + |
| 56 | +Unit tests are also included in the module. To execute these, run the following |
| 57 | +command from this directory: |
| 58 | + |
| 59 | +``` |
| 60 | +(cd tests && ../env/bin/pytest --cov=delphi_changehc --cov-report=term-missing) |
| 61 | +``` |
| 62 | + |
| 63 | +The output will show the number of unit tests that passed and failed, along |
| 64 | +with the percentage of code covered by the tests. None of the tests should |
| 65 | +fail and the code lines that are not covered by unit tests should be small and |
| 66 | +should not include critical sub-routines. |
| 67 | + |
| 68 | +## Code tour |
| 69 | + |
| 70 | +- update_sensor.py: ChangeHCSensorUpdator: reads the data, makes transformations, |
| 71 | +- sensor.py: ChangeHCSensor: methods for transforming data, including backfill and smoothing |
| 72 | +- load_data.py: methods for loading claims and EHR data |
| 73 | +- geo_maps.py: geo reindexing |
0 commit comments