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
| Active as of 2025-08-25 |
<Library xmlns="http://hl7.org/fhir">
<id value="TJCOverall"/>
<meta>
<profile
value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablelibrary"/>
<profile
value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-computablelibrary"/>
<profile
value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablelibrary"/>
<profile
value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-executablelibrary"/>
<profile
value="http://hl7.org/fhir/uv/cql/StructureDefinition/cql-library"/>
<profile
value="http://hl7.org/fhir/uv/cql/StructureDefinition/elm-json-library"/>
<profile
value="http://hl7.org/fhir/uv/cql/StructureDefinition/elm-xml-library"/>
</meta>
<language value="en"/>
<text>
<status value="extensions"/>
<div xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<table class="narrative-table">
<tbody>
<tr>
<th colspan="2" scope="row" class="row-header"><a name="metadata"> </a>Metadata</th>
</tr>
<tr>
<th scope="row" class="row-header">Title</th>
<td class="content-container">TJCOverall</td>
</tr>
<tr>
<th scope="row" class="row-header">Version</th>
<td class="content-container">9.1.000</td>
</tr>
<tr>
<th scope="row" class="row-header">Topic</th>
<td class="content-container">FHIR
</td>
</tr>
<tr>
<th scope="row" class="row-header">Topic</th>
<td class="content-container">CQL
</td>
</tr>
<tr>
<th scope="row" class="row-header">Steward (Publisher)</th>
<td class="content-container">The Joint Commission</td>
</tr>
<tr>
<th scope="row" class="row-header">Description</th>
<td class="content-container"><div><p>Common functions and definitions used by TJC measures</p>
</div></td>
</tr>
<tr>
<th scope="row" class="row-header">Type</th>
<td class="content-container">
<a href="http://terminology.hl7.org/7.1.0/CodeSystem-library-type.html">http://terminology.hl7.org/CodeSystem/library-type</a>#logic-library
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header"><a name="parameters"> </a>Parameters</th>
</tr>
<tr>
<th scope="row" class="row-header">Parameter</th>
<td class="content-container">None</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">Library Content</th>
</tr>
<tr>
<th scope="row" class="row-header">CQL Content</th>
<td>
<a name="cql-content"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@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"] NonElectiveEncounter
["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]</code></pre>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">Generated using version 0.5.6 of the sample-content-ig Liquid templates</th>
</tr>
</tbody>
</table>
</div>
</text>
<extension
url="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-softwaresystem">
<valueReference>
<reference value="Device/cqf-tooling"/>
</valueReference>
</extension>
<url value="https://madie.cms.gov/Library/TJCOverall"/>
<version value="9.1.000"/>
<name value="TJCOverall"/>
<title value="TJCOverall"/>
<status value="active"/>
<experimental value="false"/>
<type>
<coding>
<system value="http://terminology.hl7.org/CodeSystem/library-type"/>
<code value="logic-library"/>
</coding>
</type>
<date value="2025-08-25T20:31:10+00:00"/>
<publisher value="The Joint Commission"/>
<description value="Common functions and definitions used by TJC measures"/>
<topic>
<text value="FHIR"/>
</topic>
<topic>
<text value="CQL"/>
</topic>
<content>
<contentType value="text/cql"/>
<data
value="LyoKQGRlc2NyaXB0aW9uOiBUSkNPdmVyYWxsIENvbW1vbiBGdW5jdGlvbnMKCk5PVEU6IFRoaXMgbGlicmFyeSBpcyBub3QgcHVibGlzaGVkIGluIHRoaXMgSUcsIGl0IGlzIGluY2x1ZGVkIGhlcmUgZm9yIGNvbnZlbmllbmNlLiBUaGUgc291cmNlIG9mIHRydXRoIGZvcgp0aGlzIGxpYnJhcnkgd2lsbCBiZSB0aGUgTUFEaUUgZW52aXJvbm1lbnQgb25jZSBpdCBmdWxseSBzdXBwb3J0cyB1c2Ugb2YgUUlDb3JlIFNUVTYtZGVyaXZlZC4KKi8KbGlicmFyeSBUSkNPdmVyYWxsIHZlcnNpb24gJzkuMS4wMDAnCgp1c2luZyBVU1F1YWxpdHlDb3JlIHZlcnNpb24gJzAuMS4wLWNpYnVpbGQnCnVzaW5nIFVTQ29yZSB2ZXJzaW9uICc2LjEuMC1kZXJpdmVkJwp1c2luZyBGSElSIHZlcnNpb24gJzQuMC4xJwoKaW5jbHVkZSBobDcuZmhpci51di5jcWwuRkhJUkhlbHBlcnMgd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