<?xml version="1.0" encoding="UTF-8"?>

<Measure xmlns="http://hl7.org/fhir">
  <id value="CMS1244FHIRECATHOQR"/>
  <meta>
    <profile value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablemeasure"/>
    <profile value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/computable-measure-cqfm"/>
    <profile value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/publishable-measure-cqfm"/>
    <profile value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/executable-measure-cqfm"/>
    <profile value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cql-measure-cqfm"/>
    <profile value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/elm-measure-cqfm"/>
    <profile value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm"/>
  </meta>
  <text>
    <status value="extensions"/><div xmlns="http://www.w3.org/1999/xhtml">
  <table class="narrative-table">
    <tbody>
<tr>


<th colspan="2" scope="row" class="row-header">Metadata</th>


</tr>

<tr>


<th scope="row" class="row-header">Title</th>



<td class="content-container">Emergency Care Access \&amp; Timeliness (HOQR)FHIR
</td>


</tr>



<tr>


<th scope="row" class="row-header">Version</th>



<td class="content-container">1.0.000</td>


</tr>


  
<tr>


<th scope="row" class="row-header">Short Name</th>



<td class="content-container">CMS1244FHIR</td>


</tr>



  
<tr>


<th scope="row" class="row-header">GUID (Version Independent)</th>



<td class="content-container">urn:uuid:1d711504-ebec-41de-81b0-d1993115eac2</td>


</tr>



  
<tr>


<th scope="row" class="row-header">GUID (Version Specific)</th>



<td class="content-container">urn:uuid:43ee6832-7bc9-4247-a51c-6d8052f1a222</td>


</tr>



  
    
    
<tr>


<th scope="row" class="row-header">CMS Identifier</th>



<td class="content-container">1244FHIR</td>


</tr>

  


  
    
    
<tr>


<th scope="row" class="row-header">CMS Consensus Based Entity Identifier</th>



<td class="content-container">4625e</td>


</tr>

  



  
    
    
<tr>


<th scope="row" class="row-header">Effective Period</th>



<td class="content-container">2027-01-01 through 2027-12-31</td>


</tr>

  















<tr>


<th scope="row" class="row-header">Steward (Publisher)</th>



<td class="content-container">Centers for Medicare &amp;amp; Medicaid Services (CMS)</td>


</tr>






<tr>


<th scope="row" class="row-header">Developer</th>



<td class="content-container">Acumen, LLC</td>


</tr>






<tr>


<th scope="row" class="row-header">Description</th>



<td class="content-container"><div><p>This measure assesses the variation in access and timeliness of emergency care to support hospital quality improvement for patients requiring emergency care in an emergency department (ED). This measure is designed to align with incentives to promote improved care both in EDs and the broader health system to help identify where patients do not receive timely access to emergency care. Emergency care access and timeliness gaps are inclusive of several concepts pertaining to boarding and crowding in an ED, including significantly longer ED wait times, higher left without being seen rates, longer boarding times, and longer total length of stay in the ED.</p>
</div></td>


</tr>



<tr>


<th scope="row" class="row-header">Copyright</th>



<td class="content-container"><div><p>Limited proprietary coding is contained in these specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2024 International Health Terminology Standards Development Organisation. All rights reserved. ICD-10 copyright 2024 World Health Organization. All Rights Reserved. CPT(R) contained in the Measure specifications is copyright 2004-2024 American Medical Association.</p>
</div></td>


</tr>


<tr>


<th scope="row" class="row-header">Disclaimer</th>



<td class="content-container"><div><p>These performance specifications are not clinical guidelines, do not establish a standard of medical care, and have 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].</p>
</div></td>


</tr>













<tr>


<th scope="row" class="row-header">Rationale</th>



<td class="content-container"><div><p>This measure aims to reduce patient harm and improve outcomes for patients requiring emergency care in an ED by addressing the variation in emergency care and measuring access and timeliness of emergency care. There are long-standing concerns about parameters that impact access and timeliness of care in the ED. Currently, there are no national metrics to assess the proportion of patients impacted by access and timeliness of ED care.</p>
</div></td>


</tr>


<tr>


<th scope="row" class="row-header">Clinical Recommendation Statement</th>



<td class="content-container"><div><p>The goal of the Emergency Care Access &amp; Timeliness (ECAT) measure is to assess and improve the safety of the 140 million ED visits that patients experience each year (Centers for Disease Control and Prevention [CDC], 2021). Limitations in access and timeliness of emergency care have been shown to be associated with harm, such as increases in mortality, delays in care, preventable errors, poor patient experience, and staff burnout. These quality limitations are also associated with increased costs of care. The ECAT measure under consideration is intended for use in CMS's Hospital Outpatient Quality Reporting (HOQR) program. The numerator is comprised of all ED visits with a quality gap in access as defined in the numerator criteria. Challenges related to emergency care access and timeliness have been increasing and have prompted public calls for action. This measure improves upon previous efforts as it measures the mean instead of the median to highlight the presence of extreme quality gaps, and captures several indicators of quality gaps by using multiple numerator criteria. Implementation of this measure, which captures multiple components of access and timeliness, can help identify facilities where patients do not receive timely access to emergency care as defined in the numerator criteria. This measure, therefore, could positively impact millions of patients who seek treatment in the ED and help address long-standing disparities in emergency care, including for patients with mental health diagnoses.</p>
</div></td>


</tr>



<tr>
  
  
  
  

<th scope="row" class="row-header">Citation</th>


  
  
  
  <td class="content-container">
    
    
    
    <div><p>American College of Emergency Physicians. (2018). Definition of Boarded Patient. Policy Statements. https://www.acep.org/patient-care/policy-statements/definition-of-boarded-patient</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

<th scope="row" class="row-header">Citation</th>


  
  
  
  <td class="content-container">
    
    
    
    <div><p>American Medical Association. (2022). What is Behavioral Health. https://www.ama-assn.org/delivering-care/public-health/what-behavioral-health</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

<th scope="row" class="row-header">Citation</th>


  
  
  
  <td class="content-container">
    
    
    
    <div><p>Centers for Disease Control and Prevention. (2021). Emergency Department Visits. https://www.cdc.gov/nchs/fastats/emergency-department.htm</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

<th scope="row" class="row-header">Citation</th>


  
  
  
  <td class="content-container">
    
    
    
    <div><p>eCQI Resource Center. (n.d). Median Admit Decision Time to ED Departure Time for Admitted Patients.</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>






  
  
<tr>


<th scope="row" class="row-header">Definition</th>



<td class="content-container">Boarding: The practice of holding inpatients in the emergency department after admission to the hospital because no hospital inpatient bed is available. (American College of Emergency Physicians \[ACEP\], 2018).
</td>


</tr>


  
  
<tr>


<th scope="row" class="row-header">Definition</th>



<td class="content-container">ED Observation: Observation stays are inclusive of both ED observation care in which a patient initially evaluated in the ED is cared for under observation status for an extended period of time in the ED or in a care area dedicated to observation care, as well as hospital observation stays in which a patient initially evaluated in the ED is cared for in observation status often in a hospital bed used for both inpatient or observation status admissions. Because these two forms of observation stays cannot be easily distinguished in a standardized fashion in existing electronic health record data ontologies, for the purposes of this quality measure all observation stays have been considered an exclusion from both numerator criteria 3 and 4.
</td>


</tr>


  
  
<tr>


<th scope="row" class="row-header">Definition</th>



<td class="content-container">Left Without Being Seen (LWBS): Patients arrive to the ED for evaluation and leave before seeing a physician, advanced practice nurse, or physician's assistant.
</td>


</tr>


  
  
<tr>


<th scope="row" class="row-header">Definition</th>



<td class="content-container">Mental Health: Mental health generally refers to mental health diagnoses, life stressors and crises, and stress-related physical symptoms (American Medical Association \[AMA\], 2022). For this measure, mental health conditions will be defined separately from substance use disorders.
</td>


</tr>



<tr>


<th scope="row" class="row-header">Guidance (Usage)</th>



<td class="content-container">Measure Score Calculation The measure score is first calculated at the individual ED level as the proportion of ED visits where any one of the four outcomes occurred, as defined by the numerator. Scores will be standardized z-scores by ED case volume strata (defined in ED visit volume bands of 20,000 visits). For CMS Certification Numbers (CCNs) with more than one ED, volume-adjusted z-scores are then combined as a weighted average for that CCN. A z-score of greater than zero means worse performance and less than zero means better performance, compared to like EDs. For the purposes of this measure, a decision to admit can be captured using any of the following: - an evaluation that results in a decision to admit - an order to admit to inpatient - an order for a bed assignment - start of inpatient admission This dQM is an episode-based measure. An episode is defined as an ED visit that ends during the measurement period. This FHIR-based measure has been derived from the QDM-based measure: CMS1244v1. Please refer to the HL7 QI-Core Implementation Guide (*++https://hl7.org/fhir/us/qicore/STU6/++* ) for more information on QI-Core and mapping recommendations from QDM to QI-Core STU 6 (*++https://hl7.org/fhir/us/qicore/STU6/qdm-to-qicore.html++*).
</td>


</tr>



  
  
  
    
    <tr>


<th colspan="2" scope="row" class="row-header">Measure Group (Rate) (ID: Group_1)</th>


</tr>
  
  
  
  
<tr>


<th scope="row" class="row-header">Basis</th>



<td class="content-container">Encounter</td>


</tr>



  
<tr>


<th scope="row" class="row-header">Scoring</th>



<td class="content-container">
    Proportion


</td>


</tr>





  
<tr>


<th scope="row" class="row-header">Improvement Notation</th>



<td class="content-container">
    Decreased score indicates improvement


</td>


</tr>






<tr>


<th scope="row" class="row-header">Type</th>



<td class="content-container">
    Outcome


</td>


</tr>



  
<tr>


<th scope="row" class="row-header">Rate Aggregation</th>



<td class="content-container">None
</td>


</tr>



  
  

    
      
        
  
    
    
    <tr>
      
        

<th scope="row" class="row-header">Initial Population</th>


      
      <td class="content-container">
        
        <em>ID</em>: InitialPopulation_1
        <br/>
        
        
          <em>Description</em>:
          <p style="white-space: pre-line" class="tab-one">All ED visits that end during the measurement period for all patients
</p>
        
        
          
            
              
              <em>Criteria</em>: <a href="#Group_1-InitialPopulation_1">Initial Population</a> 
            
          
          
        
        
        
      </td>
    </tr>
  

      
    

    
      
        
  
    
    
    <tr>
      
        

<th scope="row" class="row-header">Denominator</th>


      
      <td class="content-container">
        
        <em>ID</em>: Denominator_1
        <br/>
        
        
          <em>Description</em>:
          <p style="white-space: pre-line" class="tab-one">Equals Initial Population
</p>
        
        
          
            
              
              <em>Criteria</em>: <a href="#Group_1-Denominator_1">Denominator</a> 
            
          
          
        
        
        
      </td>
    </tr>
  

      
    

    
      
    

    
      
    

    
      
        
  
    
    
    <tr>
      
        

<th scope="row" class="row-header">Numerator</th>


      
      <td class="content-container">
        
        <em>ID</em>: Numerator_1
        <br/>
        
        
          <em>Description</em>:
          <p style="white-space: pre-line" class="tab-one">The numerator is comprised of ED visits meeting the denominator criteria and where the patient experiences any of the following quality gaps in access: 1. The patient waited longer than 60 minutes (1 hour) after arrival to the ED to be placed in a treatment room or dedicated treatment area that allows for audiovisual privacy during history-taking and physical examination, or 2. The patient left the ED without being evaluated, or 3. The patient boarded (time from Decision to Admit order to ED departure for admitted patients) in the ED for longer than 240 minutes (4 hours), or 4. The patient had an ED length of stay (LOS) (time from ED arrival to ED departure as defined by the ED departure timestamp indicating when the patient physically left the ED) of longer than 480 minutes (8 hours). ED encounters with ED observation stays are excluded from criteria #3 (boarding) and #4 (ED LOS). To clarify, patients who have a 'decision to admit' after an ED observation stay remain excluded from criteria #3 (boarded) calculations.
</p>
        
        
          
            
              
              <em>Criteria</em>: <a href="#Group_1-Numerator_1">Numerator</a> 
            
          
          
        
        
        
      </td>
    </tr>
  

      
    

    
      
    

  


  

<tr>
  

<th scope="row" class="row-header">Stratifier</th>


  <td class="content-container">
    
      <em>ID</em>: Stratification_1_1
      
        <br/>
      
    
    
    
      <em>Description</em>: All patients aged less than 18 years seen in the ED who do not have an ED encounter principal diagnosis consistent with mental health diagnosis. Patients who have an ED encounter principal diagnosis consistent with substance use disorders will be included in this stratification.

    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Stratifier</th>


  <td class="content-container">
    
      <em>ID</em>: Stratification_1_2
      
        <br/>
      
    
    
    
      <em>Description</em>: All patients aged 18 years and older seen in the ED who do not have an ED encounter principal diagnosis consistent with mental health diagnosis. Patients who have an ED encounter principal diagnosis consistent with substance use disorders will be included in this stratification.

    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Stratifier</th>


  <td class="content-container">
    
      <em>ID</em>: Stratification_1_3
      
        <br/>
      
    
    
    
      <em>Description</em>: All patients aged less than 18 years seen in the ED who have an ED encounter principal diagnosis consistent with mental health diagnosis.

    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Stratifier</th>


  <td class="content-container">
    
      <em>ID</em>: Stratification_1_4
      
        <br/>
      
    
    
    
      <em>Description</em>: All patients aged 18 years and older seen in the ED who have an ED encounter principal diagnosis consistent with mental health diagnosis.

    
  </td>
</tr>







  
    
    
    
    
    
<tr>


<th scope="row" class="row-header"/>



<td class="content-container">For every patient evaluated by this measure also identify payer, race, ethnicity and sex</td>


</tr>

  




  <tr>


<th colspan="2" scope="row" class="row-header">Supplemental Data Elements</th>


</tr>


<tr>
  

<th scope="row" class="row-header">Supplemental Data Element</th>


  <td class="content-container">
    
      <em>ID</em>: sde-ethnicity
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: SDE Ethnicity

    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#cms1244fhirecathoqr-sde-ethnicity">SDE Ethnicity</a> 
        
      
    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Supplemental Data Element</th>


  <td class="content-container">
    
      <em>ID</em>: sde-payer
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: SDE Payer

    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#cms1244fhirecathoqr-sde-payer">SDE Payer</a> 
        
      
    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Supplemental Data Element</th>


  <td class="content-container">
    
      <em>ID</em>: sde-race
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: SDE Race

    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#cms1244fhirecathoqr-sde-race">SDE Race</a> 
        
      
    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Supplemental Data Element</th>


  <td class="content-container">
    
      <em>ID</em>: sde-sex
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: SDE Sex

    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#cms1244fhirecathoqr-sde-sex">SDE Sex</a> 
        
      
    
  </td>
</tr>


<tr>


<th colspan="2" scope="row" class="row-header">Measure Logic</th>


</tr>

<tr>


<th scope="row" class="row-header">Primary Library</th>



<td class="content-container"><code>https://madie.cms.gov/Library/CMS1244FHIRECATHOQR</code></td>


</tr>




<tr>
  <th scope="row" class="row-header">Contents</th>
  <td class="content-container">
    <em><a href="#population-criteria">Population Criteria</a></em>
    <br/>
    <em><a href="#definitions">Logic Definitions</a></em>
    <br/>
    <em><a href="#terminology">Terminology</a></em>
    <br/>
    <em><a href="#dependencies">Dependencies</a></em>
    <br/>
    <em><a href="#data-requirements">Data Requirements</a></em>
    <br/>
    <em><a href="#parameters">Parameters</a></em>
    <br/>
  </td>
</tr>


  <tr>


<th colspan="2" scope="row" class="row-header"><a name="population-criteria"> </a>Population Criteria</th>


</tr>
  
  
  

  
  
  
    
    <tr>


<th colspan="2" scope="row" class="row-header">Measure Group (Rate) (ID: Group_1)</th>


</tr>
  
  
  
  

    
      
          
    
      
        
          
        
          
        
          
        
          
        
          
        
          
            
              
            
            
            
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Initial Population
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
      
      <a name="Group_1-InitialPopulation_1"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Initial Population&quot;:
  &quot;ED Evaluation and Management&quot;
    union &quot;ED Triage Excluding Those Prior To ED Encounters&quot;</code></pre>
    
      
      <a href="#cms1244fhirecathoqr-initial-population"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
      
    
  

      
    

    
      
          
    
      
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            
              
            
            
            
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Denominator
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
      
      <a name="Group_1-Denominator_1"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Denominator&quot;:
  &quot;Initial Population&quot;</code></pre>
    
      
      <a href="#cms1244fhirecathoqr-denominator"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
      
    
  

      
    

    
      
    

    
      
    

    
      
          
    
      
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            
              
            
            
            
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Numerator
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
      
      <a name="Group_1-Numerator_1"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Numerator&quot;:
  &quot;Time to Treatment Room Greater Than 60 Minutes&quot;
    union &quot;ED Arrival Left Without Being Seen&quot;
    union &quot;Boarded Time Greater Than 240 Minutes and No Observation Stay&quot;
    union &quot;ED Length of Stay Greater Than 480 Minutes and No Observation Stay&quot;</code></pre>
    
      
      <a href="#cms1244fhirecathoqr-numerator"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
      
    
  

      
    

    
      
    

  


  

  
    
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Stratifier
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Stratification 1&quot;:
  &quot;Pediatric With No Mental Health Diagnosis&quot;</code></pre>
    
      
      <a href="#cms1244fhirecathoqr-stratification-1"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
    
  

  
    
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Stratifier
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Stratification 2&quot;:
  &quot;Adult With No Mental Health Diagnosis&quot;</code></pre>
    
      
      <a href="#cms1244fhirecathoqr-stratification-2"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
    
  

  
    
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Stratifier
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Stratification 3&quot;:
  &quot;Pediatric With Mental Health Diagnosis&quot;</code></pre>
    
      
      <a href="#cms1244fhirecathoqr-stratification-3"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
    
  

  
    
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Stratifier
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Stratification 4&quot;:
  &quot;Adult With Mental Health Diagnosis&quot;</code></pre>
    
      
      <a href="#cms1244fhirecathoqr-stratification-4"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
    
  


  

  
  


  <tr>


<th colspan="2" scope="row" class="row-header"><a name="definitions"> </a>Logic Definitions</th>


</tr>
  
  
          
        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SupplementalDataElements</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="supplementaldataelements-sde-sex"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Sex&quot;:
  case
    when Patient.sex() = '248153007' then &quot;Male (finding)&quot;
    when Patient.sex() = '248152002' then &quot;Female (finding)&quot;
    else null
  end</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SupplementalDataElements</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="supplementaldataelements-sde-payer"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Payer&quot;:
  [USQualityCore.Coverage: type in &quot;Payer Type&quot;] Payer
    return {
      code: Payer.type,
      period: Payer.period
    }</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SupplementalDataElements</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="supplementaldataelements-sde-ethnicity"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Ethnicity&quot;:
  (Patient.ethnicity()) E
    return Tuple {
      codes: { E.ombCategory } union E.detailed,
      display: E.text
    }</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SupplementalDataElements</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="supplementaldataelements-sde-race"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Race&quot;:
  (Patient.race()) R
    return Tuple {
      codes: R.ombCategory union R.detailed,
      display: R.text
    }</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        




        
        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-sde-sex"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Sex&quot;:
  SDE.&quot;SDE Sex&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-ed-evaluation-and-management"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;ED Evaluation and Management&quot;:
  [Encounter: &quot;Emergency Department Evaluation and Management Visit&quot;] EDEvalManagementVisit
    where EDEvalManagementVisit.period ends during day of &quot;Measurement Period&quot;
      and EDEvalManagementVisit.status = 'finished'</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-ed-triage"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;ED Triage&quot;:
  ( [Encounter: &quot;Triage&quot;] EDTriage
      where EDTriage.period ends during day of &quot;Measurement Period&quot;
        and EDTriage.status in { 'finished', 'triaged' }
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-ed-triage-excluding-those-prior-to-ed-encounters"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;ED Triage Excluding Those Prior To ED Encounters&quot;:
  &quot;ED Triage&quot; EDTriageinMP
    where not exists ( &quot;ED Evaluation and Management&quot; EDEvalManagementInMP
        where ( ( EDTriageinMP.period overlaps before EDEvalManagementInMP.period )
            or ( EDTriageinMP.period during EDEvalManagementInMP.period )
            or ( EDEvalManagementInMP.period during EDTriageinMP.period )
            or ( EDTriageinMP.period ends 120 minutes or less before start of EDEvalManagementInMP.period )
        )
    )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-initial-population"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Initial Population&quot;:
  &quot;ED Evaluation and Management&quot;
    union &quot;ED Triage Excluding Those Prior To ED Encounters&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-denominator"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Denominator&quot;:
  &quot;Initial Population&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-ed-triage-before-evaluation-management"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;ED Triage Before Evaluation Management&quot;:
  &quot;ED Triage&quot; EDTriageinMP
    with &quot;Denominator&quot; EDEncounter
      such that ( ( EDTriageinMP.period overlaps before EDEncounter.period )
          or ( EDTriageinMP.period during EDEncounter.period )
          or ( EDEncounter.period during EDTriageinMP.period )
          or ( EDTriageinMP.period ends 120 minutes or less before start of EDEncounter.period )
      )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-ed-triage-and-evaluation-management"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;ED Triage and Evaluation Management&quot;:
  &quot;Denominator&quot;
    union &quot;ED Triage Before Evaluation Management&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-time-to-treatment-room-greater-than-60-minutes"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Time to Treatment Room Greater Than 60 Minutes&quot;:
  &quot;ED Evaluation and Management&quot; EDEvalManagementInMP
    where EDEvalManagementInMP.edArrivalTime ( ) 61 minutes or more before EDEvalManagementInMP.edTreatmentRoomTimeArrivalTime ( )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-ed-arrival-left-without-being-seen"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;ED Arrival Left Without Being Seen&quot;:
  &quot;Denominator&quot; EDEncounter
    where EDEncounter.hospitalization.dischargeDisposition ~ &quot;Patient left without being seen (finding)&quot;</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-ed-to-inpatient-order"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;ED To Inpatient Order&quot;:
  [ServiceRequest: &quot;Decision to Admit to Hospital Inpatient&quot;] AdmitIPOrder
    where AdmitIPOrder.status in { 'active', 'completed' }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-decision-to-admit-encounter-order"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Decision to Admit Encounter Order&quot;:
  &quot;Denominator&quot; EDEncounter
    with CQMCommon.&quot;Inpatient Encounter&quot; EncounterInpatient
      such that EncounterInpatient.admitDecisionUsingEncounterOrder ( ) 241 minutes or more before EDEncounter.edDepartureTime ( )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-assessment-in-ed"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Assessment In ED&quot;:
  [&quot;ObservationClinicalResult&quot;: &quot;Emergency Department Evaluation&quot;]
    union [&quot;SimpleObservation&quot;: &quot;Emergency Department Evaluation&quot;] ObsInED
      where ObsInED.value as CodeableConcept in &quot;Admit Inpatient&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-decision-to-admit-using-assessment"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Decision to Admit Using Assessment&quot;:
  &quot;Denominator&quot; EDEncounter
    with CQMCommon.&quot;Inpatient Encounter&quot; EncounterInpatient
      such that EncounterInpatient.admitDecisionUsingAssessment ( ) 241 minutes or more before EDEncounter.edDepartureTime ( )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-inpatient-or-bed-assignment-encounter-order"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Inpatient Or Bed Assignment Encounter Order&quot;:
  ( [ServiceRequest: &quot;Encounter Inpatient&quot;]
    union [ServiceRequest: &quot;Patient bed assigned (finding)&quot;] ) IPRequest
    where IPRequest.status in { 'active', 'completed' }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-time-of-admit-order-or-bed-assignment-to-departure-greater-than-241-minutes"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Time of Admit Order Or Bed Assignment to Departure Greater Than 241 Minutes&quot;:
  &quot;Denominator&quot; EDEncounter
    with CQMCommon.&quot;Inpatient Encounter&quot; InpatientEncounter
      such that InpatientEncounter.admitInpatientOrBedAssignmentEncounterOrder ( ) 241 minutes or more before EDEncounter.edDepartureTime ( )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-admitted-to-inpatient-241-minutes-or-more-before-departure"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Admitted to Inpatient 241 Minutes or More Before Departure&quot;:
  &quot;Denominator&quot; EDEncounter
    with CQMCommon.&quot;Inpatient Encounter&quot; Inpatient
      such that Inpatient.holdingInEDAfterAdmission ( ) 241 minutes or more before EDEncounter.edDepartureTime ( )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-boarded-time-greater-than-240-minutes"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Boarded Time Greater Than 240 Minutes&quot;:
  &quot;Decision to Admit Encounter Order&quot;
    union &quot;Decision to Admit Using Assessment&quot;
    union &quot;Time of Admit Order Or Bed Assignment to Departure Greater Than 241 Minutes&quot;
    union &quot;Admitted to Inpatient 241 Minutes or More Before Departure&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-ed-observation-status"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;ED Observation Status&quot;:
  [Encounter: &quot;Observation Services&quot;] EDObsEncounter
    with &quot;Denominator&quot; EDEncounter
      such that EDObsEncounter.period during EDEncounter.period
        and EDObsEncounter.status = 'finished'</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-boarded-time-greater-than-240-minutes-and-no-observation-stay"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Boarded Time Greater Than 240 Minutes and No Observation Stay&quot;:
  ( &quot;Boarded Time Greater Than 240 Minutes&quot; Boarding
      where not exists ( &quot;ED Observation Status&quot; EDObs
          where ( EDObs.period during Boarding.period )
      )
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-ed-length-of-stay-greater-than-480-minutes"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;ED Length of Stay Greater Than 480 Minutes&quot;:
  &quot;Denominator&quot; EDEncounter
    where EDEncounter.edArrivalTime ( ) 481 minutes or more before EDEncounter.edDepartureTime ( )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-ed-length-of-stay-greater-than-480-minutes-and-no-observation-stay"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;ED Length of Stay Greater Than 480 Minutes and No Observation Stay&quot;:
  ( &quot;ED Length of Stay Greater Than 480 Minutes&quot; EDStay
      where not exists ( &quot;ED Observation Status&quot; EDObs
          where ( EDObs.period during EDStay.period )
      )
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-numerator"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Numerator&quot;:
  &quot;Time to Treatment Room Greater Than 60 Minutes&quot;
    union &quot;ED Arrival Left Without Being Seen&quot;
    union &quot;Boarded Time Greater Than 240 Minutes and No Observation Stay&quot;
    union &quot;ED Length of Stay Greater Than 480 Minutes and No Observation Stay&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-ed-encounter-or-triage-of-patients-18-years-and-older"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;ED Encounter or Triage of Patients 18 Years and Older&quot;:
  &quot;Denominator&quot; EDEncounter
    where AgeInYearsAt(date from start of &quot;Measurement Period&quot;) &gt;= 18</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-adult-with-mental-health-diagnosis"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Adult With Mental Health Diagnosis&quot;:
  ( &quot;ED Encounter or Triage of Patients 18 Years and Older&quot; AdultEDEncounters
      where ( AdultEDEncounters.hasPrincipalDiagnosisOf ( &quot;Mental Health Diagnosis without Substance Use Disorders&quot; ) )
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-stratification-4"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Stratification 4&quot;:
  &quot;Adult With Mental Health Diagnosis&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-ed-encounter-or-triage-of-patients-less-than-18-years"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;ED Encounter or Triage of Patients Less Than 18 Years&quot;:
  &quot;Denominator&quot; EDEncounter
    where AgeInYearsAt(date from start of &quot;Measurement Period&quot;) &lt; 18</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-pediatric-with-mental-health-diagnosis"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Pediatric With Mental Health Diagnosis&quot;:
  ( &quot;ED Encounter or Triage of Patients Less Than 18 Years&quot; PediatricEDEncounters
      where ( PediatricEDEncounters.hasPrincipalDiagnosisOf ( &quot;Mental Health Diagnosis without Substance Use Disorders&quot; ) )
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-stratification-3"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Stratification 3&quot;:
  &quot;Pediatric With Mental Health Diagnosis&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-adult-with-no-mental-health-diagnosis"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Adult With No Mental Health Diagnosis&quot;:
  ( &quot;ED Encounter or Triage of Patients 18 Years and Older&quot; AdultEDEncounters
      where not ( AdultEDEncounters.hasPrincipalDiagnosisOf ( &quot;Mental Health Diagnosis without Substance Use Disorders&quot; ) )
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-stratification-2"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Stratification 2&quot;:
  &quot;Adult With No Mental Health Diagnosis&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-pediatric-with-no-mental-health-diagnosis"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Pediatric With No Mental Health Diagnosis&quot;:
  ( &quot;ED Encounter or Triage of Patients Less Than 18 Years&quot; PediatricEDEncounters
      where not ( PediatricEDEncounters.hasPrincipalDiagnosisOf ( &quot;Mental Health Diagnosis without Substance Use Disorders&quot; ) )
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-stratification-1"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Stratification 1&quot;:
  &quot;Pediatric With No Mental Health Diagnosis&quot;</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-sde-payer"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Payer&quot;:
  SDE.&quot;SDE Payer&quot;</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-sde-ethnicity"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Ethnicity&quot;:
  SDE.&quot;SDE Ethnicity&quot;</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-sde-race"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Race&quot;:
  SDE.&quot;SDE Race&quot;</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-edarrivaltime"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function &quot;edArrivalTime&quot;(EDEncounter Encounter):
  Last(&quot;ED Triage and Evaluation Management&quot;.location Location
      where exists((Location.location.getLocation().type) LocationType
          where(LocationType in &quot;Emergency Department Location&quot;
              or LocationType ~ &quot;Emergency room&quot;
              or LocationType ~ &quot;Emergency trauma unit&quot;
          )
      )
        and start of Location.period is not null
        and(Location.period ends 120 minutes or less before start of EDEncounter.period
            or Location.period overlaps before EDEncounter.period
            or EDEncounter.period overlaps before Location.period
            or Location.period starts same as start of EDEncounter.period
        )
      return start of Location.period
      sort ascending
  )</code></pre>
  </td>

</tr>



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-edtreatmentroomtimearrivaltime"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function &quot;edTreatmentRoomTimeArrivalTime&quot;(EDEncounter Encounter):
  First(EDEncounter.location Location
      where Location.location.getLocation().type in &quot;Emergency Department Treatment Location&quot;
        and start of Location.period is not null
      return start of Location.period
      sort ascending
  )</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-admitdecisionusingencounterorder"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function &quot;admitDecisionUsingEncounterOrder&quot;(EncounterInpatient Encounter):
  Last(&quot;ED To Inpatient Order&quot; AdmitOrder
      let LastEDVisit: EncounterInpatient.lastEDEncounter()
      where AdmitOrder.authoredOn during LastEDVisit.period
        and AdmitOrder.intent ~ 'order'
      return AdmitOrder.authoredOn
      sort ascending
  )</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-lastedencounter"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function &quot;lastEDEncounter&quot;(EncounterInpatient Encounter):
  Last(&quot;ED Evaluation and Management&quot; EDEvalManagementInMP
      where EDEvalManagementInMP.period starts 1 day or less before or on start of EncounterInpatient.period
        and EDEvalManagementInMP.period starts before start of EncounterInpatient.period
        and EDEvalManagementInMP.period during day of &quot;Measurement Period&quot;
        and EDEvalManagementInMP.status = 'finished'
      sort by 
      end of period ascending
  )</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-eddeparturetime"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function &quot;edDepartureTime&quot;(EDEncounter Encounter):
  Last(&quot;ED Triage and Evaluation Management&quot;.location Location
      where exists((Location.location.getLocation().type) LocationType
          where(LocationType in &quot;Emergency Department Location&quot;
              or LocationType ~ &quot;Emergency room&quot;
              or LocationType ~ &quot;Emergency trauma unit&quot;
          )
      )
        and 
        end of Location.period is not null
        and(Location.period ends 120 minutes or less before start of EDEncounter.period
            or Location.period overlaps before EDEncounter.period
            or EDEncounter.period overlaps before Location.period
            or Location.period starts same as start of EDEncounter.period
        )
      return 
      end of Location.period
      sort ascending
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-admitdecisionusingassessment"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function &quot;admitDecisionUsingAssessment&quot;(EncounterInpatient Encounter):
  Last(&quot;Assessment In ED&quot; EDEvaluation
      let LastEDVisit: EncounterInpatient.lastEDEncounter()
      where EDEvaluation.effective.toInterval() starts during LastEDVisit.period
        and EDEvaluation.status in { 'final', 'amended', 'corrected' }
      return start of EDEvaluation.effective.toInterval()
      sort ascending
  )</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-admitinpatientorbedassignmentencounterorder"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function &quot;admitInpatientOrBedAssignmentEncounterOrder&quot;(Encounter Encounter):
  Last((&quot;Inpatient Or Bed Assignment Encounter Order&quot;) AdmitInpatientOrder
      let LastEDVisit: Encounter.lastEDEncounter()
      where AdmitInpatientOrder.authoredOn during LastEDVisit.period
      return AdmitInpatientOrder.authoredOn
      sort ascending
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CMS1244FHIRECATHOQR</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cms1244fhirecathoqr-holdinginedafteradmission"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function holdingInEDAfterAdmission(InpatientEncounter Encounter):
  Last(CQMCommon.&quot;Inpatient Encounter&quot; AdmittedInpatient
      let LastEDVisit: InpatientEncounter.lastEDEncounter()
      where start of AdmittedInpatient.period during LastEDVisit.period
      return start of AdmittedInpatient.period
      sort ascending
  )</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value string): value.value</code></pre>
  </td>

</tr>



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value uri): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tointerval"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)
value to a CQL DateTime Interval
@comment: If the start value of the given period is unspecified, the starting
boundary of the resulting interval will be open (meaning the start of the interval
is unknown, as opposed to interpreted as the beginning of time).
*/
define function ToInterval(period FHIR.Period):
    if period is null then
        null
    else
        if period.&quot;start&quot; is null then
            Interval(period.&quot;start&quot;.value, period.&quot;end&quot;.value]
        else
            Interval[period.&quot;start&quot;.value, period.&quot;end&quot;.value]</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value EncounterStatus): value.value</code></pre>
  </td>

</tr>



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-toconcept"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.
*/
define function ToConcept(concept FHIR.CodeableConcept):
    if concept is null then
        null
    else
        System.Concept {
            codes: concept.coding C return ToCode(C),
            display: concept.text.value
        }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tocode"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.
*/
define function ToCode(coding FHIR.Coding):
    if coding is null then
        null
    else
        System.Code {
          code: coding.code.value,
          system: coding.system.value,
          version: coding.version.value,
          display: coding.display.value
        }</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-todatetime"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToDateTime(value dateTime): value.value</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value ServiceRequestStatus): value.value</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value ServiceRequestIntent): value.value</code></pre>
  </td>

</tr>



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-todatetime"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToDateTime(value instant): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-todate"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToDate(value date): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-toquantity"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity) 
value to a CQL Quantity
@comment: If the given quantity has a comparator specified, a runtime error is raised. If the given quantity
has a system other than UCUM (i.e. `http://unitsofmeasure.org`) or CQL calendar units (i.e. `http://hl7.org/fhirpath/CodeSystem/calendar-units`)
an error is raised. For UCUM to calendar units, the `ToCalendarUnit` function is used.
@seealso: ToCalendarUnit
*/
define function ToQuantity(quantity FHIR.Quantity):
    case
        when quantity is null then null
        when quantity.value is null then null
        when quantity.comparator is not null then
            Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')
        when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'
              or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then
            System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }
        else
            Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' &amp; quantity.unit.value &amp; ' (' &amp; quantity.system.value &amp; '|' &amp; quantity.code.value &amp; ')')
    end</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tocalendarunit"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Converts a UCUM definite duration unit to a CQL calendar duration
unit using conversions specified in the [quantities](https://cql.hl7.org/02-authorsguide.html#quantities) 
topic of the CQL specification.
@comment: Note that for durations above days (or weeks), the conversion is understood to be approximate
*/
define function ToCalendarUnit(unit System.String):
    case unit
        when 'ms' then 'millisecond'
        when 's' then 'second'
        when 'min' then 'minute'
        when 'h' then 'hour'
        when 'd' then 'day'
        when 'wk' then 'week'
        when 'mo' then 'month'
        when 'a' then 'year'
        else unit
    end</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value ObservationStatus): value.value</code></pre>
  </td>

</tr>



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value ClaimStatus): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value Use): value.value</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        




        
        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CQMCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cqmcommon-inpatient-encounter"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Inpatient Encounter&quot;:
  [Encounter: &quot;Encounter Inpatient&quot;] EncounterInpatient
    where EncounterInpatient.status = 'finished'
      and EncounterInpatient.period ends during day of &quot;Measurement Period&quot;</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CQMCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cqmcommon-getlocation"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns the Location resource specified by the given reference.
*/
define fluent function getLocation(reference Reference):
  singleton from (
    [Location] L where reference.references(L)
  )</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CQMCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cqmcommon-hasprincipaldiagnosisof"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
 @description: Returns the condition that is specified as the principal diagnosis for the encounter and has a code in the given valueSet.
 @comment: See the QICore 6 Authoring Patterns discussion on [Principal Diagnosis and Present on Admission](https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns-QICore-v6.0.0#conditions-present-on-admission-and-principal-diagnoses) for more information
 */
 define fluent function hasPrincipalDiagnosisOf(encounter Encounter, valueSet System.ValueSet):
   (encounter.principalDiagnosis()) PD
     return PD.diagnosis in valueSet
       or PD.diagnosis.getCondition().code in valueSet</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CQMCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cqmcommon-principaldiagnosis"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns the claim diagnosis element that is specified as the principal diagnosis for the encounter
 @comment: See the QICore 6 Authoring Patterns discussion on [Principal Diagnosis and Present on Admission](https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns-QICore-v6.0.0#conditions-present-on-admission-and-principal-diagnoses) for more information
*/
define fluent function principalDiagnosis(encounter Encounter):
singleton from (
     (encounter.claimDiagnosis()) CD
       where CD.type.includesCode(&quot;Principal Diagnosis&quot;)
   )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CQMCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cqmcommon-claimdiagnosis"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns the claim diagnosis elements for the given encounter
@comment: See the QICore 6 Authoring Patterns discussion on [Principal Diagnosis and Present on Admission](https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns-QICore-v6.0.0#conditions-present-on-admission-and-principal-diagnoses) for more information
*/
define fluent function claimDiagnosis(encounter Encounter):
  encounter E
    let 
      claim: ([Claim] C where C.status = 'active' and C.use = 'claim' and exists (C.item I where I.encounter.references(E))),
      claimItem: (claim.item I where I.encounter.references(E))
    return claim.diagnosis D where D.sequence in claimItem.diagnosisSequence</code></pre>
  </td>

</tr>



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> CQMCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cqmcommon-getcondition"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns the Condition resource for the given reference
*/
define fluent function getCondition(reference Reference):
  singleton from (([ConditionEncounterDiagnosis] union [ConditionProblemsHealthConcerns]) C where reference.references(C.id))</code></pre>
  </td>

</tr>



        



        



        



        



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhircommon-ext"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns the single extension (if present) on the given resource with the specified url.
@comment: This function uses singleton from to ensure that a run-time exception is thrown if there
is more than one extension on the given resource with the specified url.
*/
define fluent function ext(domainResource DomainResource, url String):
  singleton from domainResource.exts(url)</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhircommon-exts"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns any extensions defined on the given resource with the specified url
*/
define fluent function exts(domainResource DomainResource, url String):
  domainResource.extension E
    where E.url = url
    return E</code></pre>
  </td>

</tr>



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhircommon-references"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns true if the given reference is to the given resource
@comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.
NOTE: This function assumes resources from the same source server.
*/
define fluent function references(reference FHIR.Reference, resource FHIR.Resource):
  resource.id = Last(Split(reference.reference, '/'))</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhircommon-tointerval"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
@comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range types
to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible
representations for timing-valued elements in FHIR, allowing this function to be used across any resource.

The input can be provided as a dateTime, Period, Timing, instant, string, Age, or Range.
The intent of this function is to provide a clear and concise mechanism to treat single
elements that have multiple possible representations as intervals so that logic doesn't have to account
for the variability. More complex calculations (such as medication request period or dispense period
calculation) need specific guidance and consideration. That guidance may make use of this function, but
the focus of this function is on single element calculations where the semantics are unambiguous.
If the input is a dateTime, the result a DateTime Interval beginning and ending on that dateTime.
If the input is a Period, the result is a DateTime Interval.
If the input is a Timing, an error is raised indicating a single interval cannot be computed from a Timing.
If the input is an instant, the result is a DateTime Interval beginning and ending on that instant.
If the input is a string, an error is raised indicating a single interval cannot be computed from a string.
If the input is an Age, the result is a DateTime Interval beginning when the patient was the given Age,
and ending immediately prior to when the patient was the given Age plus one year.
If the input is a Range, the result is a DateTime Interval beginning when the patient was the Age given
by the low end of the Range, and ending immediately prior to when the patient was the Age given by the
high end of the Range plus one year.

NOTE: Due to the
complexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used
with a Timing or String.
*/
define fluent function toInterval(choice Choice&lt;FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range&gt;):
  case
    when choice is FHIR.dateTime then
      Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]
    when choice is FHIR.Period then
      FHIRHelpers.ToInterval(choice as FHIR.Period)
    when choice is FHIR.instant then
      Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]
    when choice is FHIR.Age then
      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),
        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)
    when choice is FHIR.Range then
      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),
        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)
    when choice is FHIR.Timing then
      Message(null as Interval&lt;DateTime&gt;, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported')
    when choice is FHIR.string then
      Message(null as Interval&lt;DateTime&gt;, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')
    else
      null as Interval&lt;DateTime&gt;
  end</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhircommon-references"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns true if any of the given references are to the given resource
@comment: Returns true if the `id` element of the given resource exactly equals the tail of any of the given references.
NOTE: This function assumes resources from the same source server.
*/
define fluent function references(references List&lt;FHIR.Reference&gt;, resource FHIR.Resource):
  exists (references R where R.references(resource))</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhircommon-includescode"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns true if the given code is in the given codeList
@comment: Returns true if the `code` is equivalent to any of the codes in the given `codeList`, false otherwise.
*/
define fluent function includesCode(codeList List&lt;CodeableConcept&gt;, code Concept):
  exists (codeList C where C ~ code)</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhircommon-references"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns true if the given reference is to the given resourceId
@comment: Returns true if the `resourceId` parameter exactly equals the tail of the given reference.
NOTE: This function assumes resources from the same source server.
*/
define fluent function references(reference FHIR.Reference, resourceId String):
  resourceId = Last(Split(reference.reference, '/'))</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhircommon-ext"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns the single extension (if present) on the given element with the specified url.
@comment: This function uses singleton from to ensure that a run-time exception is thrown if there
is more than one extension on the given element with the specified url.
*/
define fluent function ext(element Element, url String):
  singleton from element.exts(url)</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhircommon-exts"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns any extensions defined on the given element with the specified url.
*/
define fluent function exts(element Element, url String):
  element.extension E
    where E.url = url
    return E</code></pre>
  </td>

</tr>



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> USCoreCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="uscorecommon-sex"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns the sex element as defined for the USCore patient profile
*/
define fluent function sex(patient Patient):
  patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-sex').value as FHIR.code</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> USCoreCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="uscorecommon-ethnicity"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function ethnicity(patient Patient):
  (patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity')) E
    return {
      ombCategory: E.ext('ombCategory').value as FHIR.Coding,
      detailed: (E.exts('detailed')) d return d.value as FHIR.Coding,
      text: E.ext('text').value as FHIR.string
    }</code></pre>
  </td>

</tr>



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> USCoreCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="uscorecommon-race"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function race(patient Patient):
  (patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-race')) E
    return {
      ombCategory: (E.exts('ombCategory')) o return o.value as FHIR.Coding,
      detailed: (E.exts('detailed')) d return d.value as FHIR.Coding,
      text: E.ext('text').value as FHIR.string
    }</code></pre>
  </td>

</tr>





  
  


  <tr>


<th colspan="2" scope="row" class="row-header"><a name="terminology"> </a>Terminology</th>


</tr>
  
  
  

 

 

 

 

 

 

 

 


<tr>
  
  
  

<th scope="row" class="row-header">Code System</th>


  
  <td class="content-container">
    
    <em>Description</em>: Code system SNOMEDCT
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://hl7.org/fhir/R4/codesystem-snomedct.html">SNOMED CT (all versions)</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://snomed.info/sct</tt>
    
  </td>
</tr>
 


<tr>
  
  
  

<th scope="row" class="row-header">Code System</th>


  
  <td class="content-container">
    
    <em>Description</em>: Code system RoleCode
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://terminology.hl7.org/7.1.0/CodeSystem-v3-RoleCode.html">RoleCode</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-RoleCode</tt>
    
  </td>
</tr>
 


<tr>
  
  
  

<th scope="row" class="row-header">Code System</th>


  
  <td class="content-container">
    
    <em>Description</em>: Code system Diagnosis Type
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://terminology.hl7.org/7.1.0/CodeSystem-ex-diagnosistype.html">Example Diagnosis Type Codes</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/ex-diagnosistype</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Emergency Department Evaluation and Management Visit
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.464.1003.101.12.1010/expansion">Emergency Department Evaluation and Management Visit</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1010</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Triage
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1046.279-20250212">Triage</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.279</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Emergency Department Location
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1046.284-20240418">Emergency Department Location</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.284</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Emergency Department Treatment Location
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1046.278-20250212">Emergency Department Treatment Location</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.278</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Encounter Inpatient
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion">Encounter Inpatient</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Decision to Admit to Hospital Inpatient
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.294/expansion">Decision to Admit to Hospital Inpatient</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.294</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Emergency Department Evaluation
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.163/expansion">Emergency Department Evaluation</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.163</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Admit Inpatient
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.164/expansion">Admit Inpatient</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.164</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Observation Services
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.143/expansion">Observation Services</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Mental Health Diagnosis without Substance Use Disorders
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1046.285-20240418">Mental Health Diagnosis without Substance Use Disorders</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.285</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Payer Type
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion">Payer Type</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591</tt>
    
  </td>
</tr>
 


  
  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Male (finding)
        <br/>
      
      <em>Code</em>: 248153007
      <br/>
      <em>System</em>: <tt>http://snomed.info/sct</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Female (finding)
        <br/>
      
      <em>Code</em>: 248152002
      <br/>
      <em>System</em>: <tt>http://snomed.info/sct</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Emergency room
        <br/>
      
      <em>Code</em>: ER
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-RoleCode</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Emergency trauma unit
        <br/>
      
      <em>Code</em>: ETU
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-RoleCode</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Patient left without being seen (finding)
        <br/>
      
      <em>Code</em>: 21541000119102
      <br/>
      <em>System</em>: <tt>http://snomed.info/sct</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Patient bed assigned (finding)
        <br/>
      
      <em>Code</em>: 5751000175101
      <br/>
      <em>System</em>: <tt>http://snomed.info/sct</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Principal Diagnosis
        <br/>
      
      <em>Code</em>: principal
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/ex-diagnosistype</tt>
    </td>
  </tr>

  
  


  <tr>


<th colspan="2" scope="row" class="row-header"><a name="dependencies"> </a>Dependencies</th>


</tr>
  
  
  


<tr>
  

<th scope="row" class="row-header">Dependency</th>


  <td class="content-container">
    
    <em>Description</em>: USQualityCore model information
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <code>https://madie.cms.gov/Library/USQualityCore-ModelInfo|0.1.0-cibuild</code>
    <br/>
    <em>Canonical URL</em>: <tt>https://madie.cms.gov/Library/USQualityCore-ModelInfo|0.1.0-cibuild</tt>
    
  </td>
</tr>
 


<tr>
  

<th scope="row" class="row-header">Dependency</th>


  <td class="content-container">
    
    <em>Description</em>: USCore model information
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://hl7.org/fhir/us/cql/2026May/Library-USCore-ModelInfo.html">http://hl7.org/fhir/us/cql/Library/USCore-ModelInfo|6.1.0-derived</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://hl7.org/fhir/us/cql/Library/USCore-ModelInfo|6.1.0-derived</tt>
    
  </td>
</tr>
 


<tr>
  

<th scope="row" class="row-header">Dependency</th>


  <td class="content-container">
    
    <em>Description</em>: FHIR model information
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://hl7.org/fhir/uv/cql/STU2/Library-FHIR-ModelInfo.html">http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1</tt>
    
  </td>
</tr>
 


<tr>
  

<th scope="row" class="row-header">Dependency</th>


  <td class="content-container">
    
    <em>Description</em>: Library SDE
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="Library-SupplementalDataElements.html">SupplementalDataElements</a> version: 6.1.000
    <br/>
    <em>Canonical URL</em>: <tt>https://madie.cms.gov/Library/SupplementalDataElements|6.1.000</tt>
    
  </td>
</tr>
 


<tr>
  

<th scope="row" class="row-header">Dependency</th>


  <td class="content-container">
    
    <em>Description</em>: Library FHIRHelpers
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://hl7.org/fhir/uv/cql/STU2/Library-FHIRHelpers.html">http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1</tt>
    
  </td>
</tr>
 


<tr>
  

<th scope="row" class="row-header">Dependency</th>


  <td class="content-container">
    
    <em>Description</em>: Library USCommon
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://hl7.org/fhir/us/cql/2026May/Library-USCoreCommon.html">http://hl7.org/fhir/us/cql/Library/USCoreCommon|2.0.0-ballot</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://hl7.org/fhir/us/cql/Library/USCoreCommon|2.0.0-ballot</tt>
    
  </td>
</tr>
 


<tr>
  

<th scope="row" class="row-header">Dependency</th>


  <td class="content-container">
    
    <em>Description</em>: Library FHIRCommon
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://hl7.org/fhir/uv/cql/STU2/Library-FHIRCommon.html">http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0</tt>
    
  </td>
</tr>
 


<tr>
  

<th scope="row" class="row-header">Dependency</th>


  <td class="content-container">
    
    <em>Description</em>: Library CQMCommon
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="Library-CQMCommon.html">CQMCommon</a> version: 5.1.000
    <br/>
    <em>Canonical URL</em>: <tt>https://madie.cms.gov/Library/CQMCommon|5.1.000</tt>
    
  </td>
</tr>
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


  
  






  <tr>


<th colspan="2" scope="row" class="row-header"><a name="data-requirements"> </a>Data Requirements</th>


</tr>
  
  
  
<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Patient
    <br/>
  
    <em>Profile(s)</em>: 
  
    <code>http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-patient</code>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: ombCategory, detailed, text
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, period, status, location, location.type, hospitalization, hospitalization.dischargeDisposition, diagnosis, diagnosis.code
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1046.279-20250212">Triage</a>
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, period, status, location, location.type, hospitalization, hospitalization.dischargeDisposition, diagnosis, diagnosis.code
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.464.1003.101.12.1010/expansion">Emergency Department Evaluation and Management Visit</a>
    <br/> 
  
  
  
  
    <span class="tab-one"><em>Path</em>: status</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      [not stated]: finished (finished)
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: period, location, location.type, hospitalization, hospitalization.dischargeDisposition, type, diagnosis, diagnosis.code
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, period, location, location.type, hospitalization, hospitalization.dischargeDisposition, diagnosis, diagnosis.code
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion">Encounter Inpatient</a>
    <br/> 
  
  
  
  
    <span class="tab-one"><em>Path</em>: status</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      [not stated]: finished (finished)
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, period, status, location, location.type, hospitalization, hospitalization.dischargeDisposition, diagnosis, diagnosis.code
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.143/expansion">Observation Services</a>
    <br/> 
  
  
  
  
    <span class="tab-one"><em>Path</em>: status</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      [not stated]: finished (finished)
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Resource
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/resource.html">Resource</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: id
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Location
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/location.html">Location</a>
    <br/>        
  
   
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: ServiceRequest
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/servicerequest.html">ServiceRequest</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, authoredOn
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.294/expansion">Decision to Admit to Hospital Inpatient</a>
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: ServiceRequest
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/servicerequest.html">ServiceRequest</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, authoredOn, intent
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.294/expansion">Decision to Admit to Hospital Inpatient</a>
    <br/> 
  
  
  
  
    <span class="tab-one"><em>Path</em>: intent</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      [not stated]: order (order)
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: ServiceRequest
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/servicerequest.html">ServiceRequest</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, authoredOn
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion">Encounter Inpatient</a>
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: ServiceRequest
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/servicerequest.html">ServiceRequest</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, authoredOn
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      <a href="http://snomed.info/id/5751000175101">SNOMED CT: 5751000175101</a> (Patient bed assigned (finding))
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <code>http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-observation-clinical-result</code>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.163/expansion">Emergency Department Evaluation</a>
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <code>http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-simple-observation</code>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, value
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.163/expansion">Emergency Department Evaluation</a>
    <br/> 
  
  
  
  
    <span class="tab-one"><em>Path</em>: value</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.164/expansion">Admit Inpatient</a>
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Patient
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/patient.html">Patient</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: birthDate
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Claim
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/claim.html">Claim</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: status, use, item
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: status</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      [not stated]: active (active)
      
    
    </span>
    <br/>
  
  
  
    <span class="tab-one"><em>Path</em>: use</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      [not stated]: claim (claim)
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Condition
    <br/>
  
    <em>Profile(s)</em>: 
  
    <code>http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-condition-encounter-diagnosis</code>
    <br/>        
  
   
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Condition
    <br/>
  
    <em>Profile(s)</em>: 
  
    <code>http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-condition-problems-health-concerns</code>
    <br/>        
  
   
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Coverage
    <br/>
  
    <em>Profile(s)</em>: 
  
    <code>http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-coverage</code>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, period
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion">Payer Type</a>
    <br/> 
  
  
  
   
  </td>
</tr>

  
  


  <tr>


<th colspan="2" scope="row" class="row-header"><a name="parameters"> </a>Parameters</th>


</tr>
  
  
  <tr>
  

<th scope="row" class="row-header"/>


  <td class="content-container">
    <table>
      <thead>
        <tr>
          <td><em>Name</em></td>
          <td><em>Use</em></td>
          <td><em>Card.</em></td>
          <td><em>Type</em></td>
          <td><em>Documentation</em></td>
        </tr>
      </thead>
      <tbody>
      
        <tr>
          <td>Measurement Period</td>
          <td>In</td>
          <td>0..1</td>
          <td>Period</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Sex</td>
          <td>Out</td>
          <td>0..1</td>
          <td>Coding</td>
          <td/>
        </tr>
      
        <tr>
          <td>Numerator</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Encounter</td>
          <td/>
        </tr>
      
        <tr>
          <td>Stratification 4</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Encounter</td>
          <td/>
        </tr>
      
        <tr>
          <td>Stratification 3</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Encounter</td>
          <td/>
        </tr>
      
        <tr>
          <td>Stratification 2</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Encounter</td>
          <td/>
        </tr>
      
        <tr>
          <td>Stratification 1</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Encounter</td>
          <td/>
        </tr>
      
        <tr>
          <td>Denominator</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Encounter</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Payer</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Resource</td>
          <td/>
        </tr>
      
        <tr>
          <td>Initial Population</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Encounter</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Ethnicity</td>
          <td>Out</td>
          <td>0..1</td>
          <td>Resource</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Race</td>
          <td>Out</td>
          <td>0..1</td>
          <td>Resource</td>
          <td/>
        </tr>
      
      </tbody>
    </table>
  </td>
</tr>

  
  

<tr>
  <th colspan="2" scope="row" class="row-header">Generated using version 0.5.4 of the sample-content-ig Liquid templates</th>
</tr>

    </tbody>
  </table>
</div>
  </text>
  <contained>
    <Library>
      <id value="effective-data-requirements"/>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://snomed.info/sct"/>
          <code value="248153007"/>
          <display value="Male (finding)"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://snomed.info/sct"/>
          <code value="248152002"/>
          <display value="Female (finding)"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://terminology.hl7.org/CodeSystem/v3-RoleCode"/>
          <code value="ER"/>
          <display value="Emergency room"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://terminology.hl7.org/CodeSystem/v3-RoleCode"/>
          <code value="ETU"/>
          <display value="Emergency trauma unit"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://snomed.info/sct"/>
          <code value="21541000119102"/>
          <display value="Patient left without being seen (finding)"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://snomed.info/sct"/>
          <code value="5751000175101"/>
          <display value="Patient bed assigned (finding)"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://terminology.hl7.org/CodeSystem/ex-diagnosistype"/>
          <code value="principal"/>
          <display value="Principal Diagnosis"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SupplementalDataElements"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Sex"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;SDE Sex&quot;:&#xA;  case&#xA;    when Patient.sex() = '248153007' then &quot;Male (finding)&quot;&#xA;    when Patient.sex() = '248152002' then &quot;Female (finding)&quot;&#xA;    else null&#xA;  end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="0"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Sex"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;SDE Sex&quot;:&#xA;  SDE.&quot;SDE Sex&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="1"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="ED Evaluation and Management"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;ED Evaluation and Management&quot;:&#xA;  [Encounter: &quot;Emergency Department Evaluation and Management Visit&quot;] EDEvalManagementVisit&#xA;    where EDEvalManagementVisit.period ends during day of &quot;Measurement Period&quot;&#xA;      and EDEvalManagementVisit.status = 'finished'"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="2"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="ED Triage"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;ED Triage&quot;:&#xA;  ( [Encounter: &quot;Triage&quot;] EDTriage&#xA;      where EDTriage.period ends during day of &quot;Measurement Period&quot;&#xA;        and EDTriage.status in { 'finished', 'triaged' }&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="3"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="ED Triage Excluding Those Prior To ED Encounters"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;ED Triage Excluding Those Prior To ED Encounters&quot;:&#xA;  &quot;ED Triage&quot; EDTriageinMP&#xA;    where not exists ( &quot;ED Evaluation and Management&quot; EDEvalManagementInMP&#xA;        where ( ( EDTriageinMP.period overlaps before EDEvalManagementInMP.period )&#xA;            or ( EDTriageinMP.period during EDEvalManagementInMP.period )&#xA;            or ( EDEvalManagementInMP.period during EDTriageinMP.period )&#xA;            or ( EDTriageinMP.period ends 120 minutes or less before start of EDEvalManagementInMP.period )&#xA;        )&#xA;    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="4"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Initial Population"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Initial Population&quot;:&#xA;  &quot;ED Evaluation and Management&quot;&#xA;    union &quot;ED Triage Excluding Those Prior To ED Encounters&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="5"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Denominator"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Denominator&quot;:&#xA;  &quot;Initial Population&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="6"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="ED Triage Before Evaluation Management"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;ED Triage Before Evaluation Management&quot;:&#xA;  &quot;ED Triage&quot; EDTriageinMP&#xA;    with &quot;Denominator&quot; EDEncounter&#xA;      such that ( ( EDTriageinMP.period overlaps before EDEncounter.period )&#xA;          or ( EDTriageinMP.period during EDEncounter.period )&#xA;          or ( EDEncounter.period during EDTriageinMP.period )&#xA;          or ( EDTriageinMP.period ends 120 minutes or less before start of EDEncounter.period )&#xA;      )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="7"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="ED Triage and Evaluation Management"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;ED Triage and Evaluation Management&quot;:&#xA;  &quot;Denominator&quot;&#xA;    union &quot;ED Triage Before Evaluation Management&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="8"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Time to Treatment Room Greater Than 60 Minutes"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Time to Treatment Room Greater Than 60 Minutes&quot;:&#xA;  &quot;ED Evaluation and Management&quot; EDEvalManagementInMP&#xA;    where EDEvalManagementInMP.edArrivalTime ( ) 61 minutes or more before EDEvalManagementInMP.edTreatmentRoomTimeArrivalTime ( )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="9"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="ED Arrival Left Without Being Seen"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;ED Arrival Left Without Being Seen&quot;:&#xA;  &quot;Denominator&quot; EDEncounter&#xA;    where EDEncounter.hospitalization.dischargeDisposition ~ &quot;Patient left without being seen (finding)&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="10"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CQMCommon"/>
        </extension>
        <extension url="name">
          <valueString value="Inpatient Encounter"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Inpatient Encounter&quot;:&#xA;  [Encounter: &quot;Encounter Inpatient&quot;] EncounterInpatient&#xA;    where EncounterInpatient.status = 'finished'&#xA;      and EncounterInpatient.period ends during day of &quot;Measurement Period&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="11"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="ED To Inpatient Order"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;ED To Inpatient Order&quot;:&#xA;  [ServiceRequest: &quot;Decision to Admit to Hospital Inpatient&quot;] AdmitIPOrder&#xA;    where AdmitIPOrder.status in { 'active', 'completed' }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="12"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Decision to Admit Encounter Order"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Decision to Admit Encounter Order&quot;:&#xA;  &quot;Denominator&quot; EDEncounter&#xA;    with CQMCommon.&quot;Inpatient Encounter&quot; EncounterInpatient&#xA;      such that EncounterInpatient.admitDecisionUsingEncounterOrder ( ) 241 minutes or more before EDEncounter.edDepartureTime ( )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="13"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Assessment In ED"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Assessment In ED&quot;:&#xA;  [&quot;ObservationClinicalResult&quot;: &quot;Emergency Department Evaluation&quot;]&#xA;    union [&quot;SimpleObservation&quot;: &quot;Emergency Department Evaluation&quot;] ObsInED&#xA;      where ObsInED.value as CodeableConcept in &quot;Admit Inpatient&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="14"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Decision to Admit Using Assessment"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Decision to Admit Using Assessment&quot;:&#xA;  &quot;Denominator&quot; EDEncounter&#xA;    with CQMCommon.&quot;Inpatient Encounter&quot; EncounterInpatient&#xA;      such that EncounterInpatient.admitDecisionUsingAssessment ( ) 241 minutes or more before EDEncounter.edDepartureTime ( )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="15"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Inpatient Or Bed Assignment Encounter Order"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Inpatient Or Bed Assignment Encounter Order&quot;:&#xA;  ( [ServiceRequest: &quot;Encounter Inpatient&quot;]&#xA;    union [ServiceRequest: &quot;Patient bed assigned (finding)&quot;] ) IPRequest&#xA;    where IPRequest.status in { 'active', 'completed' }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="16"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Time of Admit Order Or Bed Assignment to Departure Greater Than 241 Minutes"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Time of Admit Order Or Bed Assignment to Departure Greater Than 241 Minutes&quot;:&#xA;  &quot;Denominator&quot; EDEncounter&#xA;    with CQMCommon.&quot;Inpatient Encounter&quot; InpatientEncounter&#xA;      such that InpatientEncounter.admitInpatientOrBedAssignmentEncounterOrder ( ) 241 minutes or more before EDEncounter.edDepartureTime ( )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="17"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Admitted to Inpatient 241 Minutes or More Before Departure"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Admitted to Inpatient 241 Minutes or More Before Departure&quot;:&#xA;  &quot;Denominator&quot; EDEncounter&#xA;    with CQMCommon.&quot;Inpatient Encounter&quot; Inpatient&#xA;      such that Inpatient.holdingInEDAfterAdmission ( ) 241 minutes or more before EDEncounter.edDepartureTime ( )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="18"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Boarded Time Greater Than 240 Minutes"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Boarded Time Greater Than 240 Minutes&quot;:&#xA;  &quot;Decision to Admit Encounter Order&quot;&#xA;    union &quot;Decision to Admit Using Assessment&quot;&#xA;    union &quot;Time of Admit Order Or Bed Assignment to Departure Greater Than 241 Minutes&quot;&#xA;    union &quot;Admitted to Inpatient 241 Minutes or More Before Departure&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="19"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="ED Observation Status"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;ED Observation Status&quot;:&#xA;  [Encounter: &quot;Observation Services&quot;] EDObsEncounter&#xA;    with &quot;Denominator&quot; EDEncounter&#xA;      such that EDObsEncounter.period during EDEncounter.period&#xA;        and EDObsEncounter.status = 'finished'"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="20"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Boarded Time Greater Than 240 Minutes and No Observation Stay"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Boarded Time Greater Than 240 Minutes and No Observation Stay&quot;:&#xA;  ( &quot;Boarded Time Greater Than 240 Minutes&quot; Boarding&#xA;      where not exists ( &quot;ED Observation Status&quot; EDObs&#xA;          where ( EDObs.period during Boarding.period )&#xA;      )&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="21"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="ED Length of Stay Greater Than 480 Minutes"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;ED Length of Stay Greater Than 480 Minutes&quot;:&#xA;  &quot;Denominator&quot; EDEncounter&#xA;    where EDEncounter.edArrivalTime ( ) 481 minutes or more before EDEncounter.edDepartureTime ( )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="22"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="ED Length of Stay Greater Than 480 Minutes and No Observation Stay"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;ED Length of Stay Greater Than 480 Minutes and No Observation Stay&quot;:&#xA;  ( &quot;ED Length of Stay Greater Than 480 Minutes&quot; EDStay&#xA;      where not exists ( &quot;ED Observation Status&quot; EDObs&#xA;          where ( EDObs.period during EDStay.period )&#xA;      )&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="23"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Numerator"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Numerator&quot;:&#xA;  &quot;Time to Treatment Room Greater Than 60 Minutes&quot;&#xA;    union &quot;ED Arrival Left Without Being Seen&quot;&#xA;    union &quot;Boarded Time Greater Than 240 Minutes and No Observation Stay&quot;&#xA;    union &quot;ED Length of Stay Greater Than 480 Minutes and No Observation Stay&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="24"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="ED Encounter or Triage of Patients 18 Years and Older"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;ED Encounter or Triage of Patients 18 Years and Older&quot;:&#xA;  &quot;Denominator&quot; EDEncounter&#xA;    where AgeInYearsAt(date from start of &quot;Measurement Period&quot;) &gt;= 18"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="25"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Adult With Mental Health Diagnosis"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Adult With Mental Health Diagnosis&quot;:&#xA;  ( &quot;ED Encounter or Triage of Patients 18 Years and Older&quot; AdultEDEncounters&#xA;      where ( AdultEDEncounters.hasPrincipalDiagnosisOf ( &quot;Mental Health Diagnosis without Substance Use Disorders&quot; ) )&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="26"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Stratification 4"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Stratification 4&quot;:&#xA;  &quot;Adult With Mental Health Diagnosis&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="27"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="ED Encounter or Triage of Patients Less Than 18 Years"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;ED Encounter or Triage of Patients Less Than 18 Years&quot;:&#xA;  &quot;Denominator&quot; EDEncounter&#xA;    where AgeInYearsAt(date from start of &quot;Measurement Period&quot;) &lt; 18"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="28"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Pediatric With Mental Health Diagnosis"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Pediatric With Mental Health Diagnosis&quot;:&#xA;  ( &quot;ED Encounter or Triage of Patients Less Than 18 Years&quot; PediatricEDEncounters&#xA;      where ( PediatricEDEncounters.hasPrincipalDiagnosisOf ( &quot;Mental Health Diagnosis without Substance Use Disorders&quot; ) )&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="29"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Stratification 3"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Stratification 3&quot;:&#xA;  &quot;Pediatric With Mental Health Diagnosis&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="30"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Adult With No Mental Health Diagnosis"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Adult With No Mental Health Diagnosis&quot;:&#xA;  ( &quot;ED Encounter or Triage of Patients 18 Years and Older&quot; AdultEDEncounters&#xA;      where not ( AdultEDEncounters.hasPrincipalDiagnosisOf ( &quot;Mental Health Diagnosis without Substance Use Disorders&quot; ) )&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="31"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Stratification 2"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Stratification 2&quot;:&#xA;  &quot;Adult With No Mental Health Diagnosis&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="32"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Pediatric With No Mental Health Diagnosis"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Pediatric With No Mental Health Diagnosis&quot;:&#xA;  ( &quot;ED Encounter or Triage of Patients Less Than 18 Years&quot; PediatricEDEncounters&#xA;      where not ( PediatricEDEncounters.hasPrincipalDiagnosisOf ( &quot;Mental Health Diagnosis without Substance Use Disorders&quot; ) )&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="33"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="Stratification 1"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Stratification 1&quot;:&#xA;  &quot;Pediatric With No Mental Health Diagnosis&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="34"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SupplementalDataElements"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Payer"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;SDE Payer&quot;:&#xA;  [USQualityCore.Coverage: type in &quot;Payer Type&quot;] Payer&#xA;    return {&#xA;      code: Payer.type,&#xA;      period: Payer.period&#xA;    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="35"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Payer"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;SDE Payer&quot;:&#xA;  SDE.&quot;SDE Payer&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="36"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SupplementalDataElements"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Ethnicity"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;SDE Ethnicity&quot;:&#xA;  (Patient.ethnicity()) E&#xA;    return Tuple {&#xA;      codes: { E.ombCategory } union E.detailed,&#xA;      display: E.text&#xA;    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="37"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Ethnicity"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;SDE Ethnicity&quot;:&#xA;  SDE.&quot;SDE Ethnicity&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="38"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SupplementalDataElements"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Race"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;SDE Race&quot;:&#xA;  (Patient.race()) R&#xA;    return Tuple {&#xA;      codes: R.ombCategory union R.detailed,&#xA;      display: R.text&#xA;    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="39"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Race"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;SDE Race&quot;:&#xA;  SDE.&quot;SDE Race&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="40"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value string): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="41"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="USCoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="sex"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Returns the sex element as defined for the USCore patient profile&#xA;*/&#xA;define fluent function sex(patient Patient):&#xA;  patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-sex').value as FHIR.code"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="42"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="ext"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Returns the single extension (if present) on the given resource with the specified url.&#xA;@comment: This function uses singleton from to ensure that a run-time exception is thrown if there&#xA;is more than one extension on the given resource with the specified url.&#xA;*/&#xA;define fluent function ext(domainResource DomainResource, url String):&#xA;  singleton from domainResource.exts(url)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="43"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="exts"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Returns any extensions defined on the given resource with the specified url&#xA;*/&#xA;define fluent function exts(domainResource DomainResource, url String):&#xA;  domainResource.extension E&#xA;    where E.url = url&#xA;    return E"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="44"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value uri): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="45"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToInterval"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)&#xA;value to a CQL DateTime Interval&#xA;@comment: If the start value of the given period is unspecified, the starting&#xA;boundary of the resulting interval will be open (meaning the start of the interval&#xA;is unknown, as opposed to interpreted as the beginning of time).&#xA;*/&#xA;define function ToInterval(period FHIR.Period):&#xA;    if period is null then&#xA;        null&#xA;    else&#xA;        if period.&quot;start&quot; is null then&#xA;            Interval(period.&quot;start&quot;.value, period.&quot;end&quot;.value]&#xA;        else&#xA;            Interval[period.&quot;start&quot;.value, period.&quot;end&quot;.value]"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="46"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value EncounterStatus): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="47"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="edArrivalTime"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function &quot;edArrivalTime&quot;(EDEncounter Encounter):&#xA;  Last(&quot;ED Triage and Evaluation Management&quot;.location Location&#xA;      where exists((Location.location.getLocation().type) LocationType&#xA;          where(LocationType in &quot;Emergency Department Location&quot;&#xA;              or LocationType ~ &quot;Emergency room&quot;&#xA;              or LocationType ~ &quot;Emergency trauma unit&quot;&#xA;          )&#xA;      )&#xA;        and start of Location.period is not null&#xA;        and(Location.period ends 120 minutes or less before start of EDEncounter.period&#xA;            or Location.period overlaps before EDEncounter.period&#xA;            or EDEncounter.period overlaps before Location.period&#xA;            or Location.period starts same as start of EDEncounter.period&#xA;        )&#xA;      return start of Location.period&#xA;      sort ascending&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="48"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CQMCommon"/>
        </extension>
        <extension url="name">
          <valueString value="getLocation"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Returns the Location resource specified by the given reference.&#xA;*/&#xA;define fluent function getLocation(reference Reference):&#xA;  singleton from (&#xA;    [Location] L where reference.references(L)&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="49"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="references"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Returns true if the given reference is to the given resource&#xA;@comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.&#xA;NOTE: This function assumes resources from the same source server.&#xA;*/&#xA;define fluent function references(reference FHIR.Reference, resource FHIR.Resource):&#xA;  resource.id = Last(Split(reference.reference, '/'))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="50"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToConcept"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.&#xA;*/&#xA;define function ToConcept(concept FHIR.CodeableConcept):&#xA;    if concept is null then&#xA;        null&#xA;    else&#xA;        System.Concept {&#xA;            codes: concept.coding C return ToCode(C),&#xA;            display: concept.text.value&#xA;        }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="51"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToCode"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.&#xA;*/&#xA;define function ToCode(coding FHIR.Coding):&#xA;    if coding is null then&#xA;        null&#xA;    else&#xA;        System.Code {&#xA;          code: coding.code.value,&#xA;          system: coding.system.value,&#xA;          version: coding.version.value,&#xA;          display: coding.display.value&#xA;        }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="52"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="edTreatmentRoomTimeArrivalTime"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function &quot;edTreatmentRoomTimeArrivalTime&quot;(EDEncounter Encounter):&#xA;  First(EDEncounter.location Location&#xA;      where Location.location.getLocation().type in &quot;Emergency Department Treatment Location&quot;&#xA;        and start of Location.period is not null&#xA;      return start of Location.period&#xA;      sort ascending&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="53"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToDateTime"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToDateTime(value dateTime): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="54"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="admitDecisionUsingEncounterOrder"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function &quot;admitDecisionUsingEncounterOrder&quot;(EncounterInpatient Encounter):&#xA;  Last(&quot;ED To Inpatient Order&quot; AdmitOrder&#xA;      let LastEDVisit: EncounterInpatient.lastEDEncounter()&#xA;      where AdmitOrder.authoredOn during LastEDVisit.period&#xA;        and AdmitOrder.intent ~ 'order'&#xA;      return AdmitOrder.authoredOn&#xA;      sort ascending&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="55"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value ServiceRequestStatus): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="56"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="lastEDEncounter"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function &quot;lastEDEncounter&quot;(EncounterInpatient Encounter):&#xA;  Last(&quot;ED Evaluation and Management&quot; EDEvalManagementInMP&#xA;      where EDEvalManagementInMP.period starts 1 day or less before or on start of EncounterInpatient.period&#xA;        and EDEvalManagementInMP.period starts before start of EncounterInpatient.period&#xA;        and EDEvalManagementInMP.period during day of &quot;Measurement Period&quot;&#xA;        and EDEvalManagementInMP.status = 'finished'&#xA;      sort by &#xA;      end of period ascending&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="57"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value ServiceRequestIntent): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="58"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="edDepartureTime"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function &quot;edDepartureTime&quot;(EDEncounter Encounter):&#xA;  Last(&quot;ED Triage and Evaluation Management&quot;.location Location&#xA;      where exists((Location.location.getLocation().type) LocationType&#xA;          where(LocationType in &quot;Emergency Department Location&quot;&#xA;              or LocationType ~ &quot;Emergency room&quot;&#xA;              or LocationType ~ &quot;Emergency trauma unit&quot;&#xA;          )&#xA;      )&#xA;        and &#xA;        end of Location.period is not null&#xA;        and(Location.period ends 120 minutes or less before start of EDEncounter.period&#xA;            or Location.period overlaps before EDEncounter.period&#xA;            or EDEncounter.period overlaps before Location.period&#xA;            or Location.period starts same as start of EDEncounter.period&#xA;        )&#xA;      return &#xA;      end of Location.period&#xA;      sort ascending&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="59"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="admitDecisionUsingAssessment"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function &quot;admitDecisionUsingAssessment&quot;(EncounterInpatient Encounter):&#xA;  Last(&quot;Assessment In ED&quot; EDEvaluation&#xA;      let LastEDVisit: EncounterInpatient.lastEDEncounter()&#xA;      where EDEvaluation.effective.toInterval() starts during LastEDVisit.period&#xA;        and EDEvaluation.status in { 'final', 'amended', 'corrected' }&#xA;      return start of EDEvaluation.effective.toInterval()&#xA;      sort ascending&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="60"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="toInterval"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval&#xA;@comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range types&#xA;to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible&#xA;representations for timing-valued elements in FHIR, allowing this function to be used across any resource.&#xA;&#xA;The input can be provided as a dateTime, Period, Timing, instant, string, Age, or Range.&#xA;The intent of this function is to provide a clear and concise mechanism to treat single&#xA;elements that have multiple possible representations as intervals so that logic doesn't have to account&#xA;for the variability. More complex calculations (such as medication request period or dispense period&#xA;calculation) need specific guidance and consideration. That guidance may make use of this function, but&#xA;the focus of this function is on single element calculations where the semantics are unambiguous.&#xA;If the input is a dateTime, the result a DateTime Interval beginning and ending on that dateTime.&#xA;If the input is a Period, the result is a DateTime Interval.&#xA;If the input is a Timing, an error is raised indicating a single interval cannot be computed from a Timing.&#xA;If the input is an instant, the result is a DateTime Interval beginning and ending on that instant.&#xA;If the input is a string, an error is raised indicating a single interval cannot be computed from a string.&#xA;If the input is an Age, the result is a DateTime Interval beginning when the patient was the given Age,&#xA;and ending immediately prior to when the patient was the given Age plus one year.&#xA;If the input is a Range, the result is a DateTime Interval beginning when the patient was the Age given&#xA;by the low end of the Range, and ending immediately prior to when the patient was the Age given by the&#xA;high end of the Range plus one year.&#xA;&#xA;NOTE: Due to the&#xA;complexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used&#xA;with a Timing or String.&#xA;*/&#xA;define fluent function toInterval(choice Choice&lt;FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range&gt;):&#xA;  case&#xA;    when choice is FHIR.dateTime then&#xA;      Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]&#xA;    when choice is FHIR.Period then&#xA;      FHIRHelpers.ToInterval(choice as FHIR.Period)&#xA;    when choice is FHIR.instant then&#xA;      Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]&#xA;    when choice is FHIR.Age then&#xA;      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),&#xA;        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)&#xA;    when choice is FHIR.Range then&#xA;      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),&#xA;        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)&#xA;    when choice is FHIR.Timing then&#xA;      Message(null as Interval&lt;DateTime&gt;, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported')&#xA;    when choice is FHIR.string then&#xA;      Message(null as Interval&lt;DateTime&gt;, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')&#xA;    else&#xA;      null as Interval&lt;DateTime&gt;&#xA;  end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="61"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToDateTime"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToDateTime(value instant): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="62"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToDate"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToDate(value date): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="63"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToQuantity"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity) &#xA;value to a CQL Quantity&#xA;@comment: If the given quantity has a comparator specified, a runtime error is raised. If the given quantity&#xA;has a system other than UCUM (i.e. `http://unitsofmeasure.org`) or CQL calendar units (i.e. `http://hl7.org/fhirpath/CodeSystem/calendar-units`)&#xA;an error is raised. For UCUM to calendar units, the `ToCalendarUnit` function is used.&#xA;@seealso: ToCalendarUnit&#xA;*/&#xA;define function ToQuantity(quantity FHIR.Quantity):&#xA;    case&#xA;        when quantity is null then null&#xA;        when quantity.value is null then null&#xA;        when quantity.comparator is not null then&#xA;            Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')&#xA;        when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'&#xA;              or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then&#xA;            System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }&#xA;        else&#xA;            Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' &amp; quantity.unit.value &amp; ' (' &amp; quantity.system.value &amp; '|' &amp; quantity.code.value &amp; ')')&#xA;    end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="64"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToCalendarUnit"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Converts a UCUM definite duration unit to a CQL calendar duration&#xA;unit using conversions specified in the [quantities](https://cql.hl7.org/02-authorsguide.html#quantities) &#xA;topic of the CQL specification.&#xA;@comment: Note that for durations above days (or weeks), the conversion is understood to be approximate&#xA;*/&#xA;define function ToCalendarUnit(unit System.String):&#xA;    case unit&#xA;        when 'ms' then 'millisecond'&#xA;        when 's' then 'second'&#xA;        when 'min' then 'minute'&#xA;        when 'h' then 'hour'&#xA;        when 'd' then 'day'&#xA;        when 'wk' then 'week'&#xA;        when 'mo' then 'month'&#xA;        when 'a' then 'year'&#xA;        else unit&#xA;    end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="65"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value ObservationStatus): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="66"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="admitInpatientOrBedAssignmentEncounterOrder"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function &quot;admitInpatientOrBedAssignmentEncounterOrder&quot;(Encounter Encounter):&#xA;  Last((&quot;Inpatient Or Bed Assignment Encounter Order&quot;) AdmitInpatientOrder&#xA;      let LastEDVisit: Encounter.lastEDEncounter()&#xA;      where AdmitInpatientOrder.authoredOn during LastEDVisit.period&#xA;      return AdmitInpatientOrder.authoredOn&#xA;      sort ascending&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="67"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1244FHIRECATHOQR"/>
        </extension>
        <extension url="name">
          <valueString value="holdingInEDAfterAdmission"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function holdingInEDAfterAdmission(InpatientEncounter Encounter):&#xA;  Last(CQMCommon.&quot;Inpatient Encounter&quot; AdmittedInpatient&#xA;      let LastEDVisit: InpatientEncounter.lastEDEncounter()&#xA;      where start of AdmittedInpatient.period during LastEDVisit.period&#xA;      return start of AdmittedInpatient.period&#xA;      sort ascending&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="68"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CQMCommon"/>
        </extension>
        <extension url="name">
          <valueString value="hasPrincipalDiagnosisOf"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA; @description: Returns the condition that is specified as the principal diagnosis for the encounter and has a code in the given valueSet.&#xA; @comment: See the QICore 6 Authoring Patterns discussion on [Principal Diagnosis and Present on Admission](https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns-QICore-v6.0.0#conditions-present-on-admission-and-principal-diagnoses) for more information&#xA; */&#xA; define fluent function hasPrincipalDiagnosisOf(encounter Encounter, valueSet System.ValueSet):&#xA;   (encounter.principalDiagnosis()) PD&#xA;     return PD.diagnosis in valueSet&#xA;       or PD.diagnosis.getCondition().code in valueSet"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="69"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CQMCommon"/>
        </extension>
        <extension url="name">
          <valueString value="principalDiagnosis"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Returns the claim diagnosis element that is specified as the principal diagnosis for the encounter&#xA; @comment: See the QICore 6 Authoring Patterns discussion on [Principal Diagnosis and Present on Admission](https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns-QICore-v6.0.0#conditions-present-on-admission-and-principal-diagnoses) for more information&#xA;*/&#xA;define fluent function principalDiagnosis(encounter Encounter):&#xA;singleton from (&#xA;     (encounter.claimDiagnosis()) CD&#xA;       where CD.type.includesCode(&quot;Principal Diagnosis&quot;)&#xA;   )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="70"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CQMCommon"/>
        </extension>
        <extension url="name">
          <valueString value="claimDiagnosis"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Returns the claim diagnosis elements for the given encounter&#xA;@comment: See the QICore 6 Authoring Patterns discussion on [Principal Diagnosis and Present on Admission](https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns-QICore-v6.0.0#conditions-present-on-admission-and-principal-diagnoses) for more information&#xA;*/&#xA;define fluent function claimDiagnosis(encounter Encounter):&#xA;  encounter E&#xA;    let &#xA;      claim: ([Claim] C where C.status = 'active' and C.use = 'claim' and exists (C.item I where I.encounter.references(E))),&#xA;      claimItem: (claim.item I where I.encounter.references(E))&#xA;    return claim.diagnosis D where D.sequence in claimItem.diagnosisSequence"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="71"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value ClaimStatus): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="72"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value Use): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="73"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="references"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Returns true if any of the given references are to the given resource&#xA;@comment: Returns true if the `id` element of the given resource exactly equals the tail of any of the given references.&#xA;NOTE: This function assumes resources from the same source server.&#xA;*/&#xA;define fluent function references(references List&lt;FHIR.Reference&gt;, resource FHIR.Resource):&#xA;  exists (references R where R.references(resource))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="74"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="includesCode"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Returns true if the given code is in the given codeList&#xA;@comment: Returns true if the `code` is equivalent to any of the codes in the given `codeList`, false otherwise.&#xA;*/&#xA;define fluent function includesCode(codeList List&lt;CodeableConcept&gt;, code Concept):&#xA;  exists (codeList C where C ~ code)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="75"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CQMCommon"/>
        </extension>
        <extension url="name">
          <valueString value="getCondition"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Returns the Condition resource for the given reference&#xA;*/&#xA;define fluent function getCondition(reference Reference):&#xA;  singleton from (([ConditionEncounterDiagnosis] union [ConditionProblemsHealthConcerns]) C where reference.references(C.id))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="76"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="references"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Returns true if the given reference is to the given resourceId&#xA;@comment: Returns true if the `resourceId` parameter exactly equals the tail of the given reference.&#xA;NOTE: This function assumes resources from the same source server.&#xA;*/&#xA;define fluent function references(reference FHIR.Reference, resourceId String):&#xA;  resourceId = Last(Split(reference.reference, '/'))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="77"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="USCoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="ethnicity"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function ethnicity(patient Patient):&#xA;  (patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity')) E&#xA;    return {&#xA;      ombCategory: E.ext('ombCategory').value as FHIR.Coding,&#xA;      detailed: (E.exts('detailed')) d return d.value as FHIR.Coding,&#xA;      text: E.ext('text').value as FHIR.string&#xA;    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="78"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="ext"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Returns the single extension (if present) on the given element with the specified url.&#xA;@comment: This function uses singleton from to ensure that a run-time exception is thrown if there&#xA;is more than one extension on the given element with the specified url.&#xA;*/&#xA;define fluent function ext(element Element, url String):&#xA;  singleton from element.exts(url)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="79"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="exts"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Returns any extensions defined on the given element with the specified url.&#xA;*/&#xA;define fluent function exts(element Element, url String):&#xA;  element.extension E&#xA;    where E.url = url&#xA;    return E"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="80"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="USCoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="race"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function race(patient Patient):&#xA;  (patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-race')) E&#xA;    return {&#xA;      ombCategory: (E.exts('ombCategory')) o return o.value as FHIR.Coding,&#xA;      detailed: (E.exts('detailed')) d return d.value as FHIR.Coding,&#xA;      text: E.ext('text').value as FHIR.string&#xA;    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="81"/>
        </extension>
      </extension>
      <name value="EffectiveDataRequirements"/>
      <status value="active"/>
      <type>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/library-type"/>
          <code value="module-definition"/>
        </coding>
      </type>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="USQualityCore model information"/>
        <resource value="https://madie.cms.gov/Library/USQualityCore-ModelInfo|0.1.0-cibuild"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="USCore model information"/>
        <resource value="http://hl7.org/fhir/us/cql/Library/USCore-ModelInfo|6.1.0-derived"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="FHIR model information"/>
        <resource value="http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library SDE"/>
        <resource value="https://madie.cms.gov/Library/SupplementalDataElements|6.1.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library FHIRHelpers"/>
        <resource value="http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library USCommon"/>
        <resource value="http://hl7.org/fhir/us/cql/Library/USCoreCommon|2.0.0-ballot"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library FHIRCommon"/>
        <resource value="http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library CQMCommon"/>
        <resource value="https://madie.cms.gov/Library/CQMCommon|5.1.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system SNOMEDCT"/>
        <resource value="http://snomed.info/sct"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system RoleCode"/>
        <resource value="http://terminology.hl7.org/CodeSystem/v3-RoleCode"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system Diagnosis Type"/>
        <resource value="http://terminology.hl7.org/CodeSystem/ex-diagnosistype"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Emergency Department Evaluation and Management Visit"/>
        <resource value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1010"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Triage"/>
        <resource value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.279"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Emergency Department Location"/>
        <resource value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.284"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Emergency Department Treatment Location"/>
        <resource value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.278"/>
      </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 Decision to Admit to Hospital Inpatient"/>
        <resource value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.294"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Emergency Department Evaluation"/>
        <resource value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.163"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Admit Inpatient"/>
        <resource value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.164"/>
      </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 Mental Health Diagnosis without Substance Use Disorders"/>
        <resource value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.285"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Payer Type"/>
        <resource value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"/>
      </relatedArtifact>
      <parameter>
        <name value="Measurement Period"/>
        <use value="in"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Period"/>
      </parameter>
      <parameter>
        <name value="SDE Sex"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Coding"/>
      </parameter>
      <parameter>
        <name value="Numerator"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="Stratification 4"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="Stratification 3"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="Stratification 2"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="Stratification 1"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="Denominator"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="SDE Payer"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Initial Population"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="SDE Ethnicity"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Race"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Resource"/>
      </parameter>
      <dataRequirement>
        <type value="Patient"/>
        <profile value="http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-patient"/>
        <mustSupport value="ombCategory"/>
        <mustSupport value="detailed"/>
        <mustSupport value="text"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="period"/>
        <mustSupport value="status"/>
        <mustSupport value="location"/>
        <mustSupport value="location.type"/>
        <mustSupport value="hospitalization"/>
        <mustSupport value="hospitalization.dischargeDisposition"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="diagnosis.code"/>
        <codeFilter>
          <path value="type"/>
          <valueSet value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.279"/>
        </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="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="period"/>
        <mustSupport value="status"/>
        <mustSupport value="location"/>
        <mustSupport value="location.type"/>
        <mustSupport value="hospitalization"/>
        <mustSupport value="hospitalization.dischargeDisposition"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="diagnosis.code"/>
        <codeFilter>
          <path value="type"/>
          <valueSet value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1010"/>
        </codeFilter>
        <codeFilter>
          <path value="status"/>
          <code>
            <code value="finished"/>
          </code>
        </codeFilter>
        <dateFilter>
          <path value="period"/>
          <valuePeriod>
            <extension url="http://hl7.org/fhir/StructureDefinition/cqf-expression">
              <valueExpression>
                <language value="text/cql-identifier"/>
                <expression value="Measurement Period"/>
              </valueExpression>
            </extension>
          </valuePeriod>
        </dateFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="period"/>
        <mustSupport value="location"/>
        <mustSupport value="location.type"/>
        <mustSupport value="hospitalization"/>
        <mustSupport value="hospitalization.dischargeDisposition"/>
        <mustSupport value="type"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="diagnosis.code"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <mustSupport value="location"/>
        <mustSupport value="location.type"/>
        <mustSupport value="hospitalization"/>
        <mustSupport value="hospitalization.dischargeDisposition"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="diagnosis.code"/>
        <codeFilter>
          <path value="type"/>
          <valueSet value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"/>
        </codeFilter>
        <codeFilter>
          <path value="status"/>
          <code>
            <code value="finished"/>
          </code>
        </codeFilter>
        <dateFilter>
          <path value="period"/>
          <valuePeriod>
            <extension url="http://hl7.org/fhir/StructureDefinition/cqf-expression">
              <valueExpression>
                <language value="text/cql-identifier"/>
                <expression value="Measurement Period"/>
              </valueExpression>
            </extension>
          </valuePeriod>
        </dateFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="period"/>
        <mustSupport value="status"/>
        <mustSupport value="location"/>
        <mustSupport value="location.type"/>
        <mustSupport value="hospitalization"/>
        <mustSupport value="hospitalization.dischargeDisposition"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="diagnosis.code"/>
        <codeFilter>
          <path value="type"/>
          <valueSet value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"/>
        </codeFilter>
        <codeFilter>
          <path value="status"/>
          <code>
            <code value="finished"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Resource"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Resource"/>
        <mustSupport value="id"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Location"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Location"/>
      </dataRequirement>
      <dataRequirement>
        <type value="ServiceRequest"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/ServiceRequest"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="authoredOn"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.294"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="ServiceRequest"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/ServiceRequest"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="authoredOn"/>
        <mustSupport value="intent"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.294"/>
        </codeFilter>
        <codeFilter>
          <path value="intent"/>
          <code>
            <code value="order"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="ServiceRequest"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/ServiceRequest"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="authoredOn"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="ServiceRequest"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/ServiceRequest"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="authoredOn"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://snomed.info/sct"/>
            <code value="5751000175101"/>
            <display value="Patient bed assigned (finding)"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-observation-clinical-result"/>
        <mustSupport value="code"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.163"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-simple-observation"/>
        <mustSupport value="code"/>
        <mustSupport value="value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.163"/>
        </codeFilter>
        <codeFilter>
          <path value="value"/>
          <valueSet value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.164"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Patient"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
        <mustSupport value="birthDate"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Claim"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Claim"/>
        <mustSupport value="status"/>
        <mustSupport value="use"/>
        <mustSupport value="item"/>
        <codeFilter>
          <path value="status"/>
          <code>
            <code value="active"/>
          </code>
        </codeFilter>
        <codeFilter>
          <path value="use"/>
          <code>
            <code value="claim"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-condition-encounter-diagnosis"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-condition-problems-health-concerns"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Coverage"/>
        <profile value="http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-coverage"/>
        <mustSupport value="type"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"/>
        </codeFilter>
      </dataRequirement>
    </Library>
  </contained>
  <extension id="supplementalDataGuidance" url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-supplementalDataGuidance">
    <extension url="guidance">
      <valueString value="For every patient evaluated by this measure also identify payer, race, ethnicity and sex"/>
    </extension>
    <extension url="usage">
      <valueCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
          <code value="supplemental-data"/>
          <display value="Supplemental Data"/>
        </coding>
        <text value="Supplemental Data Guidance"/>
      </valueCodeableConcept>
    </extension>
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/cqf-definitionTerm">
    <extension url="term">
      <valueString value="Boarding"/>
    </extension>
    <extension url="definition">
      <valueMarkdown value="The practice of holding inpatients in the emergency department after admission to the hospital because no hospital inpatient bed is available. (American College of Emergency Physicians \[ACEP\], 2018).&#xA;"/>
    </extension>
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/cqf-definitionTerm">
    <extension url="term">
      <valueString value="ED Observation"/>
    </extension>
    <extension url="definition">
      <valueMarkdown value="Observation stays are inclusive of both ED observation care in which a patient initially evaluated in the ED is cared for under observation status for an extended period of time in the ED or in a care area dedicated to observation care, as well as hospital observation stays in which a patient initially evaluated in the ED is cared for in observation status often in a hospital bed used for both inpatient or observation status admissions. Because these two forms of observation stays cannot be easily distinguished in a standardized fashion in existing electronic health record data ontologies, for the purposes of this quality measure all observation stays have been considered an exclusion from both numerator criteria 3 and 4.&#xA;"/>
    </extension>
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/cqf-definitionTerm">
    <extension url="term">
      <valueString value="Left Without Being Seen (LWBS)"/>
    </extension>
    <extension url="definition">
      <valueMarkdown value="Patients arrive to the ED for evaluation and leave before seeing a physician, advanced practice nurse, or physician's assistant.&#xA;"/>
    </extension>
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/cqf-definitionTerm">
    <extension url="term">
      <valueString value="Mental Health"/>
    </extension>
    <extension url="definition">
      <valueMarkdown value="Mental health generally refers to mental health diagnoses, life stressors and crises, and stress-related physical symptoms (American Medical Association \[AMA\], 2022). For this measure, mental health conditions will be defined separately from substance use disorders.&#xA;"/>
    </extension>
  </extension>
  <extension url="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-softwaresystem">
    <valueReference>
      <reference value="Device/cqf-tooling"/>
    </valueReference>
  </extension>
  <extension url="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements">
    <valueCanonical value="#effective-data-requirements"/>
  </extension>
  <url value="https://madie.cms.gov/Measure/CMS1244FHIRECATHOQR"/>
  <identifier>
    <use value="usual"/>
    <type>
      <coding>
        <system value="http://terminology.hl7.org/CodeSystem/artifact-identifier-type"/>
        <code value="short-name"/>
        <display value="Short Name"/>
      </coding>
    </type>
    <system value="https://madie.cms.gov/measure/shortName"/>
    <value value="CMS1244FHIR"/>
  </identifier>
  <identifier>
    <use value="official"/>
    <type>
      <coding>
        <system value="http://terminology.hl7.org/CodeSystem/artifact-identifier-type"/>
        <code value="version-independent"/>
        <display value="Version Independent"/>
      </coding>
    </type>
    <system value="urn:ietf:rfc:3986"/>
    <value value="urn:uuid:1d711504-ebec-41de-81b0-d1993115eac2"/>
  </identifier>
  <identifier>
    <use value="official"/>
    <type>
      <coding>
        <system value="http://terminology.hl7.org/CodeSystem/artifact-identifier-type"/>
        <code value="version-specific"/>
        <display value="Version Specific"/>
      </coding>
    </type>
    <system value="urn:ietf:rfc:3986"/>
    <value value="urn:uuid:43ee6832-7bc9-4247-a51c-6d8052f1a222"/>
  </identifier>
  <identifier>
    <use value="official"/>
    <type>
      <coding>
        <system value="http://terminology.hl7.org/CodeSystem/artifact-identifier-type"/>
        <code value="endorser"/>
        <display value="Endorser"/>
      </coding>
    </type>
    <system value="https://madie.cms.gov/measure/cbeId"/>
    <value value="4625e"/>
    <assigner>
      <display value="CMS Consensus Based Entity"/>
    </assigner>
  </identifier>
  <identifier>
    <use value="official"/>
    <type>
      <coding>
        <system value="http://terminology.hl7.org/CodeSystem/artifact-identifier-type"/>
        <code value="publisher"/>
        <display value="Publisher"/>
      </coding>
    </type>
    <system value="https://madie.cms.gov/measure/cmsId"/>
    <value value="1244FHIR"/>
    <assigner>
      <display value="CMS"/>
    </assigner>
  </identifier>
  <version value="1.0.000"/>
  <name value="CMS1244FHIRECATHOQR"/>
  <title value="Emergency Care Access \&amp; Timeliness (HOQR)FHIR&#xA;"/>
  <status value="active"/>
  <experimental value="false"/>
  <date value="2026-01-16T18:18:12+00:00"/>
  <publisher value="Centers for Medicare &amp;amp; Medicaid Services (CMS)"/>
  <contact>
    <telecom>
      <system value="url"/>
      <value value="https://www.cms.gov/"/>
    </telecom>
  </contact>
  <description value="This measure assesses the variation in access and timeliness of emergency care to support hospital quality improvement for patients requiring emergency care in an emergency department (ED). This measure is designed to align with incentives to promote improved care both in EDs and the broader health system to help identify where patients do not receive timely access to emergency care. Emergency care access and timeliness gaps are inclusive of several concepts pertaining to boarding and crowding in an ED, including significantly longer ED wait times, higher left without being seen rates, longer boarding times, and longer total length of stay in the ED.&#xA;"/>
  <usage value="Measure Score Calculation The measure score is first calculated at the individual ED level as the proportion of ED visits where any one of the four outcomes occurred, as defined by the numerator. Scores will be standardized z-scores by ED case volume strata (defined in ED visit volume bands of 20,000 visits). For CMS Certification Numbers (CCNs) with more than one ED, volume-adjusted z-scores are then combined as a weighted average for that CCN. A z-score of greater than zero means worse performance and less than zero means better performance, compared to like EDs. For the purposes of this measure, a decision to admit can be captured using any of the following: - an evaluation that results in a decision to admit - an order to admit to inpatient - an order for a bed assignment - start of inpatient admission This dQM is an episode-based measure. An episode is defined as an ED visit that ends during the measurement period. This FHIR-based measure has been derived from the QDM-based measure: CMS1244v1. Please refer to the HL7 QI-Core Implementation Guide (*++https://hl7.org/fhir/us/qicore/STU6/++* ) for more information on QI-Core and mapping recommendations from QDM to QI-Core STU 6 (*++https://hl7.org/fhir/us/qicore/STU6/qdm-to-qicore.html++*).&#xA;"/>
  <copyright value="Limited proprietary coding is contained in these specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets. This material contains SNOMED Clinical Terms(R) (SNOMED CT\[R\]) copyright 2004-2024 International Health Terminology Standards Development Organisation. All rights reserved. ICD-10 copyright 2024 World Health Organization. All Rights Reserved. CPT(R) contained in the Measure specifications is copyright 2004-2024 American Medical Association.&#xA;"/>
  <effectivePeriod>
    <start value="2027-01-01"/>
    <end value="2027-12-31"/>
  </effectivePeriod>
  <author>
    <name value="Acumen, LLC"/>
    <telecom>
      <system value="url"/>
      <value value="https://www.acumenllc.com/"/>
    </telecom>
  </author>
  <relatedArtifact>
    <type value="citation"/>
    <citation value="American College of Emergency Physicians. (2018). Definition of Boarded Patient. Policy Statements. https://www.acep.org/patient-care/policy-statements/definition-of-boarded-patient&#xA;"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation value="American Medical Association. (2022). What is Behavioral Health. https://www.ama-assn.org/delivering-care/public-health/what-behavioral-health&#xA;"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation value="Centers for Disease Control and Prevention. (2021). Emergency Department Visits. https://www.cdc.gov/nchs/fastats/emergency-department.htm&#xA;"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation value="eCQI Resource Center. (n.d). Median Admit Decision Time to ED Departure Time for Admitted Patients.&#xA;"/>
  </relatedArtifact>
  <library value="https://madie.cms.gov/Library/CMS1244FHIRECATHOQR"/>
  <disclaimer value="These performance specifications are not clinical guidelines, do not establish a standard of medical care, and have 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\].&#xA;"/>
  <rationale value="This measure aims to reduce patient harm and improve outcomes for patients requiring emergency care in an ED by addressing the variation in emergency care and measuring access and timeliness of emergency care. There are long-standing concerns about parameters that impact access and timeliness of care in the ED. Currently, there are no national metrics to assess the proportion of patients impacted by access and timeliness of ED care.&#xA;"/>
  <clinicalRecommendationStatement value="The goal of the Emergency Care Access \&amp; Timeliness (ECAT) measure is to assess and improve the safety of the 140 million ED visits that patients experience each year (Centers for Disease Control and Prevention \[CDC\], 2021). Limitations in access and timeliness of emergency care have been shown to be associated with harm, such as increases in mortality, delays in care, preventable errors, poor patient experience, and staff burnout. These quality limitations are also associated with increased costs of care. The ECAT measure under consideration is intended for use in CMS's Hospital Outpatient Quality Reporting (HOQR) program. The numerator is comprised of all ED visits with a quality gap in access as defined in the numerator criteria. Challenges related to emergency care access and timeliness have been increasing and have prompted public calls for action. This measure improves upon previous efforts as it measures the mean instead of the median to highlight the presence of extreme quality gaps, and captures several indicators of quality gaps by using multiple numerator criteria. Implementation of this measure, which captures multiple components of access and timeliness, can help identify facilities where patients do not receive timely access to emergency care as defined in the numerator criteria. This measure, therefore, could positively impact millions of patients who seek treatment in the ED and help address long-standing disparities in emergency care, including for patients with mental health diagnoses.&#xA;"/>
  <group id="Group_1">
    <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-scoring">
      <valueCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/measure-scoring"/>
          <code value="proportion"/>
          <display value="Proportion"/>
        </coding>
      </valueCodeableConcept>
    </extension>
    <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-populationBasis">
      <valueCode value="Encounter"/>
    </extension>
    <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-type">
      <valueCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/measure-type"/>
          <code value="outcome"/>
          <display value="Outcome"/>
        </coding>
      </valueCodeableConcept>
    </extension>
    <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-rateAggregation">
      <valueString value="None&#xA;"/>
    </extension>
    <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-improvementNotation">
      <valueCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/measure-improvement-notation"/>
          <code value="decrease"/>
          <display value="Decreased score indicates improvement"/>
        </coding>
      </valueCodeableConcept>
    </extension>
    <population id="InitialPopulation_1">
      <code>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="initial-population"/>
          <display value="Initial Population"/>
        </coding>
      </code>
      <description value="All ED visits that end during the measurement period for all patients&#xA;"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Initial Population"/>
      </criteria>
    </population>
    <population id="Denominator_1">
      <code>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="denominator"/>
          <display value="Denominator"/>
        </coding>
      </code>
      <description value="Equals Initial Population&#xA;"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Denominator"/>
      </criteria>
    </population>
    <population id="Numerator_1">
      <code>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="numerator"/>
          <display value="Numerator"/>
        </coding>
      </code>
      <description value="The numerator is comprised of ED visits meeting the denominator criteria and where the patient experiences any of the following quality gaps in access: 1. The patient waited longer than 60 minutes (1 hour) after arrival to the ED to be placed in a treatment room or dedicated treatment area that allows for audiovisual privacy during history-taking and physical examination, or 2. The patient left the ED without being evaluated, or 3. The patient boarded (time from Decision to Admit order to ED departure for admitted patients) in the ED for longer than 240 minutes (4 hours), or 4. The patient had an ED length of stay (LOS) (time from ED arrival to ED departure as defined by the ED departure timestamp indicating when the patient physically left the ED) of longer than 480 minutes (8 hours). ED encounters with ED observation stays are excluded from criteria #3 (boarding) and #4 (ED LOS). To clarify, patients who have a 'decision to admit' after an ED observation stay remain excluded from criteria #3 (boarded) calculations.&#xA;"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Numerator"/>
      </criteria>
    </population>
    <stratifier id="Stratification_1_1">
      <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-appliesTo">
        <valueCodeableConcept>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
            <code value="initial-population"/>
            <display value="Initial Population"/>
          </coding>
        </valueCodeableConcept>
      </extension>
      <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-appliesTo">
        <valueCodeableConcept>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
            <code value="denominator"/>
            <display value="Denominator"/>
          </coding>
        </valueCodeableConcept>
      </extension>
      <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-appliesTo">
        <valueCodeableConcept>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
            <code value="numerator"/>
            <display value="Numerator"/>
          </coding>
        </valueCodeableConcept>
      </extension>
      <description value="All patients aged less than 18 years seen in the ED who do not have an ED encounter principal diagnosis consistent with mental health diagnosis. Patients who have an ED encounter principal diagnosis consistent with substance use disorders will be included in this stratification.&#xA;"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Stratification 1"/>
      </criteria>
    </stratifier>
    <stratifier id="Stratification_1_2">
      <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-appliesTo">
        <valueCodeableConcept>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
            <code value="initial-population"/>
            <display value="Initial Population"/>
          </coding>
        </valueCodeableConcept>
      </extension>
      <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-appliesTo">
        <valueCodeableConcept>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
            <code value="denominator"/>
            <display value="Denominator"/>
          </coding>
        </valueCodeableConcept>
      </extension>
      <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-appliesTo">
        <valueCodeableConcept>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
            <code value="numerator"/>
            <display value="Numerator"/>
          </coding>
        </valueCodeableConcept>
      </extension>
      <description value="All patients aged 18 years and older seen in the ED who do not have an ED encounter principal diagnosis consistent with mental health diagnosis. Patients who have an ED encounter principal diagnosis consistent with substance use disorders will be included in this stratification.&#xA;"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Stratification 2"/>
      </criteria>
    </stratifier>
    <stratifier id="Stratification_1_3">
      <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-appliesTo">
        <valueCodeableConcept>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
            <code value="initial-population"/>
            <display value="Initial Population"/>
          </coding>
        </valueCodeableConcept>
      </extension>
      <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-appliesTo">
        <valueCodeableConcept>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
            <code value="denominator"/>
            <display value="Denominator"/>
          </coding>
        </valueCodeableConcept>
      </extension>
      <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-appliesTo">
        <valueCodeableConcept>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
            <code value="numerator"/>
            <display value="Numerator"/>
          </coding>
        </valueCodeableConcept>
      </extension>
      <description value="All patients aged less than 18 years seen in the ED who have an ED encounter principal diagnosis consistent with mental health diagnosis.&#xA;"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Stratification 3"/>
      </criteria>
    </stratifier>
    <stratifier id="Stratification_1_4">
      <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-appliesTo">
        <valueCodeableConcept>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
            <code value="initial-population"/>
            <display value="Initial Population"/>
          </coding>
        </valueCodeableConcept>
      </extension>
      <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-appliesTo">
        <valueCodeableConcept>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
            <code value="denominator"/>
            <display value="Denominator"/>
          </coding>
        </valueCodeableConcept>
      </extension>
      <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-appliesTo">
        <valueCodeableConcept>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
            <code value="numerator"/>
            <display value="Numerator"/>
          </coding>
        </valueCodeableConcept>
      </extension>
      <description value="All patients aged 18 years and older seen in the ED who have an ED encounter principal diagnosis consistent with mental health diagnosis.&#xA;"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Stratification 4"/>
      </criteria>
    </stratifier>
  </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&#xA;"/>
    <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&#xA;"/>
    <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&#xA;"/>
    <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&#xA;"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Sex"/>
    </criteria>
  </supplementalData>
</Measure>