Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 1.09 KB

README.md

File metadata and controls

31 lines (26 loc) · 1.09 KB

Medicare Hospital Cost Reports (HCRIS) Data

Python and MySQL Scripts to extract and analyze Medicare HCRIS files.

Load HCRIS files from CMS

  1. Setup MySQL environment
    • Recommend high cpu and high memory server with optimization of mysqld.cnf configuration
    • Using Google Cloud compute engine n1-highmem-4 (4 vCPUs, 26 GB memory) it takes ~15 min
  2. Run hcris_create_database.sql
    • Creates empty HCRIS databsase and tables
  3. Setup Python 3 enviornment
    • Create config.py file as below
    • Install mysql.connector Python package
  4. Review and update features.csv file
    • Lists variable that will be extracted from HCRIS files
    • Contains variable names and variable locations in HCRIS worksheets
  5. Run hcris_load_extract.py
    • Downloads and loads Medicare HCRIS data into MySQL
    • Extracts features present in features.csv and creates hcris.csv file for analysis with R or Python

config.py

class Database:
    def __init__(self):
        self.user = "[user]"
        self.password = "[password]"


database = Database()

Clean up