Introduction
[HEDIS](/terms/HEDIS) measure calculation is not a data warehouse query problem. It is a data integration problem, a logic specification problem, and a source data quality problem — all combined. NCQA's technical specifications define denominator criteria, numerator criteria, exclusion logic, and allowable value sets for over 90 measures. Each measure specification runs 5–15 pages. One misunderstood logic clause can incorrectly exclude thousands of members from a denominator, producing a measure rate that bears no resemblance to reality.
NCQA Compliance Audits and Health Plan Accreditation reviews are not forgiving of measure logic errors. This guide covers the architecture and data model for a defensible HEDIS pipeline.
Source Data Domains
HEDIS measures draw from four primary data sources, each with different availability and quality characteristics:
| Source | Data Type | Latency | Quality Challenge |
|---|---|---|---|
| Claims | Procedure, diagnosis, pharmacy dispensing | 7–30 days post-service | Pending claims, late submissions |
| Lab results | Ordered and resulted lab tests ([LOINC](/terms/LOINC)) | Variable (EHI, lab vendor) | Incomplete coverage for non-integrated labs |
| Pharmacy | Dispensed medications ([NDC](/terms/NDC)) | 3–7 days post-dispense | PBM data gaps, multi-PBM environments |
| Encounter / EHR | Diagnoses, procedures, vital signs | Variable (FHIR, HL7) | EHR incompleteness for hybrid measures |
Administrative vs Hybrid Measures
Administrative measures are calculated entirely from claims data. No supplemental data sources required. Faster to calculate, but limited to what appears on a claim.
Hybrid measures use a combination of administrative data and medical record review. For a random sample of members, NCQA requires medical record abstraction to validate administrative data or supplement it.
Electronic Clinical Data System (ECDS) measures use EHR data (clinical quality measures) directly.
Your data architecture must support all three. Hybrid measures require a sampling workflow and a medical record abstraction data model alongside the claims-based logic.
Measure Denominator Continuous Enrollment Logic
Every HEDIS measure has a continuous enrollment requirement — the member must have been continuously enrolled for a specified period (typically 1 year for the measurement year) to be eligible for the denominator. This is the most commonly misimplemented logic in HEDIS pipelines.
-- Continuous enrollment check: member must have no gap >45 days during measurement year
-- (NCQA standard is no gaps, or 1 gap ≤45 days depending on measure)
WITH enrollment_gaps AS (
SELECT
enterprise_member_id,
coverage_start_date,
coverage_end_date,
LAG(coverage_end_date) OVER (
PARTITION BY enterprise_member_id ORDER BY coverage_start_date
) AS prev_coverage_end,
coverage_start_date - LAG(coverage_end_date) OVER (
PARTITION BY enterprise_member_id ORDER BY coverage_start_date
) AS gap_days
FROM member.coverage_periods
WHERE coverage_start_date <= '2024-12-31'
AND coverage_end_date >= '2024-01-01'
),
member_gap_summary AS (
SELECT
enterprise_member_id,
MAX(COALESCE(gap_days, 0)) AS max_gap_days,
COUNT(CASE WHEN gap_days > 0 THEN 1 END) AS gap_count
FROM enrollment_gaps
GROUP BY enterprise_member_id
)
SELECT enterprise_member_id
FROM member_gap_summary
WHERE max_gap_days <= 45 -- NCQA threshold; varies by measure
AND gap_count <= 1; -- at most 1 gap allowed; varies by measure
Breast Cancer Screening (BCS) Measure Logic
Breast Cancer Screening is one of the most commonly reported HEDIS measures. Here is the logic structure:
Denominator: Women aged 52–74 as of December 31 of the measurement year who were continuously enrolled in the measurement year and the year prior.
Numerator: A mammogram (bilateral or unilateral) on or between October 1 of the year prior to the measurement year and December 31 of the measurement year (27-month window).
-- BCS Denominator
WITH bcs_denominator AS (
SELECT m.enterprise_member_id
FROM mdm.member_master m
JOIN analytics.member_continuous_enrollment ce
ON m.enterprise_member_id = ce.enterprise_member_id
AND ce.measurement_year = 2024
AND ce.continuously_enrolled_flag = TRUE
WHERE m.gender_code = 'F'
AND DATEDIFF('year', m.date_of_birth, '2024-12-31') BETWEEN 52 AND 74
),
-- BCS Numerator: mammogram in 27-month window
bcs_numerator AS (
SELECT DISTINCT c.enterprise_member_id
FROM claims.claim_header c
JOIN claims.claim_line cl ON c.claim_id = cl.claim_id
WHERE cl.cpt_code IN (
'77055','77056','77057','77061','77062','77063', -- [CPT](/terms/cpt) mammography codes
'G0202','G0204','G0206' -- HCPCS mammography codes
)
AND c.service_from_date BETWEEN '2022-10-01' AND '2024-12-31' -- 27-month window
AND c.adjudication_status = 'PAID'
)
-- BCS Measure Result
SELECT
d.enterprise_member_id,
CASE WHEN n.enterprise_member_id IS NOT NULL THEN TRUE ELSE FALSE END AS in_numerator,
TRUE AS in_denominator
FROM bcs_denominator d
LEFT JOIN bcs_numerator n ON d.enterprise_member_id = n.enterprise_member_id;
HEDIS Data Model
CREATE TABLE quality.hedis_measure_result (
result_id BIGINT GENERATED ALWAYS AS IDENTITY,
measurement_year INT NOT NULL,
measure_id VARCHAR(20) NOT NULL, -- BCS, CBP, CDC, COL, etc.
measure_name VARCHAR(200),
enterprise_member_id VARCHAR(36) NOT NULL,
in_denominator BOOLEAN NOT NULL,
denominator_exclusion BOOLEAN,
exclusion_reason VARCHAR(100),
in_numerator BOOLEAN,
data_source_flag VARCHAR(20), -- ADMINISTRATIVE, HYBRID, ECDS
numerator_date DATE, -- date of qualifying event
numerator_code VARCHAR(20), -- CPT/HCPCS/LOINC that satisfied numerator
gap_open_flag BOOLEAN, -- denominator-eligible, not in numerator
computed_at TIMESTAMP NOT NULL,
logic_version VARCHAR(20), -- NCQA spec version used
PRIMARY KEY (result_id)
);
CREATE UNIQUE INDEX ON quality.hedis_measure_result
(measurement_year, measure_id, enterprise_member_id);
Value Set Management
NCQA publishes HEDIS value sets — the CPT, HCPCS, ICD-10, LOINC, and NDC code lists that define qualifying events for each measure. These update annually and are licensed from NCQA.
Store value sets in a dedicated reference table:
CREATE TABLE reference.hedis_value_set (
value_set_id VARCHAR(50) NOT NULL,
value_set_name VARCHAR(200) NOT NULL,
code_system VARCHAR(20) NOT NULL, -- CPT, HCPCS, ICD10CM, LOINC, NDC, RXNORM
code VARCHAR(20) NOT NULL,
code_desc VARCHAR(500),
ncqa_release_year INT NOT NULL,
effective_date DATE,
PRIMARY KEY (value_set_id, code_system, code)
);
Join your claims and lab data against reference.hedis_value_set rather than hardcoding CPT lists in your measure SQL. This makes annual value set updates a data load, not a code change.
Key Takeaways
- Continuous enrollment logic is the most commonly misimplemented HEDIS requirement. Implement it as a reusable utility table consumed by all measures.
- Value sets must be stored in a reference table, not hardcoded in measure SQL — NCQA updates them annually and a hardcoded value set will produce incorrect results after the update.
- Hybrid measures require a sampling and medical record abstraction workflow alongside the administrative calculation pipeline.
- The
logic_versioncolumn in your measure result table is not optional — NCQA auditors will ask which specification year your logic implements. - Use the [HCC Calculator](/tools/hcc-calculator) to validate risk adjustment data that feeds into HEDIS measure denominator eligibility for risk-stratified measures.
mdatool Team
The mdatool team builds free engineering tools for healthcare data architects, analysts, and engineers working across payer, provider, and life sciences data.
Related Guides
Key Terms in This Article
More in Healthcare Data Modeling
AI-Powered Healthcare Data Modeling: Generate Production-Ready Schemas in 30 Seconds
Healthcare data architects spend days designing schemas from scratch — Medicare Advantage claims warehouses alone require 20+ tables, hundreds of columns, and platform-specific syntax. The mdatool AI Data Modeling tool generates a production-ready Star Schema for Snowflake, BigQuery, or Databricks in 30 seconds, with ISO-11179 standard column names built in.
Read moreEnforcing ISO-11179 Healthcare Naming Standards in dbt Projects
Every healthcare data warehouse eventually develops naming drift — DOB in one model, birth_dt in another, member_birth_date in a third. The dbt-healthcare-standards package brings ISO-11179 column naming directly into your dbt project as installable macros and schema tests.
Read moreAI-Powered Healthcare Data Modeling: Generate Production-Ready Schemas in Seconds
Healthcare data models take weeks to design manually — HIPAA constraints, CMS reporting requirements, and ISO-11179 naming standards all have to be applied correctly from the start. AI data modeling changes that. Here is how to generate production-ready schemas for Snowflake, BigQuery, and Databricks in seconds.
Read moreFree Tools
Free HCC RAF Score Calculator
Calculate CMS-HCC V28 RAF scores from ICD-10 codes. No account required.
Try it freeFree SQL Linter
Catch SQL bugs, performance issues, and naming violations before production.
Try it freeFree DDL Converter
Translate SQL schemas between Snowflake, BigQuery, Oracle, and SQL Server.
Try it freeReady to improve your data architecture?
Free tools for DDL conversion, SQL analysis, naming standards, and more.
Get weekly healthcare data engineering tips
Practical guides on data modeling, SQL standards, and healthcare domain conventions — straight to your inbox.
No spam. Unsubscribe any time.