dQM CMS Content Implementation Guide
2026.1.0 - CI Build

dQM CMS Content Implementation Guide, published by cqframework. This guide is not an authorized publication; it is the continuous build for version 2026.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/dqm-content-cms-2026/ and changes regularly. See the Directory of published versions

Library: Stratification Patient Example

Official URL: https://madie.cms.gov/Library/StratificationPatientExample Version: 2026.1.0
Standards status: Informative Maturity Level: 1 Computable Name: StratificationPatientExample

StratificationPatientExample logic.

Metadata
Title Stratification Patient Example
Version 2026.1.0
Topic FHIR
Topic CQL
Description

StratificationPatientExample logic.

Type logic-library from http://terminology.hl7.org/CodeSystem/library-type
Dependency Description: Library FHIRHelpers
Resource: http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1
Canonical URL: http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1
Dependency Description: Library FHIRCommon
Resource: http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0
Canonical URL: http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0
Dependency Description: Library PatientCommon
Resource: Patient Common
Canonical URL: https://madie.cms.gov/Library/PatientCommon
Parameters
Parameter None
Library Content
CQL Content
library StratificationPatientExample

using FHIR version '4.0.1'

include hl7.fhir.uv.cql.FHIRHelpers version '4.0.1'
include hl7.fhir.uv.cql.FHIRCommon version '2.0.0'

include PatientCommon

parameter "Measurement Period" Interval<DateTime>
  default Interval[@2026-01-01T00:00:00.000Z, @2027-01-01T00:00:00.000Z)

context Patient

define "Well-Visit Encounter":
  [Encounter] E
    where E.status = 'finished'
      and E.period ends during day of "Measurement Period"

define "Initial Population":
  true

define "Denominator":
  Patient.active is true

define "Numerator":
  exists ("Well-Visit Encounter")

/* Criteria-based Stratifiers */

define "Stratifier P0Y--P21Y":
  Patient.ageInYearsAt(end of "Measurement Period") between 0 and 20

define "Stratifier P21Y--P41Y":
  Patient.ageInYearsAt(end of "Measurement Period") between 21 and 40

define "Stratifier P41Y--P9999Y":
  Patient.ageInYearsAt(end of "Measurement Period") >= 41

/* Value-based Stratifiers */

define "Gender Stratifier":
  Patient.gender

define "Age Range Stratifier":
  case
    when Patient.ageInYearsAt(end of "Measurement Period") between 0 and 20 then 'P0Y--P21Y'
    when Patient.ageInYearsAt(end of "Measurement Period") between 21 and 40 then 'P21Y--P41Y'
    when Patient.ageInYearsAt(end of "Measurement Period") >= 41 then 'P41Y--P9999Y'
    else null
  end

ELM XML Content
Encoded data 
ELM JSON Content
Encoded data 
Generated using version 0.5.6-cibuild of the sample-content-ig Liquid templates