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 2026-01-16 |
<Measure xmlns="http://hl7.org/fhir">
<id value="CMS819FHIRHHORAE"/>
<meta>
<profile
value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablemeasure"/>
<profile
value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/computable-measure-cqfm"/>
<profile
value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/publishable-measure-cqfm"/>
<profile
value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/executable-measure-cqfm"/>
<profile
value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cql-measure-cqfm"/>
<profile
value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/elm-measure-cqfm"/>
<profile
value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm"/>
</meta>
<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">Metadata</th>
</tr>
<tr>
<th scope="row" class="row-header">Title</th>
<td class="content-container">Hospital Harm - Opioid-Related Adverse EventsFHIR
</td>
</tr>
<tr>
<th scope="row" class="row-header">Version</th>
<td class="content-container">1.0.000</td>
</tr>
<tr>
<th scope="row" class="row-header">Short Name</th>
<td class="content-container">CMS819FHIR</td>
</tr>
<tr>
<th scope="row" class="row-header">GUID (Version Independent)</th>
<td class="content-container">urn:uuid:30256069-ee4f-45b8-895a-5452cf8e9e4e</td>
</tr>
<tr>
<th scope="row" class="row-header">GUID (Version Specific)</th>
<td class="content-container">urn:uuid:d58ce964-1cb1-40b5-a4aa-40b030191990</td>
</tr>
<tr>
<th scope="row" class="row-header">CMS Identifier</th>
<td class="content-container">819FHIR</td>
</tr>
<tr>
<th scope="row" class="row-header">CMS Consensus Based Entity Identifier</th>
<td class="content-container">3501e</td>
</tr>
<tr>
<th scope="row" class="row-header">Effective Period</th>
<td class="content-container">2026-01-01 through 2026-12-31</td>
</tr>
<tr>
<th scope="row" class="row-header">Steward (Publisher)</th>
<td class="content-container">Centers for Medicare &amp; Medicaid Services (CMS)</td>
</tr>
<tr>
<th scope="row" class="row-header">Developer</th>
<td class="content-container">Mathematica</td>
</tr>
<tr>
<th scope="row" class="row-header">Description</th>
<td class="content-container"><div><p>This measure assesses the number of inpatient hospitalizations for patients age 18 and older who have been administered an opioid medication and are subsequently administered an opioid antagonist within 12 hours, an indication of an opioid-related adverse event</p>
</div></td>
</tr>
<tr>
<th scope="row" class="row-header">Copyright</th>
<td class="content-container"><div><p>Limited proprietary coding is contained in the Measure specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets. Mathematica disclaims all liability for use or accuracy of any third-party codes contained in the specifications. LOINC(R) copyright 2004-2024 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2024 International Health Terminology Standards Development Organisation. ICD-10 copyright 2024 World Health Organization. All Rights Reserved.</p>
</div></td>
</tr>
<tr>
<th scope="row" class="row-header">Disclaimer</th>
<td class="content-container"><div><p>This performance measure is not a clinical guideline, does not establish a standard of medical care and has not been tested for all potential applications. THE MEASURES AND SPECIFICATIONS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. Due to technical limitations, registered trademarks are indicated by (R) or [R] and unregistered trademarks are indicated by (TM) or [TM].</p>
</div></td>
</tr>
<tr>
<th scope="row" class="row-header">Rationale</th>
<td class="content-container"><div><p>Opioids are often the foundation for sedation and pain relief. Opioid-based analgesia continues to be the most commonly used treatment in postoperative pain management, with more than 95% of surgical patients receiving opioids during their hospitalization (Baker et al., 2020). However, use of opioids can also lead to serious adverse events, including constipation, over sedation, delirium, and respiratory depression (Urman et al., 2021a). Opioid-related adverse events (ORADE) have both patient-level and financial implications. The presence of an ORADE was associated with a 55% longer postoperative length of stay, 29% lower odds of discharge home, and 2.9 times the odds of death (Urman et al., 2021b). For surgical patients, occurrence of opioid-related adverse events was associated with an increase of 1.6 days in length of stay (LOS) and $8225 more in cost for the index hospitalization. Patients who experienced ORADEs while in a hospitalized setting were more likely to have received a higher total dose of opioids during hospitalization (Cone et al., 2023; Shafi et al., 2018). Numerous studies report the additive (risk-adjusted) hospitalization cost burden of surgical patients with ORADEs to be between $4350-$8225, representing a 27-47% increase in (risk-adjusted) admission costs (Khanna et al., 2021).</p>
<p>Most opioid-related adverse events are preventable. Each year, adverse drug events (ADE) account for nearly 700,000 emergency department visits and 100,000 hospitalizations (AHRQ, 2019). An estimated one-third of all adverse events that occur in the inpatient setting are adverse drug events (ODPHP, 2020). Additionally, in a closed-claims analysis, 97% of adverse events were judged preventable with better monitoring and response (Lee et al., 2015). Naloxone administration is often used as an indicator of a severe opioid-related adverse event, and implementation of this measure can advance safe use of opioids in hospitals and prevent these serious and potentially lethal adverse drug events.</p>
</div></td>
</tr>
<tr>
<th scope="row" class="row-header">Clinical Recommendation Statement</th>
<td class="content-container"><div><p>Naloxone is an opioid reversal agent typically used for severe opioid-related adverse events. Naloxone administration has been used in a number of studies as an indicator of opioid-related adverse events (Yiu, et al., 2022; Lynn & Galinkin, 2017; Nwulu et al., 2013).</p>
<p>From Section 10 of the 2015 American Heart Association Guidelines Update for Cardiopulmonary Resuscitation and Emergency Cardiovascular Care (Lavonas et al., 2015), the following recommendation is listed for use of naloxone:</p>
<p>Naloxone is a potent opioid receptor antagonist in the brain, spinal cord, and gastrointestinal system. Naloxone has an excellent safety profile and can rapidly reverse central nervous system (CNS) and respiratory depression in a patient with an opioid-associated resuscitative emergency.</p>
<p>The 2020 American Heart Association guidelines update for cardiopulmonary resuscitation continue to recommend naloxone for a patient with suspected opioid overdose who has a definite pulse but no normal breathing or only gasping (i.e., a respiratory arrest), in addition to providing standard Pediatric Basic Life Support (PBLS) or Pediatric Advanced Life Support (PALS), it is reasonable for responders to administer intramuscular or intranasal naloxone. These recommendations are identical for adults (American Heart Association, 2020).</p>
<p>In February 2022, the Food and Drug Administration (FDA) approved its abbreviated new drug application for nalmefene hydrochloride injection, 2mg/2mL (1mg/1mL). Nalmefene is an opioid antagonist indicated for the complete or partial reversal of opioid drug effects, including respiratory depression, induced by either natural or synthetic opioids, and in the management of known or suspected opioid overdose (FDA, 2022). In contrast to naloxone, the long half-life of nalmefene is similar to or greater than that of many opioid receptor agonists (Britch & Walsh, 2022), which could decrease the need for repeat drug administration. In May 2023, FDA approved nalmefene hydrochloride nasal spray that delivers 2.7 milligrams (mg) of nalmefene into the nasal cavity (FDA, 2023).</p>
</div></td>
</tr>
<tr>
<th scope="row" class="row-header">Citation</th>
<td class="content-container">
<div><p>Agency for Healthcare Research and Quality. (2019). Medication Errors and Adverse Drug Events. Rockville: US Department of Health & Human Services. Retrieved from https://psnet.ahrq.gov/primer/medication-errors-and-adverse-drug-events</p>
</div>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Citation</th>
<td class="content-container">
<div><p>American Heart Association and American Society of Anesthesiologists. (2021). Naloxone in CPR/AED Training and Public Access to Defibrillation. Retrieved from https://www.heart.org/-/media/Files/About-Us/Policy-Research/Policy-Positions/CPR-and-AED/Naloxone-Position-Statement.pdf</p>
</div>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Citation</th>
<td class="content-container">
<div><p>American Heart Association. (2020). Highlights of the 2020 American Heart Association's Guidelines for CPR and ECC. https://cpr.heart.org/-/media/cpr-files/cpr-guidelines-files/highlights/hghlghts_2020_ecc_guidelines_english.pdf</p>
</div>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Citation</th>
<td class="content-container">
<div><p>Baker, J., Brovman, E.Y., Rao, N., Beutler, S.S., Urman, R.D. (2020). Potential Opioid-Related Adverse Drug Events Are Associated With Decreased Revenue in Hip Replacement Surgery in the Older Population. Geriatric Orthopaedic Surgery & Rehabilitation. January 2020. doi:10.1177/2151459320915328</p>
</div>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Citation</th>
<td class="content-container">
<div><p>Britch, S.C., Walsh, S.L. (2022). Treatment of opioid overdose: current approaches and recent advances. Psychopharmacology (Berl). 2022;239(7):2063-2081. doi:10.1007/s00213-022-06125-5</p>
</div>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Citation</th>
<td class="content-container">
<div><p>Food and Drug Administration. (2022). Nalmefene Hydrochloride Injection 2mg/2mL (1mg/1mL) [Full Prescribing Information]. Stamford, CT: Purdue Pharma L.P., 02/08/2022. https://www.accessdata.fda.gov/spl/data/d4bb0797-a4ed-4ed4-9904-604433eea4ff/d4bb0797-a4ed-4ed4-9904-604433eea4ff.xml</p>
</div>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Citation</th>
<td class="content-container">
<div><p>Kessler, E. R., Shah, M., Gruschkus, S. K., & Raju, A. (2013). Cost and quality implications of opioid-based postsurgical pain control using administrative claims data from a large health system: opioid-related adverse events and their impact on clinical and economic outcomes. Pharmacotherapy, 33(4), 383-391. doi: 10.1002/phar.1223</p>
</div>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Citation</th>
<td class="content-container">
<div><p>Khanna, A.K., Saager, L., Bergese, S.D., et al. (2021). Opioid-induced respiratory depression increases hospital costs and length of stay in patients recovering on the general care floor. BMC Anesthesiol. 2021;21(1):88. Published 2021 Mar 20. doi:10.1186/s12871-021-01307-8</p>
</div>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Citation</th>
<td class="content-container">
<div><p>Lavonas, E. J., Drennan, I. R., Gabrielli, A., Heffner, A. C., Hoyte, C. O., Orkin, A. M., Donnino, M. W. (2015). Part 10: Special Circumstances of Resuscitation. 2015 American Heart Association Guidelines Update for Cardiopulmonary Resuscitation and Emergency Cardiovascular Care, 132(18 suppl 2), S501-S518. doi: 10.1161/cir.0000000000000264</p>
</div>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Citation</th>
<td class="content-container">
<div><p>Lee, L. A., Caplan, R. A., Stephens, L. S., Posner, K. L., Terman, G. W., Voepel-Lewis, T., & Domino, K. B. (2015). Postoperative opioid-induced respiratory depression: a closed claims analysis. Anesthesiology, 122(3), 659-665</p>
</div>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Citation</th>
<td class="content-container">
<div><p>Lynn, R. R., Galinkin, J. (2017). Naloxone dosage for opioid reversal: Current evidence and clinical implications. Therapeutic Advances in Drug Safety, 9(1), 63-88. doi:10.1177/204209861774416</p>
</div>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Citation</th>
<td class="content-container">
<div><p>Makary, M. A., Daniel, M. (2016). Medical error-the third leading cause of death in the US. BMJ, 353, i2139. doi: 10.1136/bmj.i2139</p>
</div>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Citation</th>
<td class="content-container">
<div><p>Med Lett Drugs Ther. (2022). Nalmefene Returns for Reversal of Opioid Overdose. Sep 5;64(1658):141-2</p>
</div>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Citation</th>
<td class="content-container">
<div><p>Nwulu, U., Nirantharakumar, K., Odesanya, R., McDowell, S. E., Coleman, J. J. (2013). Improvement in the detection of adverse drug events by the use of electronic health and prescription records: an evaluation of two trigger tools. Eur J Clin Pharmacol, 69(2), 255-259. doi: 10.1007/s00228-012-1327-1</p>
</div>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Citation</th>
<td class="content-container">
<div><p>Shafi, S., Collinsworth, A.W., Copeland, L.A., et al. (2018). Association of Opioid-Related Adverse Drug Events With Clinical and Cost Outcomes Among Surgical Patients in a Large Integrated Health Care Delivery System. JAMA Surg. 2018;153(8):757-763. doi:10.1001/jamasurg.2018.1039. PMID: 29799927; PMCID: PMC6142954</p>
</div>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Citation</th>
<td class="content-container">
<div><p>Urman, R.D., Khanna, A.K., Bergese, S.D., et al. (2021). Postoperative opioid administration characteristics associated with opioid-induced respiratory depression: Results from the PRODIGY trial. J Clin Anesth. 2021;70:110167. doi:10.1016/j.jclinane.110167</p>
</div>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Citation</th>
<td class="content-container">
<div><p>Urman, R.D., Seger, D.L., Fiskio, J.M., et al. (2021). The Burden of Opioid-Related Adverse Drug Events on Hospitalized Previously Opioid-Free Surgical Patients. J Patient Saf. 2021;17(2):e76-e83</p>
</div>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Guidance (Usage)</th>
<td class="content-container">Qualifying encounters (denominator) include all patients 18 years of age or older with at least one opioid medication administered outside of the operating room.
To create the numerator:
1. First, start with those encounters meeting denominator criteria.
2. Next, remove all events where an opioid or opioid antagonist was administered in the operating room.
Opioid antagonist administrations in the operating room are excluded because they could be part of the sedation plan as administered by an anesthesiologist. Encounters that include use of opioid antagonists for procedures and recovery outside of the operating room (e.g., bone marrow biopsy and PACU) are included in the numerator, as it would indicate the patient was over-sedated. Note that should a facility not utilize temporary patient locations, alternative times may be used to determine whether a patient is in the operating room during opioid antagonist administration. Since anesthesia end time could represent the time the anesthesiologist signed off, and thus may include the patient's time in the PACU, this should be avoided.
3. Next, remove all events where the opioid antagonist was administered via an enteral route. Only opioid antagonists given by a non-enteral (i.e., intravenous, intramuscular, subcutaneous, intranasal, inhalation) route are considered.
4. Finally, remove all administrations of opioid antagonist that were given greater than 12 hours following hospital administration of an opioid medication.
This dQM is an episode-based measure. An episode is defined as each inpatient hospitalization or encounter that ends during the measurement period.
This FHIR-based measure has been derived from the QDM-based measure: CMS819v4. Please refer to the HL7 QI-Core Implementation Guide (https://hl7.org/fhir/us/qicore/STU6/) for more information on QI-Core and mapping recommendations from QDM to QI-Core STU 6 (https://hl7.org/fhir/us/qicore/STU6/qdm-to-qicore.html).
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">Measure Group (Rate) (ID: Group_1)</th>
</tr>
<tr>
<th scope="row" class="row-header">Basis</th>
<td class="content-container">Encounter</td>
</tr>
<tr>
<th scope="row" class="row-header">Scoring</th>
<td class="content-container">
Proportion
</td>
</tr>
<tr>
<th scope="row" class="row-header">Improvement Notation</th>
<td class="content-container">
Decreased score indicates improvement
</td>
</tr>
<tr>
<th scope="row" class="row-header">Type</th>
<td class="content-container">
Outcome
</td>
</tr>
<tr>
<th scope="row" class="row-header">Rate Aggregation</th>
<td class="content-container">None
</td>
</tr>
<tr>
<th scope="row" class="row-header">Initial Population</th>
<td class="content-container">
<em>ID</em>: InitialPopulation_1
<br/>
<em>Description</em>:
<p style="white-space: pre-line" class="tab-one">Inpatient hospitalizations that end during the measurement period for patients age 18 and older and at least one opioid medication administration starts during the hospitalization outside of the operating room
</p>
<em>Criteria</em>: <a href="#Group_1-InitialPopulation_1">Initial Population</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Denominator</th>
<td class="content-container">
<em>ID</em>: Denominator_1
<br/>
<em>Description</em>:
<p style="white-space: pre-line" class="tab-one">Equals Initial Population
</p>
<em>Criteria</em>: <a href="#Group_1-Denominator_1">Denominator</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Numerator</th>
<td class="content-container">
<em>ID</em>: Numerator_1
<br/>
<em>Description</em>:
<p style="white-space: pre-line" class="tab-one">Inpatient hospitalizations where a non-enteral opioid antagonist administration starts during the hospitalization outside of the operating room and 12 hours or less following an opioid medication administered outside of the operating room. The route of administration of the opioid antagonist must be by intranasal spray, inhalation, intramuscular, subcutaneous, or intravenous injection. Only one numerator event is counted per encounter.
</p>
<em>Criteria</em>: <a href="#Group_1-Numerator_1">Numerator</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header"/>
<td class="content-container">For every patient evaluated by this measure also identify payer, race, ethnicity and sex</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">Supplemental Data Elements</th>
</tr>
<tr>
<th scope="row" class="row-header">Supplemental Data Element</th>
<td class="content-container">
<em>ID</em>: sde-ethnicity
<br/>
<em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
<br/>
<em>Description</em>: SDE Ethnicity
<br/>
<em>Logic Definition</em>: <a href="#cms819fhirhhorae-sde-ethnicity">SDE Ethnicity</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Supplemental Data Element</th>
<td class="content-container">
<em>ID</em>: sde-payer
<br/>
<em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
<br/>
<em>Description</em>: SDE Payer
<br/>
<em>Logic Definition</em>: <a href="#cms819fhirhhorae-sde-payer">SDE Payer</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Supplemental Data Element</th>
<td class="content-container">
<em>ID</em>: sde-race
<br/>
<em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
<br/>
<em>Description</em>: SDE Race
<br/>
<em>Logic Definition</em>: <a href="#cms819fhirhhorae-sde-race">SDE Race</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Supplemental Data Element</th>
<td class="content-container">
<em>ID</em>: sde-sex
<br/>
<em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
<br/>
<em>Description</em>: SDE Sex
<br/>
<em>Logic Definition</em>: <a href="#cms819fhirhhorae-sde-sex">SDE Sex</a>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">Measure Logic</th>
</tr>
<tr>
<th scope="row" class="row-header">Primary Library</th>
<td class="content-container"><code>https://madie.cms.gov/Library/CMS819FHIRHHORAE</code></td>
</tr>
<tr>
<th scope="row" class="row-header">Contents</th>
<td class="content-container">
<em><a href="#population-criteria">Population Criteria</a></em>
<br/>
<em><a href="#definitions">Logic Definitions</a></em>
<br/>
<em><a href="#terminology">Terminology</a></em>
<br/>
<em><a href="#dependencies">Dependencies</a></em>
<br/>
<em><a href="#data-requirements">Data Requirements</a></em>
<br/>
<em><a href="#parameters">Parameters</a></em>
<br/>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header"><a name="population-criteria"> </a>Population Criteria</th>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">Measure Group (Rate) (ID: Group_1)</th>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Initial Population
</th>
</tr>
<tr>
<td>
<a name="Group_1-InitialPopulation_1"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Initial Population":
"Encounter With Opioid Administration Outside Of Operating Room"</code></pre>
<a href="#cms819fhirhhorae-initial-population"><em>Definition</em></a>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Denominator
</th>
</tr>
<tr>
<td>
<a name="Group_1-Denominator_1"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Denominator":
"Initial Population"</code></pre>
<a href="#cms819fhirhhorae-denominator"><em>Definition</em></a>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Numerator
</th>
</tr>
<tr>
<td>
<a name="Group_1-Numerator_1"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Numerator":
"Encounter With NonOperating Room Opioid And Antagonist Administration"</code></pre>
<a href="#cms819fhirhhorae-numerator"><em>Definition</em></a>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header"><a name="definitions"> </a>Logic Definitions</th>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> SupplementalDataElements</td>
</tr>
<tr>
<td>
<a name="supplementaldataelements-sde-sex"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "SDE Sex":
case
when Patient.sex() = '248153007' then "Male (finding)"
when Patient.sex() = '248152002' then "Female (finding)"
else null
end</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> SupplementalDataElements</td>
</tr>
<tr>
<td>
<a name="supplementaldataelements-sde-payer"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "SDE Payer":
[USQualityCore.Coverage: type in "Payer Type"] Payer
return {
code: Payer.type,
period: Payer.period
}</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> SupplementalDataElements</td>
</tr>
<tr>
<td>
<a name="supplementaldataelements-sde-ethnicity"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "SDE Ethnicity":
(Patient.ethnicity()) E
return Tuple {
codes: { E.ombCategory } union E.detailed,
display: E.text
}</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> SupplementalDataElements</td>
</tr>
<tr>
<td>
<a name="supplementaldataelements-sde-race"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "SDE Race":
(Patient.race()) R
return Tuple {
codes: R.ombCategory union R.detailed,
display: R.text
}</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> CMS819FHIRHHORAE</td>
</tr>
<tr>
<td>
<a name="cms819fhirhhorae-sde-sex"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "SDE Sex":
SDE."SDE Sex"</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> CMS819FHIRHHORAE</td>
</tr>
<tr>
<td>
<a name="cms819fhirhhorae-non-enteral-opioid-antagonist-administration"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Non Enteral Opioid Antagonist Administration":
["MedicationAdministration": "Opioid Antagonist"] AntagonistGiven
where AntagonistGiven.status = 'completed'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> CMS819FHIRHHORAE</td>
</tr>
<tr>
<td>
<a name="cms819fhirhhorae-opioid-administration"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Opioid Administration":
["MedicationAdministration": "Opioids, All"] Opioids
where Opioids.status = 'completed'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> CMS819FHIRHHORAE</td>
</tr>
<tr>
<td>
<a name="cms819fhirhhorae-qualifying-encounter"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">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'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> CMS819FHIRHHORAE</td>
</tr>
<tr>
<td>
<a name="cms819fhirhhorae-encounter-with-opioid-administration-outside-of-operating-room"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">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
)</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> CMS819FHIRHHORAE</td>
</tr>
<tr>
<td>
<a name="cms819fhirhhorae-initial-population"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Initial Population":
"Encounter With Opioid Administration Outside Of Operating Room"</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> CMS819FHIRHHORAE</td>
</tr>
<tr>
<td>
<a name="cms819fhirhhorae-denominator"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Denominator":
"Initial Population"</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> CMS819FHIRHHORAE</td>
</tr>
<tr>
<td>
<a name="cms819fhirhhorae-encounter-with-nonoperating-room-opioid-and-antagonist-administration"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@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 scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> CMS819FHIRHHORAE</td>
</tr>
<tr>
<td>
<a name="cms819fhirhhorae-numerator"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Numerator":
"Encounter With NonOperating Room Opioid And Antagonist Administration"</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> CMS819FHIRHHORAE</td>
</tr>
<tr>
<td>
<a name="cms819fhirhhorae-sde-payer"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "SDE Payer":
SDE."SDE Payer"</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> CMS819FHIRHHORAE</td>
</tr>
<tr>
<td>
<a name="cms819fhirhhorae-sde-ethnicity"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "SDE Ethnicity":
SDE."SDE Ethnicity"</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> CMS819FHIRHHORAE</td>
</tr>
<tr>
<td>
<a name="cms819fhirhhorae-sde-race"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "SDE Race":
SDE."SDE Race"</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-tostring"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value string): value.value</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-tostring"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value uri): value.value</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-toconcept"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.
*/
define function ToConcept(concept FHIR.CodeableConcept):
if concept is null then
null
else
System.Concept {
codes: concept.coding C return ToCode(C),
display: concept.text.value
}</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-tocode"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.
*/
define function ToCode(coding FHIR.Coding):
if coding is null then
null
else
System.Code {
code: coding.code.value,
system: coding.system.value,
version: coding.version.value,
display: coding.display.value
}</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-tostring"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value MedicationAdministrationStatus): value.value</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-todate"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToDate(value date): value.value</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-tointerval"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)
value to a CQL DateTime Interval
@comment: If the start value of the given period is unspecified, the starting
boundary of the resulting interval will be open (meaning the start of the interval
is unknown, as opposed to interpreted as the beginning of time).
*/
define function ToInterval(period FHIR.Period):
if period is null then
null
else
if period."start" is null then
Interval(period."start".value, period."end".value]
else
Interval[period."start".value, period."end".value]</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-tostring"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value EncounterStatus): value.value</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-todatetime"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToDateTime(value dateTime): value.value</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-todatetime"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToDateTime(value instant): value.value</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-toquantity"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity)
value to a CQL Quantity
@comment: If the given quantity has a comparator specified, a runtime error is raised. If the given quantity
has a system other than UCUM (i.e. `http://unitsofmeasure.org`) or CQL calendar units (i.e. `http://hl7.org/fhirpath/CodeSystem/calendar-units`)
an error is raised. For UCUM to calendar units, the `ToCalendarUnit` function is used.
@seealso: ToCalendarUnit
*/
define function ToQuantity(quantity FHIR.Quantity):
case
when quantity is null then null
when quantity.value is null then null
when quantity.comparator is not null then
Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')
when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'
or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then
System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }
else
Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' & quantity.unit.value & ' (' & quantity.system.value & '|' & quantity.code.value & ')')
end</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-tocalendarunit"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Converts a UCUM definite duration unit to a CQL calendar duration
unit using conversions specified in the [quantities](https://cql.hl7.org/02-authorsguide.html#quantities)
topic of the CQL specification.
@comment: Note that for durations above days (or weeks), the conversion is understood to be approximate
*/
define function ToCalendarUnit(unit System.String):
case unit
when 'ms' then 'millisecond'
when 's' then 'second'
when 'min' then 'minute'
when 'h' then 'hour'
when 'd' then 'day'
when 'wk' then 'week'
when 'mo' then 'month'
when 'a' then 'year'
else unit
end</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> CQMCommon</td>
</tr>
<tr>
<td>
<a name="cqmcommon-hospitalizationwithobservation"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Hospitalization with Observation returns the total interval from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter
*/
define fluent function hospitalizationWithObservation(TheEncounter Encounter ):
TheEncounter Visit
let ObsVisit: Last([Encounter: "Observation Services"] LastObs
where LastObs.status = 'finished'
and LastObs.period ends 1 hour or less on or before start of Visit.period
sort by end of period
),
VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),
EDVisit: Last([Encounter: "Emergency Department Visit"] LastED
where LastED.status = 'finished'
and LastED.period ends 1 hour or less on or before VisitStart
sort by end of period
)
return Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> CQMCommon</td>
</tr>
<tr>
<td>
<a name="cqmcommon-getlocation"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns the Location resource specified by the given reference.
*/
define fluent function getLocation(reference Reference):
singleton from (
[Location] L where reference.references(L)
)</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRCommon</td>
</tr>
<tr>
<td>
<a name="fhircommon-ext"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns the single extension (if present) on the given resource with the specified url.
@comment: This function uses singleton from to ensure that a run-time exception is thrown if there
is more than one extension on the given resource with the specified url.
*/
define fluent function ext(domainResource DomainResource, url String):
singleton from domainResource.exts(url)</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRCommon</td>
</tr>
<tr>
<td>
<a name="fhircommon-exts"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns any extensions defined on the given resource with the specified url
*/
define fluent function exts(domainResource DomainResource, url String):
domainResource.extension E
where E.url = url
return E</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRCommon</td>
</tr>
<tr>
<td>
<a name="fhircommon-tointerval"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
@comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range types
to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible
representations for timing-valued elements in FHIR, allowing this function to be used across any resource.
The input can be provided as a dateTime, Period, Timing, instant, string, Age, or Range.
The intent of this function is to provide a clear and concise mechanism to treat single
elements that have multiple possible representations as intervals so that logic doesn't have to account
for the variability. More complex calculations (such as medication request period or dispense period
calculation) need specific guidance and consideration. That guidance may make use of this function, but
the focus of this function is on single element calculations where the semantics are unambiguous.
If the input is a dateTime, the result a DateTime Interval beginning and ending on that dateTime.
If the input is a Period, the result is a DateTime Interval.
If the input is a Timing, an error is raised indicating a single interval cannot be computed from a Timing.
If the input is an instant, the result is a DateTime Interval beginning and ending on that instant.
If the input is a string, an error is raised indicating a single interval cannot be computed from a string.
If the input is an Age, the result is a DateTime Interval beginning when the patient was the given Age,
and ending immediately prior to when the patient was the given Age plus one year.
If the input is a Range, the result is a DateTime Interval beginning when the patient was the Age given
by the low end of the Range, and ending immediately prior to when the patient was the Age given by the
high end of the Range plus one year.
NOTE: Due to the
complexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used
with a Timing or String.
*/
define fluent function toInterval(choice Choice<FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range>):
case
when choice is FHIR.dateTime then
Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]
when choice is FHIR.Period then
FHIRHelpers.ToInterval(choice as FHIR.Period)
when choice is FHIR.instant then
Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]
when choice is FHIR.Age then
Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),
FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)
when choice is FHIR.Range then
Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),
FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)
when choice is FHIR.Timing then
Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported')
when choice is FHIR.string then
Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')
else
null as Interval<DateTime>
end</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRCommon</td>
</tr>
<tr>
<td>
<a name="fhircommon-references"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns true if the given reference is to the given resource
@comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.
NOTE: This function assumes resources from the same source server.
*/
define fluent function references(reference FHIR.Reference, resource FHIR.Resource):
resource.id = Last(Split(reference.reference, '/'))</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRCommon</td>
</tr>
<tr>
<td>
<a name="fhircommon-ext"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns the single extension (if present) on the given element with the specified url.
@comment: This function uses singleton from to ensure that a run-time exception is thrown if there
is more than one extension on the given element with the specified url.
*/
define fluent function ext(element Element, url String):
singleton from element.exts(url)</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRCommon</td>
</tr>
<tr>
<td>
<a name="fhircommon-exts"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns any extensions defined on the given element with the specified url.
*/
define fluent function exts(element Element, url String):
element.extension E
where E.url = url
return E</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> USCoreCommon</td>
</tr>
<tr>
<td>
<a name="uscorecommon-sex"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns the sex element as defined for the USCore patient profile
*/
define fluent function sex(patient Patient):
patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-sex').value as FHIR.code</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> USCoreCommon</td>
</tr>
<tr>
<td>
<a name="uscorecommon-ethnicity"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function ethnicity(patient Patient):
(patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity')) E
return {
ombCategory: E.ext('ombCategory').value as FHIR.Coding,
detailed: (E.exts('detailed')) d return d.value as FHIR.Coding,
text: E.ext('text').value as FHIR.string
}</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> USCoreCommon</td>
</tr>
<tr>
<td>
<a name="uscorecommon-race"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function race(patient Patient):
(patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-race')) E
return {
ombCategory: (E.exts('ombCategory')) o return o.value as FHIR.Coding,
detailed: (E.exts('detailed')) d return d.value as FHIR.Coding,
text: E.ext('text').value as FHIR.string
}</code></pre>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header"><a name="terminology"> </a>Terminology</th>
</tr>
<tr>
<th scope="row" class="row-header">Code System</th>
<td class="content-container">
<em>Description</em>: Code system SNOMEDCT
<br/>
<em>Resource</em>: <a href="http://hl7.org/fhir/R4/codesystem-snomedct.html">SNOMED CT (all versions)</a>
<br/>
<em>Canonical URL</em>: <tt>http://snomed.info/sct</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Value Set</th>
<td class="content-container">
<em>Description</em>: Value set Opioid Antagonist
<br/>
<em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1248.119/expansion">Opioid Antagonist</a>
<br/>
<em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.119</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Value Set</th>
<td class="content-container">
<em>Description</em>: Value set Opioids, All
<br/>
<em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1196.226/expansion">Opioids, All</a>
<br/>
<em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1196.226</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Value Set</th>
<td class="content-container">
<em>Description</em>: Value set Encounter Inpatient
<br/>
<em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion">Encounter Inpatient</a>
<br/>
<em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Value Set</th>
<td class="content-container">
<em>Description</em>: Value set Observation Services
<br/>
<em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.143/expansion">Observation Services</a>
<br/>
<em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Value Set</th>
<td class="content-container">
<em>Description</em>: Value set Emergency Department Visit
<br/>
<em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.292/expansion">Emergency Department Visit</a>
<br/>
<em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Value Set</th>
<td class="content-container">
<em>Description</em>: Value set Operating Room Suite
<br/>
<em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1248.141/expansion">Operating Room Suite</a>
<br/>
<em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.141</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Value Set</th>
<td class="content-container">
<em>Description</em>: Value set Routes of Administration for Opioid Antagonists
<br/>
<em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1248.187/expansion">Routes of Administration for Opioid Antagonists</a>
<br/>
<em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.187</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Value Set</th>
<td class="content-container">
<em>Description</em>: Value set Payer Type
<br/>
<em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion">Payer Type</a>
<br/>
<em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Direct Reference Code</th>
<td class="content-container">
<em>Display</em>: Male (finding)
<br/>
<em>Code</em>: 248153007
<br/>
<em>System</em>: <tt>http://snomed.info/sct</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Direct Reference Code</th>
<td class="content-container">
<em>Display</em>: Female (finding)
<br/>
<em>Code</em>: 248152002
<br/>
<em>System</em>: <tt>http://snomed.info/sct</tt>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header"><a name="dependencies"> </a>Dependencies</th>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: USQualityCore model information
<br/>
<em>Resource</em>: <code>https://madie.cms.gov/Library/USQualityCore-ModelInfo|0.1.0-cibuild</code>
<br/>
<em>Canonical URL</em>: <tt>https://madie.cms.gov/Library/USQualityCore-ModelInfo|0.1.0-cibuild</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: USCore model information
<br/>
<em>Resource</em>: <a href="http://hl7.org/fhir/us/cql/2026May/Library-USCore-ModelInfo.html">http://hl7.org/fhir/us/cql/Library/USCore-ModelInfo|6.1.0-derived</a>
<br/>
<em>Canonical URL</em>: <tt>http://hl7.org/fhir/us/cql/Library/USCore-ModelInfo|6.1.0-derived</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: FHIR model information
<br/>
<em>Resource</em>: <a href="http://hl7.org/fhir/uv/cql/STU2/Library-FHIR-ModelInfo.html">http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1</a>
<br/>
<em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: Library SDE
<br/>
<em>Resource</em>: <a href="Library-SupplementalDataElements.html">SupplementalDataElements</a> version: 6.1.000
<br/>
<em>Canonical URL</em>: <tt>https://madie.cms.gov/Library/SupplementalDataElements|6.1.000</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: Library FHIRHelpers
<br/>
<em>Resource</em>: <a href="http://hl7.org/fhir/uv/cql/STU2/Library-FHIRHelpers.html">http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1</a>
<br/>
<em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: Library USCommon
<br/>
<em>Resource</em>: <a href="http://hl7.org/fhir/us/cql/2026May/Library-USCoreCommon.html">http://hl7.org/fhir/us/cql/Library/USCoreCommon|2.0.0-ballot</a>
<br/>
<em>Canonical URL</em>: <tt>http://hl7.org/fhir/us/cql/Library/USCoreCommon|2.0.0-ballot</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: Library FHIRCommon
<br/>
<em>Resource</em>: <a href="http://hl7.org/fhir/uv/cql/STU2/Library-FHIRCommon.html">http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0</a>
<br/>
<em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: Library CQMCommon
<br/>
<em>Resource</em>: <a href="Library-CQMCommon.html">CQMCommon</a> version: 5.1.000
<br/>
<em>Canonical URL</em>: <tt>https://madie.cms.gov/Library/CQMCommon|5.1.000</tt>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header"><a name="data-requirements"> </a>Data Requirements</th>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: Patient
<br/>
<em>Profile(s)</em>:
<code>http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-patient</code>
<br/>
<em>Must Support Elements</em>: ombCategory, detailed, text
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: Medication
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medication.html">Medication</a>
<br/>
<em>Must Support Elements</em>: id, code
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: code</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1248.119/expansion">Opioid Antagonist</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: Medication
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medication.html">Medication</a>
<br/>
<em>Must Support Elements</em>: id, code
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: code</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1196.226/expansion">Opioids, All</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationAdministration
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationadministration.html">MedicationAdministration</a>
<br/>
<em>Must Support Elements</em>: medication, status, effective, dosage, dosage.route
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1248.119/expansion">Opioid Antagonist</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationAdministration
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationadministration.html">MedicationAdministration</a>
<br/>
<em>Must Support Elements</em>: medication.reference, status, effective, dosage, dosage.route
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationAdministration
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationadministration.html">MedicationAdministration</a>
<br/>
<em>Must Support Elements</em>: medication, status, effective, dosage, dosage.route
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1196.226/expansion">Opioids, All</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: Encounter
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>
<br/>
<em>Must Support Elements</em>: type, status, period, location
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: type</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.143/expansion">Observation Services</a>
<br/>
<span class="tab-one"><em>Path</em>: status</span>
<br/>
<span class="tab-one"><em>Code(s)</em>:
[not stated]: finished (finished)
</span>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: Encounter
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>
<br/>
<em>Must Support Elements</em>: type, status, period, location
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: type</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.292/expansion">Emergency Department Visit</a>
<br/>
<span class="tab-one"><em>Path</em>: status</span>
<br/>
<span class="tab-one"><em>Code(s)</em>:
[not stated]: finished (finished)
</span>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: Encounter
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>
<br/>
<em>Must Support Elements</em>: type, period, status, location
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: type</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion">Encounter Inpatient</a>
<br/>
<span class="tab-one"><em>Path</em>: status</span>
<br/>
<span class="tab-one"><em>Code(s)</em>:
[not stated]: finished (finished)
</span>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: Patient
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/patient.html">Patient</a>
<br/>
<em>Must Support Elements</em>: birthDate
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: Resource
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/resource.html">Resource</a>
<br/>
<em>Must Support Elements</em>: id
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: Location
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/location.html">Location</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: Coverage
<br/>
<em>Profile(s)</em>:
<code>http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-coverage</code>
<br/>
<em>Must Support Elements</em>: type, period
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: type</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion">Payer Type</a>
<br/>
</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"/>
<td class="content-container">
<table>
<thead>
<tr>
<td><em>Name</em></td>
<td><em>Use</em></td>
<td><em>Card.</em></td>
<td><em>Type</em></td>
<td><em>Documentation</em></td>
</tr>
</thead>
<tbody>
<tr>
<td>Measurement Period</td>
<td>In</td>
<td>0..1</td>
<td>Period</td>
<td/>
</tr>
<tr>
<td>SDE Sex</td>
<td>Out</td>
<td>0..1</td>
<td>Coding</td>
<td/>
</tr>
<tr>
<td>Numerator</td>
<td>Out</td>
<td>0..*</td>
<td>Encounter</td>
<td/>
</tr>
<tr>
<td>Denominator</td>
<td>Out</td>
<td>0..*</td>
<td>Encounter</td>
<td/>
</tr>
<tr>
<td>SDE Payer</td>
<td>Out</td>
<td>0..*</td>
<td>Resource</td>
<td/>
</tr>
<tr>
<td>Initial Population</td>
<td>Out</td>
<td>0..*</td>
<td>Encounter</td>
<td/>
</tr>
<tr>
<td>SDE Ethnicity</td>
<td>Out</td>
<td>0..1</td>
<td>Resource</td>
<td/>
</tr>
<tr>
<td>SDE Race</td>
<td>Out</td>
<td>0..1</td>
<td>Resource</td>
<td/>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">Generated using version 0.5.4 of the sample-content-ig Liquid templates</th>
</tr>
</tbody>
</table>
</div>
</text>
<contained>
<Library>
<id value="effective-data-requirements"/>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
<valueCoding>
<system value="http://snomed.info/sct"/>
<code value="248153007"/>
<display value="Male (finding)"/>
</valueCoding>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
<valueCoding>
<system value="http://snomed.info/sct"/>
<code value="248152002"/>
<display value="Female (finding)"/>
</valueCoding>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="SupplementalDataElements"/>
</extension>
<extension url="name">
<valueString value="SDE Sex"/>
</extension>
<extension url="statement">
<valueString
value="define "SDE Sex":
case
when Patient.sex() = '248153007' then "Male (finding)"
when Patient.sex() = '248152002' then "Female (finding)"
else null
end"/>
</extension>
<extension url="displaySequence">
<valueInteger value="0"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="CMS819FHIRHHORAE"/>
</extension>
<extension url="name">
<valueString value="SDE Sex"/>
</extension>
<extension url="statement">
<valueString
value="define "SDE Sex":
SDE."SDE Sex""/>
</extension>
<extension url="displaySequence">
<valueInteger value="1"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="CMS819FHIRHHORAE"/>
</extension>
<extension url="name">
<valueString value="Non Enteral Opioid Antagonist Administration"/>
</extension>
<extension url="statement">
<valueString
value="define "Non Enteral Opioid Antagonist Administration":
["MedicationAdministration": "Opioid Antagonist"] AntagonistGiven
where AntagonistGiven.status = 'completed'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="2"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="CMS819FHIRHHORAE"/>
</extension>
<extension url="name">
<valueString value="Opioid Administration"/>
</extension>
<extension url="statement">
<valueString
value="define "Opioid Administration":
["MedicationAdministration": "Opioids, All"] Opioids
where Opioids.status = 'completed'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="3"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="CMS819FHIRHHORAE"/>
</extension>
<extension url="name">
<valueString value="Qualifying Encounter"/>
</extension>
<extension url="statement">
<valueString
value="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'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="4"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="CMS819FHIRHHORAE"/>
</extension>
<extension url="name">
<valueString
value="Encounter With Opioid Administration Outside Of Operating Room"/>
</extension>
<extension url="statement">
<valueString
value="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
)"/>
</extension>
<extension url="displaySequence">
<valueInteger value="5"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="CMS819FHIRHHORAE"/>
</extension>
<extension url="name">
<valueString value="Initial Population"/>
</extension>
<extension url="statement">
<valueString
value="define "Initial Population":
"Encounter With Opioid Administration Outside Of Operating Room""/>
</extension>
<extension url="displaySequence">
<valueInteger value="6"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="CMS819FHIRHHORAE"/>
</extension>
<extension url="name">
<valueString value="Denominator"/>
</extension>
<extension url="statement">
<valueString
value="define "Denominator":
"Initial Population""/>
</extension>
<extension url="displaySequence">
<valueInteger value="7"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="CMS819FHIRHHORAE"/>
</extension>
<extension url="name">
<valueString
value="Encounter With NonOperating Room Opioid And Antagonist Administration"/>
</extension>
<extension url="statement">
<valueString
value="/*
@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"/>
</extension>
<extension url="displaySequence">
<valueInteger value="8"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="CMS819FHIRHHORAE"/>
</extension>
<extension url="name">
<valueString value="Numerator"/>
</extension>
<extension url="statement">
<valueString
value="define "Numerator":
"Encounter With NonOperating Room Opioid And Antagonist Administration""/>
</extension>
<extension url="displaySequence">
<valueInteger value="9"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="SupplementalDataElements"/>
</extension>
<extension url="name">
<valueString value="SDE Payer"/>
</extension>
<extension url="statement">
<valueString
value="define "SDE Payer":
[USQualityCore.Coverage: type in "Payer Type"] Payer
return {
code: Payer.type,
period: Payer.period
}"/>
</extension>
<extension url="displaySequence">
<valueInteger value="10"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="CMS819FHIRHHORAE"/>
</extension>
<extension url="name">
<valueString value="SDE Payer"/>
</extension>
<extension url="statement">
<valueString
value="define "SDE Payer":
SDE."SDE Payer""/>
</extension>
<extension url="displaySequence">
<valueInteger value="11"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="SupplementalDataElements"/>
</extension>
<extension url="name">
<valueString value="SDE Ethnicity"/>
</extension>
<extension url="statement">
<valueString
value="define "SDE Ethnicity":
(Patient.ethnicity()) E
return Tuple {
codes: { E.ombCategory } union E.detailed,
display: E.text
}"/>
</extension>
<extension url="displaySequence">
<valueInteger value="12"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="CMS819FHIRHHORAE"/>
</extension>
<extension url="name">
<valueString value="SDE Ethnicity"/>
</extension>
<extension url="statement">
<valueString
value="define "SDE Ethnicity":
SDE."SDE Ethnicity""/>
</extension>
<extension url="displaySequence">
<valueInteger value="13"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="SupplementalDataElements"/>
</extension>
<extension url="name">
<valueString value="SDE Race"/>
</extension>
<extension url="statement">
<valueString
value="define "SDE Race":
(Patient.race()) R
return Tuple {
codes: R.ombCategory union R.detailed,
display: R.text
}"/>
</extension>
<extension url="displaySequence">
<valueInteger value="14"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="CMS819FHIRHHORAE"/>
</extension>
<extension url="name">
<valueString value="SDE Race"/>
</extension>
<extension url="statement">
<valueString
value="define "SDE Race":
SDE."SDE Race""/>
</extension>
<extension url="displaySequence">
<valueInteger value="15"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToString"/>
</extension>
<extension url="statement">
<valueString
value="define function ToString(value string): value.value"/>
</extension>
<extension url="displaySequence">
<valueInteger value="16"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="USCoreCommon"/>
</extension>
<extension url="name">
<valueString value="sex"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Returns the sex element as defined for the USCore patient profile
*/
define fluent function sex(patient Patient):
patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-sex').value as FHIR.code"/>
</extension>
<extension url="displaySequence">
<valueInteger value="17"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRCommon"/>
</extension>
<extension url="name">
<valueString value="ext"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Returns the single extension (if present) on the given resource with the specified url.
@comment: This function uses singleton from to ensure that a run-time exception is thrown if there
is more than one extension on the given resource with the specified url.
*/
define fluent function ext(domainResource DomainResource, url String):
singleton from domainResource.exts(url)"/>
</extension>
<extension url="displaySequence">
<valueInteger value="18"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRCommon"/>
</extension>
<extension url="name">
<valueString value="exts"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Returns any extensions defined on the given resource with the specified url
*/
define fluent function exts(domainResource DomainResource, url String):
domainResource.extension E
where E.url = url
return E"/>
</extension>
<extension url="displaySequence">
<valueInteger value="19"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToString"/>
</extension>
<extension url="statement">
<valueString
value="define function ToString(value uri): value.value"/>
</extension>
<extension url="displaySequence">
<valueInteger value="20"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToConcept"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.
*/
define function ToConcept(concept FHIR.CodeableConcept):
if concept is null then
null
else
System.Concept {
codes: concept.coding C return ToCode(C),
display: concept.text.value
}"/>
</extension>
<extension url="displaySequence">
<valueInteger value="21"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToCode"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.
*/
define function ToCode(coding FHIR.Coding):
if coding is null then
null
else
System.Code {
code: coding.code.value,
system: coding.system.value,
version: coding.version.value,
display: coding.display.value
}"/>
</extension>
<extension url="displaySequence">
<valueInteger value="22"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToString"/>
</extension>
<extension url="statement">
<valueString
value="define function ToString(value MedicationAdministrationStatus): value.value"/>
</extension>
<extension url="displaySequence">
<valueInteger value="23"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToDate"/>
</extension>
<extension url="statement">
<valueString
value="define function ToDate(value date): value.value"/>
</extension>
<extension url="displaySequence">
<valueInteger value="24"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToInterval"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)
value to a CQL DateTime Interval
@comment: If the start value of the given period is unspecified, the starting
boundary of the resulting interval will be open (meaning the start of the interval
is unknown, as opposed to interpreted as the beginning of time).
*/
define function ToInterval(period FHIR.Period):
if period is null then
null
else
if period."start" is null then
Interval(period."start".value, period."end".value]
else
Interval[period."start".value, period."end".value]"/>
</extension>
<extension url="displaySequence">
<valueInteger value="25"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToString"/>
</extension>
<extension url="statement">
<valueString
value="define function ToString(value EncounterStatus): value.value"/>
</extension>
<extension url="displaySequence">
<valueInteger value="26"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRCommon"/>
</extension>
<extension url="name">
<valueString value="toInterval"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
@comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range types
to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible
representations for timing-valued elements in FHIR, allowing this function to be used across any resource.
The input can be provided as a dateTime, Period, Timing, instant, string, Age, or Range.
The intent of this function is to provide a clear and concise mechanism to treat single
elements that have multiple possible representations as intervals so that logic doesn't have to account
for the variability. More complex calculations (such as medication request period or dispense period
calculation) need specific guidance and consideration. That guidance may make use of this function, but
the focus of this function is on single element calculations where the semantics are unambiguous.
If the input is a dateTime, the result a DateTime Interval beginning and ending on that dateTime.
If the input is a Period, the result is a DateTime Interval.
If the input is a Timing, an error is raised indicating a single interval cannot be computed from a Timing.
If the input is an instant, the result is a DateTime Interval beginning and ending on that instant.
If the input is a string, an error is raised indicating a single interval cannot be computed from a string.
If the input is an Age, the result is a DateTime Interval beginning when the patient was the given Age,
and ending immediately prior to when the patient was the given Age plus one year.
If the input is a Range, the result is a DateTime Interval beginning when the patient was the Age given
by the low end of the Range, and ending immediately prior to when the patient was the Age given by the
high end of the Range plus one year.
NOTE: Due to the
complexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used
with a Timing or String.
*/
define fluent function toInterval(choice Choice<FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range>):
case
when choice is FHIR.dateTime then
Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]
when choice is FHIR.Period then
FHIRHelpers.ToInterval(choice as FHIR.Period)
when choice is FHIR.instant then
Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]
when choice is FHIR.Age then
Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),
FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)
when choice is FHIR.Range then
Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),
FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)
when choice is FHIR.Timing then
Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported')
when choice is FHIR.string then
Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')
else
null as Interval<DateTime>
end"/>
</extension>
<extension url="displaySequence">
<valueInteger value="27"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToDateTime"/>
</extension>
<extension url="statement">
<valueString
value="define function ToDateTime(value dateTime): value.value"/>
</extension>
<extension url="displaySequence">
<valueInteger value="28"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToDateTime"/>
</extension>
<extension url="statement">
<valueString
value="define function ToDateTime(value instant): value.value"/>
</extension>
<extension url="displaySequence">
<valueInteger value="29"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToQuantity"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity)
value to a CQL Quantity
@comment: If the given quantity has a comparator specified, a runtime error is raised. If the given quantity
has a system other than UCUM (i.e. `http://unitsofmeasure.org`) or CQL calendar units (i.e. `http://hl7.org/fhirpath/CodeSystem/calendar-units`)
an error is raised. For UCUM to calendar units, the `ToCalendarUnit` function is used.
@seealso: ToCalendarUnit
*/
define function ToQuantity(quantity FHIR.Quantity):
case
when quantity is null then null
when quantity.value is null then null
when quantity.comparator is not null then
Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')
when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'
or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then
System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }
else
Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' & quantity.unit.value & ' (' & quantity.system.value & '|' & quantity.code.value & ')')
end"/>
</extension>
<extension url="displaySequence">
<valueInteger value="30"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToCalendarUnit"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Converts a UCUM definite duration unit to a CQL calendar duration
unit using conversions specified in the [quantities](https://cql.hl7.org/02-authorsguide.html#quantities)
topic of the CQL specification.
@comment: Note that for durations above days (or weeks), the conversion is understood to be approximate
*/
define function ToCalendarUnit(unit System.String):
case unit
when 'ms' then 'millisecond'
when 's' then 'second'
when 'min' then 'minute'
when 'h' then 'hour'
when 'd' then 'day'
when 'wk' then 'week'
when 'mo' then 'month'
when 'a' then 'year'
else unit
end"/>
</extension>
<extension url="displaySequence">
<valueInteger value="31"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="CQMCommon"/>
</extension>
<extension url="name">
<valueString value="hospitalizationWithObservation"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Hospitalization with Observation returns the total interval from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter
*/
define fluent function hospitalizationWithObservation(TheEncounter Encounter ):
TheEncounter Visit
let ObsVisit: Last([Encounter: "Observation Services"] LastObs
where LastObs.status = 'finished'
and LastObs.period ends 1 hour or less on or before start of Visit.period
sort by end of period
),
VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),
EDVisit: Last([Encounter: "Emergency Department Visit"] LastED
where LastED.status = 'finished'
and LastED.period ends 1 hour or less on or before VisitStart
sort by end of period
)
return Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]"/>
</extension>
<extension url="displaySequence">
<valueInteger value="32"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="CQMCommon"/>
</extension>
<extension url="name">
<valueString value="getLocation"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Returns the Location resource specified by the given reference.
*/
define fluent function getLocation(reference Reference):
singleton from (
[Location] L where reference.references(L)
)"/>
</extension>
<extension url="displaySequence">
<valueInteger value="33"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRCommon"/>
</extension>
<extension url="name">
<valueString value="references"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Returns true if the given reference is to the given resource
@comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.
NOTE: This function assumes resources from the same source server.
*/
define fluent function references(reference FHIR.Reference, resource FHIR.Resource):
resource.id = Last(Split(reference.reference, '/'))"/>
</extension>
<extension url="displaySequence">
<valueInteger value="34"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="USCoreCommon"/>
</extension>
<extension url="name">
<valueString value="ethnicity"/>
</extension>
<extension url="statement">
<valueString
value="define fluent function ethnicity(patient Patient):
(patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity')) E
return {
ombCategory: E.ext('ombCategory').value as FHIR.Coding,
detailed: (E.exts('detailed')) d return d.value as FHIR.Coding,
text: E.ext('text').value as FHIR.string
}"/>
</extension>
<extension url="displaySequence">
<valueInteger value="35"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRCommon"/>
</extension>
<extension url="name">
<valueString value="ext"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Returns the single extension (if present) on the given element with the specified url.
@comment: This function uses singleton from to ensure that a run-time exception is thrown if there
is more than one extension on the given element with the specified url.
*/
define fluent function ext(element Element, url String):
singleton from element.exts(url)"/>
</extension>
<extension url="displaySequence">
<valueInteger value="36"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRCommon"/>
</extension>
<extension url="name">
<valueString value="exts"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Returns any extensions defined on the given element with the specified url.
*/
define fluent function exts(element Element, url String):
element.extension E
where E.url = url
return E"/>
</extension>
<extension url="displaySequence">
<valueInteger value="37"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="USCoreCommon"/>
</extension>
<extension url="name">
<valueString value="race"/>
</extension>
<extension url="statement">
<valueString
value="define fluent function race(patient Patient):
(patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-race')) E
return {
ombCategory: (E.exts('ombCategory')) o return o.value as FHIR.Coding,
detailed: (E.exts('detailed')) d return d.value as FHIR.Coding,
text: E.ext('text').value as FHIR.string
}"/>
</extension>
<extension url="displaySequence">
<valueInteger value="38"/>
</extension>
</extension>
<name value="EffectiveDataRequirements"/>
<status value="active"/>
<type>
<coding>
<system value="http://terminology.hl7.org/CodeSystem/library-type"/>
<code value="module-definition"/>
</coding>
</type>
<relatedArtifact>
<type value="depends-on"/>
<display value="USQualityCore model information"/>
<resource
value="https://madie.cms.gov/Library/USQualityCore-ModelInfo|0.1.0-cibuild"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="USCore model information"/>
<resource
value="http://hl7.org/fhir/us/cql/Library/USCore-ModelInfo|6.1.0-derived"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="FHIR model information"/>
<resource
value="http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Library SDE"/>
<resource
value="https://madie.cms.gov/Library/SupplementalDataElements|6.1.000"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Library FHIRHelpers"/>
<resource
value="http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Library USCommon"/>
<resource
value="http://hl7.org/fhir/us/cql/Library/USCoreCommon|2.0.0-ballot"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Library FHIRCommon"/>
<resource
value="http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Library CQMCommon"/>
<resource value="https://madie.cms.gov/Library/CQMCommon|5.1.000"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Code system SNOMEDCT"/>
<resource value="http://snomed.info/sct"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set Opioid Antagonist"/>
<resource
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.119"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set Opioids, All"/>
<resource
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1196.226"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set Encounter Inpatient"/>
<resource
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set Observation Services"/>
<resource
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set Emergency Department Visit"/>
<resource
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set Operating Room Suite"/>
<resource
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.141"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display
value="Value set Routes of Administration for Opioid Antagonists"/>
<resource
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.187"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set Payer Type"/>
<resource
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"/>
</relatedArtifact>
<parameter>
<name value="Measurement Period"/>
<use value="in"/>
<min value="0"/>
<max value="1"/>
<type value="Period"/>
</parameter>
<parameter>
<name value="SDE Sex"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="Coding"/>
</parameter>
<parameter>
<name value="Numerator"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Encounter"/>
</parameter>
<parameter>
<name value="Denominator"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Encounter"/>
</parameter>
<parameter>
<name value="SDE Payer"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Resource"/>
</parameter>
<parameter>
<name value="Initial Population"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Encounter"/>
</parameter>
<parameter>
<name value="SDE Ethnicity"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="Resource"/>
</parameter>
<parameter>
<name value="SDE Race"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="Resource"/>
</parameter>
<dataRequirement>
<type value="Patient"/>
<profile
value="http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-patient"/>
<mustSupport value="ombCategory"/>
<mustSupport value="detailed"/>
<mustSupport value="text"/>
</dataRequirement>
<dataRequirement>
<type value="Medication"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Medication"/>
<mustSupport value="id"/>
<mustSupport value="code"/>
<codeFilter>
<path value="code"/>
<valueSet
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.119"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="Medication"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Medication"/>
<mustSupport value="id"/>
<mustSupport value="code"/>
<codeFilter>
<path value="code"/>
<valueSet
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1196.226"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationAdministration"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration"/>
<mustSupport value="medication"/>
<mustSupport value="status"/>
<mustSupport value="effective"/>
<mustSupport value="dosage"/>
<mustSupport value="dosage.route"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.119"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationAdministration"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration"/>
<mustSupport value="medication.reference"/>
<mustSupport value="status"/>
<mustSupport value="effective"/>
<mustSupport value="dosage"/>
<mustSupport value="dosage.route"/>
</dataRequirement>
<dataRequirement>
<type value="MedicationAdministration"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration"/>
<mustSupport value="medication"/>
<mustSupport value="status"/>
<mustSupport value="effective"/>
<mustSupport value="dosage"/>
<mustSupport value="dosage.route"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1196.226"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="Encounter"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
<mustSupport value="type"/>
<mustSupport value="status"/>
<mustSupport value="period"/>
<mustSupport value="location"/>
<codeFilter>
<path value="type"/>
<valueSet
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"/>
</codeFilter>
<codeFilter>
<path value="status"/>
<code>
<code value="finished"/>
</code>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="Encounter"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
<mustSupport value="type"/>
<mustSupport value="status"/>
<mustSupport value="period"/>
<mustSupport value="location"/>
<codeFilter>
<path value="type"/>
<valueSet
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"/>
</codeFilter>
<codeFilter>
<path value="status"/>
<code>
<code value="finished"/>
</code>
</codeFilter>
<dateFilter>
<path value="period"/>
<valuePeriod>
<extension url="http://hl7.org/fhir/uv/crmi-analysisException">
<valueString
value="Error attempting to determine filter value: toFhirValue not implemented for Subtract"/>
</extension>
</valuePeriod>
</dateFilter>
</dataRequirement>
<dataRequirement>
<type value="Encounter"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
<mustSupport value="type"/>
<mustSupport value="period"/>
<mustSupport value="status"/>
<mustSupport value="location"/>
<codeFilter>
<path value="type"/>
<valueSet
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"/>
</codeFilter>
<codeFilter>
<path value="status"/>
<code>
<code value="finished"/>
</code>
</codeFilter>
<dateFilter>
<path value="period"/>
<valuePeriod>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-expression">
<valueExpression>
<language value="text/cql-identifier"/>
<expression value="Measurement Period"/>
</valueExpression>
</extension>
</valuePeriod>
</dateFilter>
</dataRequirement>
<dataRequirement>
<type value="Patient"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
<mustSupport value="birthDate"/>
</dataRequirement>
<dataRequirement>
<type value="Resource"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Resource"/>
<mustSupport value="id"/>
</dataRequirement>
<dataRequirement>
<type value="Location"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Location"/>
</dataRequirement>
<dataRequirement>
<type value="Coverage"/>
<profile
value="http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-coverage"/>
<mustSupport value="type"/>
<mustSupport value="period"/>
<codeFilter>
<path value="type"/>
<valueSet
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"/>
</codeFilter>
</dataRequirement>
</Library>
</contained>
<extension
url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-supplementalDataGuidance" id="supplementalDataGuidance">
<extension url="guidance">
<valueString
value="For every patient evaluated by this measure also identify payer, race, ethnicity and sex"/>
</extension>
<extension url="usage">
<valueCodeableConcept>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
<code value="supplemental-data"/>
<display value="Supplemental Data"/>
</coding>
<text value="Supplemental Data Guidance"/>
</valueCodeableConcept>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-softwaresystem">
<valueReference>
<reference value="Device/cqf-tooling"/>
</valueReference>
</extension>
<extension
url="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements">
<valueCanonical value="#effective-data-requirements"/>
</extension>
<url value="https://madie.cms.gov/Measure/CMS819FHIRHHORAE"/>
<identifier>
<use value="usual"/>
<type>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/artifact-identifier-type"/>
<code value="short-name"/>
<display value="Short Name"/>
</coding>
</type>
<system value="https://madie.cms.gov/measure/shortName"/>
<value value="CMS819FHIR"/>
</identifier>
<identifier>
<use value="official"/>
<type>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/artifact-identifier-type"/>
<code value="version-independent"/>
<display value="Version Independent"/>
</coding>
</type>
<system value="urn:ietf:rfc:3986"/>
<value value="urn:uuid:30256069-ee4f-45b8-895a-5452cf8e9e4e"/>
</identifier>
<identifier>
<use value="official"/>
<type>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/artifact-identifier-type"/>
<code value="version-specific"/>
<display value="Version Specific"/>
</coding>
</type>
<system value="urn:ietf:rfc:3986"/>
<value value="urn:uuid:d58ce964-1cb1-40b5-a4aa-40b030191990"/>
</identifier>
<identifier>
<use value="official"/>
<type>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/artifact-identifier-type"/>
<code value="endorser"/>
<display value="Endorser"/>
</coding>
</type>
<system value="https://madie.cms.gov/measure/cbeId"/>
<value value="3501e"/>
<assigner>
<display value="CMS Consensus Based Entity"/>
</assigner>
</identifier>
<identifier>
<use value="official"/>
<type>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/artifact-identifier-type"/>
<code value="publisher"/>
<display value="Publisher"/>
</coding>
</type>
<system value="https://madie.cms.gov/measure/cmsId"/>
<value value="819FHIR"/>
<assigner>
<display value="CMS"/>
</assigner>
</identifier>
<version value="1.0.000"/>
<name value="CMS819FHIRHHORAE"/>
<title value="Hospital Harm - Opioid-Related Adverse EventsFHIR
"/>
<status value="active"/>
<experimental value="false"/>
<date value="2026-01-16T18:18:14+00:00"/>
<publisher value="Centers for Medicare &amp; Medicaid Services (CMS)"/>
<contact>
<telecom>
<system value="url"/>
<value value="https://www.cms.gov/"/>
</telecom>
</contact>
<description
value="This measure assesses the number of inpatient hospitalizations for patients age 18 and older who have been administered an opioid medication and are subsequently administered an opioid antagonist within 12 hours, an indication of an opioid-related adverse event
"/>
<usage
value="Qualifying encounters (denominator) include all patients 18 years of age or older with at least one opioid medication administered outside of the operating room.
To create the numerator:
1. First, start with those encounters meeting denominator criteria.
2. Next, remove all events where an opioid or opioid antagonist was administered in the operating room.
Opioid antagonist administrations in the operating room are excluded because they could be part of the sedation plan as administered by an anesthesiologist. Encounters that include use of opioid antagonists for procedures and recovery outside of the operating room (e.g., bone marrow biopsy and PACU) are included in the numerator, as it would indicate the patient was over-sedated. Note that should a facility not utilize temporary patient locations, alternative times may be used to determine whether a patient is in the operating room during opioid antagonist administration. Since anesthesia end time could represent the time the anesthesiologist signed off, and thus may include the patient's time in the PACU, this should be avoided.
3. Next, remove all events where the opioid antagonist was administered via an enteral route. Only opioid antagonists given by a non-enteral (i.e., intravenous, intramuscular, subcutaneous, intranasal, inhalation) route are considered.
4. Finally, remove all administrations of opioid antagonist that were given greater than 12 hours following hospital administration of an opioid medication.
This dQM is an episode-based measure. An episode is defined as each inpatient hospitalization or encounter that ends during the measurement period.
This FHIR-based measure has been derived from the QDM-based measure: CMS819v4. Please refer to the HL7 QI-Core Implementation Guide (https://hl7.org/fhir/us/qicore/STU6/) for more information on QI-Core and mapping recommendations from QDM to QI-Core STU 6 (https://hl7.org/fhir/us/qicore/STU6/qdm-to-qicore.html).
"/>
<copyright
value="Limited proprietary coding is contained in the Measure specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets. Mathematica disclaims all liability for use or accuracy of any third-party codes contained in the specifications. LOINC(R) copyright 2004-2024 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT\[R\]) copyright 2004-2024 International Health Terminology Standards Development Organisation. ICD-10 copyright 2024 World Health Organization. All Rights Reserved.
"/>
<effectivePeriod>
<start value="2026-01-01"/>
<end value="2026-12-31"/>
</effectivePeriod>
<author>
<name value="Mathematica"/>
<telecom>
<system value="url"/>
<value value="https://www.mathematica.org/"/>
</telecom>
</author>
<relatedArtifact>
<type value="citation"/>
<citation
value="Agency for Healthcare Research and Quality. (2019). Medication Errors and Adverse Drug Events. Rockville: US Department of Health \& Human Services. Retrieved from https://psnet.ahrq.gov/primer/medication-errors-and-adverse-drug-events
"/>
</relatedArtifact>
<relatedArtifact>
<type value="citation"/>
<citation
value="American Heart Association and American Society of Anesthesiologists. (2021). Naloxone in CPR/AED Training and Public Access to Defibrillation. Retrieved from https://www.heart.org/-/media/Files/About-Us/Policy-Research/Policy-Positions/CPR-and-AED/Naloxone-Position-Statement.pdf
"/>
</relatedArtifact>
<relatedArtifact>
<type value="citation"/>
<citation
value="American Heart Association. (2020). Highlights of the 2020 American Heart Association's Guidelines for CPR and ECC. https://cpr.heart.org/-/media/cpr-files/cpr-guidelines-files/highlights/hghlghts_2020_ecc_guidelines_english.pdf
"/>
</relatedArtifact>
<relatedArtifact>
<type value="citation"/>
<citation
value="Baker, J., Brovman, E.Y., Rao, N., Beutler, S.S., Urman, R.D. (2020). Potential Opioid-Related Adverse Drug Events Are Associated With Decreased Revenue in Hip Replacement Surgery in the Older Population. Geriatric Orthopaedic Surgery \& Rehabilitation. January 2020. doi:10.1177/2151459320915328
"/>
</relatedArtifact>
<relatedArtifact>
<type value="citation"/>
<citation
value="Britch, S.C., Walsh, S.L. (2022). Treatment of opioid overdose: current approaches and recent advances. Psychopharmacology (Berl). 2022;239(7):2063-2081. doi:10.1007/s00213-022-06125-5
"/>
</relatedArtifact>
<relatedArtifact>
<type value="citation"/>
<citation
value="Food and Drug Administration. (2022). Nalmefene Hydrochloride Injection 2mg/2mL (1mg/1mL) \[Full Prescribing Information\]. Stamford, CT: Purdue Pharma L.P., 02/08/2022. https://www.accessdata.fda.gov/spl/data/d4bb0797-a4ed-4ed4-9904-604433eea4ff/d4bb0797-a4ed-4ed4-9904-604433eea4ff.xml
"/>
</relatedArtifact>
<relatedArtifact>
<type value="citation"/>
<citation
value="Kessler, E. R., Shah, M., Gruschkus, S. K., \& Raju, A. (2013). Cost and quality implications of opioid-based postsurgical pain control using administrative claims data from a large health system: opioid-related adverse events and their impact on clinical and economic outcomes. Pharmacotherapy, 33(4), 383-391. doi: 10.1002/phar.1223
"/>
</relatedArtifact>
<relatedArtifact>
<type value="citation"/>
<citation
value="Khanna, A.K., Saager, L., Bergese, S.D., et al. (2021). Opioid-induced respiratory depression increases hospital costs and length of stay in patients recovering on the general care floor. BMC Anesthesiol. 2021;21(1):88. Published 2021 Mar 20. doi:10.1186/s12871-021-01307-8
"/>
</relatedArtifact>
<relatedArtifact>
<type value="citation"/>
<citation
value="Lavonas, E. J., Drennan, I. R., Gabrielli, A., Heffner, A. C., Hoyte, C. O., Orkin, A. M., Donnino, M. W. (2015). Part 10: Special Circumstances of Resuscitation. 2015 American Heart Association Guidelines Update for Cardiopulmonary Resuscitation and Emergency Cardiovascular Care, 132(18 suppl 2), S501-S518. doi: 10.1161/cir.0000000000000264
"/>
</relatedArtifact>
<relatedArtifact>
<type value="citation"/>
<citation
value="Lee, L. A., Caplan, R. A., Stephens, L. S., Posner, K. L., Terman, G. W., Voepel-Lewis, T., \& Domino, K. B. (2015). Postoperative opioid-induced respiratory depression: a closed claims analysis. Anesthesiology, 122(3), 659-665
"/>
</relatedArtifact>
<relatedArtifact>
<type value="citation"/>
<citation
value="Lynn, R. R., Galinkin, J. (2017). Naloxone dosage for opioid reversal: Current evidence and clinical implications. Therapeutic Advances in Drug Safety, 9(1), 63-88. doi:10.1177/204209861774416
"/>
</relatedArtifact>
<relatedArtifact>
<type value="citation"/>
<citation
value="Makary, M. A., Daniel, M. (2016). Medical error-the third leading cause of death in the US. BMJ, 353, i2139. doi: 10.1136/bmj.i2139
"/>
</relatedArtifact>
<relatedArtifact>
<type value="citation"/>
<citation
value="Med Lett Drugs Ther. (2022). Nalmefene Returns for Reversal of Opioid Overdose. Sep 5;64(1658):141-2
"/>
</relatedArtifact>
<relatedArtifact>
<type value="citation"/>
<citation
value="Nwulu, U., Nirantharakumar, K., Odesanya, R., McDowell, S. E., Coleman, J. J. (2013). Improvement in the detection of adverse drug events by the use of electronic health and prescription records: an evaluation of two trigger tools. Eur J Clin Pharmacol, 69(2), 255-259. doi: 10.1007/s00228-012-1327-1
"/>
</relatedArtifact>
<relatedArtifact>
<type value="citation"/>
<citation
value="Shafi, S., Collinsworth, A.W., Copeland, L.A., et al. (2018). Association of Opioid-Related Adverse Drug Events With Clinical and Cost Outcomes Among Surgical Patients in a Large Integrated Health Care Delivery System. JAMA Surg. 2018;153(8):757-763. doi:10.1001/jamasurg.2018.1039. PMID: 29799927; PMCID: PMC6142954
"/>
</relatedArtifact>
<relatedArtifact>
<type value="citation"/>
<citation
value="Urman, R.D., Khanna, A.K., Bergese, S.D., et al. (2021). Postoperative opioid administration characteristics associated with opioid-induced respiratory depression: Results from the PRODIGY trial. J Clin Anesth. 2021;70:110167. doi:10.1016/j.jclinane.110167
"/>
</relatedArtifact>
<relatedArtifact>
<type value="citation"/>
<citation
value="Urman, R.D., Seger, D.L., Fiskio, J.M., et al. (2021). The Burden of Opioid-Related Adverse Drug Events on Hospitalized Previously Opioid-Free Surgical Patients. J Patient Saf. 2021;17(2):e76-e83
"/>
</relatedArtifact>
<library value="https://madie.cms.gov/Library/CMS819FHIRHHORAE"/>
<disclaimer
value="This performance measure is not a clinical guideline, does not establish a standard of medical care and has not been tested for all potential applications. THE MEASURES AND SPECIFICATIONS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. Due to technical limitations, registered trademarks are indicated by (R) or \[R\] and unregistered trademarks are indicated by (TM) or \[TM\].
"/>
<rationale
value="Opioids are often the foundation for sedation and pain relief. Opioid-based analgesia continues to be the most commonly used treatment in postoperative pain management, with more than 95% of surgical patients receiving opioids during their hospitalization (Baker et al., 2020). However, use of opioids can also lead to serious adverse events, including constipation, over sedation, delirium, and respiratory depression (Urman et al., 2021a). Opioid-related adverse events (ORADE) have both patient-level and financial implications. The presence of an ORADE was associated with a 55% longer postoperative length of stay, 29% lower odds of discharge home, and 2.9 times the odds of death (Urman et al., 2021b). For surgical patients, occurrence of opioid-related adverse events was associated with an increase of 1.6 days in length of stay (LOS) and $8225 more in cost for the index hospitalization. Patients who experienced ORADEs while in a hospitalized setting were more likely to have received a higher total dose of opioids during hospitalization (Cone et al., 2023; Shafi et al., 2018). Numerous studies report the additive (risk-adjusted) hospitalization cost burden of surgical patients with ORADEs to be between $4350-$8225, representing a 27-47% increase in (risk-adjusted) admission costs (Khanna et al., 2021).
Most opioid-related adverse events are preventable. Each year, adverse drug events (ADE) account for nearly 700,000 emergency department visits and 100,000 hospitalizations (AHRQ, 2019). An estimated one-third of all adverse events that occur in the inpatient setting are adverse drug events (ODPHP, 2020). Additionally, in a closed-claims analysis, 97% of adverse events were judged preventable with better monitoring and response (Lee et al., 2015). Naloxone administration is often used as an indicator of a severe opioid-related adverse event, and implementation of this measure can advance safe use of opioids in hospitals and prevent these serious and potentially lethal adverse drug events.
"/>
<clinicalRecommendationStatement
value="Naloxone is an opioid reversal agent typically used for severe opioid-related adverse events. Naloxone administration has been used in a number of studies as an indicator of opioid-related adverse events (Yiu, et al., 2022; Lynn \& Galinkin, 2017; Nwulu et al., 2013).
From Section 10 of the 2015 American Heart Association Guidelines Update for Cardiopulmonary Resuscitation and Emergency Cardiovascular Care (Lavonas et al., 2015), the following recommendation is listed for use of naloxone:
Naloxone is a potent opioid receptor antagonist in the brain, spinal cord, and gastrointestinal system. Naloxone has an excellent safety profile and can rapidly reverse central nervous system (CNS) and respiratory depression in a patient with an opioid-associated resuscitative emergency.
The 2020 American Heart Association guidelines update for cardiopulmonary resuscitation continue to recommend naloxone for a patient with suspected opioid overdose who has a definite pulse but no normal breathing or only gasping (i.e., a respiratory arrest), in addition to providing standard Pediatric Basic Life Support (PBLS) or Pediatric Advanced Life Support (PALS), it is reasonable for responders to administer intramuscular or intranasal naloxone. These recommendations are identical for adults (American Heart Association, 2020).
In February 2022, the Food and Drug Administration (FDA) approved its abbreviated new drug application for nalmefene hydrochloride injection, 2mg/2mL (1mg/1mL). Nalmefene is an opioid antagonist indicated for the complete or partial reversal of opioid drug effects, including respiratory depression, induced by either natural or synthetic opioids, and in the management of known or suspected opioid overdose (FDA, 2022). In contrast to naloxone, the long half-life of nalmefene is similar to or greater than that of many opioid receptor agonists (Britch \& Walsh, 2022), which could decrease the need for repeat drug administration. In May 2023, FDA approved nalmefene hydrochloride nasal spray that delivers 2.7 milligrams (mg) of nalmefene into the nasal cavity (FDA, 2023).
"/>
<group id="Group_1">
<extension
url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-scoring">
<valueCodeableConcept>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/measure-scoring"/>
<code value="proportion"/>
<display value="Proportion"/>
</coding>
</valueCodeableConcept>
</extension>
<extension
url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-populationBasis">
<valueCode value="Encounter"/>
</extension>
<extension
url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-type">
<valueCodeableConcept>
<coding>
<system value="http://terminology.hl7.org/CodeSystem/measure-type"/>
<code value="outcome"/>
<display value="Outcome"/>
</coding>
</valueCodeableConcept>
</extension>
<extension
url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-rateAggregation">
<valueString value="None
"/>
</extension>
<extension
url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-improvementNotation">
<valueCodeableConcept>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/measure-improvement-notation"/>
<code value="decrease"/>
<display value="Decreased score indicates improvement"/>
</coding>
</valueCodeableConcept>
</extension>
<population id="InitialPopulation_1">
<code>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/measure-population"/>
<code value="initial-population"/>
<display value="Initial Population"/>
</coding>
</code>
<description
value="Inpatient hospitalizations that end during the measurement period for patients age 18 and older and at least one opioid medication administration starts during the hospitalization outside of the operating room
"/>
<criteria>
<language value="text/cql-identifier"/>
<expression value="Initial Population"/>
</criteria>
</population>
<population id="Denominator_1">
<code>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/measure-population"/>
<code value="denominator"/>
<display value="Denominator"/>
</coding>
</code>
<description value="Equals Initial Population
"/>
<criteria>
<language value="text/cql-identifier"/>
<expression value="Denominator"/>
</criteria>
</population>
<population id="Numerator_1">
<code>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/measure-population"/>
<code value="numerator"/>
<display value="Numerator"/>
</coding>
</code>
<description
value="Inpatient hospitalizations where a non-enteral opioid antagonist administration starts during the hospitalization outside of the operating room and 12 hours or less following an opioid medication administered outside of the operating room. The route of administration of the opioid antagonist must be by intranasal spray, inhalation, intramuscular, subcutaneous, or intravenous injection. Only one numerator event is counted per encounter.
"/>
<criteria>
<language value="text/cql-identifier"/>
<expression value="Numerator"/>
</criteria>
</population>
</group>
<supplementalData id="sde-ethnicity">
<usage>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
<code value="supplemental-data"/>
</coding>
</usage>
<description value="SDE Ethnicity
"/>
<criteria>
<language value="text/cql-identifier"/>
<expression value="SDE Ethnicity"/>
</criteria>
</supplementalData>
<supplementalData id="sde-payer">
<usage>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
<code value="supplemental-data"/>
</coding>
</usage>
<description value="SDE Payer
"/>
<criteria>
<language value="text/cql-identifier"/>
<expression value="SDE Payer"/>
</criteria>
</supplementalData>
<supplementalData id="sde-race">
<usage>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
<code value="supplemental-data"/>
</coding>
</usage>
<description value="SDE Race
"/>
<criteria>
<language value="text/cql-identifier"/>
<expression value="SDE Race"/>
</criteria>
</supplementalData>
<supplementalData id="sde-sex">
<usage>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
<code value="supplemental-data"/>
</coding>
</usage>
<description value="SDE Sex
"/>
<criteria>
<language value="text/cql-identifier"/>
<expression value="SDE Sex"/>
</criteria>
</supplementalData>
</Measure>