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: TJCOverall

Official URL: https://madie.cms.gov/Library/TJCOverall | Version: 9.1.000
Active as of 2025-08-25 | Responsible: The Joint Commission | Computable Name: TJCOverall

Common functions and definitions used by TJC measures

Metadata
Title | TJCOverall
Version | 9.1.000
Topic | FHIR
Topic | CQL
Steward (Publisher) | The Joint Commission
Description | Common functions and definitions used by TJC measures
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: Library USCoreCommon Resource: http://hl7.org/fhir/us/cql/Library/USCoreCommon|2.0.0-ballot Canonical URL: `http://hl7.org/fhir/us/cql/Library/USCoreCommon|2.0.0-ballot`
Dependency | Description: Library USCoreElements Resource: http://hl7.org/fhir/us/cql/Library/USCoreElements|2.0.0-ballot Canonical URL: `http://hl7.org/fhir/us/cql/Library/USCoreElements|2.0.0-ballot`
Dependency | Description: Library CQMCommon Resource: CQMCommonversion: null5.1.000) Canonical URL: `https://madie.cms.gov/Library/CQMCommon|5.1.000`
Dependency | Description: Library USQualityCoreCommon Resource: US Quality Core Commonversion: null0.1.0-cibuild) Canonical URL: `https://madie.cms.gov/Library/USQualityCoreCommon|0.1.0-cibuild`
Dependency | Description: Value Set Comfort Measures Resource: Comfort Measures Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/1.3.6.1.4.1.33895.1.3.0.45`
Dependency | Description: Value Set Discharge To Acute Care Facility Resource: Discharge To Acute Care Facility Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.87`
Dependency | Description: Value Set Discharged to Health Care Facility for Hospice Care Resource: Discharged to Health Care Facility for Hospice Care Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.207`
Dependency | Description: Value Set Discharged to Home for Hospice Care Resource: Discharged to Home for Hospice Care Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.209`
Dependency | Description: Value Set Ischemic Stroke Resource: Ischemic Stroke Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.247`
Dependency | Description: Value Set Left Against Medical Advice Resource: Left Against Medical Advice Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.308`
Dependency | Description: Value Set Nonelective Inpatient Encounter Resource: Nonelective Inpatient Encounter Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.424`
Dependency | Description: Value Set Patient Expired Resource: Patient Expired Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.309`
Data Requirement | Type: Encounter Profile(s): Encounter Code Filter(s): Path: type ValueSet: Nonelective Inpatient Encounter
Data Requirement | Type: ServiceRequest Profile(s): ServiceRequest Code Filter(s): Path: code ValueSet: Comfort Measures
Data Requirement | Type: Procedure Profile(s): Procedure Code Filter(s): Path: code ValueSet: Comfort Measures
Parameters
Name | Use | Card. | Type | Documentation
Measurement Period | In | 0..1 | Period |
Patient | Out | 0..1 | Resource |
Non Elective Inpatient Encounter With Age | Out | 0..* | Encounter |
Ischemic Stroke Encounter | Out | 0..* | Encounter |
Ischemic Stroke Encounters With Discharge Disposition | Out | 0..* | Encounter |
Intervention Comfort Measures | Out | 0..* | Resource |
Encounter With Comfort Measures During Hospitalization | Out | 0..* | Encounter |
Library Content
CQL Content |
    /*
    @description: TJCOverall Common Functions

    NOTE: This library is not published in this IG, it is included here for convenience. The source of truth for
    this library will be the MADiE environment once it fully supports use of QICore STU6-derived.
    */
    library TJCOverall version '9.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
    include hl7.fhir.us.cql.USCoreCommon version '2.0.0-ballot' called USCoreCommon
    include hl7.fhir.us.cql.USCoreElements version '2.0.0-ballot' called USCoreElements

    include CQMCommon version '5.1.000' called CQMCommon
    include USQualityCoreCommon version '0.1.0-cibuild' called USQualityCoreCommon

    valueset "Comfort Measures": 'http://cts.nlm.nih.gov/fhir/ValueSet/1.3.6.1.4.1.33895.1.3.0.45'
    valueset "Discharge To Acute Care Facility": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.87'
    valueset "Discharged to Health Care Facility for Hospice Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.207'
    valueset "Discharged to Home for Hospice Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.209'
    valueset "Ischemic Stroke": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.247'
    valueset "Left Against Medical Advice": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.308'
    valueset "Nonelective Inpatient Encounter": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.424'
    valueset "Patient Expired": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.309'

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

    context Patient

    define "Non Elective Inpatient Encounter With Age":
      ["Encounter": "Nonelective Inpatient Encounter"] NonElectiveEncounter
            where AgeInYearsAt(date from start of NonElectiveEncounter.period ) >= 18
             and NonElectiveEncounter.period ends during day of "Measurement Period"

    define "Ischemic Stroke Encounter":
      "Non Elective Inpatient Encounter With Age" NonElectiveEncounterWithAge
       where NonElectiveEncounterWithAge.hasPrincipalDiagnosisOf("Ischemic Stroke" )

    define "Ischemic Stroke Encounters With Discharge Disposition":
      "Ischemic Stroke Encounter" IschemicStrokeEncounter
      let DischDisp: IschemicStrokeEncounter.hospitalization.dischargeDisposition
      	where  DischDisp in "Discharge To Acute Care Facility"
    		or DischDisp in "Left Against Medical Advice"
    		or DischDisp in "Patient Expired"
    		or DischDisp in "Discharged to Home for Hospice Care"
    		or DischDisp in "Discharged to Health Care Facility for Hospice Care"

    define "Encounter With Comfort Measures During Hospitalization":
      "Ischemic Stroke Encounter" IschemicStrokeEncounter
        with "Intervention Comfort Measures" ComfortMeasure
         such that Coalesce(start of ComfortMeasure.performed.toInterval(), ComfortMeasure.authoredOn) during IschemicStrokeEncounter.hospitalizationWithObservation()

    define "Intervention Comfort Measures":
      ( ["ServiceRequest": "Comfort Measures"] ComfortCare
        where ComfortCare.status in { 'active', 'completed', 'on-hold' }
          and ComfortCare.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
      )
      union ( ["Procedure": "Comfort Measures"] ComfortCarePerformed
            where ComfortCarePerformed.status in { 'completed', 'in-progress' }
      )

    define fluent function calendarDayOfOrDayAfter(StartValue DateTime):
      Interval [date from (StartValue), date from (StartValue) + 1 day]
ELM XML Content |
    Encoded data
ELM JSON Content |
    Encoded data
Generated using version 0.5.4 of the sample-content-ig Liquid templates