dQM QICore Content Implementation Guide
2026.0.0 - CI Build

dQM QICore Content Implementation Guide, published by cqframework. This guide is not an authorized publication; it is the continuous build for version 2026.0.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-qicore-2026/ and changes regularly. See the Directory of published versions

Library: Stratification Patient Example

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

StratificationPatientExample logic.

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

StratificationPatientExample logic.

Type logic-library from http://terminology.hl7.org/CodeSystem/library-type
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 (48148 characters)
ELM JSON Content
Encoded data (93928 characters)
Generated using version 0.5.0 of the sample-content-ig Liquid templates