Draft dQM CMS Content Implementation Guide
2025.1.0 - CI Build

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

## Library: Status

Official URL: https://madie.cms.gov/Library/Status | Version: 2.1.000
Active as of 2025-10-02 | Responsible: National Committee for Quality Assurance | Computable Name: Status

This library contains functions used to constrain FHIR resource elements for measures authored by NCQA, based on QICore 6.0.0 resources including IG and authoring patterns. The functions may appear similar to some QICoreCommon functions but differ in that they have constraints that are relevant for measures authored by NCQA.

Metadata
Title | Status
Version | 2.1.000
Topic | FHIR
Topic | CQL
Steward (Publisher) | National Committee for Quality Assurance
Description | This library contains functions used to constrain FHIR resource elements for measures authored by NCQA, based on QICore 6.0.0 resources including IG and authoring patterns. The functions may appear similar to some QICoreCommon functions but differ in that they have constraints that are relevant for measures authored by NCQA.
Type | logic-library from http://terminology.hl7.org/CodeSystem/library-type
Dependency | Description: Model USQualityCore Resource: `https://madie.cms.gov/Library/USQualityCore-ModelInfo|0.1.0-cibuild` Canonical URL: `https://madie.cms.gov/Library/USQualityCore-ModelInfo|0.1.0-cibuild`
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: Code System ObservationCategoryCodes Resource: Observation Category Codes Canonical URL: `http://terminology.hl7.org/CodeSystem/observation-category`
Dependency | Description: Code System ConditionVerificationStatusCodes Resource: ConditionVerificationStatus Canonical URL: `http://terminology.hl7.org/CodeSystem/condition-ver-status`
Parameters
Name | Use | Card. | Type | Documentation
Patient | Out | 0..1 | Resource |
Library Content
CQL Content |
    /*
    @description: This library contains functions used to constrain FHIR resource elements for measures
    authored by NCQA, based on QICore 7.0.0 resources then refactoring to use USQualityCore 0.1.0 including IG and authoring patterns. The functions
    may appear similar to some QICoreCommon functions but differ in that they have constraints that are
    relevant for measures authored by NCQA.

    NOTE: For use by March 2026 US Realm Connectathon participants for internal use only. Not for use or distribution in commercial products.
    */
    library Status version '2.1.000'

    using USQualityCore version '0.1.0-cibuild'
    using USCore version '6.1.0-derived'
    using FHIR version '4.0.1'

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

    // TODO: Consider whether to refactor to use the FHIRCommon declarations here
    codesystem "ObservationCategoryCodes": 'http://terminology.hl7.org/CodeSystem/observation-category'
    codesystem "ConditionVerificationStatusCodes": 'http://terminology.hl7.org/CodeSystem/condition-ver-status'

    code "exam": 'exam' from "ObservationCategoryCodes" display 'exam'
    code "imaging": 'imaging' from "ObservationCategoryCodes" display 'imaging'
    code "confirmed": 'confirmed' from ConditionVerificationStatusCodes display 'confirmed'
    code "unconfirmed": 'unconfirmed' from ConditionVerificationStatusCodes display 'unconfirmed'
    code "provisional": 'provisional' from ConditionVerificationStatusCodes display 'provisional'
    code "differential": 'differential' from ConditionVerificationStatusCodes display 'differential'

    context Patient

    // TODO: Deprecate because this is now in FHIRCommon
    //Condition
    /*
    @description: Returns conditions in the given list that either have no verification status or have a verification status of confirmed, unconfirmed, provisional, or differential
    @deprecated: Use the USCoreCommon verified function insteada
    */
    define fluent function verified(conditions List<Choice<ConditionProblemsHealthConcerns, ConditionEncounterDiagnosis>>):
      conditions C
        where C.verificationStatus is not null implies
          (C.verificationStatus ~ "confirmed"
            or C.verificationStatus ~ "unconfirmed"
            or C.verificationStatus ~ "provisional"
            or C.verificationStatus ~ "differential"
          )

    //Assessment, Performed
    define fluent function isAssessmentPerformed(Obs List<ObservationScreeningAssessment>):
      Obs O
        where O.status in { 'final', 'amended', 'corrected' }

    //Device, Order - Personal Use Devices
    define fluent function isDeviceOrderPersonalUseDevices(DeviceRequest List<FHIR.DeviceRequest>):
      DeviceRequest D
        where D.status in { 'active', 'completed' }
          and D.intent in {'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'}

    //Diagnostic Study, Order
    define fluent function isDiagnosticStudyOrder(ServiceRequest List<FHIR.ServiceRequest>):
      ServiceRequest S
        where S.status in { 'active', 'completed' }
          and S.intent in {'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'}

    //Intervention, Order
    define fluent function isInterventionOrder(ServiceRequest List<FHIR.ServiceRequest>):
      ServiceRequest S
        where S.status in { 'active', 'completed' }
          and S.intent in {'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'}

    //Laboratory Test, Order
    define fluent function isLaboratoryTestOrder(ServiceRequest List<FHIR.ServiceRequest>):
      ServiceRequest S
        where S.status in { 'active', 'completed' }
          and S.intent in {'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'}

    //Diagnostic Study, Performed
    define fluent function isDiagnosticStudyPerformed(Obs List<ObservationClinicalResult>):
      Obs O
        where O.status in { 'final', 'amended', 'corrected' }
            and exists ( O.category ObservationCategory
            where ( ObservationCategory ) ~ "imaging"
        )

    //Encounter, Performed
    //General usage unless required otherwise by measure intent (e.g., follow-up encounters)
    define fluent function isEncounterPerformed(Enc List<FHIR.Encounter>):
      Enc E
        where E.status = 'finished'

    //Immunization, Administered
    define fluent function isImmunizationAdministered(Immunization List<FHIR.Immunization>):
      Immunization I
        where I.status ~ 'completed'

    //Intervention, Performed
    define fluent function isInterventionPerformed(Proc List<FHIR.Procedure>):
      Proc P
        where P.status ~ 'completed'

    //Procedure, Performed
    define fluent function isProcedurePerformed(Proc List<FHIR.Procedure>):
      Proc P
        where P.status ~ 'completed'

    //Laboratory Test, Performed
    define fluent function isLaboratoryTestPerformed(Obs List<LaboratoryResultObservation>):
      Obs O
        where O.status in { 'final', 'amended', 'corrected' }

    //Medication, Active
    define fluent function isMedicationActive(MedicationRequest List<FHIR.MedicationRequest>):
      MedicationRequest M
        where M.status = 'active'
          and M.intent in {'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'}

    //Medication, Dispensed
    define fluent function isMedicationDispensed(Med List<FHIR.MedicationDispense>):
      Med M
        where M.status in { 'completed', 'in-progress', 'on-hold' }

    //Medication, Order
    define fluent function isMedicationOrder(MedicationRequest List<FHIR.MedicationRequest>):
      MedicationRequest M
        where M.status in { 'active', 'completed' }
        and M.intent in {'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'}

    //Physical Exam, Performed
    define fluent function isPhysicalExamPerformed(Obs List<ObservationClinicalResult>):
      Obs O
        where O.status in { 'final', 'amended', 'corrected' }
          and exists ( O.category ObservationCategory
              where ( ObservationCategory ) ~ "exam"
          )

    //Observation Vital Signs
    define fluent function isObservationBP(Obs List<BloodPressureProfile>):
      Obs O
        where O.status in { 'final', 'amended', 'corrected' }

    define fluent function isObservationBodyHeight(Obs List<BodyHeightProfile>):
      Obs O
        where O.status in { 'final', 'amended', 'corrected' }

    define fluent function isObservationBodyWeight(Obs List<BodyWeightProfile>):
      Obs O
        where O.status in { 'final', 'amended', 'corrected' }

    define fluent function isObservationBMI(Obs List<BMIProfile>):
      Obs O
        where O.status in { 'final', 'amended', 'corrected' }

    //Observation Pediatric BMI
    define fluent function isObservationPediatricBMI(Obs List<PediatricBMIforAgeObservationProfile>):
      Obs O
        where O.status in { 'final', 'amended', 'corrected' }

    //Observation Smoking Status
    define fluent function isObservationSmokingStatus(Obs List<SmokingStatusProfile>):
      Obs O
        where O.status = 'final'

    //Symptom
    define fluent function isSymptom(Obs List<SimpleObservation>):
      Obs O
        where O.status in { 'preliminary', 'final', 'amended', 'corrected' }
ELM XML Content |
    Encoded data
ELM JSON Content |
    Encoded data
Generated using version 0.5.4 of the sample-content-ig Liquid templates