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: Supporting Evidence Example

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

SupportingEvidenceExample logic.

Metadata
Title | Supporting Evidence Example
Version | 2026.0.0
Topic | FHIR
Topic | CQL
Description | SupportingEvidenceExample logic.
Type | logic-library from http://terminology.hl7.org/CodeSystem/library-type
Library Content
CQL Content |
    library SupportingEvidenceExample

    using FHIR version '4.0.1'

    include hl7.fhir.uv.cql.FHIRHelpers version '4.0.1' called FHIRHelpers

    parameter "Measurement Period" Interval<DateTime> default Interval[@2024-01-01T00:00:00, @2024-12-31T23:59:59]

    // cql parameter that can pass in fhir id of an encounter
    parameter practitionerParam String

    context Patient

    // boolean population results
    // has matching encounter

    define "Initial Population Boolean":
      exists "All Encounters"

    define "Denominator Boolean":
        "Initial Population Boolean"

    define "Denominator Exclusion Boolean":
      exists "Encounter Cancelled"

    define "Denominator Exception Boolean":
      exists "Encounter InProgress"

    define "Numerator Exclusion Boolean":
      exists "Encounter Arrived"

    define "Numerator Boolean":
      exists "Encounters in Period"

    define "Measure Population Exclusions Boolean":
        "Denominator Exclusion Boolean"

    define "Measure Population Boolean":
        "Denominator Boolean"

    // resource population results
    // qty of matching encounters

    define "Initial Population Resource":
        "All Encounters"

    define "Denominator Resource":
        "Initial Population Resource"

    define "Denominator Exclusion Resource":
        "Encounter Cancelled"

    define "Denominator Exception Resource":
        "Encounter InProgress"

    define "Numerator Exclusion Resource":
        "Encounter Arrived"

    define "Numerator Resource":
        "Encounters in Period"

    define "Measure Population Exclusions Resource":
        "Denominator Exclusion Resource"

    define "Measure Population Resource":
        "Denominator Resource"

    // for prospective gap calculations
    define "date of compliance":
        "Measurement Period"

    // cql to force results
    define "always false":
        false

    define "always true":
        true

    define "list of boolean":
        {true, false, true}

    define "list of dates":
      { @2024-01-01, @2024-01-02, @2024-01-03 }

    define "PatientRes":
        [Patient] P

    define "list of string":
        {'test1', 'test2', 'test3'}

    define "interval":
        Interval[@2024-01-01T00:00:00, @2024-12-31T23:59:59]

    define "TestIntervalList":
      {
        Interval[@2024-01-01T00:00:00, @2024-01-31T23:59:59],
        Interval[@2024-02-01T00:00:00, @2024-02-29T23:59:59]
      }

    define "TestDecimalList":
      { 1.5, 2.75, 1.0 / 3.0 }

    define "TestFloatValue":
        1.0 / 3.0

    define "list of numbers":
        {31, 88, 11}

    define "string":
        'string test'

    define "date":
        @2026-01-01

    define "datetime":
        @2026-12-30T23:59:59

    define "NullExample":
             null

    define "EmptyListExample":
      { }

    define "number":
             31

    define "decimal":
             31.31

    define "test tuple":
             {
        number: "number",
        dates: "list of dates",
        birthYear: "string"
      }

    define "list test tuple":
             {{
        number: "number",
        dates: "list of dates",
        birthYear: "string"
      },{
        number: "number",
        dates: "list of dates",
        birthYear: "string"
      }}

    define "test code":
        "SDE Sex"

    // sde single value

    define "SDE Sex":
      case
          when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' }
          when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' }
          else null
        end

    // sde list of values

     define "SDE Encounters":
        "All Encounters"

    // Continuous Variable
    // number of hours for encounter

    define function "MeasureObservation"(encounter Encounter):
        duration in minutes of encounter.period

    // Cont Variable
    // boolean basis age in years to end of measurementPeriod

    define function "MeasureObservationBoolean"():
             AgeInYearsAt(end of "Measurement Period")
    // component stratifier

    define "Gender Stratification":
      "SDE Sex"

    // boolean criteria stratifier

    define "boolean strat not finished":
      exists "Encounter Not Finished"

    // cql parameter boolean criteria stratifier

    define "boolean strat has practitioner":
      exists "Matching General Practitioner"

    // resource criteria stratifier

    define "resource strat not finished":
        "Encounter Not Finished"

    // main criteria logic

    define "All Encounters":
         [Encounter] E

    define "Encounters in Period":
         [Encounter] E
           where E.period during "Measurement Period" and E.status='finished'

    define "Encounter Cancelled":
        [Encounter] E
           where E.status = 'cancelled'

    define "Encounter Status":
        [Encounter] E
             return E.status

    define "Encounter InProgress":
        [Encounter] E
           where E.status = 'in-progress'

    define "Encounter Arrived":
        [Encounter] E
           where E.status = 'arrived'

    define "Encounter Not Finished":
        [Encounter] E
            where E.status != 'finished'

    define "Matching General Practitioner":
        [Patient] p
           where Last(Split(First(p.generalPractitioner.reference),'/')) = Last(Split(practitionerParam,'/'))

    define "Age":
        AgeInYearsAt(start of "Measurement Period")

    define "Date":
        Interval[@2024-02-01T00:00:00, @2024-10-31T23:59:59]

    define "ip date":
        "Date"

    define "den date":
        "Date"

    define "num date":
        "Date"

    define "exc date":
        "Date"
ELM XML Content |
    Encoded data (115388 characters)
ELM JSON Content |
    Encoded data (219240 characters)
Generated using version 0.5.0 of the sample-content-ig Liquid templates