An easy way to calculate CCBHC measurements.
Project description
CCBHC Measurements
Table of Contents
- Purpose
- Currently Supported Measurements
- Code Demonstration
- De-panda-cies
- License
- Installation
- Contributors
- Contributions and Discussions
Purpose
All CCBHCs are required to report Quality Measurements. The goal of this package is to simplify the process for calculating CCBHC measurements for all CCBHCs.
Our code is simple:
- Import the Measurement you want to calculate.
- Give it the required data (downloaded excel reports from your EHR, query data from SQL, or whatever)
- Run
get_all_submeasures(). Under the hood,get_all_submeasures()determines which data meets the Measurments criteria and which does not. - Export your data to your preferred tool for analysis. If you want to keep it in pandas, you already have it. If you want to use Excel, or Power BI, you can export it there as well!
Currently Supported Measurements
- DEP REM 6 - Depression Remission at Six Months - Dep Rem 6 Required Data Input and Output Diagram
The definition for these Measurements can be at https://www.samhsa.gov/sites/default/files/ccbhc-quality-measures-technical-specifications-manual.pdf
At the moment we only have these Measurements, but more will be added in the future. Check out the Contributions and Discussions section.
Code Demonstration
import pandas as pd
import ccbhc_measurements as ccbhc
- Step 1: Load in the data into Pandas Dataframes
all_inclusive_excel_file = r"../file/path/to/Dep Rem Data.xlsx"
phq_data = pd.read_xlsx(all_inclusive_excel_file, sheet_name = "phq9")
diagnosis_data = pd.read_xlsx(all_inclusive_excel_file, sheet_name = "diagnosis")
demographic_data = pd.read_xlsx(all_inclusive_excel_file, sheet_name = "demographic")
insurance_data = pd.read_xlsx(all_inclusive_excel_file, sheet_name = "insurance")
- Step 2: Ensure that the dataframes follows the correct schema
Dep Rem 6 Required Data Input and Output Diagram
phq_data = phq_data[["patient_id","patient_DOB","encounter_id","encounter_datetime","total_score"]].copy()
diagnosis_data = diagnosis_data[["patient_id","encounter_datetime","diagnosis"]].copy()
demographic_data = demographic_data[["patient_id","race","ethnicity"]].copy()
insurance_data = insurance_data[["patient_id","insurance","start_datetime","end_datetime"]].copy()
- Step 3: Calculate Dep-Rem
submeasure_data = [phq_data,diagnosis_data,demographic_data,insurance_data]
measure = ccbhc.Dep_Rem(submeasure_data)
results = measure.get_all_submeasures()s
for name, data in results.items():
data.to_excel(name+".xlsx", index=False)
De-panda-cies
- pandas - Powerful data structures for data analysis, time series, and statistics
- python-dateutil - Extensions to the standard Python datetime module
- pytz - Brings the Olson tz database into Python which allows accurate and cross platform timezone calculations
License
Installation
The source code is currently hosted on GitHub at: https://github.com/Pesach-Tikvah-Hope-Development-Inc/CCBHC_Measurements
Binary installers for the latest released version are available at the Python Package Index (PyPI)
# PyPI
pip install ccbhc-measurements
Contributors
- Alex Gursky
- Yisroel Len
Contributions and Discussions
Feel free to add and create you own Measurements. All Measurements should follow this uml.
Send us your recomendations, bugs, questions or feedback at agursky@pesachtikvah.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ccbhc_measurements-2025.2.14.tar.gz.
File metadata
- Download URL: ccbhc_measurements-2025.2.14.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba9a045f52106514537f1e97286c7a0ab9ec1782ebe8476170e818fc58e4ca00
|
|
| MD5 |
a729d7286c9d24d23ac41093fa2a43cb
|
|
| BLAKE2b-256 |
c99adcc176d7aeeeccc5d3e7fcf2036a73f812fca004cf833a361226a9dbef80
|
File details
Details for the file ccbhc_measurements-2025.2.14-py3-none-any.whl.
File metadata
- Download URL: ccbhc_measurements-2025.2.14-py3-none-any.whl
- Upload date:
- Size: 19.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17534566eedf887ec926b1306997bbde005f731088e9f7bc8bc7b9e1cb4203e4
|
|
| MD5 |
9234dbfbbd038bc8700ccf99b9d9ec9c
|
|
| BLAKE2b-256 |
c46afb130590869511b03807498bbc6d1ee6fe581aa093dbfc6f2aea09c7eba0
|