Skip to main content

CCBHC Measurements

Table of Contents

Purpose

This package is designed to simplify CCBHC reporting by automating the measurement process. It accepts all relevant clinical —such as PHQ-9s, AUDITs, and SDOH screenings— and insurance data and returns a labeled DataFrame indicating whether each patient meets the criteria for the chosen CCBHC measurements. The package is designed to be comprehensive in that you can give it ALL your historical data and it will output EVERY patient labeled in EVERY Measurement Year for a given Measurement. Take a look at this DEP-REM-6 example:

simple example of how the package works

Click here for the more detailed DEP-REM-6 example pdf

1. Data Processing

Our code is simple:

  1. Import the Measurement you want to calculate.
  2. Give it the required data (downloaded excel reports from your EHR, query data from SQL, or whatever)
  3. Run get_all_submeasures(). Under the hood, get_all_submeasures() determines which data meets the Measurments criteria and which does not.
  4. 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!

2. Dashboard Display

We've also created a base Power BI file as a foundation for a dashboard. Check out the dashboard folder here.

Dashboard Picture

Currently Supported Measurements

The definition for these Measurements can be found at https://www.samhsa.gov/sites/default/files/ccbhc-quality-measures-technical-specifications-manual.pdf

IMPORTANT We unsure if we will be implementing the I-SERV Measurement and its SubMeasures. We would like to hear your thoughts on the matter, feel free to email us and let us know what you think.

Moving forward, our focus will shift from the SAMHSA-required measurements to those mandated by New York State.

Code Demonstration

This is a basic demonstration for the Dep-Rem-6 Measurement, see here for more in depth demonstrations

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()
for name, data in results.items():
    data.to_excel(name+".xlsx", index=False)
Example Data Output:
patient_id patient_measurement_year_id encounter_id age medicaid numerator numerator_reason
1 1-2024 1 18+ FALSE TRUE Has Remission
2 1-2025 3 18+ FALSE FALSE Remission Period not Reached
3 3-2024 4 18+ FALSE FALSE No PHQ-9 Follow Up
4 4-2024 5 18+ FALSE FALSE No Remission

- Step 4: Create a Dashboard in Power BI (Optional)

We've created an example dashboard in Power BI for easy implementation but feel free to use the analysis tool of your choice. Feel free to download it from the dashboard folder.

De-panda-cies

License

CC BY-NC-SA 4.0

Installation

Binary installers for the latest released version are available at the Python Package Index (PyPI)

# PyPI
pip install ccbhc_measurements

Contributors

  • Alex Gursky - Data Engineer
  • Max Friedman - Data Engineer
  • Yisroel Len - Director of Data Analytics & CCBHC Project Evaluator

Contributions and Discussions

Feel free to add and create you own Measurements. All Measurements should follow this uml and you can use this guide to show you how to do it!

Send us your recomendations, bugs, questions or feedback at agursky@pesachtikvah.com


Back to Top

Metadata

Release files for ccbhc-measurements 2026.8.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ccbhc-measurements 2026.8.4
File Size Uploaded Provenance Actions
ccbhc_measurements-2026.8.4.tar.gz 41.2 kB Without provenance Details for ccbhc_measurements-2026.8.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ccbhc-measurements 2026.8.4
File Interpreter ABI Platform Actions
ccbhc_measurements-2026.8.4-py3-none-any.whl Python 3 none any Details for ccbhc_measurements-2026.8.4-py3-none-any.whl

Total release size: 93.4 kB

Release files / ccbhc_measurements-2026.8.4.tar.gz

Download URL ccbhc_measurements-2026.8.4.tar.gz
Size 41.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1592948ef828960d7945956f58c8f1a37a3efe77e029c28ffcbe495a424066af
BLAKE2b-256 checksum
How to use checksums
b609ebd6a09bd47d33fbc055aa4c8d56feb0655fd1783c54d952541628a28a8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / ccbhc_measurements-2026.8.4-py3-none-any.whl

Download URL ccbhc_measurements-2026.8.4-py3-none-any.whl
Size 52.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2700b0473a88abf445c12723b6751b1feb24d9c7b257703b3e1c67e9d47c7916
BLAKE2b-256 checksum
How to use checksums
aa0d4b8ab84521f763371404f09ec8c4b9b67de03a9fbfbea8552e2657e5c436
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for ccbhc-measurements 2026.8.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2026.8.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page