dQM QICore Content Implementation Guide
2025.0.0 - CI Build

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

: Hospital Harm - Postoperative Respiratory FailureFHIR - XML Representation

Active as of 2025-08-25

Raw xml | Download


<Measure xmlns="http://hl7.org/fhir">
  <id value="CMS1218FHIRHHRF"/>
  <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" class="col-12">
  <table class="narrative-table">
    <tbody>
<tr>


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


</tr>

<tr>


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


<td class="content-container">Hospital Harm - Postoperative Respiratory FailureFHIR</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">CMS1218FHIR</td>
</tr>



  
<tr>


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


<td class="content-container">urn:uuid:b6857e46-6412-432d-abc8-0508efc0d2d7</td>
</tr>



  
<tr>


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


<td class="content-container">urn:uuid:fb07b5c1-50c3-45e7-b8c7-ca26409a0f48</td>
</tr>



  
    
    
<tr>


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


<td class="content-container">1218FHIR</td>
</tr>

  


  
    
    
<tr>


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


<td class="content-container">4130e</td>
</tr>

  



  
    
    
<tr>


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


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

  















<tr>


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


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






<tr>


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


<td class="content-container">Mathematica</td>
</tr>






<tr>


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


<td class="content-container"><p>This measure assesses the number of elective inpatient hospitalizations for patients aged 18 years and older without an obstetrical condition who have a procedure resulting in postoperative respiratory failure (PRF)</p></td>
</tr>



<tr>


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


<td class="content-container"><p>Limited proprietary coding is contained in the Measure specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets. Mathematica disclaims all liability for use or accuracy of any third-party codes contained in the specifications. LOINC(R) copyright 2004-2024 Regenstrief Institute, Inc.</p>
<p>This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2024 International Health Terminology Standards Development Organisation. ICD-10 copyright 2024 World Health Organization. All Rights Reserved.</p></td>
</tr>


<tr>


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


<td class="content-container"><p>This performance measure is not a clinical guideline, does not establish a standard of medical care, and has not been tested for all potential applications.</p>
<p>THE MEASURES AND SPECIFICATIONS ARE PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND.</p>
<p>Due to technical limitations, registered trademarks are indicated by (R) or [R] and unregistered trademarks are indicated by (TM) or [TM].</p></td>
</tr>











<tr>


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


<td class="content-container"><p>Postoperative respiratory failure (PRF), defined as unplanned endotracheal reintubation, prolonged inability to wean from mechanical ventilation, or inadequate oxygenation and/or ventilation, is the most common serious postoperative pulmonary complication, with an incidence of up to 7.5% (the incidence of any postoperative pulmonary complication ranges from 10-40%) (Arozullah et al., 2000; Canet et al., 2015; Gupta et al., 2011; Kor et al., 2014). This measure addresses the prevalence of PRF and the variance between hospitals in the incidence of PRF. PRF is a serious complication that can increase the risk of morbidity and mortality, with in-hospital mortality resulting from PRF estimated at 25% to 40% (Arozullah et al., 2000; Canet &amp; Gallart, 2014). Surgical procedures complicated by PRF have 3.74 times higher adjusted odds of death than those not complicated by respiratory failure, 1.47 times higher odds of 90-day readmission, and 1.86 times higher odds of an outpatient visit with one of 44 postoperative conditions (e.g., bacterial infection, fluid and electrolyte disorder, abdominal hernia) within 90 days of hospital discharge (Miller et al., 2001; Romano et al, 2009). PRF is additionally associated with prolonged mechanical ventilation and the need for rehabilitation or skilled nursing facility placement upon discharge (Thompson &amp; Lisco, 2018).</p>
<p>The incidence of PRF varies by hospital, with higher reported rates of PRF in nonteaching hospitals than teaching hospitals (Rahman et al., 2013). Additionally, one study found that the odds of developing PRF increased by 6% for each level increase in hospital size from small to large (Rahman et al., 2013). This suggests that there remains room for improvement in hospitals reporting higher rates of PRF.</p>
<p>The most widely used current measures of PRF are based on either claims data (CMS Patient Safety Indicator (PSI) 11) or proprietary registry data (National Surgical Quality Improvement Program (NSQIP) of the American College of Surgeons). The dQM is closely modeled after the NSQIP measure of PRF, which has been widely adopted across American hospitals, and is intended to complement and eventually supplant CMS PSI 11.</p></td>
</tr>


<tr>


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


<td class="content-container"><p>Recent studies and current clinical practice guidelines for PRF have identified enhanced recovery pathways, prophylactic mucolytics, postoperative continuous positive airway pressure ventilation, lung protective intraoperative ventilation, prophylactic respiratory physiotherapy, epidural analgesia, and goal directed hemodynamic therapy as evidence-based interventions to reduce the incidence of PRF. Yet, progress in reducing the incidence of PRF has been stymied by lack of consensus regarding the definition of PRF, which patients are most at-risk, which risk factors are potentially modifiable, and which patients are more likely to benefit from targeted interventions of a health care system's limited resources. This measure would address this gap in data.</p>
<p>Relevant clinical guidelines for preventing postoperative respiratory failure can be found in the following:</p>
<ul>
 <li><p>Mohanty, et al. Optimal Perioperative Management of the Geriatric Patient: Best Practices Guideline from ACS NSQIP/AGS, 2016</p></li>
 <li><p>Piraino, et al. AARC Clinical Practice Guideline: Management of Adult Patients with Oxygen in the Acute Care Setting, 2022</p></li>
</ul></td>
</tr>




<tr>
  
  
  
  

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


  
  
  <td class="content-container">
    
    
    
    <p>Arozullah, A.M., Daley, J., Henderson, W.G., &amp; Khuri, S.F. (2000). Multifactorial risk index for predicting postoperative respiratory failure in men after major noncardiac surgery. The National Veterans Administration Surgical Quality Improvement Program. Annals of surgery. 232(2):242-253. doi: 10.1097/00000658-200008000-00015. PMID: 10903604; PMCID: PMC1421137.</p>
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  <td class="content-container">
    
    
    
    <p>Canet, J., &amp; Gallart, L. (2014). Postoperative respiratory failure: Pathogenesis, prediction, and prevention. Current Opinion in Critical Care. 20(1):56-62. doi: 10.1097/MCC.0000000000000045. PMID: 24240985.</p>
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  <td class="content-container">
    
    
    
    <p>Canet, J., Sabate, S., Mazo, V., Gallart, L., de Abreu, M.G., Belda, J., ... &amp; Pelosi, P. (2015). PERISCOPE group. Development and validation of a score to predict postoperative respiratory failure in a multicentre European cohort: A prospective, observational study. Eur J Anaesthesiol. 32(7):458-70. doi: 10.1097/EJA.0000000000000223. PMID: 26020123.</p>
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  <td class="content-container">
    
    
    
    <p>Gupta, H., Gupta, P.K., Fang, X., Miller, W.J., Cemaj, S., Forse, R.A., &amp; Morrow, L.E. (2011). Development and validation of a risk calculator predicting postoperative respiratory failure. Chest. 140(5):1207-1215. doi: 10.1378/chest.11-0466. Epub 2011 Jul 14. PMID: 21757571.</p>
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  <td class="content-container">
    
    
    
    <p>Kor, D.J., Lingineni, R.K., Gajic, O., Park, P.K., Blum, J.M., Hou, P.C., ... &amp; Talmor, D.S. (2014). Predicting risk of postoperative lung injury in high-risk surgical patients: a multicenter cohort study. Anesthesiology. 120(5):1168-81. doi: 10.1097/ALN.0000000000000216. PMID: 24755786; PMCID: PMC3999474.</p>
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  <td class="content-container">
    
    
    
    <p>Miller, M.R., Elixhauser, A., Zhan, C., &amp; Meyer, G.S. (2001). Patient Safety Indicators: using administrative data to identify potential patient safety concerns. Health Serv Res. 36(6 Pt 2):110-32. PMID: 16148964; PMCID: PMC1383610.</p>
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  <td class="content-container">
    
    
    
    <p>Rahman, M., Neal, D., Fargen, K.M., &amp; Hoh, B.L. (2013). Establishing standard performance measures for adult brain tumor patients: a Nationwide Inpatient Sample database study. Neuro Oncol. 15(11):1580-8. doi: 10.1093/neuonc/not108. Epub 2013 Sep 30. PMID: 24084409; PMCID: PMC3813415.</p>
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  <td class="content-container">
    
    
    
    <p>Romano, P.S., Mull, H.J., Rivard, P.E., Zhao, S., Henderson, W.G., Loveland, S., Tsilimingras, D., ... &amp; Rosen, A.K. (2009). Validity of selected AHRQ patient safety indicators based on VA National Surgical Quality Improvement Program data. Health Serv Res. 44(1):182-204. doi: 10.1111/j.1475-6773.2008.00905.x. Epub 2008 Sep 17. PMID: 18823449; PMCID: PMC2669628.</p>
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  <td class="content-container">
    
    
    
    <p>Thompson, S.L., &amp; Lisco, S.J. (2018). Postoperative respiratory failure. Int Anesthesiol Clin. 56(1):147-164. doi: 10.1097/AIA.0000000000000173. PMID: 29189437.</p>
    
    
    
    
    
  </td>
</tr>







<tr>


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


<td class="content-container"><p>PRF is evaluated using mechanical ventilation (MV) documentation or intubation and extubation documentation to allow for hospital documentation variances. Therefore, if MV documentation is not available, intubation and extubation can serve as a proxy for determining if MV occurred and its duration. To determine that an unplanned initiation of MV occurred, the logic looks for evidence of a non-invasive oxygen therapy assessment such as oxygen via 'nasal canula' or 'breathing room air' prior to the MV occurrence to verify that MV was newly initiated. Additionally, facility location codes are used to determine if MV was initiated outside of a procedural area (e.g., medical floor). Conversely, to determine MV duration, the logic looks for evidence that a non-invasive oxygen therapy assessment or another operating room procedure does not exist prior to the MV occurrence to verify that MV was continued without interruption from a procedural area.</p>
<p/>
<p>This dQM is an episode-based measure. An episode is defined as each inpatient hospitalization or encounter that ends during the measurement period.</p>
<p/>
<p>This FHIR-based measure has been derived from the QDM-based measure: CMS1218v2. 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).</p></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">[http://terminology.hl7.org/CodeSystem/measure-scoring#proportion: 'Proportion']</td>
</tr>







  
<tr>


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


<td class="content-container">[http://terminology.hl7.org/CodeSystem/measure-type#outcome: 'Outcome']</td>
</tr>




  
<tr>


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


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



  
<tr>


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


<td class="content-container">[http://terminology.hl7.org/CodeSystem/measure-improvement-notation#decrease: 'Decreased score indicates improvement']</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"><p>Elective inpatient hospitalizations with no preceding emergency department visit that end during the measurement period for patients aged 18 and older without an obstetrical condition and at least one surgical procedure was performed within the first 3 days of the encounter</p></p>
        
        
          
            
            <em>Logic Definition</em>: <a href="#primary-cms1218fhirhhrf-initial-population">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"><p>Equals Initial Population</p></p>
        
        
          
            
            <em>Logic Definition</em>: <a href="#primary-cms1218fhirhhrf-denominator">Denominator</a> 
          
        
      </td>
    </tr>
  

  
    <tr>
      
        

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


      
      <td class="content-container">
        
        <em>ID</em>: DenominatorExclusion_1
        <br/>
        
        
          <em>Description</em>:
          <p style="white-space: pre-line" class="tab-one"><p>Inpatient hospitalizations for patients:</p>
<p>With a diagnosis for a degenerative neurological disorder</p>
<p>With any selected head, neck, and thoracic surgery involving significant risk of airway compromise or requiring airway protection</p>
<p>Who have mechanical ventilation that starts more than one hour prior to the start of the first operating room (OR) procedure</p>
<p>With a diagnosis for a neuromuscular disorder</p>
<p>With arterial partial pressure of carbon dioxide (PaCO2)&gt;50 mmHg combined with an arterial pH&lt;7.30 within 48 hours or less prior to the start of the first OR procedure</p>
<p>With arterial partial pressure of oxygen (PaO2)&lt;50 mmHg within 48 hours or less prior to the start of the first OR procedure</p>
<p>With a principal diagnosis for acute respiratory failure</p>
<p>With a diagnosis for acute respiratory failure present on admission</p>
<p>With any diagnosis present on admission for the existence of a tracheostomy</p>
<p>Where a tracheostomy is performed before or on the same day as the first OR procedure</p></p>
        
        
          
            
            <em>Logic Definition</em>: <a href="#primary-cms1218fhirhhrf-denominator-exclusions">Denominator Exclusions</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"><p>Elective inpatient hospitalizations for patients with postoperative respiratory failure as evidenced by any of the following:</p>
<p>Criterion A: Mechanical ventilation (MV) initiated within 30 days after first OR procedure, as evidenced by:</p>
<p>A.1. Intubation that occurs outside of a procedural area and within 30 days after the end of the first OR procedure of the encounter.</p>
<p>or</p>
<p>A.2. MV that occurs outside of a procedural area within 30 days after the end of the first OR procedure of the encounter and is preceded by a period of non-invasive oxygen therapy between the end of the OR procedure and the MV occurrence, and without a subsequent OR procedure between the non-invasive oxygen therapy and the MV occurrence.</p>
<p>or</p>
<p>Criterion B: MV with a duration of more than 48 hours after the first OR procedure, as evidenced by:</p>
<p>B.1. Extubation that occurs outside of a procedural area more than 48 hours after the end of an OR procedure and within 30 days after the end of the first OR procedure, and is not preceded by a period of non-invasive oxygen therapy or a subsequent OR procedure between the end of the OR procedure and the extubation occurrence.</p>
<p>or</p>
<p>B.2 Mechanical ventilation that occurs between 48 and 72 hours after the end of an OR procedure and within 30 days after the end of the first OR procedure, and is not preceded by a non-invasive oxygen therapy or a subsequent OR procedure between the end of the OR procedure and the MV occurrence.</p></p>
        
        
          
            
            <em>Logic Definition</em>: <a href="#primary-cms1218fhirhhrf-numerator">Numerator</a> 
          
        
      </td>
    </tr>
  

  


  
    
<tr>


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


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

  

  
    
<tr>


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


<td class="content-container"><p>Variables are collected for the development of baseline risk adjustment model</p>
<p>Report the first resulted vital sign values during the encounter in the Unified Code for Units of Measure (UCUM) units specified:</p>
<ul>
 <li>Body temperature: Cel, [degF]</li>
 <li>Heart rate: {Beats}/min</li>
 <li>Respiratory rate: {Breaths}/min</li>
 <li>Systolic blood pressure: mm[Hg]</li>
</ul>
<p>Report the first resulted laboratory test values during the encounter in UCUM units specified:</p>
<ul>
 <li>Albumin: g/dL, umol/L</li>
 <li>Aspartate aminotransferase (AST/SGOT): U/L, IU/L</li>
 <li>Bicarbonate: mmol/L</li>
 <li>Bilirubin: mg/dL, umol/L</li>
 <li>Blood urea nitrogen (BUN): mg/dL, umol/L</li>
 <li>Carbon dioxide (partial pressure): mm[Hg]</li>
 <li>Creatinine: mg/dL, umol/L</li>
 <li>Hematocrit: %</li>
 <li>Hemoglobin: g/dL, mmol/L</li>
 <li>Leukocyte count: {cells}/uL, 10<em>3/uL, 10</em>9/L, /mm3</li>
 <li>Oxygen (partial pressure): mm[Hg]</li>
 <li>pH of arterial blood: [pH]</li>
 <li>Platelet count: 10<em>3/uL, 10</em>9/L, /mm3</li>
 <li>Sodium: meq/L, mmol/L</li>
 <li>White blood cell count: {cells}/uL, 10<em>3/uL, 10</em>9/L, /mm3</li>
</ul>
<p>Additional variables used for risk adjustment:</p>
<ul>
 <li>American Society of Anesthesiologists (ASA) physical status class assessment that starts during the encounter</li>
 <li>First Body mass index (BMI), reported using UCUM unit: kg/m2</li>
 <li>Encounter diagnoses with their present on admission (POA) indicators</li>
 <li>Most recent smoking status</li>
 <li>Principal surgical procedures that start during the encounter</li>
</ul>
<p>Please see the Hospital Harm - Postoperative Respiratory Failure Risk Adjustment Methodology Report on the dQM-specific page on the eCQI Resource Center website: https://ecqi.healthit.gov/</p></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>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data]
        
        <br/>
      
    
    
      <em>Description</em>: SDE Ethnicity
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-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>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data]
        
        <br/>
      
    
    
      <em>Description</em>: SDE Payer
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-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>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data]
        
        <br/>
      
    
    
      <em>Description</em>: SDE Race
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-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>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data]
        
        <br/>
      
    
    
      <em>Description</em>: SDE Sex
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-sde-sex">SDE Sex</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-all-encounter-diagnoses-with-poa-indication
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable All Encounter Diagnoses With POA Indication
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-all-encounter-diagnoses-with-poa-indication">Risk Variable All Encounter Diagnoses With POA Indication</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-asa-physical-status-class
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable ASA Physical Status Class
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-asa-physical-status-class">Risk Variable ASA Physical Status Class</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-body-mass-index-(bmi)
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable Body Mass Index (BMI)
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-body-mass-index-(bmi)">Risk Variable Body Mass Index (BMI)</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-encounter-procedures
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable Encounter Procedures
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-encounter-procedures">Risk Variable Encounter Procedures</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-albumin-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First Albumin In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-albumin-in-encounter">Risk Variable First Albumin In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-arterial-ph-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First Arterial pH In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-arterial-ph-in-encounter">Risk Variable First Arterial pH In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-ast-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First AST In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-ast-in-encounter">Risk Variable First AST In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-bicarbonate-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First Bicarbonate In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-bicarbonate-in-encounter">Risk Variable First Bicarbonate In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-bilirubin-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First Bilirubin In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-bilirubin-in-encounter">Risk Variable First Bilirubin In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-blood-urea-nitrogen-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First Blood Urea Nitrogen In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-blood-urea-nitrogen-in-encounter">Risk Variable First Blood Urea Nitrogen In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-bmi
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First BMI
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-bmi">Risk Variable First BMI</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-body-temperature-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First Body Temperature In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-body-temperature-in-encounter">Risk Variable First Body Temperature In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-carbon-dioxide-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First Carbon Dioxide In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-carbon-dioxide-in-encounter">Risk Variable First Carbon Dioxide In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-creatinine-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First Creatinine In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-creatinine-in-encounter">Risk Variable First Creatinine In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-heart-rate-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First Heart Rate In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-heart-rate-in-encounter">Risk Variable First Heart Rate In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-hematocrit-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First Hematocrit In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-hematocrit-in-encounter">Risk Variable First Hematocrit In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-hemoglobin-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First Hemoglobin In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-hemoglobin-in-encounter">Risk Variable First Hemoglobin In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-leukocyte-count-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First Leukocyte Count In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-leukocyte-count-in-encounter">Risk Variable First Leukocyte Count In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-oxygen-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First Oxygen In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-oxygen-in-encounter">Risk Variable First Oxygen In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-platelet-count-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First Platelet Count In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-platelet-count-in-encounter">Risk Variable First Platelet Count In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-respiratory-rate-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First Respiratory Rate In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-respiratory-rate-in-encounter">Risk Variable First Respiratory Rate In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-sodium-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First Sodium In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-sodium-in-encounter">Risk Variable First Sodium In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-systolic-blood-pressure-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First Systolic Blood Pressure In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-systolic-blood-pressure-in-encounter">Risk Variable First Systolic Blood Pressure In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-first-white-blood-cell-count-in-encounter
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable First White Blood Cell Count In Encounter
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-first-white-blood-cell-count-in-encounter">Risk Variable First White Blood Cell Count In Encounter</a> 
      
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
      <em>ID</em>: risk-variable-principal-procedure
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor]
        
        <br/>
      
    
    
      <em>Description</em>: Risk Variable Principal Procedure
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#cms1218fhirhhrf-risk-variable-principal-procedure">Risk Variable Principal Procedure</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">https://madie.cms.gov/Library/CMS1218FHIRHHRF</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/>
  </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">
    
      
      <a name="primary-cms1218fhirhhrf-initial-population"> </a>
    
    
    Initial Population
    
  </th>
</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Initial Population&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot;</code></pre>
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
      
    
  

  
    
      
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            
              
            
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="primary-cms1218fhirhhrf-denominator"> </a>
    
    
    Denominator
    
  </th>
</tr>
<tr>

  <td>
    <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">
    
      
      <a name="primary-cms1218fhirhhrf-denominator-exclusions"> </a>
    
    
    Denominator Exclusion
    
  </th>
</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Denominator Exclusions&quot;:
  &quot;Encounter With Degenerative Neurological Disorder&quot;
    union &quot;Encounter With High Risk To Airway Head Neck And Thoracic Surgery&quot;
    union &quot;Encounter With Mechanical Ventilation That Starts More Than One Hour Prior To Start Of First OR Procedure&quot;
    union &quot;Encounter With Neuromuscular Disorder&quot;
    union &quot;Encounter With PaCO2 Greater Than 50 And Arterial pH Less Than 7.30 Within 48 Hours Prior To Start Of First OR Procedure&quot;
    union &quot;Encounter With PaO2 Less Than 50 Within 48 Hours Prior To Start Of First OR Procedure&quot;
    union &quot;Encounter With Principal Diagnosis Of Acute Respiratory Failure&quot;
    union &quot;Encounter With Diagnosis Of Acute Respiratory Failure Present On Admission&quot;
    union &quot;Encounter With Tracheostomy Present On Admission&quot;
    union &quot;Encounter With Tracheostomy Prior To Or On The Same Day Of First OR Procedure&quot;</code></pre>
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
      
    
  

  
    
      
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            
              
            
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="primary-cms1218fhirhhrf-numerator"> </a>
    
    
    Numerator
    
  </th>
</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Numerator&quot;:
  &quot;Encounter With Intubation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure&quot;
    union &quot;Encounter With Mechanical Ventilation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure And Preceded By Non Invasive Oxygen Therapy&quot;
    union &quot;Encounter With Extubation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure More Than 48 Hours After End Of Anesthesia&quot;
    union &quot;Encounter With Mechanical Ventilation Within 30 Days Of End Of First OR Procedure And Between 48 And 72 Hours After End Of OR Procedure And Not Preceded By Non Invasive Oxygen Therapy Or Anesthesia&quot;</code></pre>
  </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">
    
      
      <a name="supplementaldataelements-sde-payer"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

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

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="supplementaldataelements-sde-race"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <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">
    
      
      <a name="supplementaldataelements-sde-sex"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <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">
    
      
      <a name="supplementaldataelements-sde-ethnicity"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <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">
    
      
      <a name="fhirhelpers-tointerval"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <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">
    
      
      <a name="fhirhelpers-toconcept"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <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">
    
      
      <a name="fhirhelpers-tocode"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <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">
    
      
      <a name="fhirhelpers-tostring"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <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">
    
      
      <a name="qicorecommon-references"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <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 Reference, resourceId String):
  resourceId = Last(Split(reference.reference, '/'))</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Given an interval, return the starting point if the interval has a starting boundary specified,
otherwise, return the ending point
*/
define fluent function earliest(choice Choice&lt;DateTime, Quantity, Interval&lt;DateTime&gt;, Interval&lt;Quantity&gt;&gt; ):
  (choice.toInterval()) period
    return
      if (period.&quot;hasStart&quot;()) then start of period
      else end of period</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Given an interval, return true if the interval has a starting boundary specified
(i.e. the start of the interval is not null and not the minimum DateTime value)
*/
define fluent function hasStart(period Interval&lt;DateTime&gt; ):
  not ( start of period is null
      or start of period = minimum DateTime
  )</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


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

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

</tr>
<tr>

  <td>
    <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;Reference&gt;, resource Resource):
  exists (references R where R.references(resource))</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <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 Reference, resource Resource):
  resource.id = Last(Split(reference.reference, '/'))</code></pre>
  </td>

</tr>



        



        



        



        



        


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

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

</tr>
<tr>

  <td>
    <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 DateTime, Quanitty, Interval&lt;DateTime&gt;, or Interval&lt;Quantity&gt; 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 QICore, allowing this function to be used across any resource.
The input can be provided as a DateTime, Quantity, Interval&lt;DateTime&gt; or Interval&lt;Quantity&gt;.
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 Quantity, the quantity is expected to be a calendar-duration interpreted as an Age,
and the result is a DateTime Interval beginning on the Date the patient turned that age and ending immediately before one year later.
If the input is a DateTime Interval, the result is the input.
If the input is a Quantity Interval, the quantities are expected to be calendar-durations interpreted as an Age, and the result
is a DateTime Interval beginning on the date the patient turned the age given as the start of the quantity interval, and ending
immediately before one year later than the date the patient turned the age given as the end of the quantity interval.
If the input is a Timing, an error will be thrown indicating that Timing calculations are not implemented. Any other input will reslt in a null DateTime Interval
*/
define fluent function toInterval(choice Choice&lt;DateTime, Quantity, Interval&lt;DateTime&gt;, Interval&lt;Quantity&gt;, Timing&gt;):
  case
	  when choice is DateTime then
    	Interval[choice as DateTime, choice as DateTime]
		when choice is Interval&lt;DateTime&gt; then
  		choice as Interval&lt;DateTime&gt;
		when choice is Quantity then
		  Interval[Patient.birthDate + (choice as Quantity),
			  Patient.birthDate + (choice as Quantity) + 1 year)
		when choice is Interval&lt;Quantity&gt; then
		  Interval[Patient.birthDate + (choice.low as Quantity),
			  Patient.birthDate + (choice.high as Quantity) + 1 year)
		when choice is Timing then
      Message(null, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported') as Interval&lt;DateTime&gt;
		else
			null as Interval&lt;DateTime&gt;
	end</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Given an interval, returns the ending point if the interval has an ending boundary specified,
otherwise, returns the starting point
*/
define fluent function latest(choice Choice&lt;DateTime, Quantity, Interval&lt;DateTime&gt;, Interval&lt;Quantity&gt;&gt; ):
  (choice.toInterval()) period
    return
      if (period.&quot;hasEnd&quot;()) then end of period
      else start of period</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Given an interval, returns true if the interval has an ending boundary specified
(i.e. the end of the interval is not null and not the maximum DateTime value)
*/
define fluent function hasEnd(period Interval&lt;DateTime&gt; ):
  not (
    end of period is null
      or end of period = maximum DateTime
  )</code></pre>
  </td>

</tr>



        



        



        


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

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

</tr>
<tr>

  <td>
    <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;Concept&gt;, code Code):
  exists (codeList C where C ~ code)</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Hospitalization with Observation and Outpatient Surgery Service returns the total interval from the start of any immediately prior emergency department visit, outpatient surgery visit or observation visit to the discharge of the given encounter.
*/
define fluent function hospitalizationWithObservationAndOutpatientSurgeryService(TheEncounter &quot;Encounter&quot; ):
  TheEncounter Visit
	  let ObsVisit: Last([Encounter: &quot;Observation Services&quot;] LastObs
		  	where LastObs.status = 'finished'
          and LastObs.period ends 1 hour or less on or before start of Visit.period
			  sort by	end of period
    	),
    	VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),
    	EDVisit: Last([Encounter: &quot;Emergency Department Visit&quot;] LastED
			  where LastED.status = 'finished'
          and LastED.period ends 1 hour or less on or before VisitStart
			  sort by	end of period
    	),
    	VisitStartWithED: Coalesce(start of EDVisit.period, VisitStart),
    	OutpatientSurgeryVisit: Last([Encounter: &quot;Outpatient Surgery Service&quot;] LastSurgeryOP
			  where LastSurgeryOP.period ends 1 hour or less on or before VisitStartWithED
			  sort by	end of period
    	)
  	return Interval[Coalesce(start of OutpatientSurgeryVisit.period, VisitStartWithED), end of Visit.period]</code></pre>
  </td>

</tr>



        



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Hospitalization with Observation returns the total interval from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter
*/
define fluent function hospitalizationWithObservation(TheEncounter Encounter ):
  TheEncounter Visit
  		let ObsVisit: Last([Encounter: &quot;Observation Services&quot;] LastObs
  				where LastObs.status = 'finished'
            and LastObs.period ends 1 hour or less on or before start of Visit.period
  				sort by end of period
  			),
  			VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),
  			EDVisit: Last([Encounter: &quot;Emergency Department Visit&quot;] LastED
  				where LastED.status = 'finished'
            and LastED.period ends 1 hour or less on or before VisitStart
  				sort by end of period
  			)
  		return Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


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

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

</tr>
<tr>

  <td>
    <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 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">
    
      
      <a name="cqmcommon-principaldiagnosis"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <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">
    
      
      <a name="cqmcommon-claimdiagnosis"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <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">
    
      
      <a name="cqmcommon-getcondition"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <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">
    
      
      <a name="cqmcommon-isdiagnosispresentonadmission"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
 @description: Returns true if the given diagnosis is present on admission, based on the given poaValueSet
 @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 isDiagnosisPresentOnAdmission(encounter Encounter, diagnosisValueSet ValueSet, poaValueSet ValueSet):
   exists (
     (encounter.claimDiagnosis()) CD
       where CD.onAdmission in poaValueSet
         and (
           CD.diagnosis in diagnosisValueSet
             or CD.diagnosis.getCondition().code in diagnosisValueSet
         )
   )</code></pre>
  </td>

</tr>



        



        




        
        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-elective-inpatient-encounter-with-age-18-and-older-without-ed-visit"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Elective Inpatient Encounter With Age 18 And Older Without ED Visit&quot;:
  [&quot;Encounter&quot;: &quot;Elective Inpatient Encounter&quot;] ElectiveEncounter
    where ElectiveEncounter.status = 'finished'
      and ElectiveEncounter.period ends during day of &quot;Measurement Period&quot;
      and ElectiveEncounter.priority is not null implies ElectiveEncounter.priority ~ &quot;Elective (qualifier value)&quot;
      and AgeInYearsAt(date from start of ElectiveEncounter.period) &gt;= 18
      and not exists ( [&quot;Encounter&quot;: &quot;Emergency Department Visit&quot;] EDVisit
          where EDVisit.status = 'finished'
            and EDVisit.period ends 1 hour or less before or on start of ElectiveEncounter.period
      )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-elective-inpatient-encounter-with-age-and-without-obstetrical-condition"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Elective Inpatient Encounter With Age And Without Obstetrical Condition&quot;:
  &quot;Elective Inpatient Encounter With Age 18 And Older Without ED Visit&quot; ElectiveEncounter
    where not ( ElectiveEncounter.reasonCode in &quot;Obstetrical Or Pregnancy Related Conditions&quot;
        or ElectiveEncounter.encounterReason ( ).code in &quot;Obstetrical Or Pregnancy Related Conditions&quot;
    )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-elective-inpatient-encounter-with-or-procedure-within-3-days"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot;:
  &quot;Elective Inpatient Encounter With Age And Without Obstetrical Condition&quot; ElectiveEncounter
    with [&quot;Procedure&quot;: &quot;General And Neuraxial Anesthesia&quot;] SurgeryWithAnesthesia
      such that SurgeryWithAnesthesia.status = 'completed'
        and SurgeryWithAnesthesia.performed.earliest ( ) during ElectiveEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
        and SurgeryWithAnesthesia.performed.earliest ( ) 3 days or less after start of ElectiveEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-initial-population"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Initial Population&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-respiratory-rate-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First Respiratory Rate In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstRespiratoryRate: QualifyingEncounter.firstRespiratoryRate ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-albumin-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First Albumin In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstAlbumin: QualifyingEncounter.firstAlbumin ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-arterial-ph-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First Arterial pH In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstArterialpH: QualifyingEncounter.firstArterialpH ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-body-temperature-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First Body Temperature In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstBodyTemp: QualifyingEncounter.firstBodyTemperature ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-carbon-dioxide-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First Carbon Dioxide In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstCarbonDioxide: QualifyingEncounter.firstCarbonDioxide ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-hematocrit-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First Hematocrit In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstHematocrit: QualifyingEncounter.firstHematocrit ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-heart-rate-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First Heart Rate In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstHeartRate: QualifyingEncounter.firstHeartRate ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-bmi"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First BMI&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstBMI: QualifyingEncounter.firstBMI ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-hemoglobin-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First Hemoglobin In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstHemoglobin: QualifyingEncounter.firstHemoglobin ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-all-encounter-diagnoses-with-poa-indication"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable All Encounter Diagnoses With POA Indication&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      diagnoses: QualifyingEncounter.claimDiagnosesWithPOA ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-sodium-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First Sodium In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstSodium: QualifyingEncounter.firstSodium ( )
    }</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-sde-payer"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <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">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-creatinine-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First Creatinine In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstCreatinine: QualifyingEncounter.firstCreatinine ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-white-blood-cell-count-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First White Blood Cell Count In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstWBCcount: QualifyingEncounter.firstWhiteBloodCellCount ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-asa-physical-status-class"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable ASA Physical Status Class&quot;:
  [&quot;ObservationScreeningAssessment&quot;: &quot;American society of anesthesiologists morbidity state&quot;] ASAclass
    with &quot;Initial Population&quot; QualifyingEncounter
      such that ASAclass.status in { 'final', 'amended', 'corrected' }
        and ASAclass.startsDuringHospitalization ( QualifyingEncounter )
        and ASAclass.value as Concept in &quot;ASA Physical Status Class&quot;
    return ASAclass.value as Concept</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-principal-procedure"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable Principal Procedure&quot;:
  from
    [&quot;Procedure&quot;] TheProcedure,
    &quot;Initial Population&quot; QualifyingEncounter
    where TheProcedure.status = 'completed'
      and TheProcedure.rank ( QualifyingEncounter ) is not null
      and TheProcedure.startsDuringHospitalization ( QualifyingEncounter )
    return Tuple {
      encounterId: QualifyingEncounter.id,
      procedureId: TheProcedure.id,
      procedureCode: TheProcedure.code,
      procedureRank: TheProcedure.rank ( QualifyingEncounter ),
      procedureTime: TheProcedure.performed.toInterval ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-body-mass-index-(bmi)"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable Body Mass Index (BMI)&quot;:
  [&quot;USCoreBMIProfile&quot;] BMI
    with &quot;Initial Population&quot; InpatientEncounter
      such that BMI.effective.toInterval ( ) starts during InpatientEncounter.hospitalizationWithObservation ( )
        and BMI.value is not null
        and BMI.status in { 'final', 'amended', 'corrected' }
    return BMI.value as Quantity</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-bicarbonate-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First Bicarbonate In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstBicarbonate: QualifyingEncounter.firstBicarbonate ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-bilirubin-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First Bilirubin In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstBilirubin: QualifyingEncounter.firstBilirubin ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-qualifying-systolic-blood-pressure-reading"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Qualifying Systolic Blood Pressure Reading&quot;:
  [&quot;USCoreBloodPressureProfile&quot;] BloodPressure
    where BloodPressure.effective.earliest ( ) during day of &quot;Measurement Period&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-systolic-blood-pressure-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First Systolic Blood Pressure In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstSystolic: QualifyingEncounter.firstSystolicBloodPressure ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-oxygen-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First Oxygen In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstOxygen: QualifyingEncounter.firstOxygen ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-leukocyte-count-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First Leukocyte Count In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstLeukocyte: QualifyingEncounter.firstLeukocyte ( )
    }</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-sde-race"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <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">
    
      
      <a name="cms1218fhirhhrf-sde-sex"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <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">
    
      
      <a name="cms1218fhirhhrf-anesthesia-procedure-list"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Anesthesia Procedure List&quot;:
  [&quot;Procedure&quot;: &quot;General And Neuraxial Anesthesia&quot;] AnesthesiaProcedures
    where AnesthesiaProcedures.performed.latest ( ) during day of &quot;Measurement Period&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-general-anesthesia-and-mac"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;General Anesthesia And MAC&quot;:
  [&quot;Procedure&quot;: &quot;Anesthesia Requiring Monitored Care&quot;] MAC
    union [&quot;Procedure&quot;: &quot;General And Neuraxial Anesthesia&quot;]</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-intubation-during-general-anesthesia-and-mac"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Intubation During General Anesthesia And MAC&quot;:
  from
    &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery,
    [&quot;Procedure&quot;: &quot;Intubation&quot;] ProceduralIntubation,
    &quot;General Anesthesia And MAC&quot; Anesthesia
    where ProceduralIntubation.status = 'completed'
      and ProceduralIntubation.startsDuringHospitalization ( EncounterWithSurgery )
      and ProceduralIntubation.performed.toInterval ( ) starts during Anesthesia.performed.toInterval ( )
    return ProceduralIntubation</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-encounter-with-intubation-outside-of-procedural-area-within-30-days-of-end-of-first-or-procedure"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Encounter With Intubation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    with [&quot;Procedure&quot;: &quot;Intubation&quot;] EndotrachealTubeIn
      such that EndotrachealTubeIn.status = 'completed'
        and EndotrachealTubeIn.starts30DaysOrLessAfterFirstAnesthesia ( EncounterWithSurgery )
        and EndotrachealTubeIn.startsDuringHospitalization ( EncounterWithSurgery )
        and EndotrachealTubeIn.performed.toInterval ( ) starts after end of EndotrachealTubeIn.latestGeneralAnesthesiaOrMAC ( ).performed.toInterval ( )
        and EncounterWithSurgery.isNotAtProceduralHospitalLocationDuring ( EndotrachealTubeIn.performed.toInterval ( ) )
        and not ( &quot;Intubation During General Anesthesia And MAC&quot;.id contains EndotrachealTubeIn.id )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-noninvasive-oxygen-therapy"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Noninvasive Oxygen Therapy&quot;:
  ( [&quot;Procedure&quot;: &quot;Non Invasive Oxygen Therapy By Nasal Cannula Or Mask&quot;] P
      where P.status = 'completed'
  )
    union ( [&quot;LaboratoryResultObservation&quot;: &quot;Non Invasive Oxygen Therapy&quot;] O
        where O.status in { 'final', 'amended', 'corrected' }
    )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-encounter-with-mechanical-ventilation-outside-of-procedural-area-within-30-days-of-end-of-first-or-procedure-and-preceded-by-non-invasive-oxygen-therapy"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Encounter With Mechanical Ventilation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure And Preceded By Non Invasive Oxygen Therapy&quot;:
  from
    &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery,
    [&quot;Procedure&quot;: &quot;Mechanical Ventilation&quot;] Ventilation,
    &quot;Noninvasive Oxygen Therapy&quot; OxygenSupport
    let VentilationInterval: Ventilation.performed.toInterval ( ),
    LatestAnesthesiaInterval: Ventilation.latestGeneralAnesthesiaOrMAC ( ).performed.toInterval ( )
    where Ventilation.status = 'completed'
      and Ventilation.starts30DaysOrLessAfterFirstAnesthesia ( EncounterWithSurgery )
      and Ventilation.startsDuringHospitalization ( EncounterWithSurgery )
      and VentilationInterval starts after end of LatestAnesthesiaInterval
      and OxygenSupport.interval ( ) starts during Interval[end of LatestAnesthesiaInterval, start of VentilationInterval]
      and EncounterWithSurgery.isNotAtProceduralHospitalLocationDuring ( VentilationInterval )
    return EncounterWithSurgery</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-extubation-with-preceding-noninvasive-oxygen"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Extubation With Preceding Noninvasive Oxygen&quot;:
  from
    &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery,
    [&quot;Procedure&quot;: &quot;Removal of endotracheal tube (procedure)&quot;] Extubation,
    &quot;Noninvasive Oxygen Therapy&quot; OxygenSupport
    let LatestAnesthesia: Extubation.latestGeneralAnesthesiaOrMAC ( )
    where Extubation.status = 'completed'
      and Extubation.startsDuringHospitalization ( EncounterWithSurgery )
      and Extubation.performed.toInterval ( ) starts after LatestAnesthesia.performed.toInterval ( )
      and OxygenSupport.interval ( ) starts during Interval[end of LatestAnesthesia.performed.toInterval ( ), start of Extubation.performed.toInterval ( )]
    return Extubation</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-extubation-during-general-anesthesia"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Extubation During General Anesthesia&quot;:
  from
    &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery,
    [&quot;Procedure&quot;: &quot;Removal of endotracheal tube (procedure)&quot;] Extubation,
    &quot;General Anesthesia And MAC&quot; Anesthesia
    where Extubation.status = 'completed'
      and Extubation.startsDuringHospitalization ( EncounterWithSurgery )
      and Extubation.performed.toInterval ( ) starts during Anesthesia.performed.toInterval ( )
    return Extubation</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-encounter-with-extubation-outside-of-procedural-area-within-30-days-of-end-of-first-or-procedure-more-than-48-hours-after-end-of-anesthesia"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Encounter With Extubation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure More Than 48 Hours After End Of Anesthesia&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    with [&quot;Procedure&quot;: &quot;Removal of endotracheal tube (procedure)&quot;] Extubation
      such that Extubation.status = 'completed'
        and Extubation.isDuringHospitalization ( EncounterWithSurgery )
        and Extubation.starts30DaysOrLessAfterFirstAnesthesia ( EncounterWithSurgery )
        and Extubation.performed.toInterval ( ) starts more than 48 hours after end of Extubation.latestGeneralAnesthesiaOrMAC ( ).performed.toInterval ( )
        and not ( ( &quot;Extubation With Preceding Noninvasive Oxygen&quot;.id contains Extubation.id )
            and not ( &quot;Extubation During General Anesthesia&quot;.id contains Extubation.id )
        )
        and EncounterWithSurgery.isNotAtProceduralHospitalLocation ( )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-encounter-with-mechanical-ventilation-within-30-days-of-end-of-first-or-procedure-and-between-48-and-72-hours-after-end-of-or-procedure-and-not-preceded-by-non-invasive-oxygen-therapy-or-anesthesia"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Encounter With Mechanical Ventilation Within 30 Days Of End Of First OR Procedure And Between 48 And 72 Hours After End Of OR Procedure And Not Preceded By Non Invasive Oxygen Therapy Or Anesthesia&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    with [&quot;Procedure&quot;: &quot;Mechanical Ventilation&quot;] Ventilation
      such that Ventilation.status = 'completed'
        and Ventilation.performed.toInterval ( ) starts 48 hours or more after end of Ventilation.latestGeneralAnesthesiaOrMAC ( ).performed.toInterval ( )
        and Ventilation.performed.toInterval ( ) starts 72 hours or less after end of Ventilation.latestGeneralAnesthesiaOrMAC ( ).performed.toInterval ( )
        and Ventilation.starts30DaysOrLessAfterFirstAnesthesia ( EncounterWithSurgery )
        and Ventilation.startsDuringHospitalization ( EncounterWithSurgery )
        and not ( &quot;Encounter With Mechanical Ventilation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure And Preceded By Non Invasive Oxygen Therapy&quot;.id contains EncounterWithSurgery.id )
        and EncounterWithSurgery.isNotAtProceduralHospitalLocation ( )</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Numerator&quot;:
  &quot;Encounter With Intubation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure&quot;
    union &quot;Encounter With Mechanical Ventilation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure And Preceded By Non Invasive Oxygen Therapy&quot;
    union &quot;Encounter With Extubation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure More Than 48 Hours After End Of Anesthesia&quot;
    union &quot;Encounter With Mechanical Ventilation Within 30 Days Of End Of First OR Procedure And Between 48 And 72 Hours After End Of OR Procedure And Not Preceded By Non Invasive Oxygen Therapy Or Anesthesia&quot;</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <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">
    
      
      <a name="cms1218fhirhhrf-risk-variable-encounter-procedures"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable Encounter Procedures&quot;:
  from
    [&quot;Procedure&quot;] TheProcedure,
    &quot;Initial Population&quot; QualifyingEncounter
    where TheProcedure.status = 'completed'
      and TheProcedure.startsDuringHospitalization ( QualifyingEncounter )
    return {
      encounterId: QualifyingEncounter.id,
      procedureId: TheProcedure.id,
      procedureCode: TheProcedure.code,
      procedureRank: TheProcedure.rank ( QualifyingEncounter ),
      procedureTime: TheProcedure.performed.toInterval ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-blood-urea-nitrogen-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First Blood Urea Nitrogen In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstBUN: QualifyingEncounter.firstBloodUreaNitrogen ( )
    }</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-sde-ethnicity"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <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">
    
      
      <a name="cms1218fhirhhrf-encounter-with-degenerative-neurological-disorder"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Encounter With Degenerative Neurological Disorder&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    where EncounterWithSurgery.reasonCode in &quot;Degenerative Neurological Disorder&quot;
      or EncounterWithSurgery.encounterReason ( ).code in &quot;Degenerative Neurological Disorder&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-encounter-with-high-risk-to-airway-head-neck-and-thoracic-surgery"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Encounter With High Risk To Airway Head Neck And Thoracic Surgery&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    with [&quot;Procedure&quot;: &quot;Head, Neck, And Thoracic Surgeries With High Risk Airway Compromise&quot;] HeadNeckProcedures
      such that HeadNeckProcedures.status = 'completed'
        and HeadNeckProcedures.startsDuringHospitalization ( EncounterWithSurgery )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-encounter-with-mechanical-ventilation-that-starts-more-than-one-hour-prior-to-start-of-first-or-procedure"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Encounter With Mechanical Ventilation That Starts More Than One Hour Prior To Start Of First OR Procedure&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    with [&quot;Procedure&quot;: &quot;Mechanical Ventilation&quot;] Ventilation
      such that Ventilation.status = 'completed'
        and Ventilation.performed.toInterval ( ) starts more than 1 hour before start of EncounterWithSurgery.firstAnesthesiaDuringHospitalization ( ).performed.toInterval ( )
        and Ventilation.startsDuringHospitalization ( EncounterWithSurgery )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-encounter-with-neuromuscular-disorder"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Encounter With Neuromuscular Disorder&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    where EncounterWithSurgery.reasonCode in &quot;Neuromuscular Disorder&quot;
      or EncounterWithSurgery.encounterReason ( ).code in &quot;Neuromuscular Disorder&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-encounter-with-paco2-greater-than-50-and-arterial-ph-less-than-7.30-within-48-hours-prior-to-start-of-first-or-procedure"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Encounter With PaCO2 Greater Than 50 And Arterial pH Less Than 7.30 Within 48 Hours Prior To Start Of First OR Procedure&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    let FirstProcedureTime: EncounterWithSurgery.firstAnesthesiaDuringHospitalization ( ).performed.toInterval ( )
    with [&quot;LaboratoryResultObservation&quot;: &quot;Carbon Dioxide Partial Pressure In Arterial Blood&quot;] CarbonDioxide
      such that CarbonDioxide.status in { 'final', 'amended', 'corrected' }
        and CarbonDioxide.effective.toInterval ( ) starts 48 hours or less before start of FirstProcedureTime
        and CarbonDioxide.value as Quantity &gt; 50 'mm[Hg]'
    with [&quot;LaboratoryResultObservation&quot;: &quot;Arterial Blood pH&quot;] BloodpH
      such that BloodpH.status in { 'final', 'amended', 'corrected' }
        and BloodpH.effective.toInterval ( ) starts 48 hours or less before start of FirstProcedureTime
        and BloodpH.value as Quantity &lt; 7.30 '[pH]'</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-encounter-with-pao2-less-than-50-within-48-hours-prior-to-start-of-first-or-procedure"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Encounter With PaO2 Less Than 50 Within 48 Hours Prior To Start Of First OR Procedure&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    let FirstProcedure: EncounterWithSurgery.firstAnesthesiaDuringHospitalization ( )
    with [&quot;LaboratoryResultObservation&quot;: &quot;Oxygen Partial Pressure In Arterial Blood&quot;] Oxygen
      such that Oxygen.status in { 'final', 'amended', 'corrected' }
        and Oxygen.effective.toInterval ( ) starts 48 hours or less before start of FirstProcedure.performed.toInterval ( )
        and Oxygen.value as Quantity &lt; 50 'mm[Hg]'</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-encounter-with-principal-diagnosis-of-acute-respiratory-failure"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Encounter With Principal Diagnosis Of Acute Respiratory Failure&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    where EncounterWithSurgery.hasPrincipalDiagnosisOf ( &quot;Acute Respiratory Failure&quot; )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-encounter-with-diagnosis-of-acute-respiratory-failure-present-on-admission"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Encounter With Diagnosis Of Acute Respiratory Failure Present On Admission&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    where EncounterWithSurgery.isDiagnosisPresentOnAdmission ( &quot;Acute Respiratory Failure&quot;, &quot;Present On Admission Or Clinically Undetermined&quot; )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-encounter-with-tracheostomy-present-on-admission"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Encounter With Tracheostomy Present On Admission&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    where EncounterWithSurgery.isDiagnosisPresentOnAdmission ( &quot;Tracheostomy Diagnoses&quot;, &quot;Present On Admission Or Clinically Undetermined&quot; )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-encounter-with-tracheostomy-before-day-of-first-or-procedure"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Encounter With Tracheostomy Before Day Of First OR Procedure&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    let FirstProcedure: EncounterWithSurgery.firstAnesthesiaDuringHospitalization ( )
    with [&quot;Procedure&quot;: &quot;Tracheostomy Procedures&quot;] TracheostomySurgery
      such that TracheostomySurgery.status = 'completed'
        and TracheostomySurgery.startsDuringHospitalization ( EncounterWithSurgery )
        and TracheostomySurgery.performed.toInterval ( ) starts before day of FirstProcedure.performed.toInterval ( )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-encounter-with-tracheostomy-same-day-of-first-or-procedure"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Encounter With Tracheostomy Same Day Of First OR Procedure&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    let FirstProcedure: EncounterWithSurgery.firstAnesthesiaDuringHospitalization ( )
    with [&quot;Procedure&quot;: &quot;Tracheostomy Procedures&quot;] TracheostomySurgery
      such that TracheostomySurgery.status = 'completed'
        and TracheostomySurgery.startsDuringHospitalization ( EncounterWithSurgery )
        and TracheostomySurgery.performed.toInterval ( ) starts during day of FirstProcedure.performed.toInterval ( )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-encounter-with-tracheostomy-prior-to-or-on-the-same-day-of-first-or-procedure"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Encounter With Tracheostomy Prior To Or On The Same Day Of First OR Procedure&quot;:
  &quot;Encounter With Tracheostomy Before Day Of First OR Procedure&quot;
    union &quot;Encounter With Tracheostomy Same Day Of First OR Procedure&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-denominator-exclusions"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Denominator Exclusions&quot;:
  &quot;Encounter With Degenerative Neurological Disorder&quot;
    union &quot;Encounter With High Risk To Airway Head Neck And Thoracic Surgery&quot;
    union &quot;Encounter With Mechanical Ventilation That Starts More Than One Hour Prior To Start Of First OR Procedure&quot;
    union &quot;Encounter With Neuromuscular Disorder&quot;
    union &quot;Encounter With PaCO2 Greater Than 50 And Arterial pH Less Than 7.30 Within 48 Hours Prior To Start Of First OR Procedure&quot;
    union &quot;Encounter With PaO2 Less Than 50 Within 48 Hours Prior To Start Of First OR Procedure&quot;
    union &quot;Encounter With Principal Diagnosis Of Acute Respiratory Failure&quot;
    union &quot;Encounter With Diagnosis Of Acute Respiratory Failure Present On Admission&quot;
    union &quot;Encounter With Tracheostomy Present On Admission&quot;
    union &quot;Encounter With Tracheostomy Prior To Or On The Same Day Of First OR Procedure&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-ast-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First AST In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstAST: QualifyingEncounter.firstAST ( )
    }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="cms1218fhirhhrf-risk-variable-first-platelet-count-in-encounter"> </a>
    
    Logic Definition
  </th>

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Risk Variable First Platelet Count In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstPlatelet: QualifyingEncounter.firstPlatelet ( )
    }</code></pre>
  </td>

</tr>



        



        



        



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function encounterReason(Encounter Encounter):
  Encounter.reasonReference D
    return singleton from ( ( [ConditionEncounterDiagnosis] cA
        union [ConditionProblemsHealthConcerns] cB ) C
        where D.references ( C.id )
    )</code></pre>
  </td>

</tr>



        



        



        



        



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstRespiratoryRate(QualifyingEncounter Encounter):
  First([USCoreRespiratoryRateProfile: &quot;Respiratory rate&quot;] FirstRespiration
      where FirstRespiration.status in { 'final', 'amended', 'corrected' }
        and FirstRespiration.effective.earliest() during QualifyingEncounter.hospitalizationWithObservation()
        and FirstRespiration.value is not null
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstAlbumin(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Albumin Lab Test&quot;] FirstAlbuminTest
      where FirstAlbuminTest.status in { 'final', 'amended', 'corrected' }
        and FirstAlbuminTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function isEarliestDuringHospitalization(choice Choice&lt;Procedure, LaboratoryResultObservation&gt;, encounter Encounter):
  case
    when choice is Procedure then ( choice as Procedure ).earliestIsDuringHospitalization ( encounter )
    when choice is LaboratoryResultObservation then ( choice as LaboratoryResultObservation ).earliestOccursDuringHospitalization ( encounter ) 
    else false end</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function earliestIsDuringHospitalization(procedure Procedure, encounter Encounter):
  procedure.performed.earliest ( ) during encounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
    and procedure.partOf is not null</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function earliestOccursDuringHospitalization(observation LaboratoryResultObservation, encounter Encounter):
  observation.effective.earliest ( ) during encounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
    and observation.value is not null</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstArterialpH(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Arterial Blood pH&quot;] FirstArterialpHTest
      where FirstArterialpHTest.status in { 'final', 'amended', 'corrected' }
        and FirstArterialpHTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstBodyTemperature(QualifyingEncounter Encounter):
  First([&quot;USCoreBodyTemperatureProfile&quot;: &quot;Body temperature&quot;] FirstTemperature
      where FirstTemperature.status in { 'final', 'amended', 'corrected' }
        and FirstTemperature.effective.earliest() during QualifyingEncounter.hospitalizationWithObservation()
        and FirstTemperature.value is not null
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstCarbonDioxide(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Carbon Dioxide Partial Pressure In Arterial Blood&quot;] FirstCarbonDioxideTest
      where FirstCarbonDioxideTest.status in { 'final', 'amended', 'corrected' }
        and FirstCarbonDioxideTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstHematocrit(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Hematocrit Lab Test&quot;] FirstHematocritTest
      where FirstHematocritTest.status in { 'final', 'amended', 'corrected' }
        and FirstHematocritTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstHeartRate(QualifyingEncounter Encounter):
  First([&quot;USCoreHeartRateProfile&quot;: &quot;Heart rate&quot;] FirstHeartBeats
      where FirstHeartBeats.status in { 'final', 'amended', 'corrected' }
        and FirstHeartBeats.effective.earliest() during QualifyingEncounter.hospitalizationWithObservation()
        and FirstHeartBeats.value is not null
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstBMI(QualifyingEncounter Encounter):
  First([USCoreBMIProfile] FirstBodyMass
      where FirstBodyMass.status in { 'final', 'amended', 'corrected' }
        and FirstBodyMass.effective.toInterval() starts during QualifyingEncounter.hospitalizationWithObservation()
        and FirstBodyMass.value is not null
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstHemoglobin(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Hemoglobin Lab Test&quot;] FirstHemoglobinTest
      where FirstHemoglobinTest.status in { 'final', 'amended', 'corrected' }
        and FirstHemoglobinTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function claimDiagnosesWithPOA(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
        and D.onAdmission is not null</code></pre>
  </td>

</tr>



        



        



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstSodium(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Sodium Lab Test&quot;] FirstSodiumTest
      where FirstSodiumTest.status in { 'final', 'amended', 'corrected' }
        and FirstSodiumTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstCreatinine(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Creatinine Lab Test&quot;] FirstCreatinineTest
      where FirstCreatinineTest.status in { 'final', 'amended', 'corrected' }
        and FirstCreatinineTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstWhiteBloodCellCount(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;White Blood Cells Count Lab Test&quot;] FirstWBCCount
      where FirstWBCCount.status in { 'final', 'amended', 'corrected' }
        and FirstWBCCount.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function startsDuringHospitalization(choice Choice&lt;Procedure, LaboratoryResultObservation, ObservationScreeningAssessment&gt;, enc Encounter):
  case
    when choice is Procedure then ( choice as Procedure ).performed.toInterval ( ) starts during enc.hospitalizationWithObservationAndOutpatientSurgeryService ( )
    when choice is LaboratoryResultObservation then ( choice as LaboratoryResultObservation ).effective.toInterval ( ) starts during enc.hospitalizationWithObservationAndOutpatientSurgeryService ( )
    when choice is ObservationScreeningAssessment then ( choice as ObservationScreeningAssessment ).effective.toInterval ( ) starts during enc.hospitalizationWithObservationAndOutpatientSurgeryService ( ) 
    else false end</code></pre>
  </td>

</tr>



        



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function rank(targetProcedure Procedure, parentEncounter Encounter):
  singleton from ( targetProcedure P
      let claim: ( [Claim] C
          where C.status = 'active'
            and C.use = 'claim'
            and exists ( C.item I
                where I.encounter.references ( parentEncounter )
            )
      ),
      claimProc: ( claim.procedure proc
          where proc.procedure.references ( P )
      )
      return claimProc.sequence R
  )</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstBicarbonate(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Bicarbonate Lab Test&quot;] FirstBicarbonateTest
      where FirstBicarbonateTest.status in { 'final', 'amended', 'corrected' }
        and FirstBicarbonateTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstBilirubin(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Bilirubin Lab Test&quot;] FirstBilirubinTest
      where FirstBilirubinTest.status in { 'final', 'amended', 'corrected' }
        and FirstBilirubinTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function &quot;firstSystolicBloodPressure&quot;(QualifyingEncounter Encounter):
  First(&quot;Qualifying Systolic Blood Pressure Reading&quot; SBPReading
      where SBPReading.status in { 'final', 'amended', 'corrected' }
        and SBPReading.effective.earliest() during QualifyingEncounter.hospitalizationWithObservation()
      return singleton from(SBPReading.component SBPComponent
          where SBPComponent.code ~ &quot;Systolic blood pressure&quot;
          return SBPComponent.value as Quantity
      )
  )</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstOxygen(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Oxygen Partial Pressure In Arterial Blood&quot;] FirstOxygenTest
      where FirstOxygenTest.status in { 'final', 'amended', 'corrected' }
        and FirstOxygenTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstLeukocyte(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Leukocyte Count Lab Test&quot;] FirstLeukocyteCount
      where FirstLeukocyteCount.status in { 'final', 'amended', 'corrected' }
        and FirstLeukocyteCount.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function starts30DaysOrLessAfterFirstAnesthesia(procedure Procedure, encounter Encounter):
  procedure.performed.toInterval ( ) starts 30 days or less after end of encounter.firstAnesthesiaDuringHospitalization ( ).performed.toInterval ( )</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function &quot;firstAnesthesiaDuringHospitalization&quot;(QualifyingEncounter Encounter):
  First(&quot;Anesthesia Procedure List&quot; anesthesia
      where anesthesia.status = 'completed'
        and anesthesia.startsDuringHospitalization(QualifyingEncounter)
      sort by start of performed.toInterval()
  )</code></pre>
  </td>

</tr>



        



        



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function latestGeneralAnesthesiaOrMAC(event Procedure):
  Last(&quot;General Anesthesia And MAC&quot; ProcedureList
      where ProcedureList.status = 'completed'
        and ProcedureList.performed.toInterval() ends before start of event.performed.toInterval()
      sort by start of performed.toInterval()
  )</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function isNotAtProceduralHospitalLocationDuring(encounter Encounter, intrvl Interval&lt;DateTime&gt;):
  not exists ( encounter.location EncounterLocation
      with [Location] Location
        such that EncounterLocation.location.references ( Location )
          and Location.type.includesCode ( &quot;ER&quot; )
          and EncounterLocation.period starts during intrvl
  )</code></pre>
  </td>

</tr>



        



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function isDuringHospitalization(choice Choice&lt;Procedure, LaboratoryResultObservation&gt;, enc Encounter):
  case
    when choice is Procedure then ( choice as Procedure ).performed.toInterval ( ) during enc.hospitalizationWithObservationAndOutpatientSurgeryService ( )
    when choice is LaboratoryResultObservation then ( choice as LaboratoryResultObservation ).effective.toInterval ( ) during enc.hospitalizationWithObservationAndOutpatientSurgeryService ( ) 
    else false end</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function isNotAtProceduralHospitalLocation(encounter Encounter):
  not exists ( encounter.location EncounterLocation
      with [Location] Location
        such that EncounterLocation.location.references ( Location )
          and Location.type.includesCode ( &quot;ER&quot; )
  )</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstBloodUreaNitrogen(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Blood Urea Nitrogen Lab Test&quot;] FirstBUN
      where FirstBUN.status in { 'final', 'amended', 'corrected' }
        and FirstBUN.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        



        



        



        



        



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstAST(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Aspartate transaminase Lab Test&quot;] FirstASTTest
      where FirstASTTest.status in { 'final', 'amended', 'corrected' }
        and FirstASTTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function firstPlatelet(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Platelet Count Lab Test&quot;] FirstPlateletCount
      where FirstPlateletCount.status in { 'final', 'amended', 'corrected' }
        and FirstPlateletCount.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity</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>: http://snomed.info/sct
    <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 LOINC
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://loinc.org
    <br/>
    <em>Canonical URL</em>: <tt>http://loinc.org</tt>
    
  </td>
</tr>
 


<tr>
  
  
  

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


  
  <td class="content-container">
    
    <em>Description</em>: Code system LocationRoles
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://terminology.hl7.org/CodeSystem/v3-RoleCode
    <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>: http://terminology.hl7.org/CodeSystem/ex-diagnosistype
    <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 Elective Inpatient Encounter
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.85
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.85</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Emergency Department Visit
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Obstetrical Or Pregnancy Related Conditions
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.263
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.263</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set General And Neuraxial Anesthesia
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.208
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.208</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>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143
    <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 Outpatient Surgery Service
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.38
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.38</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Albumin Lab Test
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.221
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.221</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Arterial Blood pH
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.96
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.96</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Carbon Dioxide Partial Pressure In Arterial Blood
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.95
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.95</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Hematocrit Lab Test
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.114
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.114</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Hemoglobin Lab Test
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.219
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.219</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Sodium Lab Test
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.119
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.119</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>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591
    <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">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Creatinine Lab Test
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.2363
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.2363</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set White Blood Cells Count Lab Test
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.129
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.129</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set ASA Physical Status Class
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.217
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.217</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Bicarbonate Lab Test
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.139
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.139</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Bilirubin Lab Test
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.223
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.223</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Oxygen Partial Pressure In Arterial Blood
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.94
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.94</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Leukocyte Count Lab Test
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.222
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.222</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Intubation
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.179
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.179</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Anesthesia Requiring Monitored Care
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.255
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.255</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Mechanical Ventilation
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.107
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.107</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Non Invasive Oxygen Therapy By Nasal Cannula Or Mask
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.209
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.209</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Non Invasive Oxygen Therapy
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.213
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.213</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Blood Urea Nitrogen Lab Test
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.218
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.218</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Degenerative Neurological Disorder
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.241
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.241</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Head, Neck, And Thoracic Surgeries With High Risk Airway Compromise
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.251
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.251</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Neuromuscular Disorder
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.239
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.239</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Acute Respiratory Failure
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.88
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.88</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Present On Admission Or Clinically Undetermined
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.197
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.197</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Tracheostomy Diagnoses
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.89
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.89</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Tracheostomy Procedures
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.181
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.181</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Aspartate transaminase Lab Test
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.224
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.224</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Platelet Count Lab Test
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.127
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.127</tt>
    
  </td>
</tr>
 


  
  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Elective (qualifier value)
        <br/>
      
      <em>Code</em>: 103390000
      <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>: Respiratory rate
        <br/>
      
      <em>Code</em>: 9279-1
      <br/>
      <em>System</em>: <tt>http://loinc.org</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Body temperature
        <br/>
      
      <em>Code</em>: 8310-5
      <br/>
      <em>System</em>: <tt>http://loinc.org</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Heart rate
        <br/>
      
      <em>Code</em>: 8867-4
      <br/>
      <em>System</em>: <tt>http://loinc.org</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: American society of anesthesiologists morbidity state
        <br/>
      
      <em>Code</em>: 97816-3
      <br/>
      <em>System</em>: <tt>http://loinc.org</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Systolic blood pressure
        <br/>
      
      <em>Code</em>: 8480-6
      <br/>
      <em>System</em>: <tt>http://loinc.org</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>: Removal of endotracheal tube (procedure)
        <br/>
      
      <em>Code</em>: 271280005
      <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>: QICore model information
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: http://hl7.org/fhir/Library/QICore-ModelInfo
    <br/>
    <em>Canonical URL</em>: <tt>http://hl7.org/fhir/Library/QICore-ModelInfo</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>: https://madie.cms.gov/Library/FHIRHelpers|4.4.000
    <br/>
    <em>Canonical URL</em>: <tt>https://madie.cms.gov/Library/FHIRHelpers|4.4.000</tt>
    
  </td>
</tr>
 


<tr>
  

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


  <td class="content-container">
    
    <em>Description</em>: Library QICoreCommon
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: https://madie.cms.gov/Library/QICoreCommon|4.0.000
    <br/>
    <em>Canonical URL</em>: <tt>https://madie.cms.gov/Library/QICoreCommon|4.0.000</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>: https://madie.cms.gov/Library/CQMCommon|4.1.000
    <br/>
    <em>Canonical URL</em>: <tt>https://madie.cms.gov/Library/CQMCommon|4.1.000</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>: https://madie.cms.gov/Library/SupplementalDataElements|5.1.000
    <br/>
    <em>Canonical URL</em>: <tt>https://madie.cms.gov/Library/SupplementalDataElements|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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient
    <br/>        
  
   
   
    <em>Must Support Elements</em>: birthDate, birthDate.value, url, extension
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, period, id, id.value, location, reasonCode, diagnosis, diagnosis.code, onAdmission
    <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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.38
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, status.value, period, priority, id, id.value, location, reasonCode, diagnosis, diagnosis.code, onAdmission
    <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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.85
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, status.value, period, id, id.value, location, reasonCode, diagnosis, diagnosis.code, onAdmission
    <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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, status.value, period, id, id.value, location, reasonCode, diagnosis, diagnosis.code, onAdmission
    <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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-encounter-diagnosis
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns
    <br/>        
  
   
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Procedure
    <br/>
  
    <em>Profile(s)</em>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.value, performed, id, id.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.255
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Procedure
    <br/>
  
    <em>Profile(s)</em>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.value, performed, id, id.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.208
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Procedure
    <br/>
  
    <em>Profile(s)</em>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.value, performed, id, id.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.179
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Procedure
    <br/>
  
    <em>Profile(s)</em>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.value, performed, id, id.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.209
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Procedure
    <br/>
  
    <em>Profile(s)</em>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.value, performed, id, id.value
    <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>: 
    
      
      http://snomed.info/sct#271280005: 'Removal of endotracheal tube (procedure)'
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Procedure
    <br/>
  
    <em>Profile(s)</em>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.value, performed, id, id.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.251
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Procedure
    <br/>
  
    <em>Profile(s)</em>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, performed, status, status.value, id, id.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.107
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Procedure
    <br/>
  
    <em>Profile(s)</em>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure
    <br/>        
  
   
   
    <em>Must Support Elements</em>: performed, status, status.value, id, id.value, partOf, code
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Procedure
    <br/>
  
    <em>Profile(s)</em>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.value, performed, id, id.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.181
    <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>: 
  
    http://hl7.org/fhir/us/core/StructureDefinition/us-core-respiratory-rate
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.value, effective, value
    <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>: 
    
      
      http://loinc.org#9279-1: 'Respiratory rate'
      
    
    </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>: 
  
    http://hl7.org/fhir/us/core/StructureDefinition/us-core-respiratory-rate
    <br/>        
  
   
   
    <em>Must Support Elements</em>: value
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.221
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.114
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.219
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.119
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.2363
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.129
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.139
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.223
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.222
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.213
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.218
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.value, effective, 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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.95
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.value, effective, 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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.96
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.value, effective, 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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.94
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.224
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.127
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab
    <br/>        
  
   
   
    <em>Must Support Elements</em>: effective, value
    <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>: 
  
    http://hl7.org/fhir/us/core/StructureDefinition/us-core-body-temperature
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.value, effective, value
    <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>: 
    
      
      http://loinc.org#8310-5: 'Body temperature'
      
    
    </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>: 
  
    http://hl7.org/fhir/us/core/StructureDefinition/us-core-body-temperature
    <br/>        
  
   
   
    <em>Must Support Elements</em>: value
    <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>: 
  
    http://hl7.org/fhir/us/core/StructureDefinition/us-core-heart-rate
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.value, effective, value
    <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>: 
    
      
      http://loinc.org#8867-4: 'Heart rate'
      
    
    </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>: 
  
    http://hl7.org/fhir/us/core/StructureDefinition/us-core-heart-rate
    <br/>        
  
   
   
    <em>Must Support Elements</em>: value
    <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>: 
  
    http://hl7.org/fhir/us/core/StructureDefinition/us-core-bmi
    <br/>        
  
   
   
    <em>Must Support Elements</em>: status, status.value, effective, value
    <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>: 
  
    http://hl7.org/fhir/StructureDefinition/Resource
    <br/>        
  
   
   
    <em>Must Support Elements</em>: id, id.value
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-claim
    <br/>        
  
   
   
    <em>Must Support Elements</em>: status, status.value, use, use.value, item
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage
    <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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-screening-assessment
    <br/>        
  
   
   
    <em>Must Support Elements</em>: effective
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-screening-assessment
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, status.value, value
    <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>: 
    
      
      http://loinc.org#97816-3: 'American society of anesthesiologists morbidity state'
      
    
    </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>: 
  
    http://hl7.org/fhir/us/core/StructureDefinition/us-core-blood-pressure
    <br/>        
  
   
   
    <em>Must Support Elements</em>: effective, status, status.value, component
    <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>: 
  
    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-location
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type
    <br/>
   
   
  </td>
</tr>

  
  

<tr>
  <th colspan="2" scope="row" class="row-header">Generated using version 0.4.8 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="103390000"/>
          <display value="Elective (qualifier value)"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://loinc.org"/>
          <code value="9279-1"/>
          <display value="Respiratory rate"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://loinc.org"/>
          <code value="8310-5"/>
          <display value="Body temperature"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://loinc.org"/>
          <code value="8867-4"/>
          <display value="Heart rate"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://loinc.org"/>
          <code value="97816-3"/>
          <display
                   value="American society of anesthesiologists morbidity state"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://loinc.org"/>
          <code value="8480-6"/>
          <display value="Systolic blood pressure"/>
        </valueCoding>
      </extension>
      <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://snomed.info/sct"/>
          <code value="271280005"/>
          <display value="Removal of endotracheal tube (procedure)"/>
        </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="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Elective Inpatient Encounter With Age 18 And Older Without ED Visit"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Elective Inpatient Encounter With Age 18 And Older Without ED Visit&quot;:
  [&quot;Encounter&quot;: &quot;Elective Inpatient Encounter&quot;] ElectiveEncounter
    where ElectiveEncounter.status = 'finished'
      and ElectiveEncounter.period ends during day of &quot;Measurement Period&quot;
      and ElectiveEncounter.priority is not null implies ElectiveEncounter.priority ~ &quot;Elective (qualifier value)&quot;
      and AgeInYearsAt(date from start of ElectiveEncounter.period) &gt;= 18
      and not exists ( [&quot;Encounter&quot;: &quot;Emergency Department Visit&quot;] EDVisit
          where EDVisit.status = 'finished'
            and EDVisit.period ends 1 hour or less before or on start of ElectiveEncounter.period
      )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="0"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Elective Inpatient Encounter With Age And Without Obstetrical Condition"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Elective Inpatient Encounter With Age And Without Obstetrical Condition&quot;:
  &quot;Elective Inpatient Encounter With Age 18 And Older Without ED Visit&quot; ElectiveEncounter
    where not ( ElectiveEncounter.reasonCode in &quot;Obstetrical Or Pregnancy Related Conditions&quot;
        or ElectiveEncounter.encounterReason ( ).code in &quot;Obstetrical Or Pregnancy Related Conditions&quot;
    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="1"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Elective Inpatient Encounter With OR Procedure Within 3 Days"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot;:
  &quot;Elective Inpatient Encounter With Age And Without Obstetrical Condition&quot; ElectiveEncounter
    with [&quot;Procedure&quot;: &quot;General And Neuraxial Anesthesia&quot;] SurgeryWithAnesthesia
      such that SurgeryWithAnesthesia.status = 'completed'
        and SurgeryWithAnesthesia.performed.earliest ( ) during ElectiveEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
        and SurgeryWithAnesthesia.performed.earliest ( ) 3 days or less after start of ElectiveEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="2"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Initial Population"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Initial Population&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="3"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Risk Variable First Respiratory Rate In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First Respiratory Rate In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstRespiratoryRate: QualifyingEncounter.firstRespiratoryRate ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="4"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Risk Variable First Albumin In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First Albumin In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstAlbumin: QualifyingEncounter.firstAlbumin ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="5"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Risk Variable First Arterial pH In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First Arterial pH In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstArterialpH: QualifyingEncounter.firstArterialpH ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="6"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Risk Variable First Body Temperature In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First Body Temperature In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstBodyTemp: QualifyingEncounter.firstBodyTemperature ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="7"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Risk Variable First Carbon Dioxide In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First Carbon Dioxide In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstCarbonDioxide: QualifyingEncounter.firstCarbonDioxide ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="8"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Risk Variable First Hematocrit In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First Hematocrit In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstHematocrit: QualifyingEncounter.firstHematocrit ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="9"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Risk Variable First Heart Rate In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First Heart Rate In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstHeartRate: QualifyingEncounter.firstHeartRate ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="10"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Risk Variable First BMI"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First BMI&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstBMI: QualifyingEncounter.firstBMI ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="11"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Risk Variable First Hemoglobin In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First Hemoglobin In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstHemoglobin: QualifyingEncounter.firstHemoglobin ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="12"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Risk Variable All Encounter Diagnoses With POA Indication"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable All Encounter Diagnoses With POA Indication&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      diagnoses: QualifyingEncounter.claimDiagnosesWithPOA ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="13"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Risk Variable First Sodium In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First Sodium In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstSodium: QualifyingEncounter.firstSodium ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="14"/>
        </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;:
  [Coverage: type in &quot;Payer Type&quot;] Payer
    return {
      code: Payer.type,
      period: Payer.period
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="15"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Payer"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Payer&quot;:
  SDE.&quot;SDE Payer&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="16"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Risk Variable First Creatinine In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First Creatinine In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstCreatinine: QualifyingEncounter.firstCreatinine ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="17"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Risk Variable First White Blood Cell Count In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First White Blood Cell Count In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstWBCcount: QualifyingEncounter.firstWhiteBloodCellCount ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="18"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Risk Variable ASA Physical Status Class"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable ASA Physical Status Class&quot;:
  [&quot;ObservationScreeningAssessment&quot;: &quot;American society of anesthesiologists morbidity state&quot;] ASAclass
    with &quot;Initial Population&quot; QualifyingEncounter
      such that ASAclass.status in { 'final', 'amended', 'corrected' }
        and ASAclass.startsDuringHospitalization ( QualifyingEncounter )
        and ASAclass.value as Concept in &quot;ASA Physical Status Class&quot;
    return ASAclass.value as Concept"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="19"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Risk Variable Principal Procedure"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable Principal Procedure&quot;:
  from
    [&quot;Procedure&quot;] TheProcedure,
    &quot;Initial Population&quot; QualifyingEncounter
    where TheProcedure.status = 'completed'
      and TheProcedure.rank ( QualifyingEncounter ) is not null
      and TheProcedure.startsDuringHospitalization ( QualifyingEncounter )
    return Tuple {
      encounterId: QualifyingEncounter.id,
      procedureId: TheProcedure.id,
      procedureCode: TheProcedure.code,
      procedureRank: TheProcedure.rank ( QualifyingEncounter ),
      procedureTime: TheProcedure.performed.toInterval ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="20"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Risk Variable Body Mass Index (BMI)"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable Body Mass Index (BMI)&quot;:
  [&quot;USCoreBMIProfile&quot;] BMI
    with &quot;Initial Population&quot; InpatientEncounter
      such that BMI.effective.toInterval ( ) starts during InpatientEncounter.hospitalizationWithObservation ( )
        and BMI.value is not null
        and BMI.status in { 'final', 'amended', 'corrected' }
    return BMI.value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="21"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Risk Variable First Bicarbonate In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First Bicarbonate In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstBicarbonate: QualifyingEncounter.firstBicarbonate ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="22"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Risk Variable First Bilirubin In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First Bilirubin In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstBilirubin: QualifyingEncounter.firstBilirubin ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="23"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Qualifying Systolic Blood Pressure Reading"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Qualifying Systolic Blood Pressure Reading&quot;:
  [&quot;USCoreBloodPressureProfile&quot;] BloodPressure
    where BloodPressure.effective.earliest ( ) during day of &quot;Measurement Period&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="24"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Risk Variable First Systolic Blood Pressure In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First Systolic Blood Pressure In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstSystolic: QualifyingEncounter.firstSystolicBloodPressure ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="25"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Risk Variable First Oxygen In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First Oxygen In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstOxygen: QualifyingEncounter.firstOxygen ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="26"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Risk Variable First Leukocyte Count In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First Leukocyte Count In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstLeukocyte: QualifyingEncounter.firstLeukocyte ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="27"/>
        </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;:
  Patient.race R
    return Tuple {
      codes: R.ombCategory union R.detailed,
      display: R.text
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="28"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Race"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Race&quot;:
  SDE.&quot;SDE Race&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="29"/>
        </extension>
      </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;:
  case
    when Patient.sex = '248153007' then &quot;Male (finding)&quot;
    when Patient.sex = '248152002' then &quot;Female (finding)&quot;
    else null
  end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="30"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Sex"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Sex&quot;:
  SDE.&quot;SDE Sex&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="31"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Anesthesia Procedure List"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Anesthesia Procedure List&quot;:
  [&quot;Procedure&quot;: &quot;General And Neuraxial Anesthesia&quot;] AnesthesiaProcedures
    where AnesthesiaProcedures.performed.latest ( ) during day of &quot;Measurement Period&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="32"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="General Anesthesia And MAC"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;General Anesthesia And MAC&quot;:
  [&quot;Procedure&quot;: &quot;Anesthesia Requiring Monitored Care&quot;] MAC
    union [&quot;Procedure&quot;: &quot;General And Neuraxial Anesthesia&quot;]"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="33"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Intubation During General Anesthesia And MAC"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Intubation During General Anesthesia And MAC&quot;:
  from
    &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery,
    [&quot;Procedure&quot;: &quot;Intubation&quot;] ProceduralIntubation,
    &quot;General Anesthesia And MAC&quot; Anesthesia
    where ProceduralIntubation.status = 'completed'
      and ProceduralIntubation.startsDuringHospitalization ( EncounterWithSurgery )
      and ProceduralIntubation.performed.toInterval ( ) starts during Anesthesia.performed.toInterval ( )
    return ProceduralIntubation"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="34"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Encounter With Intubation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter With Intubation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    with [&quot;Procedure&quot;: &quot;Intubation&quot;] EndotrachealTubeIn
      such that EndotrachealTubeIn.status = 'completed'
        and EndotrachealTubeIn.starts30DaysOrLessAfterFirstAnesthesia ( EncounterWithSurgery )
        and EndotrachealTubeIn.startsDuringHospitalization ( EncounterWithSurgery )
        and EndotrachealTubeIn.performed.toInterval ( ) starts after end of EndotrachealTubeIn.latestGeneralAnesthesiaOrMAC ( ).performed.toInterval ( )
        and EncounterWithSurgery.isNotAtProceduralHospitalLocationDuring ( EndotrachealTubeIn.performed.toInterval ( ) )
        and not ( &quot;Intubation During General Anesthesia And MAC&quot;.id contains EndotrachealTubeIn.id )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="35"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Noninvasive Oxygen Therapy"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Noninvasive Oxygen Therapy&quot;:
  ( [&quot;Procedure&quot;: &quot;Non Invasive Oxygen Therapy By Nasal Cannula Or Mask&quot;] P
      where P.status = 'completed'
  )
    union ( [&quot;LaboratoryResultObservation&quot;: &quot;Non Invasive Oxygen Therapy&quot;] O
        where O.status in { 'final', 'amended', 'corrected' }
    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="36"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Encounter With Mechanical Ventilation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure And Preceded By Non Invasive Oxygen Therapy"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter With Mechanical Ventilation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure And Preceded By Non Invasive Oxygen Therapy&quot;:
  from
    &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery,
    [&quot;Procedure&quot;: &quot;Mechanical Ventilation&quot;] Ventilation,
    &quot;Noninvasive Oxygen Therapy&quot; OxygenSupport
    let VentilationInterval: Ventilation.performed.toInterval ( ),
    LatestAnesthesiaInterval: Ventilation.latestGeneralAnesthesiaOrMAC ( ).performed.toInterval ( )
    where Ventilation.status = 'completed'
      and Ventilation.starts30DaysOrLessAfterFirstAnesthesia ( EncounterWithSurgery )
      and Ventilation.startsDuringHospitalization ( EncounterWithSurgery )
      and VentilationInterval starts after end of LatestAnesthesiaInterval
      and OxygenSupport.interval ( ) starts during Interval[end of LatestAnesthesiaInterval, start of VentilationInterval]
      and EncounterWithSurgery.isNotAtProceduralHospitalLocationDuring ( VentilationInterval )
    return EncounterWithSurgery"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="37"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Extubation With Preceding Noninvasive Oxygen"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Extubation With Preceding Noninvasive Oxygen&quot;:
  from
    &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery,
    [&quot;Procedure&quot;: &quot;Removal of endotracheal tube (procedure)&quot;] Extubation,
    &quot;Noninvasive Oxygen Therapy&quot; OxygenSupport
    let LatestAnesthesia: Extubation.latestGeneralAnesthesiaOrMAC ( )
    where Extubation.status = 'completed'
      and Extubation.startsDuringHospitalization ( EncounterWithSurgery )
      and Extubation.performed.toInterval ( ) starts after LatestAnesthesia.performed.toInterval ( )
      and OxygenSupport.interval ( ) starts during Interval[end of LatestAnesthesia.performed.toInterval ( ), start of Extubation.performed.toInterval ( )]
    return Extubation"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="38"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Extubation During General Anesthesia"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Extubation During General Anesthesia&quot;:
  from
    &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery,
    [&quot;Procedure&quot;: &quot;Removal of endotracheal tube (procedure)&quot;] Extubation,
    &quot;General Anesthesia And MAC&quot; Anesthesia
    where Extubation.status = 'completed'
      and Extubation.startsDuringHospitalization ( EncounterWithSurgery )
      and Extubation.performed.toInterval ( ) starts during Anesthesia.performed.toInterval ( )
    return Extubation"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="39"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Encounter With Extubation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure More Than 48 Hours After End Of Anesthesia"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter With Extubation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure More Than 48 Hours After End Of Anesthesia&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    with [&quot;Procedure&quot;: &quot;Removal of endotracheal tube (procedure)&quot;] Extubation
      such that Extubation.status = 'completed'
        and Extubation.isDuringHospitalization ( EncounterWithSurgery )
        and Extubation.starts30DaysOrLessAfterFirstAnesthesia ( EncounterWithSurgery )
        and Extubation.performed.toInterval ( ) starts more than 48 hours after end of Extubation.latestGeneralAnesthesiaOrMAC ( ).performed.toInterval ( )
        and not ( ( &quot;Extubation With Preceding Noninvasive Oxygen&quot;.id contains Extubation.id )
            and not ( &quot;Extubation During General Anesthesia&quot;.id contains Extubation.id )
        )
        and EncounterWithSurgery.isNotAtProceduralHospitalLocation ( )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="40"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Encounter With Mechanical Ventilation Within 30 Days Of End Of First OR Procedure And Between 48 And 72 Hours After End Of OR Procedure And Not Preceded By Non Invasive Oxygen Therapy Or Anesthesia"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter With Mechanical Ventilation Within 30 Days Of End Of First OR Procedure And Between 48 And 72 Hours After End Of OR Procedure And Not Preceded By Non Invasive Oxygen Therapy Or Anesthesia&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    with [&quot;Procedure&quot;: &quot;Mechanical Ventilation&quot;] Ventilation
      such that Ventilation.status = 'completed'
        and Ventilation.performed.toInterval ( ) starts 48 hours or more after end of Ventilation.latestGeneralAnesthesiaOrMAC ( ).performed.toInterval ( )
        and Ventilation.performed.toInterval ( ) starts 72 hours or less after end of Ventilation.latestGeneralAnesthesiaOrMAC ( ).performed.toInterval ( )
        and Ventilation.starts30DaysOrLessAfterFirstAnesthesia ( EncounterWithSurgery )
        and Ventilation.startsDuringHospitalization ( EncounterWithSurgery )
        and not ( &quot;Encounter With Mechanical Ventilation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure And Preceded By Non Invasive Oxygen Therapy&quot;.id contains EncounterWithSurgery.id )
        and EncounterWithSurgery.isNotAtProceduralHospitalLocation ( )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="41"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Numerator"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Numerator&quot;:
  &quot;Encounter With Intubation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure&quot;
    union &quot;Encounter With Mechanical Ventilation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure And Preceded By Non Invasive Oxygen Therapy&quot;
    union &quot;Encounter With Extubation Outside Of Procedural Area Within 30 Days Of End Of First OR Procedure More Than 48 Hours After End Of Anesthesia&quot;
    union &quot;Encounter With Mechanical Ventilation Within 30 Days Of End Of First OR Procedure And Between 48 And 72 Hours After End Of OR Procedure And Not Preceded By Non Invasive Oxygen Therapy Or Anesthesia&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="42"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Denominator"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Denominator&quot;:
  &quot;Initial Population&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="43"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Risk Variable Encounter Procedures"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable Encounter Procedures&quot;:
  from
    [&quot;Procedure&quot;] TheProcedure,
    &quot;Initial Population&quot; QualifyingEncounter
    where TheProcedure.status = 'completed'
      and TheProcedure.startsDuringHospitalization ( QualifyingEncounter )
    return {
      encounterId: QualifyingEncounter.id,
      procedureId: TheProcedure.id,
      procedureCode: TheProcedure.code,
      procedureRank: TheProcedure.rank ( QualifyingEncounter ),
      procedureTime: TheProcedure.performed.toInterval ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="44"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Risk Variable First Blood Urea Nitrogen In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First Blood Urea Nitrogen In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstBUN: QualifyingEncounter.firstBloodUreaNitrogen ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="45"/>
        </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;:
  Patient.ethnicity E
    return Tuple {
      codes: { E.ombCategory } union E.detailed,
      display: E.text
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="46"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Ethnicity"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Ethnicity&quot;:
  SDE.&quot;SDE Ethnicity&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="47"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Encounter With Degenerative Neurological Disorder"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter With Degenerative Neurological Disorder&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    where EncounterWithSurgery.reasonCode in &quot;Degenerative Neurological Disorder&quot;
      or EncounterWithSurgery.encounterReason ( ).code in &quot;Degenerative Neurological Disorder&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="48"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Encounter With High Risk To Airway Head Neck And Thoracic Surgery"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter With High Risk To Airway Head Neck And Thoracic Surgery&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    with [&quot;Procedure&quot;: &quot;Head, Neck, And Thoracic Surgeries With High Risk Airway Compromise&quot;] HeadNeckProcedures
      such that HeadNeckProcedures.status = 'completed'
        and HeadNeckProcedures.startsDuringHospitalization ( EncounterWithSurgery )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="49"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Encounter With Mechanical Ventilation That Starts More Than One Hour Prior To Start Of First OR Procedure"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter With Mechanical Ventilation That Starts More Than One Hour Prior To Start Of First OR Procedure&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    with [&quot;Procedure&quot;: &quot;Mechanical Ventilation&quot;] Ventilation
      such that Ventilation.status = 'completed'
        and Ventilation.performed.toInterval ( ) starts more than 1 hour before start of EncounterWithSurgery.firstAnesthesiaDuringHospitalization ( ).performed.toInterval ( )
        and Ventilation.startsDuringHospitalization ( EncounterWithSurgery )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="50"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Encounter With Neuromuscular Disorder"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter With Neuromuscular Disorder&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    where EncounterWithSurgery.reasonCode in &quot;Neuromuscular Disorder&quot;
      or EncounterWithSurgery.encounterReason ( ).code in &quot;Neuromuscular Disorder&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="51"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Encounter With PaCO2 Greater Than 50 And Arterial pH Less Than 7.30 Within 48 Hours Prior To Start Of First OR Procedure"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter With PaCO2 Greater Than 50 And Arterial pH Less Than 7.30 Within 48 Hours Prior To Start Of First OR Procedure&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    let FirstProcedureTime: EncounterWithSurgery.firstAnesthesiaDuringHospitalization ( ).performed.toInterval ( )
    with [&quot;LaboratoryResultObservation&quot;: &quot;Carbon Dioxide Partial Pressure In Arterial Blood&quot;] CarbonDioxide
      such that CarbonDioxide.status in { 'final', 'amended', 'corrected' }
        and CarbonDioxide.effective.toInterval ( ) starts 48 hours or less before start of FirstProcedureTime
        and CarbonDioxide.value as Quantity &gt; 50 'mm[Hg]'
    with [&quot;LaboratoryResultObservation&quot;: &quot;Arterial Blood pH&quot;] BloodpH
      such that BloodpH.status in { 'final', 'amended', 'corrected' }
        and BloodpH.effective.toInterval ( ) starts 48 hours or less before start of FirstProcedureTime
        and BloodpH.value as Quantity &lt; 7.30 '[pH]'"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="52"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Encounter With PaO2 Less Than 50 Within 48 Hours Prior To Start Of First OR Procedure"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter With PaO2 Less Than 50 Within 48 Hours Prior To Start Of First OR Procedure&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    let FirstProcedure: EncounterWithSurgery.firstAnesthesiaDuringHospitalization ( )
    with [&quot;LaboratoryResultObservation&quot;: &quot;Oxygen Partial Pressure In Arterial Blood&quot;] Oxygen
      such that Oxygen.status in { 'final', 'amended', 'corrected' }
        and Oxygen.effective.toInterval ( ) starts 48 hours or less before start of FirstProcedure.performed.toInterval ( )
        and Oxygen.value as Quantity &lt; 50 'mm[Hg]'"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="53"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Encounter With Principal Diagnosis Of Acute Respiratory Failure"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter With Principal Diagnosis Of Acute Respiratory Failure&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    where EncounterWithSurgery.hasPrincipalDiagnosisOf ( &quot;Acute Respiratory Failure&quot; )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="54"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Encounter With Diagnosis Of Acute Respiratory Failure Present On Admission"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter With Diagnosis Of Acute Respiratory Failure Present On Admission&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    where EncounterWithSurgery.isDiagnosisPresentOnAdmission ( &quot;Acute Respiratory Failure&quot;, &quot;Present On Admission Or Clinically Undetermined&quot; )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="55"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Encounter With Tracheostomy Present On Admission"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter With Tracheostomy Present On Admission&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    where EncounterWithSurgery.isDiagnosisPresentOnAdmission ( &quot;Tracheostomy Diagnoses&quot;, &quot;Present On Admission Or Clinically Undetermined&quot; )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="56"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Encounter With Tracheostomy Before Day Of First OR Procedure"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter With Tracheostomy Before Day Of First OR Procedure&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    let FirstProcedure: EncounterWithSurgery.firstAnesthesiaDuringHospitalization ( )
    with [&quot;Procedure&quot;: &quot;Tracheostomy Procedures&quot;] TracheostomySurgery
      such that TracheostomySurgery.status = 'completed'
        and TracheostomySurgery.startsDuringHospitalization ( EncounterWithSurgery )
        and TracheostomySurgery.performed.toInterval ( ) starts before day of FirstProcedure.performed.toInterval ( )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="57"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Encounter With Tracheostomy Same Day Of First OR Procedure"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter With Tracheostomy Same Day Of First OR Procedure&quot;:
  &quot;Elective Inpatient Encounter With OR Procedure Within 3 Days&quot; EncounterWithSurgery
    let FirstProcedure: EncounterWithSurgery.firstAnesthesiaDuringHospitalization ( )
    with [&quot;Procedure&quot;: &quot;Tracheostomy Procedures&quot;] TracheostomySurgery
      such that TracheostomySurgery.status = 'completed'
        and TracheostomySurgery.startsDuringHospitalization ( EncounterWithSurgery )
        and TracheostomySurgery.performed.toInterval ( ) starts during day of FirstProcedure.performed.toInterval ( )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="58"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Encounter With Tracheostomy Prior To Or On The Same Day Of First OR Procedure"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounter With Tracheostomy Prior To Or On The Same Day Of First OR Procedure&quot;:
  &quot;Encounter With Tracheostomy Before Day Of First OR Procedure&quot;
    union &quot;Encounter With Tracheostomy Same Day Of First OR Procedure&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="59"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Denominator Exclusions"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Denominator Exclusions&quot;:
  &quot;Encounter With Degenerative Neurological Disorder&quot;
    union &quot;Encounter With High Risk To Airway Head Neck And Thoracic Surgery&quot;
    union &quot;Encounter With Mechanical Ventilation That Starts More Than One Hour Prior To Start Of First OR Procedure&quot;
    union &quot;Encounter With Neuromuscular Disorder&quot;
    union &quot;Encounter With PaCO2 Greater Than 50 And Arterial pH Less Than 7.30 Within 48 Hours Prior To Start Of First OR Procedure&quot;
    union &quot;Encounter With PaO2 Less Than 50 Within 48 Hours Prior To Start Of First OR Procedure&quot;
    union &quot;Encounter With Principal Diagnosis Of Acute Respiratory Failure&quot;
    union &quot;Encounter With Diagnosis Of Acute Respiratory Failure Present On Admission&quot;
    union &quot;Encounter With Tracheostomy Present On Admission&quot;
    union &quot;Encounter With Tracheostomy Prior To Or On The Same Day Of First OR Procedure&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="60"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="Risk Variable First AST In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First AST In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstAST: QualifyingEncounter.firstAST ( )
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="61"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Risk Variable First Platelet Count In Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Risk Variable First Platelet Count In Encounter&quot;:
  &quot;Initial Population&quot; QualifyingEncounter
    return Tuple {
      encounterId: QualifyingEncounter.id,
      firstPlatelet: QualifyingEncounter.firstPlatelet ( )
    }"/>
        </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="ToInterval"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)
value to a CQL DateTime Interval
@comment: If the start value of the given period is unspecified, the starting
boundary of the resulting interval will be open (meaning the start of the interval
is unknown, as opposed to interpreted as the beginning of time).
*/
define function ToInterval(period FHIR.Period):
    if period is null then
        null
    else
        if period.&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]"/>
        </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="ToConcept"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.
*/
define function ToConcept(concept FHIR.CodeableConcept):
    if concept is null then
        null
    else
        System.Concept {
            codes: concept.coding C return ToCode(C),
            display: concept.text.value
        }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="64"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToCode"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.
*/
define function ToCode(coding FHIR.Coding):
    if coding is null then
        null
    else
        System.Code {
          code: coding.code.value,
          system: coding.system.value,
          version: coding.version.value,
          display: coding.display.value
        }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="65"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="encounterReason"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function encounterReason(Encounter Encounter):
  Encounter.reasonReference D
    return singleton from ( ( [ConditionEncounterDiagnosis] cA
        union [ConditionProblemsHealthConcerns] cB ) C
        where D.references ( C.id )
    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="66"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="QICoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="references"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@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 Reference, resourceId String):
  resourceId = Last(Split(reference.reference, '/'))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="67"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="QICoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="earliest"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Given an interval, return the starting point if the interval has a starting boundary specified,
otherwise, return the ending point
*/
define fluent function earliest(choice Choice&lt;DateTime, Quantity, Interval&lt;DateTime&gt;, Interval&lt;Quantity&gt;&gt; ):
  (choice.toInterval()) period
    return
      if (period.&quot;hasStart&quot;()) then start of period
      else end of period"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="68"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="QICoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="hasStart"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Given an interval, return true if the interval has a starting boundary specified
(i.e. the start of the interval is not null and not the minimum DateTime value)
*/
define fluent function hasStart(period Interval&lt;DateTime&gt; ):
  not ( start of period is null
      or start of period = minimum DateTime
  )"/>
        </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="hospitalizationWithObservationAndOutpatientSurgeryService"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Hospitalization with Observation and Outpatient Surgery Service returns the total interval from the start of any immediately prior emergency department visit, outpatient surgery visit or observation visit to the discharge of the given encounter.
*/
define fluent function hospitalizationWithObservationAndOutpatientSurgeryService(TheEncounter &quot;Encounter&quot; ):
  TheEncounter Visit
	  let ObsVisit: Last([Encounter: &quot;Observation Services&quot;] LastObs
		  	where LastObs.status = 'finished'
          and LastObs.period ends 1 hour or less on or before start of Visit.period
			  sort by	end of period
    	),
    	VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),
    	EDVisit: Last([Encounter: &quot;Emergency Department Visit&quot;] LastED
			  where LastED.status = 'finished'
          and LastED.period ends 1 hour or less on or before VisitStart
			  sort by	end of period
    	),
    	VisitStartWithED: Coalesce(start of EDVisit.period, VisitStart),
    	OutpatientSurgeryVisit: Last([Encounter: &quot;Outpatient Surgery Service&quot;] LastSurgeryOP
			  where LastSurgeryOP.period ends 1 hour or less on or before VisitStartWithED
			  sort by	end of period
    	)
  	return Interval[Coalesce(start of OutpatientSurgeryVisit.period, VisitStartWithED), end of Visit.period]"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="70"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstRespiratoryRate"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstRespiratoryRate(QualifyingEncounter Encounter):
  First([USCoreRespiratoryRateProfile: &quot;Respiratory rate&quot;] FirstRespiration
      where FirstRespiration.status in { 'final', 'amended', 'corrected' }
        and FirstRespiration.effective.earliest() during QualifyingEncounter.hospitalizationWithObservation()
        and FirstRespiration.value is not null
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="71"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CQMCommon"/>
        </extension>
        <extension url="name">
          <valueString value="hospitalizationWithObservation"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Hospitalization with Observation returns the total interval from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter
*/
define fluent function hospitalizationWithObservation(TheEncounter Encounter ):
  TheEncounter Visit
  		let ObsVisit: Last([Encounter: &quot;Observation Services&quot;] LastObs
  				where LastObs.status = 'finished'
            and LastObs.period ends 1 hour or less on or before start of Visit.period
  				sort by end of period
  			),
  			VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),
  			EDVisit: Last([Encounter: &quot;Emergency Department Visit&quot;] LastED
  				where LastED.status = 'finished'
            and LastED.period ends 1 hour or less on or before VisitStart
  				sort by end of period
  			)
  		return Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="72"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstAlbumin"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstAlbumin(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Albumin Lab Test&quot;] FirstAlbuminTest
      where FirstAlbuminTest.status in { 'final', 'amended', 'corrected' }
        and FirstAlbuminTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="73"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="isEarliestDuringHospitalization"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function isEarliestDuringHospitalization(choice Choice&lt;Procedure, LaboratoryResultObservation&gt;, encounter Encounter):
  case
    when choice is Procedure then ( choice as Procedure ).earliestIsDuringHospitalization ( encounter )
    when choice is LaboratoryResultObservation then ( choice as LaboratoryResultObservation ).earliestOccursDuringHospitalization ( encounter ) 
    else false end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="74"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="earliestIsDuringHospitalization"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function earliestIsDuringHospitalization(procedure Procedure, encounter Encounter):
  procedure.performed.earliest ( ) during encounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
    and procedure.partOf is not null"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="75"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="earliestOccursDuringHospitalization"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function earliestOccursDuringHospitalization(observation LaboratoryResultObservation, encounter Encounter):
  observation.effective.earliest ( ) during encounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
    and observation.value is not null"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="76"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstArterialpH"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstArterialpH(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Arterial Blood pH&quot;] FirstArterialpHTest
      where FirstArterialpHTest.status in { 'final', 'amended', 'corrected' }
        and FirstArterialpHTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="77"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstBodyTemperature"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstBodyTemperature(QualifyingEncounter Encounter):
  First([&quot;USCoreBodyTemperatureProfile&quot;: &quot;Body temperature&quot;] FirstTemperature
      where FirstTemperature.status in { 'final', 'amended', 'corrected' }
        and FirstTemperature.effective.earliest() during QualifyingEncounter.hospitalizationWithObservation()
        and FirstTemperature.value is not null
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="78"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstCarbonDioxide"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstCarbonDioxide(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Carbon Dioxide Partial Pressure In Arterial Blood&quot;] FirstCarbonDioxideTest
      where FirstCarbonDioxideTest.status in { 'final', 'amended', 'corrected' }
        and FirstCarbonDioxideTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="79"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstHematocrit"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstHematocrit(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Hematocrit Lab Test&quot;] FirstHematocritTest
      where FirstHematocritTest.status in { 'final', 'amended', 'corrected' }
        and FirstHematocritTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="80"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstHeartRate"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstHeartRate(QualifyingEncounter Encounter):
  First([&quot;USCoreHeartRateProfile&quot;: &quot;Heart rate&quot;] FirstHeartBeats
      where FirstHeartBeats.status in { 'final', 'amended', 'corrected' }
        and FirstHeartBeats.effective.earliest() during QualifyingEncounter.hospitalizationWithObservation()
        and FirstHeartBeats.value is not null
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="81"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstBMI"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstBMI(QualifyingEncounter Encounter):
  First([USCoreBMIProfile] FirstBodyMass
      where FirstBodyMass.status in { 'final', 'amended', 'corrected' }
        and FirstBodyMass.effective.toInterval() starts during QualifyingEncounter.hospitalizationWithObservation()
        and FirstBodyMass.value is not null
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="82"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstHemoglobin"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstHemoglobin(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Hemoglobin Lab Test&quot;] FirstHemoglobinTest
      where FirstHemoglobinTest.status in { 'final', 'amended', 'corrected' }
        and FirstHemoglobinTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="83"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="claimDiagnosesWithPOA"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function claimDiagnosesWithPOA(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
        and D.onAdmission is not null"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="84"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="QICoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="references"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@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;Reference&gt;, resource Resource):
  exists (references R where R.references(resource))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="85"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="QICoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="references"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns true if the given reference is to the given resource
@comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.
NOTE: This function assumes resources from the same source server.
*/
define fluent function references(reference Reference, resource Resource):
  resource.id = Last(Split(reference.reference, '/'))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="86"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstSodium"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstSodium(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Sodium Lab Test&quot;] FirstSodiumTest
      where FirstSodiumTest.status in { 'final', 'amended', 'corrected' }
        and FirstSodiumTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="87"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstCreatinine"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstCreatinine(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Creatinine Lab Test&quot;] FirstCreatinineTest
      where FirstCreatinineTest.status in { 'final', 'amended', 'corrected' }
        and FirstCreatinineTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="88"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstWhiteBloodCellCount"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstWhiteBloodCellCount(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;White Blood Cells Count Lab Test&quot;] FirstWBCCount
      where FirstWBCCount.status in { 'final', 'amended', 'corrected' }
        and FirstWBCCount.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="89"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="startsDuringHospitalization"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function startsDuringHospitalization(choice Choice&lt;Procedure, LaboratoryResultObservation, ObservationScreeningAssessment&gt;, enc Encounter):
  case
    when choice is Procedure then ( choice as Procedure ).performed.toInterval ( ) starts during enc.hospitalizationWithObservationAndOutpatientSurgeryService ( )
    when choice is LaboratoryResultObservation then ( choice as LaboratoryResultObservation ).effective.toInterval ( ) starts during enc.hospitalizationWithObservationAndOutpatientSurgeryService ( )
    when choice is ObservationScreeningAssessment then ( choice as ObservationScreeningAssessment ).effective.toInterval ( ) starts during enc.hospitalizationWithObservationAndOutpatientSurgeryService ( ) 
    else false end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="90"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="QICoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="toInterval"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
@comment: Normalizes a choice type of DateTime, Quanitty, Interval&lt;DateTime&gt;, or Interval&lt;Quantity&gt; 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 QICore, allowing this function to be used across any resource.
The input can be provided as a DateTime, Quantity, Interval&lt;DateTime&gt; or Interval&lt;Quantity&gt;.
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 Quantity, the quantity is expected to be a calendar-duration interpreted as an Age,
and the result is a DateTime Interval beginning on the Date the patient turned that age and ending immediately before one year later.
If the input is a DateTime Interval, the result is the input.
If the input is a Quantity Interval, the quantities are expected to be calendar-durations interpreted as an Age, and the result
is a DateTime Interval beginning on the date the patient turned the age given as the start of the quantity interval, and ending
immediately before one year later than the date the patient turned the age given as the end of the quantity interval.
If the input is a Timing, an error will be thrown indicating that Timing calculations are not implemented. Any other input will reslt in a null DateTime Interval
*/
define fluent function toInterval(choice Choice&lt;DateTime, Quantity, Interval&lt;DateTime&gt;, Interval&lt;Quantity&gt;, Timing&gt;):
  case
	  when choice is DateTime then
    	Interval[choice as DateTime, choice as DateTime]
		when choice is Interval&lt;DateTime&gt; then
  		choice as Interval&lt;DateTime&gt;
		when choice is Quantity then
		  Interval[Patient.birthDate + (choice as Quantity),
			  Patient.birthDate + (choice as Quantity) + 1 year)
		when choice is Interval&lt;Quantity&gt; then
		  Interval[Patient.birthDate + (choice.low as Quantity),
			  Patient.birthDate + (choice.high as Quantity) + 1 year)
		when choice is Timing then
      Message(null, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported') as Interval&lt;DateTime&gt;
		else
			null as Interval&lt;DateTime&gt;
	end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="91"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="rank"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function rank(targetProcedure Procedure, parentEncounter Encounter):
  singleton from ( targetProcedure P
      let claim: ( [Claim] C
          where C.status = 'active'
            and C.use = 'claim'
            and exists ( C.item I
                where I.encounter.references ( parentEncounter )
            )
      ),
      claimProc: ( claim.procedure proc
          where proc.procedure.references ( P )
      )
      return claimProc.sequence R
  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="92"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstBicarbonate"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstBicarbonate(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Bicarbonate Lab Test&quot;] FirstBicarbonateTest
      where FirstBicarbonateTest.status in { 'final', 'amended', 'corrected' }
        and FirstBicarbonateTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="93"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstBilirubin"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstBilirubin(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Bilirubin Lab Test&quot;] FirstBilirubinTest
      where FirstBilirubinTest.status in { 'final', 'amended', 'corrected' }
        and FirstBilirubinTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="94"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstSystolicBloodPressure"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function &quot;firstSystolicBloodPressure&quot;(QualifyingEncounter Encounter):
  First(&quot;Qualifying Systolic Blood Pressure Reading&quot; SBPReading
      where SBPReading.status in { 'final', 'amended', 'corrected' }
        and SBPReading.effective.earliest() during QualifyingEncounter.hospitalizationWithObservation()
      return singleton from(SBPReading.component SBPComponent
          where SBPComponent.code ~ &quot;Systolic blood pressure&quot;
          return SBPComponent.value as Quantity
      )
  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="95"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstOxygen"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstOxygen(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Oxygen Partial Pressure In Arterial Blood&quot;] FirstOxygenTest
      where FirstOxygenTest.status in { 'final', 'amended', 'corrected' }
        and FirstOxygenTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="96"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstLeukocyte"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstLeukocyte(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Leukocyte Count Lab Test&quot;] FirstLeukocyteCount
      where FirstLeukocyteCount.status in { 'final', 'amended', 'corrected' }
        and FirstLeukocyteCount.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="97"/>
        </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="98"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="starts30DaysOrLessAfterFirstAnesthesia"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function starts30DaysOrLessAfterFirstAnesthesia(procedure Procedure, encounter Encounter):
  procedure.performed.toInterval ( ) starts 30 days or less after end of encounter.firstAnesthesiaDuringHospitalization ( ).performed.toInterval ( )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="99"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstAnesthesiaDuringHospitalization"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function &quot;firstAnesthesiaDuringHospitalization&quot;(QualifyingEncounter Encounter):
  First(&quot;Anesthesia Procedure List&quot; anesthesia
      where anesthesia.status = 'completed'
        and anesthesia.startsDuringHospitalization(QualifyingEncounter)
      sort by start of performed.toInterval()
  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="100"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="QICoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="latest"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Given an interval, returns the ending point if the interval has an ending boundary specified,
otherwise, returns the starting point
*/
define fluent function latest(choice Choice&lt;DateTime, Quantity, Interval&lt;DateTime&gt;, Interval&lt;Quantity&gt;&gt; ):
  (choice.toInterval()) period
    return
      if (period.&quot;hasEnd&quot;()) then end of period
      else start of period"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="101"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="QICoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="hasEnd"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Given an interval, returns true if the interval has an ending boundary specified
(i.e. the end of the interval is not null and not the maximum DateTime value)
*/
define fluent function hasEnd(period Interval&lt;DateTime&gt; ):
  not (
    end of period is null
      or end of period = maximum DateTime
  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="102"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="latestGeneralAnesthesiaOrMAC"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function latestGeneralAnesthesiaOrMAC(event Procedure):
  Last(&quot;General Anesthesia And MAC&quot; ProcedureList
      where ProcedureList.status = 'completed'
        and ProcedureList.performed.toInterval() ends before start of event.performed.toInterval()
      sort by start of performed.toInterval()
  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="103"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="isNotAtProceduralHospitalLocationDuring"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function isNotAtProceduralHospitalLocationDuring(encounter Encounter, intrvl Interval&lt;DateTime&gt;):
  not exists ( encounter.location EncounterLocation
      with [Location] Location
        such that EncounterLocation.location.references ( Location )
          and Location.type.includesCode ( &quot;ER&quot; )
          and EncounterLocation.period starts during intrvl
  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="104"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="QICoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="includesCode"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@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;Concept&gt;, code Code):
  exists (codeList C where C ~ code)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="105"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="isDuringHospitalization"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function isDuringHospitalization(choice Choice&lt;Procedure, LaboratoryResultObservation&gt;, enc Encounter):
  case
    when choice is Procedure then ( choice as Procedure ).performed.toInterval ( ) during enc.hospitalizationWithObservationAndOutpatientSurgeryService ( )
    when choice is LaboratoryResultObservation then ( choice as LaboratoryResultObservation ).effective.toInterval ( ) during enc.hospitalizationWithObservationAndOutpatientSurgeryService ( ) 
    else false end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="106"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="isNotAtProceduralHospitalLocation"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function isNotAtProceduralHospitalLocation(encounter Encounter):
  not exists ( encounter.location EncounterLocation
      with [Location] Location
        such that EncounterLocation.location.references ( Location )
          and Location.type.includesCode ( &quot;ER&quot; )
  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="107"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstBloodUreaNitrogen"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstBloodUreaNitrogen(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Blood Urea Nitrogen Lab Test&quot;] FirstBUN
      where FirstBUN.status in { 'final', 'amended', 'corrected' }
        and FirstBUN.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="108"/>
        </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="/*
 @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 ValueSet):
   (encounter.principalDiagnosis()) PD
     return PD.diagnosis in valueSet
       or PD.diagnosis.getCondition().code in valueSet"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="109"/>
        </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="/*
@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;)
   )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="110"/>
        </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="/*
@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"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="111"/>
        </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="/*
@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))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="112"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CQMCommon"/>
        </extension>
        <extension url="name">
          <valueString value="isDiagnosisPresentOnAdmission"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
 @description: Returns true if the given diagnosis is present on admission, based on the given poaValueSet
 @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 isDiagnosisPresentOnAdmission(encounter Encounter, diagnosisValueSet ValueSet, poaValueSet ValueSet):
   exists (
     (encounter.claimDiagnosis()) CD
       where CD.onAdmission in poaValueSet
         and (
           CD.diagnosis in diagnosisValueSet
             or CD.diagnosis.getCondition().code in diagnosisValueSet
         )
   )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="113"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstAST"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstAST(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Aspartate transaminase Lab Test&quot;] FirstASTTest
      where FirstASTTest.status in { 'final', 'amended', 'corrected' }
        and FirstASTTest.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="114"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CMS1218FHIRHHRF"/>
        </extension>
        <extension url="name">
          <valueString value="firstPlatelet"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function firstPlatelet(QualifyingEncounter Encounter):
  First([LaboratoryResultObservation: &quot;Platelet Count Lab Test&quot;] FirstPlateletCount
      where FirstPlateletCount.status in { 'final', 'amended', 'corrected' }
        and FirstPlateletCount.isEarliestDuringHospitalization(QualifyingEncounter)
      sort by effective.earliest()
  ).value as Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="115"/>
        </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="QICore model information"/>
        <resource value="http://hl7.org/fhir/Library/QICore-ModelInfo"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library FHIRHelpers"/>
        <resource value="https://madie.cms.gov/Library/FHIRHelpers|4.4.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library QICoreCommon"/>
        <resource value="https://madie.cms.gov/Library/QICoreCommon|4.0.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library CQMCommon"/>
        <resource value="https://madie.cms.gov/Library/CQMCommon|4.1.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library SDE"/>
        <resource
                  value="https://madie.cms.gov/Library/SupplementalDataElements|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 LOINC"/>
        <resource value="http://loinc.org"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system LocationRoles"/>
        <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 Elective Inpatient Encounter"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.85"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Emergency Department Visit"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display
                 value="Value set Obstetrical Or Pregnancy Related Conditions"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.263"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set General And Neuraxial Anesthesia"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.208"/>
      </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 Outpatient Surgery Service"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.38"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Albumin Lab Test"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.221"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Arterial Blood pH"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.96"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display
                 value="Value set Carbon Dioxide Partial Pressure In Arterial Blood"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.95"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Hematocrit Lab Test"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.114"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Hemoglobin Lab Test"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.219"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Sodium Lab Test"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.119"/>
      </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>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Creatinine Lab Test"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.2363"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set White Blood Cells Count Lab Test"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.129"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set ASA Physical Status Class"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.217"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Bicarbonate Lab Test"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.139"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Bilirubin Lab Test"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.223"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Oxygen Partial Pressure In Arterial Blood"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.94"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Leukocyte Count Lab Test"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.222"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Intubation"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.179"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Anesthesia Requiring Monitored Care"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.255"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Mechanical Ventilation"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.107"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display
                 value="Value set Non Invasive Oxygen Therapy By Nasal Cannula Or Mask"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.209"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Non Invasive Oxygen Therapy"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.213"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Blood Urea Nitrogen Lab Test"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.218"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Degenerative Neurological Disorder"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.241"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display
                 value="Value set Head, Neck, And Thoracic Surgeries With High Risk Airway Compromise"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.251"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Neuromuscular Disorder"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.239"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Acute Respiratory Failure"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.88"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display
                 value="Value set Present On Admission Or Clinically Undetermined"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.197"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Tracheostomy Diagnoses"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.89"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Tracheostomy Procedures"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.181"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Aspartate transaminase Lab Test"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.224"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Platelet Count Lab Test"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.127"/>
      </relatedArtifact>
      <parameter>
        <name value="Measurement Period"/>
        <use value="in"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Period"/>
      </parameter>
      <parameter>
        <name value="Initial Population"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Numerator"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Denominator"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Denominator Exclusions"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Payer"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Race"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Sex"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Coding"/>
      </parameter>
      <parameter>
        <name value="SDE Ethnicity"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First Respiratory Rate In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First Albumin In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First Arterial pH In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First Body Temperature In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First Carbon Dioxide In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First Hematocrit In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First Heart Rate In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First BMI"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First Hemoglobin In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name
              value="Risk Variable All Encounter Diagnoses With POA Indication"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First Sodium In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First Creatinine In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name
              value="Risk Variable First White Blood Cell Count In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable ASA Physical Status Class"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="CodeableConcept"/>
      </parameter>
      <parameter>
        <name value="Risk Variable Principal Procedure"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable Body Mass Index (BMI)"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Quantity"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First Bicarbonate In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First Bilirubin In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name
              value="Risk Variable First Systolic Blood Pressure In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First Oxygen In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First Leukocyte Count In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable Encounter Procedures"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First Blood Urea Nitrogen In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First AST In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Risk Variable First Platelet Count In Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <dataRequirement>
        <type value="Patient"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient"/>
        <mustSupport value="birthDate"/>
        <mustSupport value="birthDate.value"/>
        <mustSupport value="url"/>
        <mustSupport value="extension"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="period"/>
        <mustSupport value="id"/>
        <mustSupport value="id.value"/>
        <mustSupport value="location"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="diagnosis.code"/>
        <mustSupport value="onAdmission"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.38"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="period"/>
        <mustSupport value="priority"/>
        <mustSupport value="id"/>
        <mustSupport value="id.value"/>
        <mustSupport value="location"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="diagnosis.code"/>
        <mustSupport value="onAdmission"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.85"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="period"/>
        <mustSupport value="id"/>
        <mustSupport value="id.value"/>
        <mustSupport value="location"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="diagnosis.code"/>
        <mustSupport value="onAdmission"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="period"/>
        <mustSupport value="id"/>
        <mustSupport value="id.value"/>
        <mustSupport value="location"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="diagnosis.code"/>
        <mustSupport value="onAdmission"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-encounter-diagnosis"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Procedure"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="performed"/>
        <mustSupport value="id"/>
        <mustSupport value="id.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.255"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Procedure"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="performed"/>
        <mustSupport value="id"/>
        <mustSupport value="id.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.208"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Procedure"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="performed"/>
        <mustSupport value="id"/>
        <mustSupport value="id.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.179"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Procedure"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="performed"/>
        <mustSupport value="id"/>
        <mustSupport value="id.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.209"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Procedure"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="performed"/>
        <mustSupport value="id"/>
        <mustSupport value="id.value"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://snomed.info/sct"/>
            <code value="271280005"/>
            <display value="Removal of endotracheal tube (procedure)"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Procedure"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="performed"/>
        <mustSupport value="id"/>
        <mustSupport value="id.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.251"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Procedure"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure"/>
        <mustSupport value="code"/>
        <mustSupport value="performed"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="id"/>
        <mustSupport value="id.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.107"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Procedure"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure"/>
        <mustSupport value="performed"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="id"/>
        <mustSupport value="id.value"/>
        <mustSupport value="partOf"/>
        <mustSupport value="code"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Procedure"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="performed"/>
        <mustSupport value="id"/>
        <mustSupport value="id.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.181"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-respiratory-rate"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="effective"/>
        <mustSupport value="value"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://loinc.org"/>
            <code value="9279-1"/>
            <display value="Respiratory rate"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-respiratory-rate"/>
        <mustSupport value="value"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.221"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.114"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.219"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.119"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.2363"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.129"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.139"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.223"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.222"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.213"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.218"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="effective"/>
        <mustSupport value="value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.95"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="effective"/>
        <mustSupport value="value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.96"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="effective"/>
        <mustSupport value="value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.94"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.224"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.127"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab"/>
        <mustSupport value="effective"/>
        <mustSupport value="value"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-body-temperature"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="effective"/>
        <mustSupport value="value"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://loinc.org"/>
            <code value="8310-5"/>
            <display value="Body temperature"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-body-temperature"/>
        <mustSupport value="value"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-heart-rate"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="effective"/>
        <mustSupport value="value"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://loinc.org"/>
            <code value="8867-4"/>
            <display value="Heart rate"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-heart-rate"/>
        <mustSupport value="value"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-bmi"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="effective"/>
        <mustSupport value="value"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Resource"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Resource"/>
        <mustSupport value="id"/>
        <mustSupport value="id.value"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Claim"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-claim"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="use"/>
        <mustSupport value="use.value"/>
        <mustSupport value="item"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Coverage"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage"/>
        <mustSupport value="type"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-screening-assessment"/>
        <mustSupport value="effective"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-screening-assessment"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="value"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://loinc.org"/>
            <code value="97816-3"/>
            <display
                     value="American society of anesthesiologists morbidity state"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-blood-pressure"/>
        <mustSupport value="effective"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="component"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Location"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-location"/>
        <mustSupport value="type"/>
      </dataRequirement>
    </Library>
  </contained>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-supplementalDataGuidance" id="supplementalDataGuidance">
    <extension url="guidance">
      <valueString
                   value="&lt;p&gt;For every patient evaluated by this measure also identify payer, race, ethnicity and sex&lt;/p&gt;"/>
    </extension>
    <extension url="usage">
      <valueCodeableConcept>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
          <code value="supplemental-data"/>
          <display value="Supplemental Data"/>
        </coding>
        <text value="Supplemental Data Guidance"/>
      </valueCodeableConcept>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-supplementalDataGuidance" id="riskAdjustmentVariableGuidance">
    <extension url="guidance">
      <valueString
                   value="&lt;p&gt;Variables are collected for the development of baseline risk adjustment model&lt;/p&gt;
&lt;p&gt;Report the first resulted vital sign values during the encounter in the Unified Code for Units of Measure (UCUM) units specified:&lt;/p&gt;
&lt;ul&gt;
 &lt;li&gt;Body temperature: Cel, [degF]&lt;/li&gt;
 &lt;li&gt;Heart rate: {Beats}/min&lt;/li&gt;
 &lt;li&gt;Respiratory rate: {Breaths}/min&lt;/li&gt;
 &lt;li&gt;Systolic blood pressure: mm[Hg]&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Report the first resulted laboratory test values during the encounter in UCUM units specified:&lt;/p&gt;
&lt;ul&gt;
 &lt;li&gt;Albumin: g/dL, umol/L&lt;/li&gt;
 &lt;li&gt;Aspartate aminotransferase (AST/SGOT): U/L, IU/L&lt;/li&gt;
 &lt;li&gt;Bicarbonate: mmol/L&lt;/li&gt;
 &lt;li&gt;Bilirubin: mg/dL, umol/L&lt;/li&gt;
 &lt;li&gt;Blood urea nitrogen (BUN): mg/dL, umol/L&lt;/li&gt;
 &lt;li&gt;Carbon dioxide (partial pressure): mm[Hg]&lt;/li&gt;
 &lt;li&gt;Creatinine: mg/dL, umol/L&lt;/li&gt;
 &lt;li&gt;Hematocrit: %&lt;/li&gt;
 &lt;li&gt;Hemoglobin: g/dL, mmol/L&lt;/li&gt;
 &lt;li&gt;Leukocyte count: {cells}/uL, 10&lt;em&gt;3/uL, 10&lt;/em&gt;9/L, /mm3&lt;/li&gt;
 &lt;li&gt;Oxygen (partial pressure): mm[Hg]&lt;/li&gt;
 &lt;li&gt;pH of arterial blood: [pH]&lt;/li&gt;
 &lt;li&gt;Platelet count: 10&lt;em&gt;3/uL, 10&lt;/em&gt;9/L, /mm3&lt;/li&gt;
 &lt;li&gt;Sodium: meq/L, mmol/L&lt;/li&gt;
 &lt;li&gt;White blood cell count: {cells}/uL, 10&lt;em&gt;3/uL, 10&lt;/em&gt;9/L, /mm3&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Additional variables used for risk adjustment:&lt;/p&gt;
&lt;ul&gt;
 &lt;li&gt;American Society of Anesthesiologists (ASA) physical status class assessment that starts during the encounter&lt;/li&gt;
 &lt;li&gt;First Body mass index (BMI), reported using UCUM unit: kg/m2&lt;/li&gt;
 &lt;li&gt;Encounter diagnoses with their present on admission (POA) indicators&lt;/li&gt;
 &lt;li&gt;Most recent smoking status&lt;/li&gt;
 &lt;li&gt;Principal surgical procedures that start during the encounter&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Please see the Hospital Harm - Postoperative Respiratory Failure Risk Adjustment Methodology Report on the dQM-specific page on the eCQI Resource Center website: https://ecqi.healthit.gov/&lt;/p&gt;"/>
    </extension>
    <extension url="usage">
      <valueCodeableConcept>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
          <code value="risk-adjustment-factor"/>
          <display value="Risk Adjustment Factor"/>
        </coding>
        <text value="Risk Adjustment Variable Guidance"/>
      </valueCodeableConcept>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements">
    <valueReference>
      <reference value="#effective-data-requirements"/>
    </valueReference>
  </extension>
  <url value="https://madie.cms.gov/Measure/CMS1218FHIRHHRF"/>
  <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="CMS1218FHIR"/>
  </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:b6857e46-6412-432d-abc8-0508efc0d2d7"/>
  </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:fb07b5c1-50c3-45e7-b8c7-ca26409a0f48"/>
  </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="4130e"/>
    <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="1218FHIR"/>
    <assigner>
      <display value="CMS"/>
    </assigner>
  </identifier>
  <version value="1.0.000"/>
  <name value="CMS1218FHIRHHRF"/>
  <title value="Hospital Harm - Postoperative Respiratory FailureFHIR
"/>
  <status value="active"/>
  <experimental value="false"/>
  <date value="2025-08-25T21:52:10+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 number of elective inpatient hospitalizations for patients aged 18 years and older without an obstetrical condition who have a procedure resulting in postoperative respiratory failure (PRF)
"/>
  <usage
         value="PRF is evaluated using mechanical ventilation (MV) documentation or intubation and extubation documentation to allow for hospital documentation variances. Therefore, if MV documentation is not available, intubation and extubation can serve as a proxy for determining if MV occurred and its duration. To determine that an unplanned initiation of MV occurred, the logic looks for evidence of a non-invasive oxygen therapy assessment such as oxygen via 'nasal canula' or 'breathing room air' prior to the MV occurrence to verify that MV was newly initiated. Additionally, facility location codes are used to determine if MV was initiated outside of a procedural area (e.g., medical floor). Conversely, to determine MV duration, the logic looks for evidence that a non-invasive oxygen therapy assessment or another operating room procedure does not exist prior to the MV occurrence to verify that MV was continued without interruption from a procedural area.

&lt;br /&gt;

This dQM is an episode-based measure. An episode is defined as each inpatient hospitalization or encounter that ends during the measurement period.

&lt;br /&gt;

This FHIR-based measure has been derived from the QDM-based measure: CMS1218v2. Please refer to the HL7 QI-Core Implementation Guide (https://hl7.org/fhir/us/qicore/STU6/) for more information on QI-Core and mapping recommendations from QDM to QI-Core STU 6 (https://hl7.org/fhir/us/qicore/STU6/qdm-to-qicore.html).
"/>
  <copyright
             value="Limited proprietary coding is contained in the Measure specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets. Mathematica disclaims all liability for use or accuracy of any third-party codes contained in the specifications. LOINC(R) copyright 2004-2024 Regenstrief Institute, Inc.

This material contains SNOMED Clinical Terms(R) (SNOMED CT\[R\]) copyright 2004-2024 International Health Terminology Standards Development Organisation. ICD-10 copyright 2024 World Health Organization. All Rights Reserved.
"/>
  <effectivePeriod>
    <start value="2026-01-01"/>
    <end value="2026-12-31"/>
  </effectivePeriod>
  <author>
    <name value="Mathematica"/>
    <telecom>
      <system value="url"/>
      <value value="https://www.mathematica.org/"/>
    </telecom>
  </author>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Arozullah, A.M., Daley, J., Henderson, W.G., \&amp; Khuri, S.F. (2000). Multifactorial risk index for predicting postoperative respiratory failure in men after major noncardiac surgery. The National Veterans Administration Surgical Quality Improvement Program. Annals of surgery. 232(2):242-253. doi: 10.1097/00000658-200008000-00015. PMID: 10903604; PMCID: PMC1421137.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Canet, J., \&amp; Gallart, L. (2014). Postoperative respiratory failure: Pathogenesis, prediction, and prevention. Current Opinion in Critical Care. 20(1):56-62. doi: 10.1097/MCC.0000000000000045. PMID: 24240985.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Canet, J., Sabate, S., Mazo, V., Gallart, L., de Abreu, M.G., Belda, J., ... \&amp; Pelosi, P. (2015). PERISCOPE group. Development and validation of a score to predict postoperative respiratory failure in a multicentre European cohort: A prospective, observational study. Eur J Anaesthesiol. 32(7):458-70. doi: 10.1097/EJA.0000000000000223. PMID: 26020123.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Gupta, H., Gupta, P.K., Fang, X., Miller, W.J., Cemaj, S., Forse, R.A., \&amp; Morrow, L.E. (2011). Development and validation of a risk calculator predicting postoperative respiratory failure. Chest. 140(5):1207-1215. doi: 10.1378/chest.11-0466. Epub 2011 Jul 14. PMID: 21757571.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Kor, D.J., Lingineni, R.K., Gajic, O., Park, P.K., Blum, J.M., Hou, P.C., ... \&amp; Talmor, D.S. (2014). Predicting risk of postoperative lung injury in high-risk surgical patients: a multicenter cohort study. Anesthesiology. 120(5):1168-81. doi: 10.1097/ALN.0000000000000216. PMID: 24755786; PMCID: PMC3999474.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Miller, M.R., Elixhauser, A., Zhan, C., \&amp; Meyer, G.S. (2001). Patient Safety Indicators: using administrative data to identify potential patient safety concerns. Health Serv Res. 36(6 Pt 2):110-32. PMID: 16148964; PMCID: PMC1383610.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Rahman, M., Neal, D., Fargen, K.M., \&amp; Hoh, B.L. (2013). Establishing standard performance measures for adult brain tumor patients: a Nationwide Inpatient Sample database study. Neuro Oncol. 15(11):1580-8. doi: 10.1093/neuonc/not108. Epub 2013 Sep 30. PMID: 24084409; PMCID: PMC3813415.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Romano, P.S., Mull, H.J., Rivard, P.E., Zhao, S., Henderson, W.G., Loveland, S., Tsilimingras, D., ... \&amp; Rosen, A.K. (2009). Validity of selected AHRQ patient safety indicators based on VA National Surgical Quality Improvement Program data. Health Serv Res. 44(1):182-204. doi: 10.1111/j.1475-6773.2008.00905.x. Epub 2008 Sep 17. PMID: 18823449; PMCID: PMC2669628.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Thompson, S.L., \&amp; Lisco, S.J. (2018). Postoperative respiratory failure. Int Anesthesiol Clin. 56(1):147-164. doi: 10.1097/AIA.0000000000000173. PMID: 29189437.
"/>
  </relatedArtifact>
  <library value="https://madie.cms.gov/Library/CMS1218FHIRHHRF"/>
  <disclaimer
              value="This performance measure is not a clinical guideline, does not establish a standard of medical care, and has not been tested for all potential applications.

THE MEASURES AND SPECIFICATIONS ARE PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND.

Due to technical limitations, registered trademarks are indicated by (R) or \[R\] and unregistered trademarks are indicated by (TM) or \[TM\].
"/>
  <rationale
             value="Postoperative respiratory failure (PRF), defined as unplanned endotracheal reintubation, prolonged inability to wean from mechanical ventilation, or inadequate oxygenation and/or ventilation, is the most common serious postoperative pulmonary complication, with an incidence of up to 7.5% (the incidence of any postoperative pulmonary complication ranges from 10-40%) (Arozullah et al., 2000; Canet et al., 2015; Gupta et al., 2011; Kor et al., 2014). This measure addresses the prevalence of PRF and the variance between hospitals in the incidence of PRF. PRF is a serious complication that can increase the risk of morbidity and mortality, with in-hospital mortality resulting from PRF estimated at 25% to 40% (Arozullah et al., 2000; Canet \&amp; Gallart, 2014). Surgical procedures complicated by PRF have 3.74 times higher adjusted odds of death than those not complicated by respiratory failure, 1.47 times higher odds of 90-day readmission, and 1.86 times higher odds of an outpatient visit with one of 44 postoperative conditions (e.g., bacterial infection, fluid and electrolyte disorder, abdominal hernia) within 90 days of hospital discharge (Miller et al., 2001; Romano et al, 2009). PRF is additionally associated with prolonged mechanical ventilation and the need for rehabilitation or skilled nursing facility placement upon discharge (Thompson \&amp; Lisco, 2018).

The incidence of PRF varies by hospital, with higher reported rates of PRF in nonteaching hospitals than teaching hospitals (Rahman et al., 2013). Additionally, one study found that the odds of developing PRF increased by 6% for each level increase in hospital size from small to large (Rahman et al., 2013). This suggests that there remains room for improvement in hospitals reporting higher rates of PRF.

The most widely used current measures of PRF are based on either claims data (CMS Patient Safety Indicator (PSI) 11) or proprietary registry data (National Surgical Quality Improvement Program (NSQIP) of the American College of Surgeons). The dQM is closely modeled after the NSQIP measure of PRF, which has been widely adopted across American hospitals, and is intended to complement and eventually supplant CMS PSI 11.
"/>
  <clinicalRecommendationStatement
                                   value="Recent studies and current clinical practice guidelines for PRF have identified enhanced recovery pathways, prophylactic mucolytics, postoperative continuous positive airway pressure ventilation, lung protective intraoperative ventilation, prophylactic respiratory physiotherapy, epidural analgesia, and goal directed hemodynamic therapy as evidence-based interventions to reduce the incidence of PRF. Yet, progress in reducing the incidence of PRF has been stymied by lack of consensus regarding the definition of PRF, which patients are most at-risk, which risk factors are potentially modifiable, and which patients are more likely to benefit from targeted interventions of a health care system's limited resources. This measure would address this gap in data.

Relevant clinical guidelines for preventing postoperative respiratory failure can be found in the following:

* Mohanty, et al. Optimal Perioperative Management of the Geriatric Patient: Best Practices Guideline from ACS NSQIP/AGS, 2016

* Piraino, et al. AARC Clinical Practice Guideline: Management of Adult Patients with Oxygen in the Acute Care Setting, 2022

"/>
  <group id="Group_1">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-scoring">
      <valueCodeableConcept>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-scoring"/>
          <code value="proportion"/>
          <display value="Proportion"/>
        </coding>
      </valueCodeableConcept>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-populationBasis">
      <valueCode value="Encounter"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-type">
      <valueCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/measure-type"/>
          <code value="outcome"/>
          <display value="Outcome"/>
        </coding>
      </valueCodeableConcept>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-rateAggregation">
      <valueString value="None
"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-improvementNotation">
      <valueCodeableConcept>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-improvement-notation"/>
          <code value="decrease"/>
          <display value="Decreased score indicates improvement"/>
        </coding>
      </valueCodeableConcept>
    </extension>
    <population id="InitialPopulation_1">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="initial-population"/>
          <display value="Initial Population"/>
        </coding>
      </code>
      <description
                   value="Elective inpatient hospitalizations with no preceding emergency department visit that end during the measurement period for patients aged 18 and older without an obstetrical condition and at least one surgical procedure was performed within the first 3 days of the encounter
"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Initial Population"/>
      </criteria>
    </population>
    <population id="Denominator_1">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="denominator"/>
          <display value="Denominator"/>
        </coding>
      </code>
      <description value="Equals Initial Population
"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Denominator"/>
      </criteria>
    </population>
    <population id="DenominatorExclusion_1">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="denominator-exclusion"/>
          <display value="Denominator Exclusion"/>
        </coding>
      </code>
      <description
                   value="Inpatient hospitalizations for patients:

With a diagnosis for a degenerative neurological disorder

With any selected head, neck, and thoracic surgery involving significant risk of airway compromise or requiring airway protection

Who have mechanical ventilation that starts more than one hour prior to the start of the first operating room (OR) procedure

With a diagnosis for a neuromuscular disorder

With arterial partial pressure of carbon dioxide (PaCO2)\&gt;50 mmHg combined with an arterial pH\&lt;7.30 within 48 hours or less prior to the start of the first OR procedure

With arterial partial pressure of oxygen (PaO2)\&lt;50 mmHg within 48 hours or less prior to the start of the first OR procedure

With a principal diagnosis for acute respiratory failure

With a diagnosis for acute respiratory failure present on admission

With any diagnosis present on admission for the existence of a tracheostomy

Where a tracheostomy is performed before or on the same day as the first OR procedure
"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Denominator Exclusions"/>
      </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="Elective inpatient hospitalizations for patients with postoperative respiratory failure as evidenced by any of the following:

Criterion A: Mechanical ventilation (MV) initiated within 30 days after first OR procedure, as evidenced by:

A.1. Intubation that occurs outside of a procedural area and within 30 days after the end of the first OR procedure of the encounter.

or

A.2. MV that occurs outside of a procedural area within 30 days after the end of the first OR procedure of the encounter and is preceded by a period of non-invasive oxygen therapy between the end of the OR procedure and the MV occurrence, and without a subsequent OR procedure between the non-invasive oxygen therapy and the MV occurrence.

or

Criterion B: MV with a duration of more than 48 hours after the first OR procedure, as evidenced by:

B.1. Extubation that occurs outside of a procedural area more than 48 hours after the end of an OR procedure and within 30 days after the end of the first OR procedure, and is not preceded by a period of non-invasive oxygen therapy or a subsequent OR procedure between the end of the OR procedure and the extubation occurrence.

or

B.2 Mechanical ventilation that occurs between 48 and 72 hours after the end of an OR procedure and within 30 days after the end of the first OR procedure, and is not preceded by a non-invasive oxygen therapy or a subsequent OR procedure between the end of the OR procedure and the MV occurrence.
"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Numerator"/>
      </criteria>
    </population>
  </group>
  <supplementalData id="sde-ethnicity">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="SDE Ethnicity
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Ethnicity"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-payer">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="SDE Payer
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Payer"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-race">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="SDE Race
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Race"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-sex">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="SDE Sex
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Sex"/>
    </criteria>
  </supplementalData>
  <supplementalData
                    id="risk-variable-all-encounter-diagnoses-with-poa-indication">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description
                 value="Risk Variable All Encounter Diagnoses With POA Indication
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression
                  value="Risk Variable All Encounter Diagnoses With POA Indication"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-asa-physical-status-class">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable ASA Physical Status Class
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable ASA Physical Status Class"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-body-mass-index-(bmi)">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable Body Mass Index (BMI)
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable Body Mass Index (BMI)"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-encounter-procedures">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable Encounter Procedures
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable Encounter Procedures"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-first-albumin-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable First Albumin In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable First Albumin In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-first-arterial-ph-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable First Arterial pH In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable First Arterial pH In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-first-ast-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable First AST In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable First AST In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-first-bicarbonate-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable First Bicarbonate In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable First Bicarbonate In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-first-bilirubin-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable First Bilirubin In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable First Bilirubin In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData
                    id="risk-variable-first-blood-urea-nitrogen-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description
                 value="Risk Variable First Blood Urea Nitrogen In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression
                  value="Risk Variable First Blood Urea Nitrogen In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-first-bmi">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable First BMI
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable First BMI"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-first-body-temperature-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable First Body Temperature In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable First Body Temperature In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-first-carbon-dioxide-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable First Carbon Dioxide In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable First Carbon Dioxide In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-first-creatinine-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable First Creatinine In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable First Creatinine In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-first-heart-rate-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable First Heart Rate In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable First Heart Rate In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-first-hematocrit-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable First Hematocrit In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable First Hematocrit In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-first-hemoglobin-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable First Hemoglobin In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable First Hemoglobin In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-first-leukocyte-count-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable First Leukocyte Count In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable First Leukocyte Count In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-first-oxygen-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable First Oxygen In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable First Oxygen In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-first-platelet-count-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable First Platelet Count In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable First Platelet Count In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-first-respiratory-rate-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable First Respiratory Rate In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable First Respiratory Rate In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-first-sodium-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable First Sodium In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable First Sodium In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData
                    id="risk-variable-first-systolic-blood-pressure-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description
                 value="Risk Variable First Systolic Blood Pressure In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression
                  value="Risk Variable First Systolic Blood Pressure In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData
                    id="risk-variable-first-white-blood-cell-count-in-encounter">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description
                 value="Risk Variable First White Blood Cell Count In Encounter
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression
                  value="Risk Variable First White Blood Cell Count In Encounter"/>
    </criteria>
  </supplementalData>
  <supplementalData id="risk-variable-principal-procedure">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="individual"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="subject-list"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="summary"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType">
      <valueCode value="data-collection"/>
    </extension>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="risk-adjustment-factor"/>
      </coding>
    </usage>
    <description value="Risk Variable Principal Procedure
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="Risk Variable Principal Procedure"/>
    </criteria>
  </supplementalData>
</Measure>