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
| Draft as of 2026-09-19 |
<Library xmlns="http://hl7.org/fhir">
<id value="CMS819FHIRHHORAE"/>
<text>
<status value="extensions"/>
<div xmlns="http://www.w3.org/1999/xhtml">
<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">Version</th>
<td class="content-container">1.1.000</td>
</tr>
<tr>
<th scope="row" class="row-header">Status</th>
<td class="content-container">Draft</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">/*
NOTE: For use by March 2026 US Realm Connectathon participants for internal use only. Not for use or distribution in commercial products.
*/
library CMS819FHIRHHORAE version '1.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
include SupplementalDataElements version '6.1.000' called SDE
include Status version '2.1.000' called Status
codesystem "SNOMEDCT": 'http://snomed.info/sct'
valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'
valueset "Operating Room Suite": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.141'
valueset "Opioid Antagonist": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.119'
valueset "Opioids, All": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1196.226'
valueset "Routes of Administration for Opioid Antagonists": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.187'
parameter "Measurement Period" Interval<DateTime>
default Interval[@2026-01-01T00:00:00.000Z, @2027-01-01T00:00:00.000Z)
context Patient
define "Denominator":
"Initial Population"
define "Initial Population":
"Encounter With Opioid Administration Outside Of Operating Room"
define "Numerator":
"Encounter With NonOperating Room Opioid And Antagonist Administration"
define "Opioid Administration":
["MedicationAdministration": "Opioids, All"] Opioids
where Opioids.status = 'completed'
define "Non Enteral Opioid Antagonist Administration":
["MedicationAdministration": "Opioid Antagonist"] AntagonistGiven
where AntagonistGiven.status = 'completed'
define "Qualifying Encounter":
["Encounter": "Encounter Inpatient"] InpatientEncounter
where AgeInYearsAt(date from start of InpatientEncounter.period) >= 18
and InpatientEncounter.period ends during day of "Measurement Period"
and InpatientEncounter.status = 'finished'
define "SDE Ethnicity":
SDE."SDE Ethnicity"
define "SDE Payer":
SDE."SDE Payer"
define "SDE Race":
SDE."SDE Race"
define "SDE Sex":
SDE."SDE Sex"
define "Encounter With Opioid Administration Outside Of Operating Room":
"Qualifying Encounter" InpatientEncounter
with "Opioid Administration" OpioidGiven
such that OpioidGiven.effective.toInterval ( ) starts during InpatientEncounter.hospitalizationWithObservation ( )
and not exists ( InpatientEncounter.location EncounterLocation
where EncounterLocation.location.getLocation ( ).type in "Operating Room Suite"
and OpioidGiven.effective.toInterval ( ) starts during EncounterLocation.period
)
/*
@author: Measure developer
@description: Provides guidance to implementers to interpret logic in following defintion correctly
@comment:Excludes opioid antagonist administered in operating room AND excludes opioids administered in operating room AND opioid is administered before opioid antagonist AND limits opioid antagonist to non-enteral routes
*/
define "Encounter With NonOperating Room Opioid And Antagonist Administration":
from
"Non Enteral Opioid Antagonist Administration" NonEnteralOpioidAntagonistGiven,
"Opioid Administration" OpioidGiven,
"Denominator" InpatientHospitalization
where not exists ( InpatientHospitalization.location EncounterLocation
where EncounterLocation.location.getLocation ( ).type in "Operating Room Suite"
and NonEnteralOpioidAntagonistGiven.effective.toInterval ( ) starts during EncounterLocation.period
)
and ( NonEnteralOpioidAntagonistGiven.effective.toInterval ( ) starts during InpatientHospitalization.hospitalizationWithObservation ( )
and OpioidGiven.effective.toInterval ( ) starts during InpatientHospitalization.hospitalizationWithObservation ( )
and OpioidGiven.effective.toInterval ( ) ends 12 hours or less before start of NonEnteralOpioidAntagonistGiven.effective.toInterval ( )
and NonEnteralOpioidAntagonistGiven.dosage.route in "Routes of Administration for Opioid Antagonists"
)
return InpatientHospitalization</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/CMS819FHIRHHORAE"/>
<version value="1.1.000"/>
<name value="CMS819FHIRHHORAE"/>
<status value="draft"/>
<type>
<coding>
<system value="http://terminology.hl7.org/CodeSystem/library-type"/>
<code value="logic-library"/>
</coding>
</type>
<date value="2026-09-19T16:31:14+00:00"/>
<content>
<contentType value="text/cql"/>
<data
value="LyoKTk9URTogRm9yIHVz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JbnBhdGllbnRIb3NwaXRhbGl6YXRpb24uaG9zcGl0YWxpemF0aW9uV2l0aE9ic2VydmF0aW9uICggKQogICAgICAgICAgYW5kIE9waW9pZEdpdmVuLmVmZmVjdGl2ZS50b0ludGVydmFsICggKSBzdGFydHMgZHVyaW5nIElucGF0aWVudEhvc3BpdGFsaXphdGlvbi5ob3NwaXRhbGl6YXRpb25XaXRoT2JzZXJ2YXRpb24gKCApCiAgICAgICAgICBhbmQgT3Bpb2lkR2l2ZW4uZWZmZWN0aXZlLnRvSW50ZXJ2YWwgKCApIGVuZHMgMTIgaG91cnMgb3IgbGVzcyBiZWZvcmUgc3RhcnQgb2YgTm9uRW50ZXJhbE9waW9pZEFudGFnb25pc3RHaXZlbi5lZmZlY3RpdmUudG9JbnRlcnZhbCAoICkKICAgICAgICAgIGFuZCBOb25FbnRlcmFsT3Bpb2lkQW50YWdvbmlzdEdpdmVuLmRvc2FnZS5yb3V0ZSBpbiAiUm91dGVzIG9mIEFkbWluaXN0cmF0aW9uIGZvciBPcGlvaWQgQW50YWdvbmlzdHMiCiAgICAgICkKICAgIHJldHVybiBJbnBhdGllbnRIb3NwaXRhbGl6YXRpb24="/>
<url value="https://madie.cms.gov/Library-CMS819FHIRHHORAE.cql"/>
</content>
</Library>