eCQM QICore Content Implementation Guide
2024.0.0 - CI Build

eCQM QICore Content Implementation Guide, published by cqframework. This guide is not an authorized publication; it is the continuous build for version 2024.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/ecqm-content-qicore-2024/ and changes regularly. See the Directory of published versions

: Hospital Harm - Opioid-Related Adverse EventsFHIR - XML Representation

Draft as of 2024-07-09

Raw xml | Download


<Measure xmlns="http://hl7.org/fhir">
  <id value="HospitalHarmOpioidRelatedAdverseEventsFHIR"/>
  <meta>
    <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"/>
  </meta>
  <text>
    <status value="extensions"/>
    <div xmlns="http://www.w3.org/1999/xhtml">
    <table class="grid dict">
        
            <tr>
                <th scope="row"><b>Title: </b></th>
                <td style="padding-left: 4px;">Hospital Harm - Opioid-Related Adverse EventsFHIR</td>
            </tr>
        

        

        
            <tr>
                <th scope="row"><b>Id: </b></th>
                <td style="padding-left: 4px;">HospitalHarmOpioidRelatedAdverseEventsFHIR</td>
            </tr>
        

        
            <tr>
                <th scope="row"><b>Version: </b></th>
                <td style="padding-left: 4px;">0.1.000</td>
            </tr>
        

        
            <tr>
                <th scope="row"><b>Url: </b></th>
                <td style="padding-left: 4px;"><a href="Measure-HospitalHarmOpioidRelatedAdverseEventsFHIR.html">Hospital Harm - Opioid-Related Adverse EventsFHIR</a></td>
            </tr>
        

        
            <tr>
                <th scope="row">
                    <b>
                        
                            
                                short-name identifier:
                            
                        
                    </b>
                </th>

                <td style="padding-left: 4px;">
                    
                        <p style="margin-bottom: 5px;">
                            <span>CMS819FHIR</span>
                        </p>
                    
                </td>
            </tr>
        
            <tr>
                <th scope="row">
                    <b>
                        
                            
                                version-independent identifier:
                            
                        
                    </b>
                </th>

                <td style="padding-left: 4px;">
                    
                        <p style="margin-bottom: 5px;">
                            <span>urn:uuid:30256069-ee4f-45b8-895a-5452cf8e9e4e</span>
                        </p>
                    
                </td>
            </tr>
        
            <tr>
                <th scope="row">
                    <b>
                        
                            
                                version-specific identifier:
                            
                        
                    </b>
                </th>

                <td style="padding-left: 4px;">
                    
                        <p style="margin-bottom: 5px;">
                            <span>urn:uuid:8f15b4f6-b1b5-41a0-b158-282ff051a62d</span>
                        </p>
                    
                </td>
            </tr>
        
            <tr>
                <th scope="row">
                    <b>
                        
                            
                                endorser (CMS Consensus Based Entity) identifier:
                            
                        
                    </b>
                </th>

                <td style="padding-left: 4px;">
                    
                        <p style="margin-bottom: 5px;">
                            <span>3501e</span>
                        </p>
                    
                </td>
            </tr>
        
            <tr>
                <th scope="row">
                    <b>
                        
                            
                                publisher (CMS) identifier:
                            
                        
                    </b>
                </th>

                <td style="padding-left: 4px;">
                    
                        <p style="margin-bottom: 5px;">
                            <span>819FHIR</span>
                        </p>
                    
                </td>
            </tr>
        

        
            <tr>
                <th scope="row"><b>Effective Period: </b></th>
                <td style="padding-left: 4px;">2025-01-01..2025-12-31</td>
            </tr>
        

        
            <tr>
                <th scope="row"><b>Status: </b></th>
                <td style="padding-left: 4px;">draft</td>
            </tr>
        

        

        
            <tr>
                <th scope="row"><b>Publisher: </b></th>
                <td style="padding-left: 4px;">Centers for Medicare &amp; Medicaid Services (CMS)</td>
            </tr>
        

        
        <tr>
            <th scope="row"><b>Author: </b></th>
            <td style="padding-left: 4px;">American Institutes for Research (AIR)</td>
        </tr>
        

        

        
            <tr>
                <th scope="row"><b>Description: </b></th>
                <td style="padding-left: 4px;"><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"><b>Purpose: </b></th>
                <td style="padding-left: 4px;"><div><p>UNKNOWN</p>
</div></td>
            </tr>
        

        
            <tr>
                <th scope="row"><b>Copyright: </b></th>
                <td style="padding-left: 4px;"><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. American Institutes for Research(R), formerly IMPAQ International, disclaims all liability for use or accuracy of any third party codes contained in the specifications.</p>
<p>LOINC(R) copyright 2004-2023 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2023 International Health Terminology Standards Development Organisation. ICD-10 copyright 2023 World Health Organization. All Rights Reserved.</p>
</div></td>
            </tr>
        

        
            <tr>
                <th scope="row"><b>Disclaimer: </b></th>
                <td style="padding-left: 4px;"><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.</p>
<p>THE MEASURES AND SPECIFICATIONS ARE PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND.</p>
<p>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"><b>Scoring: </b></th>
                <td style="padding-left: 4px;">
                    
                        
                            <p style="margin-bottom: 5px;">
                                <span>Proportion </span>
                            </p>
                        
                    
                    
                </td>
            </tr>
        

        

        

        

        

        
        <tr>
            <th scope="row"><b>Rationale: </b></th>
            <td style="padding-left: 4px;"><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, 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, 2021b). For surgical patients, occurrence of opioid-related adverse events was associated with an increase of 1.6 days in 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"><b>Clinical recommendation statement: </b></th>
            <td style="padding-left: 4px;"><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 et al., 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>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.</p>
<p>In February 2022, 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 et al., 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.</p>
</div></td>
        </tr>
        

        

        
            <tr>
                <th scope="row"><b>Guidance (Usage): </b></th>
                <td style="padding-left: 4px;">Qualifying encounters (denominator) include all patients 18 years of age or older at the start of the encounter 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 antagonists that were given greater than 12 hours following hospital administration of an opioid medication.

This eCQM 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: CMS819v3.

Please refer to the HL7 QI-Core Implementation Guide(https://hl7.org/fhir/us/qicore/STU4.1.1/) for more information on QI-Core and mapping recommendations from QDM to QI-Core4.1.1 (https://hl7.org/fhir/us/qicore/STU4.1.1/qdm-to-qicore.html).</td>
            </tr>
        

        
            
                <tr>
                    <th scope="row"><b>Population Criteria: </b></th>
                    <td style="padding-left: 4px;">
                        
                            <table class="grid-dict">
                                
                                    <tr>
                                        <th><b>6501fc94da013638e7b3dc06</b></th>
                                    </tr>
                                
                                
                                    <tr>
                                        <td>Initial Population:</td>

                                        
                                            
                                                <td>Inpatient hospitalizations for patients age 18 years and older during which at least one opioid medication was administered outside of the operating room</td>
                                            
                                        

                                    </tr>
                                
                                    <tr>
                                        <td>Denominator:</td>

                                        
                                            
                                                <td>Equals Initial Population</td>
                                            
                                        

                                    </tr>
                                
                                    <tr>
                                        <td>Numerator:</td>

                                        
                                            
                                                <td>Inpatient hospitalizations where an opioid antagonist was administered outside of the operating room and within 12 hours 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.</td>
                                            
                                        

                                    </tr>
                                
                                
                            </table>
                        
                    </td>
                </tr>
            
        

        
            <tr>
                <th scope="row"><b> Supplemental Data Elements: </b></th>
                <td style="padding-left: 4px;">
                    
                        
                            
                                <p>SDE Ethnicity</p>
                            
                        
                    
                        
                            
                                <p>SDE Payer</p>
                            
                        
                    
                        
                            
                                <p>SDE Race</p>
                            
                        
                    
                        
                            
                                <p>SDE Sex</p>
                            
                        
                    
                </td>
            </tr>
        

        

        
            <tr>
                <th scope="row">
                    <b> Supplemental Data Guidance
                        : </b></th>
                <td style="padding-left: 4px;"> For every patient evaluated by this measure also identify payer, race, ethnicity and sex; SDE Ethnicity 
 SDE Payer 
 SDE Race 
 SDE Sex 
  </td>
            </tr>
        

        
            <tr>
                <th scope="row"><b>Libraries: </b></th>
                <td style="padding-left: 4px;">
                    <table class="grid-dict">
                        
                            <tr>
                                <td><a href="Library-HospitalHarmOpioidRelatedAdverseEventsFHIR.html">HospitalHarmOpioidRelatedAdverseEventsFHIR</a></td>
                            </tr>
                        
                    </table>
                </td>
            </tr>
        

        

        
            
                <tr>
                    <th scope="row"><b>Terminology and Other Dependencies: </b></th>
                    <td style="padding-left: 4px;">
                        
                            <li><code>Library/SupplementalDataElements|3.5.000</code></li>
                        
                            <li><code>Library/FHIRHelpers|4.4.000</code></li>
                        
                            <li><code>Library/QICoreCommon|2.1.000</code></li>
                        
                            <li><code>Library/CQMCommon|2.2.000</code></li>
                        
                            <li><a href="http://hl7.org/fhir/R4/codesystem-administrative-gender.html">AdministrativeGender</a></li>
                        
                            <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1248.119/expansion">http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.119</a></li>
                        
                            <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1196.226/expansion">Opioids, All</a></li>
                        
                            <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion">Encounter Inpatient</a></li>
                        
                            <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.143/expansion">Observation Services</a></li>
                        
                            <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.292/expansion">Emergency Department Visit</a></li>
                        
                            <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1248.141/expansion">http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.141</a></li>
                        
                            <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1248.187/expansion">http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.187</a></li>
                        
                            <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion">Payer</a></li>
                        
                    </td>
                </tr>
                <tr>
                    <th scope="row"><b>Parameters:</b></th>
                    <td style="padding-left: 4px;">
                        <table class="grid-dict">
                            <tr>
                                <th><b>name</b></th>
                                <th><b>use</b></th>
                                <th><b>min</b></th>
                                <th><b>max</b></th>
                                <th><b>type</b></th>
                            </tr>
                            
                                <tr>
                                    <td>Measurement Period</td>
                                    <td>In</td>
                                    <td>0</td>
                                    <td>1</td>
                                    <td>Period</td>
                                </tr>
                            
                                <tr>
                                    <td>SDE Sex</td>
                                    <td>Out</td>
                                    <td>0</td>
                                    <td>1</td>
                                    <td>Coding</td>
                                </tr>
                            
                                <tr>
                                    <td>Numerator</td>
                                    <td>Out</td>
                                    <td>0</td>
                                    <td>*</td>
                                    <td>Resource</td>
                                </tr>
                            
                                <tr>
                                    <td>Denominator</td>
                                    <td>Out</td>
                                    <td>0</td>
                                    <td>*</td>
                                    <td>Resource</td>
                                </tr>
                            
                                <tr>
                                    <td>SDE Payer</td>
                                    <td>Out</td>
                                    <td>0</td>
                                    <td>*</td>
                                    <td>Resource</td>
                                </tr>
                            
                                <tr>
                                    <td>Initial Population</td>
                                    <td>Out</td>
                                    <td>0</td>
                                    <td>*</td>
                                    <td>Resource</td>
                                </tr>
                            
                                <tr>
                                    <td>SDE Ethnicity</td>
                                    <td>Out</td>
                                    <td>0</td>
                                    <td>1</td>
                                    <td>Resource</td>
                                </tr>
                            
                                <tr>
                                    <td>SDE Race</td>
                                    <td>Out</td>
                                    <td>0</td>
                                    <td>1</td>
                                    <td>Resource</td>
                                </tr>
                            
                        </table>
                    </td>
                </tr>

                <tr>
                    <th scope="row"><b>DataRequirements:</b></th>
                    <td style="padding-left: 4px;">
                        <table class="grid-dict">
                            <tr>
                                <th><b>Resource Type</b></th>
                                <th><b>Resource Elements</b></th>
                                <th><b>Valueset Name</b></th>
                                <th><b>Valueset</b></th>
                            </tr>
                            
                                <tr>
                                    <td>Patient(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-patient.html">QICorePatient</a>)</td>
                                    <td>
                                        
                                            ethnicity
                                        
                                            race
                                        
                                    </td>
                                    <td>
                                        
                                    </td>
                                    <td/>
                                </tr>
                            
                                <tr>
                                    <td>MedicationAdministration(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-medicationadministration.html">QICoreMedicationAdministration</a>)</td>
                                    <td>
                                        
                                            medication
                                        
                                            status
                                        
                                            status.value
                                        
                                            effective
                                        
                                            dosage
                                        
                                            dosage.route
                                        
                                    </td>
                                    <td>
                                        
                                            
                                                 Opioid Antagonist
                                            
                                        
                                    </td>
                                    <td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1248.119/expansion">http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.119</a></td>
                                </tr>
                            
                                <tr>
                                    <td>MedicationAdministration(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-medicationadministration.html">QICoreMedicationAdministration</a>)</td>
                                    <td>
                                        
                                            medication
                                        
                                            status
                                        
                                            status.value
                                        
                                            effective
                                        
                                            dosage
                                        
                                            dosage.route
                                        
                                    </td>
                                    <td>
                                        
                                            
                                                 Opioids, All
                                            
                                        
                                    </td>
                                    <td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1196.226/expansion">Opioids, All</a></td>
                                </tr>
                            
                                <tr>
                                    <td>Encounter(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-encounter.html">QICoreEncounter</a>)</td>
                                    <td>
                                        
                                            type
                                        
                                            status
                                        
                                            status.value
                                        
                                            period
                                        
                                            location
                                        
                                    </td>
                                    <td>
                                        
                                            
                                                 Observation Services
                                            
                                        
                                    </td>
                                    <td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.143/expansion">Observation Services</a></td>
                                </tr>
                            
                                <tr>
                                    <td>Encounter(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-encounter.html">QICoreEncounter</a>)</td>
                                    <td>
                                        
                                            type
                                        
                                            status
                                        
                                            status.value
                                        
                                            period
                                        
                                            location
                                        
                                    </td>
                                    <td>
                                        
                                            
                                                 Emergency Department Visit
                                            
                                        
                                    </td>
                                    <td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.292/expansion">Emergency Department Visit</a></td>
                                </tr>
                            
                                <tr>
                                    <td>Encounter(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-encounter.html">QICoreEncounter</a>)</td>
                                    <td>
                                        
                                            type
                                        
                                            period
                                        
                                            status
                                        
                                            status.value
                                        
                                            location
                                        
                                    </td>
                                    <td>
                                        
                                            
                                                 Encounter Inpatient
                                            
                                        
                                    </td>
                                    <td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion">Encounter Inpatient</a></td>
                                </tr>
                            
                                <tr>
                                    <td>Location(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-location.html">QICoreLocation</a>)</td>
                                    <td>
                                        
                                            id
                                        
                                            id.value
                                        
                                    </td>
                                    <td>
                                        
                                    </td>
                                    <td/>
                                </tr>
                            
                                <tr>
                                    <td>Coverage(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-coverage.html">QICoreCoverage</a>)</td>
                                    <td>
                                        
                                            type
                                        
                                            period
                                        
                                    </td>
                                    <td>
                                        
                                            
                                                 Payer Type
                                            
                                        
                                    </td>
                                    <td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion">Payer</a></td>
                                </tr>
                            
                        </table>
                    </td>
                </tr>

                
                    <tr>
                        <th scope="row"><b>Direct Reference Codes:</b></th>
                        <td style="padding-left: 4px;">
                            <table class="grid-dict">
                                <tr>
                                    <th><b>display</b></th>
                                    <th><b>code</b></th>
                                    <th><b>system</b></th>
                                </tr>
                                
                                    <tr>
                                        <td>Male</td>
                                        <td>M</td>
                                        <td><a href="http://hl7.org/fhir/R4/codesystem-administrative-gender.html">http://hl7.org/fhir/administrative-gender</a></td>
                                    </tr>
                                
                                    <tr>
                                        <td>Female</td>
                                        <td>F</td>
                                        <td><a href="http://hl7.org/fhir/R4/codesystem-administrative-gender.html">http://hl7.org/fhir/administrative-gender</a></td>
                                    </tr>
                                
                            </table>
                        </td>
                    </tr>
                

                
                <tr>
                    <th scope="row"><b>Logic Definitions:</b></th>
                    <td style="padding-left: 4px;">
                        
                        <table class="grid-dict">
                            <tr>
                                <th><b>Group</b></th>
                                <th><b>Scoring</b></th>
                                <th><b>Population Criteria</b></th>
                                <th><b>Expression</b></th>
                            </tr>
                            <tr>
                                
                                <td> 6501fc94da013638e7b3dc06 </td>
                                <td colspan="3" style="padding-left: 4px;">
                                    
                                        <b>Group scoring:</b>
                                        
                                            <span>  proportion </span>
                                        
                                    

                                    

                                    
                                        <b>Measure scoring:</b>
                                        
                                            <p style="margin-bottom: 5px;">
                                                <span>Proportion</span>
                                            </p>
                                        
                                    

                                    

                                    
                                        <tr>
                                        
                                            <th scope="row"><b>Type: </b></th>
                                            <td style="padding-left: 4px;">
                                                
                                                    
                                                        <p style="margin-bottom: 5px;">
                                                            <span>Outcome </span>
                                                        </p>
                                                    
                                                
                                                
                                            </td>
                                        
                                        </tr>
                                    

                                    

                                    
                                    <tr>
                                        <th scope="row"><b>Rate Aggregation: </b></th>
                                        <td colspan="3" style="padding-left: 4px;">None</td>
                                    </tr>
                                    

                                    
                                        <tr>
                                            <th scope="row"><b>Improvement Notation: </b></th>
                                            <td style="padding-left: 4px;">
                                            
                                                
                                                    
                                                        <p style="margin-bottom: 5px;">
                                                            <span>decrease </span>
                                                        </p>
                                                    
                                                
                                                
                                            
                                            </td>
                                        </tr>
                                    

                                    

                                </td>
                                
                                <tr>
                                    <td/>
                                    <td/>
                                    <td>Initial Population</td>
                                    <td>
                                        
                                            <pre><code class="language-cql">define &quot;Initial Population&quot;:
  &quot;Encounter with Opioid Administration Outside of Operating Room&quot;</code></pre>
                                        
                                    </td>
                                </tr>
                                
                                <tr>
                                    <td/>
                                    <td/>
                                    <td>Denominator</td>
                                    <td>
                                        
                                            <pre><code class="language-cql">define &quot;Denominator&quot;:
  &quot;Initial Population&quot;</code></pre>
                                        
                                    </td>
                                </tr>
                                
                                <tr>
                                    <td/>
                                    <td/>
                                    <td>Numerator</td>
                                    <td>
                                        
                                            <pre><code class="language-cql">define &quot;Numerator&quot;:
  &quot;Encounter with Non Enteral Opioid Antagonist Administration Outside of Operating Room and within 12 Hrs After Opioid&quot;</code></pre>
                                        
                                    </td>
                                </tr>
                                
                                
                            
                            </tr>
                        </table>
                

                <table class="grid-dict">
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>SupplementalDataElements</td>
                            
                            
                                <td>SDE Sex</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;SDE Sex&quot;:
  case
    when Patient.gender = 'male' then &quot;M&quot;
    when Patient.gender = 'female' then &quot;F&quot;
    else null
  end</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>HospitalHarmOpioidRelatedAdverseEventsFHIR</td>
                            
                            
                                <td>SDE Sex</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;SDE Sex&quot;:
  SDE.&quot;SDE Sex&quot;</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>HospitalHarmOpioidRelatedAdverseEventsFHIR</td>
                            
                            
                                <td>Opioid Antagonist Administration</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;Opioid Antagonist Administration&quot;:
  [&quot;MedicationAdministration&quot;: &quot;Opioid Antagonist&quot;] AntagonistGiven
    where AntagonistGiven.status = 'completed'
      and AntagonistGiven.status != 'not-done'</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>HospitalHarmOpioidRelatedAdverseEventsFHIR</td>
                            
                            
                                <td>Opioid Administration</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;Opioid Administration&quot;:
  [&quot;MedicationAdministration&quot;: &quot;Opioids, All&quot;] Opioids
    where Opioids.status = 'completed'
      and Opioids.status != 'not-done'</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>HospitalHarmOpioidRelatedAdverseEventsFHIR</td>
                            
                            
                                <td>Qualifying Encounter</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;Qualifying Encounter&quot;:
  [&quot;Encounter&quot;: &quot;Encounter Inpatient&quot;] InpatientEncounter
    where AgeInYearsAt(date from start of InpatientEncounter.period) &gt;= 18
      and InpatientEncounter.period ends during day of &quot;Measurement Period&quot;
      and InpatientEncounter.status = 'finished'</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>HospitalHarmOpioidRelatedAdverseEventsFHIR</td>
                            
                            
                                <td>Encounter with Opioid Administration Outside of Operating Room</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;Encounter with Opioid Administration Outside of Operating Room&quot;:
  &quot;Qualifying Encounter&quot; InpatientEncounter
    with &quot;Opioid Administration&quot; OpioidGiven
      such that QICoreCommon.&quot;ToInterval&quot; ( OpioidGiven.effective ) starts during CQMCommon.&quot;HospitalizationWithObservation&quot; ( InpatientEncounter )
        and not exists ( InpatientEncounter.location EncounterLocation
            where CQMCommon.GetLocation ( EncounterLocation.location ).type in &quot;Operating Room Suite&quot;
              and QICoreCommon.&quot;ToInterval&quot; ( OpioidGiven.effective ) starts during EncounterLocation.period
        )</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>HospitalHarmOpioidRelatedAdverseEventsFHIR</td>
                            
                            
                                <td>Initial Population</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;Initial Population&quot;:
  &quot;Encounter with Opioid Administration Outside of Operating Room&quot;</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>HospitalHarmOpioidRelatedAdverseEventsFHIR</td>
                            
                            
                                <td>Denominator</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;Denominator&quot;:
  &quot;Initial Population&quot;</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>HospitalHarmOpioidRelatedAdverseEventsFHIR</td>
                            
                            
                                <td>Encounter with Non Enteral Opioid Antagonist Administration Outside of Operating Room and within 12 Hrs After Opioid</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;Encounter with Non Enteral Opioid Antagonist Administration Outside of Operating Room and within 12 Hrs After Opioid&quot;:
  // Opioids administered before opioid antagonist AND excludes opioid antagonist administered in operating room AND limits opioid antagonist to non-enteral routes//
  
  from
    &quot;Opioid Antagonist Administration&quot; OpioidAntagonistGiven,
    &quot;Opioid Administration&quot; OpioidGiven,
    &quot;Denominator&quot; EncounterWithQualifyingAge
    where not exists ( EncounterWithQualifyingAge.location EncounterLocation
        where CQMCommon.GetLocation ( EncounterLocation.location ).type in &quot;Operating Room Suite&quot;
          and QICoreCommon.&quot;ToInterval&quot; ( OpioidAntagonistGiven.effective ) starts during EncounterLocation.period
    )
      and ( QICoreCommon.&quot;ToInterval&quot; ( OpioidAntagonistGiven.effective ) starts during CQMCommon.&quot;HospitalizationWithObservation&quot; ( EncounterWithQualifyingAge )
          and QICoreCommon.&quot;ToInterval&quot; ( OpioidGiven.effective ) starts during CQMCommon.&quot;HospitalizationWithObservation&quot; ( EncounterWithQualifyingAge )
          and QICoreCommon.&quot;ToInterval&quot; ( OpioidGiven.effective ) ends 12 hours or less before start of QICoreCommon.&quot;ToInterval&quot; ( OpioidAntagonistGiven.effective )
          and OpioidAntagonistGiven.dosage.route in &quot;Routes of Administration for Opioid Antagonists&quot;
      )
    return EncounterWithQualifyingAge</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>HospitalHarmOpioidRelatedAdverseEventsFHIR</td>
                            
                            
                                <td>Numerator</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;Numerator&quot;:
  &quot;Encounter with Non Enteral Opioid Antagonist Administration Outside of Operating Room and within 12 Hrs After Opioid&quot;</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>SupplementalDataElements</td>
                            
                            
                                <td>SDE Payer</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;SDE Payer&quot;:
  [Coverage: type in &quot;Payer Type&quot;] Payer
    return {
      code: Payer.type,
      period: Payer.period
    }</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>HospitalHarmOpioidRelatedAdverseEventsFHIR</td>
                            
                            
                                <td>SDE Payer</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;SDE Payer&quot;:
  SDE.&quot;SDE Payer&quot;</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>SupplementalDataElements</td>
                            
                            
                                <td>SDE Ethnicity</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;SDE Ethnicity&quot;:
  Patient.ethnicity E
    return Tuple {
      codes: { E.ombCategory } union E.detailed,
      display: E.text
    }</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>HospitalHarmOpioidRelatedAdverseEventsFHIR</td>
                            
                            
                                <td>SDE Ethnicity</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;SDE Ethnicity&quot;:
  SDE.&quot;SDE Ethnicity&quot;</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>SupplementalDataElements</td>
                            
                            
                                <td>SDE Race</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;SDE Race&quot;:
  Patient.race R
    return Tuple {
      codes: R.ombCategory union R.detailed,
      display: R.text
    }</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>HospitalHarmOpioidRelatedAdverseEventsFHIR</td>
                            
                            
                                <td>SDE Race</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;SDE Race&quot;:
  SDE.&quot;SDE Race&quot;</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>CQMCommon</td>
                            
                            
                                <td>HospitalizationWithObservation</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="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
@deprecated: This function is deprecated. Use the fluent function `hospitalizationWithObservation()` instead.
*/
define function &quot;HospitalizationWithObservation&quot;(TheEncounter Encounter ):
  TheEncounter Visit
  		let ObsVisit: Last([Encounter: &quot;Observation Services&quot;] 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: &quot;Emergency Department Visit&quot;] 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><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>CQMCommon</td>
                            
                            
                                <td>GetLocation</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">/*
@description: Returns the Location resource specified by the given reference
@deprecated: This function is deprecated. Use the fluent function `getLocation()` instead.
*/
define function &quot;GetLocation&quot;(reference Reference ):
  singleton from (
    [Location] L where L.id = reference.reference.getId()
  )</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>QICoreCommon</td>
                            
                            
                                <td>getId</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">/*
@description: Returns the tail of the given uri (i.e. everything after the last slash in the URI).
@comment: This function can be used to determine the logical id of a given resource. It can be used in
a single-server environment to trace references. However, this function does not attempt to resolve
or distinguish the base of the given url, and so cannot be used safely in multi-server environments.
*/
define fluent function getId(uri String):
  Last(Split(uri, '/'))</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>FHIRHelpers</td>
                            
                            
                                <td>ToConcept</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="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><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>FHIRHelpers</td>
                            
                            
                                <td>ToString</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define function ToString(value uri): value.value</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>FHIRHelpers</td>
                            
                            
                                <td>ToCode</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="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>
                    
                    </table>
                </td>
            </tr>
            
        
    

    </table>
</div>
  </text>
  <contained>
    <Library>
      <id value="effective-data-requirements"/>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-directReferenceCode">
        <valueCoding>
          <system value="http://hl7.org/fhir/administrative-gender"/>
          <code value="M"/>
          <display value="Male"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-directReferenceCode">
        <valueCoding>
          <system value="http://hl7.org/fhir/administrative-gender"/>
          <code value="F"/>
          <display value="Female"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="SupplementalDataElements"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Sex"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Sex&quot;:
  case
    when Patient.gender = 'male' then &quot;M&quot;
    when Patient.gender = 'female' then &quot;F&quot;
    else null
  end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="0"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="HospitalHarmOpioidRelatedAdverseEventsFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Sex"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Sex&quot;:
  SDE.&quot;SDE Sex&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="1"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="HospitalHarmOpioidRelatedAdverseEventsFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="Opioid Antagonist Administration"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Opioid Antagonist Administration&quot;:
  [&quot;MedicationAdministration&quot;: &quot;Opioid Antagonist&quot;] AntagonistGiven
    where AntagonistGiven.status = 'completed'
      and AntagonistGiven.status != 'not-done'"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="2"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="HospitalHarmOpioidRelatedAdverseEventsFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="Opioid Administration"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Opioid Administration&quot;:
  [&quot;MedicationAdministration&quot;: &quot;Opioids, All&quot;] Opioids
    where Opioids.status = 'completed'
      and Opioids.status != 'not-done'"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="3"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="HospitalHarmOpioidRelatedAdverseEventsFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="Qualifying Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Qualifying Encounter&quot;:
  [&quot;Encounter&quot;: &quot;Encounter Inpatient&quot;] InpatientEncounter
    where AgeInYearsAt(date from start of InpatientEncounter.period) &gt;= 18
      and InpatientEncounter.period ends during day of &quot;Measurement Period&quot;
      and InpatientEncounter.status = 'finished'"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="4"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="HospitalHarmOpioidRelatedAdverseEventsFHIR"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Encounter with Opioid Administration Outside of Operating Room"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter with Opioid Administration Outside of Operating Room&quot;:
  &quot;Qualifying Encounter&quot; InpatientEncounter
    with &quot;Opioid Administration&quot; OpioidGiven
      such that QICoreCommon.&quot;ToInterval&quot; ( OpioidGiven.effective ) starts during CQMCommon.&quot;HospitalizationWithObservation&quot; ( InpatientEncounter )
        and not exists ( InpatientEncounter.location EncounterLocation
            where CQMCommon.GetLocation ( EncounterLocation.location ).type in &quot;Operating Room Suite&quot;
              and QICoreCommon.&quot;ToInterval&quot; ( OpioidGiven.effective ) starts during EncounterLocation.period
        )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="5"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="HospitalHarmOpioidRelatedAdverseEventsFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="Initial Population"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Initial Population&quot;:
  &quot;Encounter with Opioid Administration Outside of Operating Room&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="6"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="HospitalHarmOpioidRelatedAdverseEventsFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="Denominator"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Denominator&quot;:
  &quot;Initial Population&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="7"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="HospitalHarmOpioidRelatedAdverseEventsFHIR"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Encounter with Non Enteral Opioid Antagonist Administration Outside of Operating Room and within 12 Hrs After Opioid"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter with Non Enteral Opioid Antagonist Administration Outside of Operating Room and within 12 Hrs After Opioid&quot;:
  // Opioids administered before opioid antagonist AND excludes opioid antagonist administered in operating room AND limits opioid antagonist to non-enteral routes//
  
  from
    &quot;Opioid Antagonist Administration&quot; OpioidAntagonistGiven,
    &quot;Opioid Administration&quot; OpioidGiven,
    &quot;Denominator&quot; EncounterWithQualifyingAge
    where not exists ( EncounterWithQualifyingAge.location EncounterLocation
        where CQMCommon.GetLocation ( EncounterLocation.location ).type in &quot;Operating Room Suite&quot;
          and QICoreCommon.&quot;ToInterval&quot; ( OpioidAntagonistGiven.effective ) starts during EncounterLocation.period
    )
      and ( QICoreCommon.&quot;ToInterval&quot; ( OpioidAntagonistGiven.effective ) starts during CQMCommon.&quot;HospitalizationWithObservation&quot; ( EncounterWithQualifyingAge )
          and QICoreCommon.&quot;ToInterval&quot; ( OpioidGiven.effective ) starts during CQMCommon.&quot;HospitalizationWithObservation&quot; ( EncounterWithQualifyingAge )
          and QICoreCommon.&quot;ToInterval&quot; ( OpioidGiven.effective ) ends 12 hours or less before start of QICoreCommon.&quot;ToInterval&quot; ( OpioidAntagonistGiven.effective )
          and OpioidAntagonistGiven.dosage.route in &quot;Routes of Administration for Opioid Antagonists&quot;
      )
    return EncounterWithQualifyingAge"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="8"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="HospitalHarmOpioidRelatedAdverseEventsFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="Numerator"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Numerator&quot;:
  &quot;Encounter with Non Enteral Opioid Antagonist Administration Outside of Operating Room and within 12 Hrs After Opioid&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="9"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="SupplementalDataElements"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Payer"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Payer&quot;:
  [Coverage: type in &quot;Payer Type&quot;] Payer
    return {
      code: Payer.type,
      period: Payer.period
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="10"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="HospitalHarmOpioidRelatedAdverseEventsFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Payer"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Payer&quot;:
  SDE.&quot;SDE Payer&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="11"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="SupplementalDataElements"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Ethnicity"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Ethnicity&quot;:
  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/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="HospitalHarmOpioidRelatedAdverseEventsFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Ethnicity"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Ethnicity&quot;:
  SDE.&quot;SDE Ethnicity&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="13"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="SupplementalDataElements"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Race"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Race&quot;:
  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/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="HospitalHarmOpioidRelatedAdverseEventsFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Race"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Race&quot;:
  SDE.&quot;SDE Race&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="15"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-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
@deprecated: This function is deprecated. Use the fluent function `hospitalizationWithObservation()` instead.
*/
define function &quot;HospitalizationWithObservation&quot;(TheEncounter Encounter ):
  TheEncounter Visit
  		let ObsVisit: Last([Encounter: &quot;Observation Services&quot;] 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: &quot;Emergency Department Visit&quot;] 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="16"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-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
@deprecated: This function is deprecated. Use the fluent function `getLocation()` instead.
*/
define function &quot;GetLocation&quot;(reference Reference ):
  singleton from (
    [Location] L where L.id = reference.reference.getId()
  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="17"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="QICoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="getId"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns the tail of the given uri (i.e. everything after the last slash in the URI).
@comment: This function can be used to determine the logical id of a given resource. It can be used in
a single-server environment to trace references. However, this function does not attempt to resolve
or distinguish the base of the given url, and so cannot be used safely in multi-server environments.
*/
define fluent function getId(uri String):
  Last(Split(uri, '/'))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="18"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-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="19"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-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/us/cqfmeasures/StructureDefinition/cqfm-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="21"/>
        </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="Library SDE"/>
        <resource value="Library/SupplementalDataElements|3.5.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library FHIRHelpers"/>
        <resource value="Library/FHIRHelpers|4.4.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library QICoreCommon"/>
        <resource value="Library/QICoreCommon|2.1.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library CQMCommon"/>
        <resource value="Library/CQMCommon|2.2.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system AdministrativeGender"/>
        <resource value="http://hl7.org/fhir/administrative-gender"/>
      </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="Resource"/>
      </parameter>
      <parameter>
        <name value="Denominator"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </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="Resource"/>
      </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://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient"/>
        <mustSupport value="ethnicity"/>
        <mustSupport value="race"/>
      </dataRequirement>
      <dataRequirement>
        <type value="MedicationAdministration"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationadministration"/>
        <mustSupport value="medication"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <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/us/qicore/StructureDefinition/qicore-medicationadministration"/>
        <mustSupport value="medication"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <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/us/qicore/StructureDefinition/qicore-encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <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.value"/>
          <code>
            <code value="finished"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <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.value"/>
          <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/us/qicore/StructureDefinition/qicore-encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="period"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <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.value"/>
          <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="Location"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-location"/>
        <mustSupport value="id"/>
        <mustSupport value="id.value"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Coverage"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-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; SDE Ethnicity 
 SDE Payer 
 SDE Race 
 SDE 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/us/cqfmeasures/StructureDefinition/cqfm-effectiveDataRequirements" id="effective-data-requirements">
    <valueReference>
      <reference value="#effective-data-requirements"/>
    </valueReference>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-softwaresystem">
    <valueReference>
      <reference value="Device/cqf-tooling"/>
    </valueReference>
  </extension>
  <url
       value="https://madie.cms.gov/Measure/HospitalHarmOpioidRelatedAdverseEventsFHIR"/>
  <identifier>
    <use value="usual"/>
    <type>
      <coding>
        <system
                value="http://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type"/>
        <code 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://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type"/>
        <code 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://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type"/>
        <code value="version-specific"/>
      </coding>
    </type>
    <system value="urn:ietf:rfc:3986"/>
    <value value="urn:uuid:8f15b4f6-b1b5-41a0-b158-282ff051a62d"/>
  </identifier>
  <identifier>
    <use value="official"/>
    <type>
      <coding>
        <system
                value="http://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type"/>
        <code 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://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type"/>
        <code value="publisher"/>
      </coding>
    </type>
    <system value="https://madie.cms.gov/measure/cmsId"/>
    <value value="819FHIR"/>
    <assigner>
      <display value="CMS"/>
    </assigner>
  </identifier>
  <version value="0.1.000"/>
  <name value="HospitalHarmOpioidRelatedAdverseEventsFHIR"/>
  <title value="Hospital Harm - Opioid-Related Adverse EventsFHIR"/>
  <status value="draft"/>
  <experimental value="false"/>
  <date value="2024-07-09T14:53:55+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"/>
  <purpose value="UNKNOWN"/>
  <usage
         value="Qualifying encounters (denominator) include all patients 18 years of age or older at the start of the encounter 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 antagonists that were given greater than 12 hours following hospital administration of an opioid medication.

This eCQM 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: CMS819v3.

Please refer to the HL7 QI-Core Implementation Guide(https://hl7.org/fhir/us/qicore/STU4.1.1/) for more information on QI-Core and mapping recommendations from QDM to QI-Core4.1.1 (https://hl7.org/fhir/us/qicore/STU4.1.1/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. American Institutes for Research(R), formerly IMPAQ International, disclaims all liability for use or accuracy of any third party codes contained in the specifications.

LOINC(R) copyright 2004-2023 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2023 International Health Terminology Standards Development Organisation. ICD-10 copyright 2023 World Health Organization. All Rights Reserved."/>
  <effectivePeriod>
    <start value="2025-01-01"/>
    <end value="2025-12-31"/>
  </effectivePeriod>
  <author>
    <name value="American Institutes for Research (AIR)"/>
    <telecom>
      <system value="url"/>
      <value value="https://www.air.org"/>
    </telecom>
  </author>
  <library
           value="https://madie.cms.gov/Library/HospitalHarmOpioidRelatedAdverseEventsFHIR"/>
  <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 &quot;AS IS&quot; 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]."/>
  <scoring>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/measure-scoring"/>
      <code value="proportion"/>
      <display value="Proportion"/>
    </coding>
  </scoring>
  <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, 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, 2021b). For surgical patients, occurrence of opioid-related adverse events was associated with an increase of 1.6 days in 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 et al., 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.

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.

In February 2022, 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 et al., 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."/>
  <group id="6501fc94da013638e7b3dc06">
    <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">
      <valueCode 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="decrease"/>
        </coding>
      </valueCodeableConcept>
    </extension>
    <population id="1C6E5BCB-BD38-4BEF-8350-8E166D397587">
      <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 for patients age 18 years and older during which at least one opioid medication was administered outside of the operating room"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Initial Population"/>
      </criteria>
    </population>
    <population id="607CB430-D084-45B0-BDEB-B321419D25DC">
      <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="85A98C8D-BA1B-44A8-B7B4-F15D0D005472">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="numerator"/>
          <display value="Numerator"/>
        </coding>
      </code>
      <description
                   value="Inpatient hospitalizations where an opioid antagonist was administered outside of the operating room and within 12 hours 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>