A comprehensive tool for converting hospital pricing data from CSV to JSON format, designed to ensure compliance with the CMS Hospital Pricing Transparency mandate. Features include automated schema validation against CMS versions 2.0.0 and 2.1.0, a user-friendly Streamlit web interface for easy data handling, and multiple schema versions.
APACHE-2.0 License
This repository contains a tool for converting CSV files of hospital pricing data to JSON format while validating against the CMS Hospital Pricing Transparency schema. The solution is designed to ensure compliance with CMS requirements, helping hospitals meet the mandate for transparency in pricing.
The CMS Hospital Pricing Transparency mandate is a rule established by the Centers for Medicare & Medicaid Services (CMS) to promote transparency in hospital pricing and empower consumers with accessible information about healthcare costs. Effective January 1, 2021, the mandate requires all hospitals operating in the United States to publish their standard charges for items and services they provide. This includes:
The CMS mandate aims to achieve several key objectives:
Enhance Consumer Decision-Making: By making pricing information readily available, the mandate empowers patients and their families to make more informed decisions about their healthcare, considering both the cost and quality of services.
Increase Market Competition: Transparency in pricing is expected to foster competition among hospitals, encouraging them to offer more cost-effective services to attract patients. This, in turn, can contribute to reducing overall healthcare costs.
Promote Accountability and Standardization: The mandate standardizes how hospitals report their pricing information, ensuring consistency and accuracy across the industry. This facilitates easier comparison of costs by consumers, payers, and regulators.
Support Policy and Research Efforts: The data made available through this mandate also helps policymakers, researchers, and regulators analyze healthcare pricing trends, identify outliers, and develop strategies to improve the efficiency and affordability of healthcare delivery.
To comply with the mandate, hospitals must:
Many hospitals face challenges in meeting these requirements due to the complexity of their pricing structures, the variability in negotiated rates, and the need to format and validate their data according to CMS standards.
This tool addresses these challenges by:
By leveraging this tool, hospitals can streamline their data publication processes, reduce the risk of non-compliance, and contribute to a more transparent healthcare market.
To install and set up the tool, follow these steps:
Clone the Repository:
git clone https://github.com/yourusername/cms-hospital-pricing-transparency.git
cd cms-hospital-pricing-transparency
Create a Virtual Environment:
python -m venv env
source env/bin/activate # On Windows use `env\Scripts\activate`
Install the Required Packages:
Use the requirements.txt
file to install the necessary Python libraries:
pip install -r requirements.txt
Start the Streamlit App:
Launch the Streamlit app to interact with the converter via a web interface:
streamlit run streamlit_app.py
Upload CSV File:
View and Download Results:
If you prefer to use the tool via the command line, you can run the cms_csv_to_json.py
script directly:
python cms_csv_to_json.py --input <input_csv_file> --output <output_json_file> --schema <schema_version>
Replace <input_csv_file>
, <output_json_file>
, and <schema_version>
with your desired input file path, output file path, and schema version (e.g., 2.0.0
or 2.1.0
).
The tool supports multiple schema versions (2.0.0
and 2.1.0
). The appropriate schema file is automatically selected based on the version specified during the conversion. You can also modify the config.py
file to add or update schema versions.
This tool uses the CMS Hospital Pricing Transparency schema, which includes detailed requirements for various data fields, such as:
The JSON output is validated against the CMS schema using the jsonschema
library. Validation errors, if any, are displayed in the Streamlit app or printed in the command line output.
If the JSON output does not conform to the schema, the tool provides detailed error messages, indicating the fields that do not comply with the schema requirements.
Contributions are welcome! Please follow these steps to contribute:
git clone https://github.com/terilios/cms-csv-json-app/
git checkout -b feature/your-feature-name
git push origin feature/your-feature-name
This project is licensed under the MIT License. See the LICENSE file for more details.