Draft dQM CMS Content Implementation Guide
2025.1.0 - CI Build

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

: NHSN Glycemic Control Hypoglycemia Initial Population - XML Representation

Active as of 2026-01-16

Raw xml | Download


<Measure xmlns="http://hl7.org/fhir">
  <id value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
  <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/cohort-measure-cqfm"/>
  </meta>
  <text>
    <status value="extensions"/>
    <div xmlns="http://www.w3.org/1999/xhtml">
  <table class="narrative-table">
    <tbody>
<tr>


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


</tr>

<tr>


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



<td class="content-container">NHSN Glycemic Control Hypoglycemia Initial Population
</td>


</tr>



<tr>


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



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


</tr>


  
<tr>


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



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


</tr>



  
<tr>


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



<td class="content-container">urn:uuid:0d555fb6-f654-418c-a2b3-2dd0c3f0e7b4</td>


</tr>



  
<tr>


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



<td class="content-container">urn:uuid:dc9459ed-48ca-45f3-923e-3352d9547461</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">Use Context</th>



<td class="content-container">
    Venue

 = 
    EH


</td>


</tr>









<tr>


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



<td class="content-container">Centers for Disease Control and Prevention (CDC)</td>


</tr>






<tr>


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



<td class="content-container">Lantana Consulting Group</td>


</tr>






<tr>


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



<td class="content-container"><div><p>All inpatient encounters (including ED/Observation visits that end within 1 hour of the start of the inpatient encounter) for patients of all ages where at least one diabetes medication was ordered or administered during the encounter that is during the measurement period.</p>
</div></td>


</tr>



<tr>


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



<td class="content-container"><div><p>The primary objective of the NHSN Glycemic Control module is to measure and benchmark medication-related hypoglycemia and hyperglycemia events within a facility. NHSN uses line-level data on medications and blood glucose reported by facilities to provide analytic reports to inform quality-improvement efforts for glycemic control and track patient safety events. As NHSN collects additional data, an additional objective will be to allow inter-facility benchmarking and evaluate national-level trends of medication-related hypoglycemia over time.</p>
</div></td>


</tr>



<tr>


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



<td class="content-container"><div><p>Limited proprietary coding is contained in the Measure specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets.</p>
</div></td>


</tr>


<tr>


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



<td class="content-container"><div><p>Disclaimer 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>This measure and specifications are subject to further revisions.</p>
</div></td>


</tr>













<tr>


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



<td class="content-container"><div><p>The NHSN Glycemic Control module supports an electronic health record (EHR)- and vendor-neutral standard for reporting patient-level, linked medication and blood glucose data for inpatients. These data support calculation of inpatient medication-related hypoglycemia events by the NHSN application, which are then returned as reports to the facility.</p>
</div></td>


</tr>


<tr>


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



<td class="content-container"><div><p>Inpatient hypoglycemia can be severe and life-threatening and is associated with longer hospital stays and increased medical costs (Wexler et al., 2007; Curkendall et al., 2009; Cook et al., 2009; Turchin et al., 2009; Egi et al., 2010). The prevalence of inpatient hypoglycemia varies with patient, hospital unit, timing of episodes, and glycemic threshold. Severe hypoglycemia (&lt;40 mg/dL) occurs in 2%--5% of hospitalized patients with diabetes mellitus (DM), while hypoglycemia &lt;70 mg/dL has been reported in up to 10% of all patients in the intensive care unit (Finfer et al., 2012). Patients with DM comprise more than 25% of all U.S. inpatient stays and medication-related hypoglycemia events are common causes of adverse drug events (ADEs) that occur in inpatient settings (Bates et al., 2023; Spector et al., 2017). Rates of severe hypoglycemia vary across hospitals, suggesting opportunities for improvement in glycemic-control quality of care (Hulkower et al., 2014; ADA, 2013; Cook et al., 2009).</p>
<p>Inpatient hyperglycemia can increase morbidity, prolong hospital stays, and increase the risk of mortality (Maynard et al., 2014; SHM, n.d.; Umpierrez et al., 2002; Kyi et al., 2019; Pratiwi et al., 2021). The prevalence of inpatient hyperglycemia varies depending upon glycemic threshold and setting, but blood glucose &gt;140 mg/dL likely occurs in approximately one-eighth to one-quarter of hospitalized patients (Pratiwi et al., 2021; Seisa et al., 2022; Barmanray et al., 2024). Tracking patient blood-glucose levels and implementing appropriate interventions may reduce complications associated with both hyperglycemia and hypoglycemia (ADA, 2013; Cook et al., 2009; Korytkowski et al., 2022; Moghissi et al., 2009).</p>
</div></td>


</tr>



<tr>
  
  
  
  

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


  
  
  
  <td class="content-container">
    
    
    
    <div><p>American Diabetes Association. Economic costs of diabetes in the U.S. in 2012. Diabetes Care 2013;36:1033--46.</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  
  <td class="content-container">
    
    
    
    <div><p>Bates, D. W., Levine, D. M., Salmasian, H., et al. (2023). The safety of inpatient health care. New England Journal of Medicine, 388(12), 142--153.</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  
  <td class="content-container">
    
    
    
    <div><p>Classen, D. C., Resar, R., Griffin, F., et al. (2011). 'Global trigger tool' shows that adverse events in hospitals may be ten times greater than previously measured. Health Affairs, 30(4), 581--589.</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  
  <td class="content-container">
    
    
    
    <div><p>Cook, C. B., Kongable, G. L., Potter, D. J., et al. (2009). Inpatient glucose control: A glycemic survey of 126 U.S. hospitals. Journal of Hospital Medicine, 4(E7), E7--E14.</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  
  <td class="content-container">
    
    
    
    <div><p>Curkendall, S. M., Natoli, J. L., Alexander, C. M., et al. (2009). Economic and clinical impact of inpatient diabetic hypoglycemia. Endocrine Practice, 15(3), 302--312.</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  
  <td class="content-container">
    
    
    
    <div><p>Egi, M., Bellomo, R., Stachowski, E., et al. (2010). Hypoglycemia and outcome in critically ill patients. Mayo Clinic Proceedings, 85(3), 217--224.</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  
  <td class="content-container">
    
    
    
    <div><p>Finfer, S., Liu, B., Chittock, D. R., et al. (2012). Hypoglycemia and risk of death in critically ill patients. New England Journal of Medicine, 367, 1108--1118.</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  
  <td class="content-container">
    
    
    
    <div><p>Gates, P. J., Meyerson, S. A., Baysari, M. T., et al. (2018). Preventable adverse drug events among inpatients: A systematic review. Pediatrics, 142, e20180805.</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  
  <td class="content-container">
    
    
    
    <div><p>Hulkower RD, Pollack RM, Zonszein J. Understanding hypoglycemia in hospitalized patients. Diabetes Manag (Lond) 2014;4:165-76.</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  
  <td class="content-container">
    
    
    
    <div><p>Maynard, G., et al. (2014). How sweet is it? The use of benchmarking to optimize inpatient glycemic control. Diabetes Spectrum, 27, 212--217.</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  
  <td class="content-container">
    
    
    
    <div><p>Moghissi ES, Korytkowski MT, DiNardo M. American Association of Clinical Endocrinologists and American Diabetes Association consensus statement on inpatient glycemic control. Endocr Pract 2009;15:353-69.</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  
  <td class="content-container">
    
    
    
    <div><p>Society of Hospital Medicine. Glycemic Control for Hospitalists. Optimizing Care, Preventing Hypoglycemia. Available at: https://www.hospitalmedicine.org/clinical-topics/glycemic-control.</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  
  <td class="content-container">
    
    
    
    <div><p>Spector, W. D., Limcangco, R., Furukawa, M. F., Encinosa, W. E. (2017). The marginal costs of adverse drug events associated with exposures to anticoagulants and hypoglycemic agents during hospitalization. Medical Care, 55(8), 856--863.</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  
  <td class="content-container">
    
    
    
    <div><p>Turchin, A., Matheny, M. E., Shubina, M., et al. (2009). Hypoglycemia and clinical outcomes in patients with diabetes hospitalized in the general ward. Diabetes Care, 32(7), 1153--1157.</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  
  <td class="content-container">
    
    
    
    <div><p>Umpierrez, G. E., Isaacs, S. D., Bazargan, N., et al. (2002). Hyperglycemia: An independent marker of in-hospital mortality in patients with undiagnosed diabetes. Journal of Clinical Endocrinology &amp; Metabolism, 87(3), 978--982.</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>

<tr>
  
  
  
  

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


  
  
  
  <td class="content-container">
    
    
    
    <div><p>Wexler, D. J., et al. (2007). Prevalence of hyper- and hypoglycemia among inpatients with diabetes: A national survey of 44 U.S. hospitals. Diabetes Care, 30(2), 367--369.</p>
</div>
    
    
    
    
    
    
    
  </td>
</tr>






  
  
<tr>


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



<td class="content-container">Blood glucose: Blood-glucose data refers to data from random, periprandial, or fasting tests; from capillary, serum, plasma, interstitial fluid, or whole-blood sources; using central laboratory device (CLD) or point-of-care (POC) testing. Data from continuous glucose monitoring (CGM) systems can only be captured if they are integrated into the EHR and exposed in the corresponding FHIR resources. Post-glucose administration tests are excluded. Events are based on the day/time the laboratory test was collected (drawn). If day/time collected is not available, the day/time the lab was ordered is used.
</td>


</tr>


  
  
<tr>


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



<td class="content-container">Emergency department (ED)/Observation (Obs) encounter: Any patient visit to an ED or observation location. One (1) patient visit equals one (1) encounter. ED/Observation encounters are considered outpatient locations.
</td>


</tr>


  
  
<tr>


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



<td class="content-container">Hypoglycemic medication: All currently and previously commercially available oral or injectable hypoglycemic medications in the United States.
</td>


</tr>


  
  
<tr>


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



<td class="content-container">Inpatient encounter: Includes all encounters in inpatient locations.
</td>


</tr>


  
  
<tr>


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



<td class="content-container">Mild hypoglycemia event: Blood glucose 54.0 mg/dL to 69.9 mg/dL as identified on CLD or prescription POC device with no subsequent repeat test for blood glucose with a result \&gt; 80 mg/dL within 5 minutes of the start of the initial low blood glucose test.
</td>


</tr>


  
  
<tr>


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



<td class="content-container">Moderate hypoglycemia event: Blood glucose 40.0 mg/dL to 53.9 mg/dL as identified on CLD or prescription POC device with no subsequent repeat test for blood glucose with a result \&gt; 80 mg/dL within 5 minutes of the start of the initial low blood glucose test.
</td>


</tr>


  
  
<tr>


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



<td class="content-container">Severe hypoglycemia event: Blood glucose \&lt; 40.0 mg/dL as identified on CLD or prescription POC device with no subsequent repeat test for blood glucose with a result \&gt; 80 mg/dL within 5 minutes of the start of the initial low blood glucose test.
</td>


</tr>



<tr>


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



<td class="content-container">All participating inpatient facilities reporting data to the NHSN Glycemic Control module must be able to report data electronically in adherence to HL7 FHIR US Core FHIR R4.0.1 data standards and specifications and NHSN instructions for reporting dQMs, including the HL7 NHSN dQM Reporting Implementation Guide (https://build.fhir.org/ig/HL7/nhsn-dqm/).
</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">
    Cohort


</td>


</tr>









<tr>


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



<td class="content-container">
    Process


</td>


</tr>




  
  

    
      
        
  
    
    
    <tr>
      
        

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


      
      <td class="content-container">
        
        <em>ID</em>: InitialPopulation_1
        <br/>
        
        
          <em>Description</em>:
          <p style="white-space: pre-line" class="tab-one">All inpatient encounters, as well as ED and OBS encounters that end within 1 hour of the start of the inpatient encounter, for patients of all ages where at least one diabetes medication was ordered or administered during the encounter that is during the measurement period.
</p>
        
        
          
            
              
              <em>Criteria</em>: <a href="#Group_1-InitialPopulation_1">Initial Population</a> 
            
          
          
        
        
        
      </td>
    </tr>
  

      
    

  


  







  
    
    
    
    
    
<tr>


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



<td class="content-container">&lt;p&gt;Supplemental Data&lt;/p&gt;</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-encounter-locations
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: SDE Encounter Locations

    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-encounter-locations">SDE Encounter Locations</a> 
        
      
    
  </td>
</tr>

<tr>
  

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


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

    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-location">SDE Location</a> 
        
      
    
  </td>
</tr>

<tr>
  

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


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

    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-medication">SDE Medication</a> 
        
      
    
  </td>
</tr>

<tr>
  

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


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

    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-blood-glucose-observation">SDE Blood Glucose Observation</a> 
        
      
    
  </td>
</tr>

<tr>
  

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


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

    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-chief-complaint">SDE Chief Complaint</a> 
        
      
    
  </td>
</tr>

<tr>
  

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


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

    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-condition">SDE Condition</a> 
        
      
    
  </td>
</tr>

<tr>
  

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


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

    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-coverage">SDE Coverage</a> 
        
      
    
  </td>
</tr>

<tr>
  

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


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

    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-initial-population-encounters">SDE Initial Population Encounters</a> 
        
      
    
  </td>
</tr>

<tr>
  

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


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

    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-medication-administration">SDE Medication Administration</a> 
        
      
    
  </td>
</tr>

<tr>
  

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


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

    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-medication-request">SDE Medication Request</a> 
        
      
    
  </td>
</tr>

<tr>
  

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


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

    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-minimal-patient">SDE Minimal Patient</a> 
        
      
    
  </td>
</tr>

<tr>
  

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


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

    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-service-request">SDE Service Request</a> 
        
      
    
  </td>
</tr>

<tr>
  

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


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

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

<tr>
  

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


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

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

<tr>
  

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


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

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

<tr>
  

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


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

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


<tr>


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


</tr>

<tr>


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



<td class="content-container"><a href="Library-NHSNGlycemicControlHypoglycemiaInitialPopulation.html">NHSNGlycemicControlHypoglycemiaInitialPopulation</a></td>


</tr>




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


  <tr>


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


</tr>
  
  
  

  
  
  
    
    <tr>


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


</tr>
  
  
  
  

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

  <td>
    
    
    
    
      
      <a name="Group_1-InitialPopulation_1"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">// Initial Population


define &quot;Initial Population&quot;:
  ( &quot;Inpatient Encounters During Measurement Period&quot;
    union &quot;Encounters with Patient Hospital Locations&quot; ) InpatientEncounters
    with &quot;Antidiabetic Drugs Administered or Ordered&quot; ADD
      such that Coalesce(start of ADD.effective.toInterval(), ADD.authoredOn) during InpatientEncounters.&quot;hospitalizationWithObservation&quot; ( )
    where ( InpatientEncounters.status = 'finished'
        or InpatientEncounters.status = 'in-progress'
        or InpatientEncounters.status = 'triaged'
        or InpatientEncounters.status = 'onleave'
        or InpatientEncounters.status = 'entered-in-error'
    )</code></pre>
    
      
      <a href="#nhsnglycemiccontrolhypoglycemiainitialpopulation-initial-population"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
      
    
  

      
    

  


  


  

  
  


  <tr>


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


</tr>
  
  
          
        



        



        



        



        



        



        



        



        



        


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

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

</tr>
<tr>

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

</tr>



        



        



        


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

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

</tr>
<tr>

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

</tr>



        



        



        



        



        


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

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

</tr>
<tr>

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

</tr>



        



        


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

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

</tr>
<tr>

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

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


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

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

</tr>
<tr>

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

</tr>



        



        



        



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cqmcommon-getmedicationcode"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns the medication code for the given MedicationRequest
*/
define fluent function getMedicationCode(request Choice&lt;MedicationAdministration, MedicationRequest&gt;):
  if request.medication is FHIR.CodeableConcept then
  	  request.medication as FHIR.CodeableConcept
  	else
  	  (singleton from ([Medication] M where request.medication.references(M))).code</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="cqmcommon-hospitalizationwithobservation"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Hospitalization with Observation returns the total interval from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter
*/
define fluent function hospitalizationWithObservation(TheEncounter Encounter ):
  TheEncounter Visit
  		let ObsVisit: Last([Encounter: &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">
    Logic Definition
  </th>

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

</tr>
<tr>

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

</tr>



        


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

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

</tr>
<tr>

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

</tr>



        



        



        


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

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

</tr>
<tr>

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

</tr>



        


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

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

</tr>
<tr>

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

</tr>



        



        



        


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

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

</tr>
<tr>

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

</tr>



        


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

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

</tr>
<tr>

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

</tr>



        


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

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

</tr>
<tr>

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

</tr>



        


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

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

</tr>
<tr>

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

</tr>



        


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

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

</tr>
<tr>

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

</tr>



        



        


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

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

</tr>
<tr>

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

</tr>



        



        



        



        


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

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

</tr>
<tr>

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

</tr>



        



        



        



        



        



        



        



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


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

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

</tr>
<tr>

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

</tr>



        



        



        



        


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

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

</tr>
<tr>

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

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

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

</tr>



        



        



        



        



        



        



        



        



        


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

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

</tr>
<tr>

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

</tr>



        


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

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

</tr>
<tr>

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

</tr>



        



        


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

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

</tr>
<tr>

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

</tr>



        


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

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

</tr>
<tr>

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

</tr>



        



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhircommon-prevalenceinterval"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns an interval representing the normalized prevalence period of a given Condition resource.
@comment: Uses the toInterval and toAbatementInterval functions to determine the widest potential interval from
onset to abatement as specified in the given Condition.
*/
define fluent function prevalenceInterval(condition Condition):
if condition.clinicalStatus ~ &quot;active&quot;
  or condition.clinicalStatus ~ &quot;recurrence&quot;
  or condition.clinicalStatus ~ &quot;relapse&quot; then
  Interval[start of condition.onset.toInterval(), end of condition.abatementInterval()]
else
  (end of condition.abatementInterval()) abatementDate
    return 
	  if abatementDate is null then
        Interval[start of condition.onset.toInterval(), abatementDate)
      else
        Interval[start of condition.onset.toInterval(), abatementDate]</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhircommon-abatementinterval"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns an interval representing the normalized Abatement of a given Condition resource.
@comment: @comment: If the abatement element of the Condition is represented as a DateTime, the result
is an interval beginning and ending on that DateTime.
If the abatement is represented as a Quantity, the quantity is expected to be a calendar-duration and is interpreted as the age of the patient. The
result is an interval from the date the patient turned that age to immediately before one year later.
If the abatement is represented as a Quantity Interval, the quantities are expected to be calendar-durations and are interpreted as an age range during
which the abatement occurred. The result is an interval from the date the patient turned the starting age of the quantity interval, and ending immediately
before one year later than the date the patient turned the ending age of the quantity interval.

NOTE: Due to the complexity of determining an interval from a String, this function will throw
a run-time exception if used with a Condition instance that has a String as the abatement value.
*/
define fluent function abatementInterval(condition Condition):
  if condition.abatement is FHIR.dateTime then
    Interval[FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime), FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime)]
  else if condition.abatement is FHIR.Period then
    FHIRHelpers.ToInterval(condition.abatement as FHIR.Period)
  else if condition.abatement is FHIR.string then
    Message(null as Interval&lt;DateTime&gt;, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')
  else if condition.abatement is FHIR.Age then
    Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age),
      FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age) + 1 year)
  else if condition.abatement is FHIR.Range then
    Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).low),
      FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).high) + 1 year)
  else if condition.abatement is FHIR.boolean then
    Interval[end of condition.onset.toInterval(), condition.recordedDate)
  else 
    null</code></pre>
  </td>

</tr>



        



        



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="usqualitycorecommon-getid"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns the id of the given uri (i.e. everything after the last slash)
*/
define fluent function getId(uri String):
  Last(Split(uri, '/'))</code></pre>
  </td>

</tr>



        



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


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

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

</tr>
<tr>

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

</tr>



        



        



        



        



        



        


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

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

</tr>
<tr>

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

</tr>



        



        



        



        


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

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

</tr>
<tr>

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

</tr>



        




        
        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-inpatient-encounters-during-measurement-period"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Inpatient Encounters During Measurement Period&quot;:
  [Encounter: &quot;Encounter Inpatient&quot;] InpatientEncounters
    where InpatientEncounters.period ends during day of &quot;Measurement Period&quot;
      and ( InpatientEncounters.class ~ USQualityCoreCommon.&quot;inpatient non-acute&quot;
          or InpatientEncounters.class ~ USQualityCoreCommon.&quot;inpatient non-acute&quot;
          or InpatientEncounters.class ~ USQualityCoreCommon.&quot;short stay&quot;
          or InpatientEncounters.class ~ USQualityCoreCommon.&quot;inpatient acute&quot;
          or InpatientEncounters.class ~ USQualityCoreCommon.&quot;inpatient encounter&quot;
      )</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-encounters-with-patient-hospital-locations"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Encounters with Patient Hospital Locations&quot;:
  &quot;Inpatient Encounters During Measurement Period&quot; InpatientEncounter
    where exists ( InpatientEncounter.location HospitalLocation
        where HospitalLocation.location.getLocation ( ).type in &quot;Inpatient, Emergency, and Observation Locations&quot;
          and HospitalLocation.period during day of InpatientEncounter.period
    )</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-medicationrequests"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;MedicationRequests&quot;:
  [MedicationRequest]</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-medicationadministrations"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;MedicationAdministrations&quot;:
  [MedicationAdministration]</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-antidiabetic-drugs-administered-or-ordered"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Antidiabetic Drugs Administered or Ordered&quot;:
  ( &quot;MedicationRequests&quot;
    union &quot;MedicationAdministrations&quot; ) MedReqOrAdmin
    where MedReqOrAdmin.getMedicationCode() in &quot;Diabetes Medications&quot;</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-initial-population"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">// Initial Population


define &quot;Initial Population&quot;:
  ( &quot;Inpatient Encounters During Measurement Period&quot;
    union &quot;Encounters with Patient Hospital Locations&quot; ) InpatientEncounters
    with &quot;Antidiabetic Drugs Administered or Ordered&quot; ADD
      such that Coalesce(start of ADD.effective.toInterval(), ADD.authoredOn) during InpatientEncounters.&quot;hospitalizationWithObservation&quot; ( )
    where ( InpatientEncounters.status = 'finished'
        or InpatientEncounters.status = 'in-progress'
        or InpatientEncounters.status = 'triaged'
        or InpatientEncounters.status = 'onleave'
        or InpatientEncounters.status = 'entered-in-error'
    )</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-coverage"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Coverage&quot;:
  [Coverage] Coverages
    where exists ( &quot;Initial Population&quot; IP
        where Coverages.period starts before or on day of IP.period
          and end of Coverages.period on or after day of end of IP.period
    )
    return { Coverages.id, Coverages.meta, Coverages.status, Coverages.type, Coverages.policyHolder, Coverages.subscriber, Coverages.subscriberId, Coverages.beneficiary, Coverages.dependent, Coverages.relationship, Coverages.period, Coverages.payor, Coverages.class, Coverages.order, Coverages.network, Coverages.subrogation, Coverages.contract }</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-medication-request"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Medication Request&quot;:
  &quot;MedicationRequests&quot; MedRequests
    where exists ( &quot;Initial Population&quot; InitialPopulation
        where MedRequests.authoredOn during InitialPopulation.&quot;hospitalizationWithObservation&quot; ( )
    )
    return { MedRequests.id, MedRequests.meta, MedRequests.status, MedRequests.statusReason, MedRequests.intent, MedRequests.category, MedRequests.priority, MedRequests.doNotPerform, MedRequests.reported, MedRequests.medication, MedRequests.subject, MedRequests.encounter, MedRequests.authoredOn, MedRequests.requester, MedRequests.recorder, MedRequests.reasonCode, MedRequests.reasonReference, MedRequests.instantiatesCanonical, MedRequests.instantiatesUri, MedRequests.courseOfTherapyType, MedRequests.dosageInstruction }</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-encounter-locations"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Encounter Locations&quot;:
  &quot;Initial Population&quot; IP
    where exists ( IP.location InitialPopulationLocation
        let types: ( InitialPopulationLocation.location ).getLocation ( ).type
        where exists ( types type
            where type in &quot;Inpatient, Emergency, and Observation Locations&quot;
        )
          and InitialPopulationLocation.period during IP.period
    )
    return { IP.id, IP.meta, IP.identifier, IP.status, IP.statusHistory, IP.class, IP.classHistory, IP.type, IP.serviceType, IP.priority, IP.subject, IP.period, IP.length, IP.reasonCode, IP.reasonReference, IP.diagnosis, IP.account, IP.hospitalization, IP.location, IP.partOf }</code></pre>
  </td>

</tr>



        



        


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

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

</tr>
<tr>

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

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-medication-administration"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Medication Administration&quot;:
  &quot;MedicationAdministrations&quot; MedAdministrations
    where exists ( &quot;Initial Population&quot; InitialPopulation
        where MedAdministrations.effective.toInterval ( ) overlaps InitialPopulation.&quot;hospitalizationWithObservation&quot; ( )
    )
    return { MedAdministrations.id, MedAdministrations.meta, MedAdministrations.instantiates, MedAdministrations.partOf, MedAdministrations.status, MedAdministrations.statusReason, MedAdministrations.category, MedAdministrations.medication, MedAdministrations.subject, MedAdministrations.context, MedAdministrations.supportingInformation, MedAdministrations.effective, MedAdministrations.performer, MedAdministrations.reasonCode, MedAdministrations.reasonReference, MedAdministrations.request, MedAdministrations.device, MedAdministrations.note, MedAdministrations.dosage }</code></pre>
  </td>

</tr>



        



        


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

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

</tr>
<tr>

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

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-initial-population-encounters"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Initial Population Encounters&quot;:
  &quot;Initial Population&quot; IP
    return { IP.id, IP.meta, IP.identifier, IP.status, IP.statusHistory, IP.class, IP.classHistory, IP.type, IP.serviceType, IP.priority, IP.subject, IP.period, IP.length, IP.reasonCode, IP.reasonReference, IP.diagnosis, IP.account, IP.hospitalization, IP.location, IP.partOf }</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-blood-glucose-observation"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">//Supplemental Data Elements


define &quot;SDE Blood Glucose Observation&quot;:
  ( [&quot;LaboratoryResultObservation&quot;: &quot;Blood Glucose Laboratory and Point of Care Tests&quot;] GlucoseTest
      where exists ( &quot;Initial Population&quot; InitialPopulation
          where start of GlucoseTest.effective.toInterval ( ) during day of InitialPopulation.period
            or GlucoseTest.issued during day of InitialPopulation.period
      )
      return { GlucoseTest.id, GlucoseTest.extension, GlucoseTest.text, GlucoseTest.referenceRange, GlucoseTest.component, GlucoseTest.basedOn, GlucoseTest.partOf, GlucoseTest.category, GlucoseTest.status, GlucoseTest.subject, GlucoseTest.focus, GlucoseTest.encounter, GlucoseTest.effective, GlucoseTest.issued, GlucoseTest.performer, GlucoseTest.value, GlucoseTest.dataAbsentReason, GlucoseTest.interpretation, GlucoseTest.note, GlucoseTest.bodySite, GlucoseTest.method, GlucoseTest.specimen, GlucoseTest.device, GlucoseTest.hasMember, GlucoseTest.derivedFrom }
  )</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-condition"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Condition&quot;:
  [&quot;ConditionProblemsHealthConcerns&quot;] Diagnosis
    where exists ( &quot;Initial Population&quot; IP
        where Diagnosis.prevalenceInterval ( ) overlaps day of IP.period
    )
    return { Diagnosis.id, Diagnosis.meta, Diagnosis.clinicalStatus, Diagnosis.verificationStatus, Diagnosis.category, Diagnosis.severity, Diagnosis.code, Diagnosis.bodySite, Diagnosis.subject, Diagnosis.encounter.reference.getId(), Diagnosis.onset, Diagnosis.stage, Diagnosis.evidence, Diagnosis.note }</code></pre>
  </td>

</tr>



        



        


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

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

</tr>
<tr>

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

</tr>



        



        


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

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

</tr>
<tr>

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

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-get-locations-from-initial-population"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Get Locations from Initial Population&quot;:
  flatten ( &quot;Initial Population&quot; IP
      let locationElements: IP.location
      return locationElements LE
        let locationReference: LE.location
        return ( locationReference.getLocation ( ) )
  )</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-location"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Location&quot;:
  &quot;Get Locations from Initial Population&quot; Locations
    where exists &quot;Initial Population&quot;
      and Locations is not null
    return { Locations.id, Locations.meta, Locations.extension, Locations.status, Locations.operationalStatus, Locations.name, Locations.alias, Locations.description, Locations.mode, Locations.type, Locations.telecom, Locations.address, Locations.physicalType, Locations.position, Locations.managingOrganization, Locations.partOf, Locations.hoursOfOperation, Locations.availabilityExceptions, Locations.endpoint }</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-service-request"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Service Request&quot;:
  [ServiceRequest] ServiceRequests
    where exists ( &quot;Initial Population&quot; InitialPopulation
        where ServiceRequests.authoredOn during InitialPopulation.period
    )
    return { ServiceRequests.id, ServiceRequests.meta, ServiceRequests.instantiatesCanonical, ServiceRequests.instantiatesUri, ServiceRequests.basedOn, ServiceRequests.replaces, ServiceRequests.requisition, ServiceRequests.status, ServiceRequests.intent, ServiceRequests.category, ServiceRequests.priority, ServiceRequests.doNotPerform, ServiceRequests.code, ServiceRequests.orderDetail, ServiceRequests.quantity, ServiceRequests.subject, ServiceRequests.encounter, ServiceRequests.occurrence, ServiceRequests.asNeeded, ServiceRequests.authoredOn, ServiceRequests.requester, ServiceRequests.performerType, ServiceRequests.performer, ServiceRequests.locationCode, ServiceRequests.reasonCode, ServiceRequests.reasonReference, ServiceRequests.insurance, ServiceRequests.bodySite, ServiceRequests.note, ServiceRequests.patientInstruction }</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-minimal-patient"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Minimal Patient&quot;:
  [Patient] MinPt
    where exists &quot;Initial Population&quot;
    return { MinPt.id, MinPt.meta, MinPt.extension, MinPt.identifier, MinPt.active, MinPt.name, MinPt.telecom, MinPt.gender, MinPt.birthDate, MinPt.deceased, MinPt.address, MinPt.maritalStatus, MinPt.multipleBirth, MinPt.photo, MinPt.contact, MinPt.communication, MinPt.generalPractitioner, MinPt.managingOrganization, MinPt.link }</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-medication"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Medication&quot;:
  ( &quot;MedicationRequests&quot;
    union &quot;MedicationAdministrations&quot; ) MedReqOrAdmin
    let medication: GetMedication(MedReqOrAdmin.medication as Reference)
    where medication is not null
      and exists ( &quot;Initial Population&quot; IP
          where Coalesce(MedReqOrAdmin.effective.toInterval(), MedReqOrAdmin.authoredOn.toInterval()) overlaps IP.&quot;hospitalizationWithObservation&quot; ( )
      )
    return { medication.id, medication.meta, medication.code, medication.status, medication.manufacturer, medication.form, medication.amount, medication.ingredient, medication.batch }</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-sde-chief-complaint"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Chief Complaint&quot;:
  &quot;Initial Population&quot; IP
    where exists ( IP.diagnosis InitialPopulationDiagnosis
        where InitialPopulationDiagnosis.use ~ FHIRCommon.&quot;CC&quot;
    )
    return { IP.id, IP.meta, IP.identifier, IP.status, IP.statusHistory, IP.class, IP.classHistory, IP.type, IP.serviceType, IP.priority, IP.subject, IP.period, IP.length, IP.reasonCode, IP.reasonReference, IP.diagnosis, IP.account, IP.hospitalization, IP.location, IP.partOf }</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="nhsnglycemiccontrolhypoglycemiainitialpopulation-getmedication"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function &quot;GetMedication&quot;(reference Reference):
  singleton from ( [Medication] Medication
      where reference.references ( Medication )
  )</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 ActCode
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://terminology.hl7.org/7.1.0/CodeSystem-v3-ActCode.html">ActCode</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-ActCode</tt>
    
  </td>
</tr>
 


<tr>
  
  
  

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


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


<tr>
  
  
  

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


  
  <td class="content-container">
    
    <em>Description</em>: Code system ConditionClinicalStatusCodes
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://terminology.hl7.org/7.1.0/CodeSystem-condition-clinical.html">Condition Clinical Status Codes</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical</tt>
    
  </td>
</tr>
 


<tr>
  
  
  

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


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


<tr>
  
  

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


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


<tr>
  
  

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


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


<tr>
  
  

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


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


<tr>
  
  

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


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


<tr>
  
  

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


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


<tr>
  
  

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


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Blood Glucose Laboratory and Point of Care Tests
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1190.38/expansion">Blood Glucose Laboratory and Point of Care Tests</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.38</tt>
    
  </td>
</tr>
 


<tr>
  
  

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


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


  
  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: inpatient non-acute
        <br/>
      
      <em>Code</em>: NONAC
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-ActCode</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: short stay
        <br/>
      
      <em>Code</em>: SS
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-ActCode</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: inpatient acute
        <br/>
      
      <em>Code</em>: ACUTE
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-ActCode</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: inpatient encounter
        <br/>
      
      <em>Code</em>: IMP
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-ActCode</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>Code</em>: active
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
      <em>Code</em>: recurrence
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
      <em>Code</em>: relapse
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Chief complaint
        <br/>
      
      <em>Code</em>: CC
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/diagnosis-role</tt>
    </td>
  </tr>

  
  


  <tr>


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


</tr>
  
  
  


<tr>
  

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


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


<tr>
  

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


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


<tr>
  

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


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


<tr>
  

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


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


<tr>
  

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


  <td class="content-container">
    
    <em>Description</em>: Library USQualityCoreCommon
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="Library-USQualityCoreCommon.html">US Quality Core Commonversion: null0.1.0-cibuild)</a>
    <br/>
    <em>Canonical URL</em>: <tt>https://madie.cms.gov/Library/USQualityCoreCommon|0.1.0-cibuild</tt>
    
  </td>
</tr>
 


<tr>
  

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


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


<tr>
  

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


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


<tr>
  

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


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


<tr>
  

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


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

 

 

 

 

 

 

 

 

 

 

 


  
  






  <tr>


<th 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>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, period, location, id, meta, identifier, statusHistory, class, classHistory, serviceType, priority, subject, length, reasonCode, reasonReference, diagnosis, account, hospitalization, partOf
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.143/expansion">Observation Services</a>
    <br/> 
  
  
  
  
    <span class="tab-one"><em>Path</em>: status</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      [not stated]: finished (finished)
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, period, location, id, meta, identifier, statusHistory, class, classHistory, serviceType, priority, subject, length, reasonCode, reasonReference, diagnosis, account, hospitalization, partOf
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.292/expansion">Emergency Department Visit</a>
    <br/> 
  
  
  
  
    <span class="tab-one"><em>Path</em>: status</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      [not stated]: finished (finished)
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, period, class, status, location, id, meta, identifier, statusHistory, classHistory, serviceType, priority, subject, length, reasonCode, reasonReference, diagnosis, account, hospitalization, partOf
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion">Encounter Inpatient</a>
    <br/> 
  
  
  
   
  </td>
</tr>

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

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Location
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/location.html">Location</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: id, meta, extension, status, operationalStatus, name, alias, description, mode, type, telecom, address, physicalType, position, managingOrganization, partOf, hoursOfOperation, availabilityExceptions, endpoint
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: MedicationRequest
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/medicationrequest.html">MedicationRequest</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: authoredOn, id, meta, status, statusReason, intent, category, priority, doNotPerform, reported, medication, subject, encounter, requester, recorder, reasonCode, reasonReference, instantiatesCanonical, instantiatesUri, courseOfTherapyType, dosageInstruction
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: MedicationAdministration
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/medicationadministration.html">MedicationAdministration</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: effective, id, meta, instantiates, partOf, status, statusReason, category, medication, subject, context, supportingInformation, performer, reasonCode, reasonReference, request, device, note, dosage
    <br/>
   
   
  </td>
</tr>

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

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Patient
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/patient.html">Patient</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: birthDate, id, meta, extension, identifier, active, name, telecom, gender, deceased, address, maritalStatus, multipleBirth, photo, contact, communication, generalPractitioner, managingOrganization, link
    <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>: 
  
    <a href="http://hl7.org/fhir/R4/coverage.html">Coverage</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: period, id, meta, status, type, policyHolder, subscriber, subscriberId, beneficiary, dependent, relationship, payor, class, order, network, subrogation, contract
    <br/>
   
   
  </td>
</tr>

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

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <code>http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-observation-lab</code>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, effective, issued, id, extension, text, referenceRange, component, basedOn, partOf, category, status, subject, focus, encounter, performer, value, dataAbsentReason, interpretation, note, bodySite, method, specimen, device, hasMember, derivedFrom
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1190.38/expansion">Blood Glucose Laboratory and Point of Care Tests</a>
    <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>: 
  
    <a href="http://hl7.org/fhir/R4/condition.html">Condition</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: abatement, onset, recordedDate, clinicalStatus
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Condition
    <br/>
  
    <em>Profile(s)</em>: 
  
    <code>http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-condition-problems-health-concerns</code>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: id, meta, clinicalStatus, verificationStatus, category, severity, code, bodySite, subject, encounter, encounter.reference, onset, stage, evidence, note
    <br/>
   
   
  </td>
</tr>

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

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: ServiceRequest
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/servicerequest.html">ServiceRequest</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: authoredOn, id, meta, instantiatesCanonical, instantiatesUri, basedOn, replaces, requisition, status, intent, category, priority, doNotPerform, code, orderDetail, quantity, subject, encounter, occurrence, asNeeded, requester, performerType, performer, locationCode, reasonCode, reasonReference, insurance, bodySite, note, patientInstruction
    <br/>
   
   
  </td>
</tr>

  
  


  <tr>


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


</tr>
  
  
  <tr>
  

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


  <td class="content-container">
    <table>
      <thead>
        <tr>
          <td><em>Name</em></td>
          <td><em>Use</em></td>
          <td><em>Card.</em></td>
          <td><em>Type</em></td>
          <td><em>Documentation</em></td>
        </tr>
      </thead>
      <tbody>
      
        <tr>
          <td>Measurement Period</td>
          <td>In</td>
          <td>0..1</td>
          <td>Period</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Coverage</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Resource</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Medication Request</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Resource</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Encounter Locations</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Resource</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Race</td>
          <td>Out</td>
          <td>0..1</td>
          <td>Resource</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Medication Administration</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Resource</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Sex</td>
          <td>Out</td>
          <td>0..1</td>
          <td>Coding</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Initial Population Encounters</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Resource</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Blood Glucose Observation</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Resource</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Condition</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Resource</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Payer</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Resource</td>
          <td/>
        </tr>
      
        <tr>
          <td>Initial Population</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Encounter</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Ethnicity</td>
          <td>Out</td>
          <td>0..1</td>
          <td>Resource</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Location</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Resource</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Service Request</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Resource</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Minimal Patient</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Resource</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Medication</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Resource</td>
          <td/>
        </tr>
      
        <tr>
          <td>SDE Chief Complaint</td>
          <td>Out</td>
          <td>0..*</td>
          <td>Resource</td>
          <td/>
        </tr>
      
      </tbody>
    </table>
  </td>
</tr>

  
  

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

    </tbody>
  </table>
</div>
  </text>
  <contained>
    <Library>
      <id value="effective-data-requirements"/>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://terminology.hl7.org/CodeSystem/v3-ActCode"/>
          <code value="NONAC"/>
          <display value="inpatient non-acute"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://terminology.hl7.org/CodeSystem/v3-ActCode"/>
          <code value="SS"/>
          <display value="short stay"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://terminology.hl7.org/CodeSystem/v3-ActCode"/>
          <code value="ACUTE"/>
          <display value="inpatient acute"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://terminology.hl7.org/CodeSystem/v3-ActCode"/>
          <code value="IMP"/>
          <display value="inpatient encounter"/>
        </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/condition-clinical"/>
          <code value="active"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/condition-clinical"/>
          <code value="recurrence"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/condition-clinical"/>
          <code value="relapse"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/diagnosis-role"/>
          <code value="CC"/>
          <display value="Chief complaint"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Inpatient Encounters During Measurement Period"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Inpatient Encounters During Measurement Period&quot;:
  [Encounter: &quot;Encounter Inpatient&quot;] InpatientEncounters
    where InpatientEncounters.period ends during day of &quot;Measurement Period&quot;
      and ( InpatientEncounters.class ~ USQualityCoreCommon.&quot;inpatient non-acute&quot;
          or InpatientEncounters.class ~ USQualityCoreCommon.&quot;inpatient non-acute&quot;
          or InpatientEncounters.class ~ USQualityCoreCommon.&quot;short stay&quot;
          or InpatientEncounters.class ~ USQualityCoreCommon.&quot;inpatient acute&quot;
          or InpatientEncounters.class ~ USQualityCoreCommon.&quot;inpatient encounter&quot;
      )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="0"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="Encounters with Patient Hospital Locations"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Encounters with Patient Hospital Locations&quot;:
  &quot;Inpatient Encounters During Measurement Period&quot; InpatientEncounter
    where exists ( InpatientEncounter.location HospitalLocation
        where HospitalLocation.location.getLocation ( ).type in &quot;Inpatient, Emergency, and Observation Locations&quot;
          and HospitalLocation.period during day of InpatientEncounter.period
    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="1"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="MedicationRequests"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;MedicationRequests&quot;:
  [MedicationRequest]"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="2"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="MedicationAdministrations"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;MedicationAdministrations&quot;:
  [MedicationAdministration]"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="3"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="Antidiabetic Drugs Administered or Ordered"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Antidiabetic Drugs Administered or Ordered&quot;:
  ( &quot;MedicationRequests&quot;
    union &quot;MedicationAdministrations&quot; ) MedReqOrAdmin
    where MedReqOrAdmin.getMedicationCode() in &quot;Diabetes Medications&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="4"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="Initial Population"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="// Initial Population


define &quot;Initial Population&quot;:
  ( &quot;Inpatient Encounters During Measurement Period&quot;
    union &quot;Encounters with Patient Hospital Locations&quot; ) InpatientEncounters
    with &quot;Antidiabetic Drugs Administered or Ordered&quot; ADD
      such that Coalesce(start of ADD.effective.toInterval(), ADD.authoredOn) during InpatientEncounters.&quot;hospitalizationWithObservation&quot; ( )
    where ( InpatientEncounters.status = 'finished'
        or InpatientEncounters.status = 'in-progress'
        or InpatientEncounters.status = 'triaged'
        or InpatientEncounters.status = 'onleave'
        or InpatientEncounters.status = 'entered-in-error'
    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="5"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Coverage"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Coverage&quot;:
  [Coverage] Coverages
    where exists ( &quot;Initial Population&quot; IP
        where Coverages.period starts before or on day of IP.period
          and end of Coverages.period on or after day of end of IP.period
    )
    return { Coverages.id, Coverages.meta, Coverages.status, Coverages.type, Coverages.policyHolder, Coverages.subscriber, Coverages.subscriberId, Coverages.beneficiary, Coverages.dependent, Coverages.relationship, Coverages.period, Coverages.payor, Coverages.class, Coverages.order, Coverages.network, Coverages.subrogation, Coverages.contract }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="6"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Medication Request"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Medication Request&quot;:
  &quot;MedicationRequests&quot; MedRequests
    where exists ( &quot;Initial Population&quot; InitialPopulation
        where MedRequests.authoredOn during InitialPopulation.&quot;hospitalizationWithObservation&quot; ( )
    )
    return { MedRequests.id, MedRequests.meta, MedRequests.status, MedRequests.statusReason, MedRequests.intent, MedRequests.category, MedRequests.priority, MedRequests.doNotPerform, MedRequests.reported, MedRequests.medication, MedRequests.subject, MedRequests.encounter, MedRequests.authoredOn, MedRequests.requester, MedRequests.recorder, MedRequests.reasonCode, MedRequests.reasonReference, MedRequests.instantiatesCanonical, MedRequests.instantiatesUri, MedRequests.courseOfTherapyType, MedRequests.dosageInstruction }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="7"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Encounter Locations"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Encounter Locations&quot;:
  &quot;Initial Population&quot; IP
    where exists ( IP.location InitialPopulationLocation
        let types: ( InitialPopulationLocation.location ).getLocation ( ).type
        where exists ( types type
            where type in &quot;Inpatient, Emergency, and Observation Locations&quot;
        )
          and InitialPopulationLocation.period during IP.period
    )
    return { IP.id, IP.meta, IP.identifier, IP.status, IP.statusHistory, IP.class, IP.classHistory, IP.type, IP.serviceType, IP.priority, IP.subject, IP.period, IP.length, IP.reasonCode, IP.reasonReference, IP.diagnosis, IP.account, IP.hospitalization, IP.location, IP.partOf }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="8"/>
        </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="9"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </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="10"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Medication Administration"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Medication Administration&quot;:
  &quot;MedicationAdministrations&quot; MedAdministrations
    where exists ( &quot;Initial Population&quot; InitialPopulation
        where MedAdministrations.effective.toInterval ( ) overlaps InitialPopulation.&quot;hospitalizationWithObservation&quot; ( )
    )
    return { MedAdministrations.id, MedAdministrations.meta, MedAdministrations.instantiates, MedAdministrations.partOf, MedAdministrations.status, MedAdministrations.statusReason, MedAdministrations.category, MedAdministrations.medication, MedAdministrations.subject, MedAdministrations.context, MedAdministrations.supportingInformation, MedAdministrations.effective, MedAdministrations.performer, MedAdministrations.reasonCode, MedAdministrations.reasonReference, MedAdministrations.request, MedAdministrations.device, MedAdministrations.note, MedAdministrations.dosage }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="11"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SupplementalDataElements"/>
        </extension>
        <extension url="name">
          <valueString value="SDE 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="12"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </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="13"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Initial Population Encounters"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Initial Population Encounters&quot;:
  &quot;Initial Population&quot; IP
    return { IP.id, IP.meta, IP.identifier, IP.status, IP.statusHistory, IP.class, IP.classHistory, IP.type, IP.serviceType, IP.priority, IP.subject, IP.period, IP.length, IP.reasonCode, IP.reasonReference, IP.diagnosis, IP.account, IP.hospitalization, IP.location, IP.partOf }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="14"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Blood Glucose Observation"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="//Supplemental Data Elements


define &quot;SDE Blood Glucose Observation&quot;:
  ( [&quot;LaboratoryResultObservation&quot;: &quot;Blood Glucose Laboratory and Point of Care Tests&quot;] GlucoseTest
      where exists ( &quot;Initial Population&quot; InitialPopulation
          where start of GlucoseTest.effective.toInterval ( ) during day of InitialPopulation.period
            or GlucoseTest.issued during day of InitialPopulation.period
      )
      return { GlucoseTest.id, GlucoseTest.extension, GlucoseTest.text, GlucoseTest.referenceRange, GlucoseTest.component, GlucoseTest.basedOn, GlucoseTest.partOf, GlucoseTest.category, GlucoseTest.status, GlucoseTest.subject, GlucoseTest.focus, GlucoseTest.encounter, GlucoseTest.effective, GlucoseTest.issued, GlucoseTest.performer, GlucoseTest.value, GlucoseTest.dataAbsentReason, GlucoseTest.interpretation, GlucoseTest.note, GlucoseTest.bodySite, GlucoseTest.method, GlucoseTest.specimen, GlucoseTest.device, GlucoseTest.hasMember, GlucoseTest.derivedFrom }
  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="15"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Condition"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Condition&quot;:
  [&quot;ConditionProblemsHealthConcerns&quot;] Diagnosis
    where exists ( &quot;Initial Population&quot; IP
        where Diagnosis.prevalenceInterval ( ) overlaps day of IP.period
    )
    return { Diagnosis.id, Diagnosis.meta, Diagnosis.clinicalStatus, Diagnosis.verificationStatus, Diagnosis.category, Diagnosis.severity, Diagnosis.code, Diagnosis.bodySite, Diagnosis.subject, Diagnosis.encounter.reference.getId(), Diagnosis.onset, Diagnosis.stage, Diagnosis.evidence, Diagnosis.note }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="16"/>
        </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;:
  [USQualityCore.Coverage: type in &quot;Payer Type&quot;] Payer
    return {
      code: Payer.type,
      period: Payer.period
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="17"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </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="18"/>
        </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="19"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </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="20"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="Get Locations from Initial Population"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Get Locations from Initial Population&quot;:
  flatten ( &quot;Initial Population&quot; IP
      let locationElements: IP.location
      return locationElements LE
        let locationReference: LE.location
        return ( locationReference.getLocation ( ) )
  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="21"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Location"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Location&quot;:
  &quot;Get Locations from Initial Population&quot; Locations
    where exists &quot;Initial Population&quot;
      and Locations is not null
    return { Locations.id, Locations.meta, Locations.extension, Locations.status, Locations.operationalStatus, Locations.name, Locations.alias, Locations.description, Locations.mode, Locations.type, Locations.telecom, Locations.address, Locations.physicalType, Locations.position, Locations.managingOrganization, Locations.partOf, Locations.hoursOfOperation, Locations.availabilityExceptions, Locations.endpoint }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="22"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Service Request"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Service Request&quot;:
  [ServiceRequest] ServiceRequests
    where exists ( &quot;Initial Population&quot; InitialPopulation
        where ServiceRequests.authoredOn during InitialPopulation.period
    )
    return { ServiceRequests.id, ServiceRequests.meta, ServiceRequests.instantiatesCanonical, ServiceRequests.instantiatesUri, ServiceRequests.basedOn, ServiceRequests.replaces, ServiceRequests.requisition, ServiceRequests.status, ServiceRequests.intent, ServiceRequests.category, ServiceRequests.priority, ServiceRequests.doNotPerform, ServiceRequests.code, ServiceRequests.orderDetail, ServiceRequests.quantity, ServiceRequests.subject, ServiceRequests.encounter, ServiceRequests.occurrence, ServiceRequests.asNeeded, ServiceRequests.authoredOn, ServiceRequests.requester, ServiceRequests.performerType, ServiceRequests.performer, ServiceRequests.locationCode, ServiceRequests.reasonCode, ServiceRequests.reasonReference, ServiceRequests.insurance, ServiceRequests.bodySite, ServiceRequests.note, ServiceRequests.patientInstruction }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="23"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Minimal Patient"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Minimal Patient&quot;:
  [Patient] MinPt
    where exists &quot;Initial Population&quot;
    return { MinPt.id, MinPt.meta, MinPt.extension, MinPt.identifier, MinPt.active, MinPt.name, MinPt.telecom, MinPt.gender, MinPt.birthDate, MinPt.deceased, MinPt.address, MinPt.maritalStatus, MinPt.multipleBirth, MinPt.photo, MinPt.contact, MinPt.communication, MinPt.generalPractitioner, MinPt.managingOrganization, MinPt.link }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="24"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Medication"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Medication&quot;:
  ( &quot;MedicationRequests&quot;
    union &quot;MedicationAdministrations&quot; ) MedReqOrAdmin
    let medication: GetMedication(MedReqOrAdmin.medication as Reference)
    where medication is not null
      and exists ( &quot;Initial Population&quot; IP
          where Coalesce(MedReqOrAdmin.effective.toInterval(), MedReqOrAdmin.authoredOn.toInterval()) overlaps IP.&quot;hospitalizationWithObservation&quot; ( )
      )
    return { medication.id, medication.meta, medication.code, medication.status, medication.manufacturer, medication.form, medication.amount, medication.ingredient, medication.batch }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="25"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Chief Complaint"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Chief Complaint&quot;:
  &quot;Initial Population&quot; IP
    where exists ( IP.diagnosis InitialPopulationDiagnosis
        where InitialPopulationDiagnosis.use ~ FHIRCommon.&quot;CC&quot;
    )
    return { IP.id, IP.meta, IP.identifier, IP.status, IP.statusHistory, IP.class, IP.classHistory, IP.type, IP.serviceType, IP.priority, IP.subject, IP.period, IP.length, IP.reasonCode, IP.reasonReference, IP.diagnosis, IP.account, IP.hospitalization, IP.location, IP.partOf }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="26"/>
        </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="27"/>
        </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="28"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CQMCommon"/>
        </extension>
        <extension url="name">
          <valueString value="getLocation"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns the Location resource specified by the given reference.
*/
define fluent function getLocation(reference Reference):
  singleton from (
    [Location] L where reference.references(L)
  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="29"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="references"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns true if the given reference is to the given resource
@comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.
NOTE: This function assumes resources from the same source server.
*/
define fluent function references(reference FHIR.Reference, resource FHIR.Resource):
  resource.id = Last(Split(reference.reference, '/'))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="30"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToString(value string): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="31"/>
        </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="32"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="CQMCommon"/>
        </extension>
        <extension url="name">
          <valueString value="getMedicationCode"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns the medication code for the given MedicationRequest
*/
define fluent function getMedicationCode(request Choice&lt;MedicationAdministration, MedicationRequest&gt;):
  if request.medication is FHIR.CodeableConcept then
  	  request.medication as FHIR.CodeableConcept
  	else
  	  (singleton from ([Medication] M where request.medication.references(M))).code"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="33"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="toInterval"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
@comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range types
to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible
representations for timing-valued elements in FHIR, allowing this function to be used across any resource.

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

NOTE: Due to the
complexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used
with a Timing or String.
*/
define fluent function toInterval(choice Choice&lt;FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range&gt;):
  case
    when choice is FHIR.dateTime then
      Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]
    when choice is FHIR.Period then
      FHIRHelpers.ToInterval(choice as FHIR.Period)
    when choice is FHIR.instant then
      Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]
    when choice is FHIR.Age then
      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),
        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)
    when choice is FHIR.Range then
      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),
        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)
    when choice is FHIR.Timing then
      Message(null as Interval&lt;DateTime&gt;, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported')
    when choice is FHIR.string then
      Message(null as Interval&lt;DateTime&gt;, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')
    else
      null as Interval&lt;DateTime&gt;
  end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="34"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToDateTime"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToDateTime(value dateTime): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="35"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToDateTime"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToDateTime(value instant): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="36"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToDate"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToDate(value date): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="37"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToQuantity"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity) 
value to a CQL Quantity
@comment: If the given quantity has a comparator specified, a runtime error is raised. If the given quantity
has a system other than UCUM (i.e. `http://unitsofmeasure.org`) or CQL calendar units (i.e. `http://hl7.org/fhirpath/CodeSystem/calendar-units`)
an error is raised. For UCUM to calendar units, the `ToCalendarUnit` function is used.
@seealso: ToCalendarUnit
*/
define function ToQuantity(quantity FHIR.Quantity):
    case
        when quantity is null then null
        when quantity.value is null then null
        when quantity.comparator is not null then
            Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')
        when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'
              or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then
            System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }
        else
            Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' &amp; quantity.unit.value &amp; ' (' &amp; quantity.system.value &amp; '|' &amp; quantity.code.value &amp; ')')
    end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="38"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToCalendarUnit"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Converts a UCUM definite duration unit to a CQL calendar duration
unit using conversions specified in the [quantities](https://cql.hl7.org/02-authorsguide.html#quantities) 
topic of the CQL specification.
@comment: Note that for durations above days (or weeks), the conversion is understood to be approximate
*/
define function ToCalendarUnit(unit System.String):
    case unit
        when 'ms' then 'millisecond'
        when 's' then 'second'
        when 'min' then 'minute'
        when 'h' then 'hour'
        when 'd' then 'day'
        when 'wk' then 'week'
        when 'mo' then 'month'
        when 'a' then 'year'
        else unit
    end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="39"/>
        </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="40"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToString(value EncounterStatus): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="41"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="USCoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="race"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function race(patient Patient):
  (patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-race')) E
    return {
      ombCategory: (E.exts('ombCategory')) o return o.value as FHIR.Coding,
      detailed: (E.exts('detailed')) d return d.value as FHIR.Coding,
      text: E.ext('text').value as FHIR.string
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="42"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="ext"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns the single extension (if present) on the given resource with the specified url.
@comment: This function uses singleton from to ensure that a run-time exception is thrown if there
is more than one extension on the given resource with the specified url.
*/
define fluent function ext(domainResource DomainResource, url String):
  singleton from domainResource.exts(url)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="43"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="exts"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns any extensions defined on the given resource with the specified url
*/
define fluent function exts(domainResource DomainResource, url String):
  domainResource.extension E
    where E.url = url
    return E"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="44"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToString(value uri): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="45"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="exts"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns any extensions defined on the given element with the specified url.
*/
define fluent function exts(element Element, url String):
  element.extension E
    where E.url = url
    return E"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="46"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="ext"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns the single extension (if present) on the given element with the specified url.
@comment: This function uses singleton from to ensure that a run-time exception is thrown if there
is more than one extension on the given element with the specified url.
*/
define fluent function ext(element Element, url String):
  singleton from element.exts(url)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="47"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="USCoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="sex"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns the sex element as defined for the USCore patient profile
*/
define fluent function sex(patient Patient):
  patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-sex').value as FHIR.code"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="48"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="prevalenceInterval"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns an interval representing the normalized prevalence period of a given Condition resource.
@comment: Uses the toInterval and toAbatementInterval functions to determine the widest potential interval from
onset to abatement as specified in the given Condition.
*/
define fluent function prevalenceInterval(condition Condition):
if condition.clinicalStatus ~ &quot;active&quot;
  or condition.clinicalStatus ~ &quot;recurrence&quot;
  or condition.clinicalStatus ~ &quot;relapse&quot; then
  Interval[start of condition.onset.toInterval(), end of condition.abatementInterval()]
else
  (end of condition.abatementInterval()) abatementDate
    return 
	  if abatementDate is null then
        Interval[start of condition.onset.toInterval(), abatementDate)
      else
        Interval[start of condition.onset.toInterval(), abatementDate]"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="49"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="abatementInterval"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns an interval representing the normalized Abatement of a given Condition resource.
@comment: @comment: If the abatement element of the Condition is represented as a DateTime, the result
is an interval beginning and ending on that DateTime.
If the abatement is represented as a Quantity, the quantity is expected to be a calendar-duration and is interpreted as the age of the patient. The
result is an interval from the date the patient turned that age to immediately before one year later.
If the abatement is represented as a Quantity Interval, the quantities are expected to be calendar-durations and are interpreted as an age range during
which the abatement occurred. The result is an interval from the date the patient turned the starting age of the quantity interval, and ending immediately
before one year later than the date the patient turned the ending age of the quantity interval.

NOTE: Due to the complexity of determining an interval from a String, this function will throw
a run-time exception if used with a Condition instance that has a String as the abatement value.
*/
define fluent function abatementInterval(condition Condition):
  if condition.abatement is FHIR.dateTime then
    Interval[FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime), FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime)]
  else if condition.abatement is FHIR.Period then
    FHIRHelpers.ToInterval(condition.abatement as FHIR.Period)
  else if condition.abatement is FHIR.string then
    Message(null as Interval&lt;DateTime&gt;, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')
  else if condition.abatement is FHIR.Age then
    Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age),
      FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age) + 1 year)
  else if condition.abatement is FHIR.Range then
    Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).low),
      FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).high) + 1 year)
  else if condition.abatement is FHIR.boolean then
    Interval[end of condition.onset.toInterval(), condition.recordedDate)
  else 
    null"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="50"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="USQualityCoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="getId"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns the id of the given uri (i.e. everything after the last slash)
*/
define fluent function getId(uri String):
  Last(Split(uri, '/'))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="51"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="USCoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="ethnicity"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define fluent function ethnicity(patient Patient):
  (patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity')) E
    return {
      ombCategory: E.ext('ombCategory').value as FHIR.Coding,
      detailed: (E.exts('detailed')) d return d.value as FHIR.Coding,
      text: E.ext('text').value as FHIR.string
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="52"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="GetMedication"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function &quot;GetMedication&quot;(reference Reference):
  singleton from ( [Medication] Medication
      where reference.references ( Medication )
  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="53"/>
        </extension>
      </extension>
      <name value="EffectiveDataRequirements"/>
      <status value="active"/>
      <type>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/library-type"/>
          <code value="module-definition"/>
        </coding>
      </type>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="USQualityCore model information"/>
        <resource
                  value="https://madie.cms.gov/Library/USQualityCore-ModelInfo|0.1.0-cibuild"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="USCore model information"/>
        <resource
                  value="http://hl7.org/fhir/us/cql/Library/USCore-ModelInfo|6.1.0-derived"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="FHIR model information"/>
        <resource
                  value="http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library FHIRHelpers"/>
        <resource
                  value="http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library USQualityCoreCommon"/>
        <resource
                  value="https://madie.cms.gov/Library/USQualityCoreCommon|0.1.0-cibuild"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library CQMCommon"/>
        <resource value="https://madie.cms.gov/Library/CQMCommon|5.1.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library FHIRCommon"/>
        <resource
                  value="http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library SDE"/>
        <resource
                  value="https://madie.cms.gov/Library/SupplementalDataElements|6.1.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library USCommon"/>
        <resource
                  value="http://hl7.org/fhir/us/cql/Library/USCoreCommon|2.0.0-ballot"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system ActCode"/>
        <resource value="http://terminology.hl7.org/CodeSystem/v3-ActCode"/>
      </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 ConditionClinicalStatusCodes"/>
        <resource
                  value="http://terminology.hl7.org/CodeSystem/condition-clinical"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system Diagnosis Role"/>
        <resource
                  value="http://terminology.hl7.org/CodeSystem/diagnosis-role"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Encounter Inpatient"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display
                 value="Value set Inpatient, Emergency, and Observation Locations"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.265"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Diabetes Medications"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.58"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Observation Services"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Emergency Department Visit"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display
                 value="Value set Blood Glucose Laboratory and Point of Care Tests"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.38"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Payer Type"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"/>
      </relatedArtifact>
      <parameter>
        <name value="Measurement Period"/>
        <use value="in"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Period"/>
      </parameter>
      <parameter>
        <name value="SDE Coverage"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Medication Request"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Encounter Locations"/>
        <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 Medication Administration"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <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 Initial Population Encounters"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Blood Glucose Observation"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Condition"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Payer"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Initial Population"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="SDE Ethnicity"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Location"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Service Request"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Minimal Patient"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Medication"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Chief Complaint"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <mustSupport value="location"/>
        <mustSupport value="id"/>
        <mustSupport value="meta"/>
        <mustSupport value="identifier"/>
        <mustSupport value="statusHistory"/>
        <mustSupport value="class"/>
        <mustSupport value="classHistory"/>
        <mustSupport value="serviceType"/>
        <mustSupport value="priority"/>
        <mustSupport value="subject"/>
        <mustSupport value="length"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="reasonReference"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="account"/>
        <mustSupport value="hospitalization"/>
        <mustSupport value="partOf"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"/>
        </codeFilter>
        <codeFilter>
          <path value="status"/>
          <code>
            <code value="finished"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <mustSupport value="location"/>
        <mustSupport value="id"/>
        <mustSupport value="meta"/>
        <mustSupport value="identifier"/>
        <mustSupport value="statusHistory"/>
        <mustSupport value="class"/>
        <mustSupport value="classHistory"/>
        <mustSupport value="serviceType"/>
        <mustSupport value="priority"/>
        <mustSupport value="subject"/>
        <mustSupport value="length"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="reasonReference"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="account"/>
        <mustSupport value="hospitalization"/>
        <mustSupport value="partOf"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"/>
        </codeFilter>
        <codeFilter>
          <path value="status"/>
          <code>
            <code value="finished"/>
          </code>
        </codeFilter>
        <dateFilter>
          <path value="period"/>
          <valuePeriod>
            <extension url="http://hl7.org/fhir/uv/crmi-analysisException">
              <valueString
                           value="Error attempting to determine filter value: toFhirValue not implemented for Subtract"/>
            </extension>
          </valuePeriod>
        </dateFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="period"/>
        <mustSupport value="class"/>
        <mustSupport value="status"/>
        <mustSupport value="location"/>
        <mustSupport value="id"/>
        <mustSupport value="meta"/>
        <mustSupport value="identifier"/>
        <mustSupport value="statusHistory"/>
        <mustSupport value="classHistory"/>
        <mustSupport value="serviceType"/>
        <mustSupport value="priority"/>
        <mustSupport value="subject"/>
        <mustSupport value="length"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="reasonReference"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="account"/>
        <mustSupport value="hospitalization"/>
        <mustSupport value="partOf"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Resource"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Resource"/>
        <mustSupport value="id"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Location"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Location"/>
        <mustSupport value="id"/>
        <mustSupport value="meta"/>
        <mustSupport value="extension"/>
        <mustSupport value="status"/>
        <mustSupport value="operationalStatus"/>
        <mustSupport value="name"/>
        <mustSupport value="alias"/>
        <mustSupport value="description"/>
        <mustSupport value="mode"/>
        <mustSupport value="type"/>
        <mustSupport value="telecom"/>
        <mustSupport value="address"/>
        <mustSupport value="physicalType"/>
        <mustSupport value="position"/>
        <mustSupport value="managingOrganization"/>
        <mustSupport value="partOf"/>
        <mustSupport value="hoursOfOperation"/>
        <mustSupport value="availabilityExceptions"/>
        <mustSupport value="endpoint"/>
      </dataRequirement>
      <dataRequirement>
        <type value="MedicationRequest"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/MedicationRequest"/>
        <mustSupport value="authoredOn"/>
        <mustSupport value="id"/>
        <mustSupport value="meta"/>
        <mustSupport value="status"/>
        <mustSupport value="statusReason"/>
        <mustSupport value="intent"/>
        <mustSupport value="category"/>
        <mustSupport value="priority"/>
        <mustSupport value="doNotPerform"/>
        <mustSupport value="reported"/>
        <mustSupport value="medication"/>
        <mustSupport value="subject"/>
        <mustSupport value="encounter"/>
        <mustSupport value="requester"/>
        <mustSupport value="recorder"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="reasonReference"/>
        <mustSupport value="instantiatesCanonical"/>
        <mustSupport value="instantiatesUri"/>
        <mustSupport value="courseOfTherapyType"/>
        <mustSupport value="dosageInstruction"/>
      </dataRequirement>
      <dataRequirement>
        <type value="MedicationAdministration"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration"/>
        <mustSupport value="effective"/>
        <mustSupport value="id"/>
        <mustSupport value="meta"/>
        <mustSupport value="instantiates"/>
        <mustSupport value="partOf"/>
        <mustSupport value="status"/>
        <mustSupport value="statusReason"/>
        <mustSupport value="category"/>
        <mustSupport value="medication"/>
        <mustSupport value="subject"/>
        <mustSupport value="context"/>
        <mustSupport value="supportingInformation"/>
        <mustSupport value="performer"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="reasonReference"/>
        <mustSupport value="request"/>
        <mustSupport value="device"/>
        <mustSupport value="note"/>
        <mustSupport value="dosage"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Medication"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Medication"/>
        <mustSupport value="code"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Patient"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
        <mustSupport value="birthDate"/>
        <mustSupport value="id"/>
        <mustSupport value="meta"/>
        <mustSupport value="extension"/>
        <mustSupport value="identifier"/>
        <mustSupport value="active"/>
        <mustSupport value="name"/>
        <mustSupport value="telecom"/>
        <mustSupport value="gender"/>
        <mustSupport value="deceased"/>
        <mustSupport value="address"/>
        <mustSupport value="maritalStatus"/>
        <mustSupport value="multipleBirth"/>
        <mustSupport value="photo"/>
        <mustSupport value="contact"/>
        <mustSupport value="communication"/>
        <mustSupport value="generalPractitioner"/>
        <mustSupport value="managingOrganization"/>
        <mustSupport value="link"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Coverage"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Coverage"/>
        <mustSupport value="period"/>
        <mustSupport value="id"/>
        <mustSupport value="meta"/>
        <mustSupport value="status"/>
        <mustSupport value="type"/>
        <mustSupport value="policyHolder"/>
        <mustSupport value="subscriber"/>
        <mustSupport value="subscriberId"/>
        <mustSupport value="beneficiary"/>
        <mustSupport value="dependent"/>
        <mustSupport value="relationship"/>
        <mustSupport value="payor"/>
        <mustSupport value="class"/>
        <mustSupport value="order"/>
        <mustSupport value="network"/>
        <mustSupport value="subrogation"/>
        <mustSupport value="contract"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Patient"/>
        <profile
                 value="http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-patient"/>
        <mustSupport value="ombCategory"/>
        <mustSupport value="detailed"/>
        <mustSupport value="text"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile
                 value="http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-observation-lab"/>
        <mustSupport value="code"/>
        <mustSupport value="effective"/>
        <mustSupport value="issued"/>
        <mustSupport value="id"/>
        <mustSupport value="extension"/>
        <mustSupport value="text"/>
        <mustSupport value="referenceRange"/>
        <mustSupport value="component"/>
        <mustSupport value="basedOn"/>
        <mustSupport value="partOf"/>
        <mustSupport value="category"/>
        <mustSupport value="status"/>
        <mustSupport value="subject"/>
        <mustSupport value="focus"/>
        <mustSupport value="encounter"/>
        <mustSupport value="performer"/>
        <mustSupport value="value"/>
        <mustSupport value="dataAbsentReason"/>
        <mustSupport value="interpretation"/>
        <mustSupport value="note"/>
        <mustSupport value="bodySite"/>
        <mustSupport value="method"/>
        <mustSupport value="specimen"/>
        <mustSupport value="device"/>
        <mustSupport value="hasMember"/>
        <mustSupport value="derivedFrom"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.38"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Condition"/>
        <mustSupport value="abatement"/>
        <mustSupport value="onset"/>
        <mustSupport value="recordedDate"/>
        <mustSupport value="clinicalStatus"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile
                 value="http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-condition-problems-health-concerns"/>
        <mustSupport value="id"/>
        <mustSupport value="meta"/>
        <mustSupport value="clinicalStatus"/>
        <mustSupport value="verificationStatus"/>
        <mustSupport value="category"/>
        <mustSupport value="severity"/>
        <mustSupport value="code"/>
        <mustSupport value="bodySite"/>
        <mustSupport value="subject"/>
        <mustSupport value="encounter"/>
        <mustSupport value="encounter.reference"/>
        <mustSupport value="onset"/>
        <mustSupport value="stage"/>
        <mustSupport value="evidence"/>
        <mustSupport value="note"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Coverage"/>
        <profile
                 value="http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-coverage"/>
        <mustSupport value="type"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="ServiceRequest"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/ServiceRequest"/>
        <mustSupport value="authoredOn"/>
        <mustSupport value="id"/>
        <mustSupport value="meta"/>
        <mustSupport value="instantiatesCanonical"/>
        <mustSupport value="instantiatesUri"/>
        <mustSupport value="basedOn"/>
        <mustSupport value="replaces"/>
        <mustSupport value="requisition"/>
        <mustSupport value="status"/>
        <mustSupport value="intent"/>
        <mustSupport value="category"/>
        <mustSupport value="priority"/>
        <mustSupport value="doNotPerform"/>
        <mustSupport value="code"/>
        <mustSupport value="orderDetail"/>
        <mustSupport value="quantity"/>
        <mustSupport value="subject"/>
        <mustSupport value="encounter"/>
        <mustSupport value="occurrence"/>
        <mustSupport value="asNeeded"/>
        <mustSupport value="requester"/>
        <mustSupport value="performerType"/>
        <mustSupport value="performer"/>
        <mustSupport value="locationCode"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="reasonReference"/>
        <mustSupport value="insurance"/>
        <mustSupport value="bodySite"/>
        <mustSupport value="note"/>
        <mustSupport value="patientInstruction"/>
      </dataRequirement>
    </Library>
  </contained>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-supplementalDataGuidance" id="supplementalDataGuidance">
    <extension url="guidance">
      <valueString value="&lt;p&gt;Supplemental Data&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/StructureDefinition/cqf-definitionTerm">
    <extension url="term">
      <valueString value="Blood glucose"/>
    </extension>
    <extension url="definition">
      <valueMarkdown
                     value="Blood-glucose data refers to data from random, periprandial, or fasting tests; from capillary, serum, plasma, interstitial fluid, or whole-blood sources; using central laboratory device (CLD) or point-of-care (POC) testing. Data from continuous glucose monitoring (CGM) systems can only be captured if they are integrated into the EHR and exposed in the corresponding FHIR resources. Post-glucose administration tests are excluded. Events are based on the day/time the laboratory test was collected (drawn). If day/time collected is not available, the day/time the lab was ordered is used.
"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-definitionTerm">
    <extension url="term">
      <valueString
                   value="Emergency department (ED)/Observation (Obs) encounter"/>
    </extension>
    <extension url="definition">
      <valueMarkdown
                     value="Any patient visit to an ED or observation location. One (1) patient visit equals one (1) encounter. ED/Observation encounters are considered outpatient locations.
"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-definitionTerm">
    <extension url="term">
      <valueString value="Hypoglycemic medication"/>
    </extension>
    <extension url="definition">
      <valueMarkdown
                     value="All currently and previously commercially available oral or injectable hypoglycemic medications in the United States.
"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-definitionTerm">
    <extension url="term">
      <valueString value="Inpatient encounter"/>
    </extension>
    <extension url="definition">
      <valueMarkdown
                     value="Includes all encounters in inpatient locations.
"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-definitionTerm">
    <extension url="term">
      <valueString value="Mild hypoglycemia event"/>
    </extension>
    <extension url="definition">
      <valueMarkdown
                     value="Blood glucose 54.0 mg/dL to 69.9 mg/dL as identified on CLD or prescription POC device with no subsequent repeat test for blood glucose with a result \&gt; 80 mg/dL within 5 minutes of the start of the initial low blood glucose test.
"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-definitionTerm">
    <extension url="term">
      <valueString value="Moderate hypoglycemia event"/>
    </extension>
    <extension url="definition">
      <valueMarkdown
                     value="Blood glucose 40.0 mg/dL to 53.9 mg/dL as identified on CLD or prescription POC device with no subsequent repeat test for blood glucose with a result \&gt; 80 mg/dL within 5 minutes of the start of the initial low blood glucose test.
"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-definitionTerm">
    <extension url="term">
      <valueString value="Severe hypoglycemia event"/>
    </extension>
    <extension url="definition">
      <valueMarkdown
                     value="Blood glucose \&lt; 40.0 mg/dL as identified on CLD or prescription POC device with no subsequent repeat test for blood glucose with a result \&gt; 80 mg/dL within 5 minutes of the start of the initial low blood glucose test.
"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements">
    <valueCanonical value="#effective-data-requirements"/>
  </extension>
  <url
       value="https://madie.cms.gov/Measure/NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
  <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="NHSNHypoglycemia"/>
  </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:0d555fb6-f654-418c-a2b3-2dd0c3f0e7b4"/>
  </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:dc9459ed-48ca-45f3-923e-3352d9547461"/>
  </identifier>
  <version value="1.1.000"/>
  <name value="NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
  <title value="NHSN Glycemic Control Hypoglycemia Initial Population
"/>
  <status value="active"/>
  <experimental value="false"/>
  <date value="2026-01-16T18:18:14+00:00"/>
  <publisher value="Centers for Disease Control and Prevention (CDC)"/>
  <contact>
    <telecom>
      <system value="url"/>
      <value value="www.cdc.gov/hiv/"/>
    </telecom>
  </contact>
  <description
               value="All inpatient encounters (including ED/Observation visits that end within 1 hour of the start of the inpatient encounter) for patients of all ages where at least one diabetes medication was ordered or administered during the encounter that is during the measurement period.
"/>
  <useContext>
    <code>
      <system
              value="http://terminology.hl7.org/CodeSystem/usage-context-type"/>
      <code value="venue"/>
      <display value="Venue"/>
    </code>
    <valueCodeableConcept>
      <coding>
        <system
                value="http://hl7.org/fhir/us/cqfmeasures/CodeSystem/intended-venue-codes"/>
        <code value="eh"/>
        <display value="EH"/>
      </coding>
    </valueCodeableConcept>
  </useContext>
  <purpose
           value="The primary objective of the NHSN Glycemic Control module is to measure and benchmark medication-related hypoglycemia and hyperglycemia events within a facility. NHSN uses line-level data on medications and blood glucose reported by facilities to provide analytic reports to inform quality-improvement efforts for glycemic control and track patient safety events. As NHSN collects additional data, an additional objective will be to allow inter-facility benchmarking and evaluate national-level trends of medication-related hypoglycemia over time.
"/>
  <usage
         value="All participating inpatient facilities reporting data to the NHSN Glycemic Control module must be able to report data electronically in adherence to HL7 FHIR US Core FHIR R4.0.1 data standards and specifications and NHSN instructions for reporting dQMs, including the HL7 NHSN dQM Reporting Implementation Guide (https://build.fhir.org/ig/HL7/nhsn-dqm/).
"/>
  <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.
"/>
  <effectivePeriod>
    <start value="2026-01-01"/>
    <end value="2026-12-31"/>
  </effectivePeriod>
  <author>
    <name value="Lantana Consulting Group"/>
    <telecom>
      <system value="url"/>
      <value value="https://www.lantanagroup.com/"/>
    </telecom>
  </author>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="American Diabetes Association. Economic costs of diabetes in the U.S. in 2012. Diabetes Care 2013;36:1033--46.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Bates, D. W., Levine, D. M., Salmasian, H., et al. (2023). The safety of inpatient health care. New England Journal of Medicine, 388(12), 142--153.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Classen, D. C., Resar, R., Griffin, F., et al. (2011). 'Global trigger tool' shows that adverse events in hospitals may be ten times greater than previously measured. Health Affairs, 30(4), 581--589.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Cook, C. B., Kongable, G. L., Potter, D. J., et al. (2009). Inpatient glucose control: A glycemic survey of 126 U.S. hospitals. Journal of Hospital Medicine, 4(E7), E7--E14.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Curkendall, S. M., Natoli, J. L., Alexander, C. M., et al. (2009). Economic and clinical impact of inpatient diabetic hypoglycemia. Endocrine Practice, 15(3), 302--312.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Egi, M., Bellomo, R., Stachowski, E., et al. (2010). Hypoglycemia and outcome in critically ill patients. Mayo Clinic Proceedings, 85(3), 217--224.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Finfer, S., Liu, B., Chittock, D. R., et al. (2012). Hypoglycemia and risk of death in critically ill patients. New England Journal of Medicine, 367, 1108--1118.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Gates, P. J., Meyerson, S. A., Baysari, M. T., et al. (2018). Preventable adverse drug events among inpatients: A systematic review. Pediatrics, 142, e20180805.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Hulkower RD, Pollack RM, Zonszein J. Understanding hypoglycemia in hospitalized patients. Diabetes Manag (Lond) 2014;4:165-76.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Maynard, G., et al. (2014). How sweet is it? The use of benchmarking to optimize inpatient glycemic control. Diabetes Spectrum, 27, 212--217.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Moghissi ES, Korytkowski MT, DiNardo M. American Association of Clinical Endocrinologists and American Diabetes Association consensus statement on inpatient glycemic control. Endocr Pract 2009;15:353-69.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Society of Hospital Medicine. Glycemic Control for Hospitalists. Optimizing Care, Preventing Hypoglycemia. Available at: https://www.hospitalmedicine.org/clinical-topics/glycemic-control.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Spector, W. D., Limcangco, R., Furukawa, M. F., Encinosa, W. E. (2017). The marginal costs of adverse drug events associated with exposures to anticoagulants and hypoglycemic agents during hospitalization. Medical Care, 55(8), 856--863.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Turchin, A., Matheny, M. E., Shubina, M., et al. (2009). Hypoglycemia and clinical outcomes in patients with diabetes hospitalized in the general ward. Diabetes Care, 32(7), 1153--1157.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Umpierrez, G. E., Isaacs, S. D., Bazargan, N., et al. (2002). Hyperglycemia: An independent marker of in-hospital mortality in patients with undiagnosed diabetes. Journal of Clinical Endocrinology \&amp; Metabolism, 87(3), 978--982.
"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="citation"/>
    <citation
              value="Wexler, D. J., et al. (2007). Prevalence of hyper- and hypoglycemia among inpatients with diabetes: A national survey of 44 U.S. hospitals. Diabetes Care, 30(2), 367--369.
"/>
  </relatedArtifact>
  <library
           value="https://madie.cms.gov/Library/NHSNGlycemicControlHypoglycemiaInitialPopulation"/>
  <disclaimer
              value="Disclaimer 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.

This measure and specifications are subject to further revisions.
"/>
  <rationale
             value="The NHSN Glycemic Control module supports an electronic health record (EHR)- and vendor-neutral standard for reporting patient-level, linked medication and blood glucose data for inpatients. These data support calculation of inpatient medication-related hypoglycemia events by the NHSN application, which are then returned as reports to the facility.
"/>
  <clinicalRecommendationStatement
                                   value="Inpatient hypoglycemia can be severe and life-threatening and is associated with longer hospital stays and increased medical costs (Wexler et al., 2007; Curkendall et al., 2009; Cook et al., 2009; Turchin et al., 2009; Egi et al., 2010). The prevalence of inpatient hypoglycemia varies with patient, hospital unit, timing of episodes, and glycemic threshold. Severe hypoglycemia (\&lt;40 mg/dL) occurs in 2%--5% of hospitalized patients with diabetes mellitus (DM), while hypoglycemia \&lt;70 mg/dL has been reported in up to 10% of all patients in the intensive care unit (Finfer et al., 2012). Patients with DM comprise more than 25% of all U.S. inpatient stays and medication-related hypoglycemia events are common causes of adverse drug events (ADEs) that occur in inpatient settings (Bates et al., 2023; Spector et al., 2017). Rates of severe hypoglycemia vary across hospitals, suggesting opportunities for improvement in glycemic-control quality of care (Hulkower et al., 2014; ADA, 2013; Cook et al., 2009).

Inpatient hyperglycemia can increase morbidity, prolong hospital stays, and increase the risk of mortality (Maynard et al., 2014; SHM, n.d.; Umpierrez et al., 2002; Kyi et al., 2019; Pratiwi et al., 2021). The prevalence of inpatient hyperglycemia varies depending upon glycemic threshold and setting, but blood glucose \&gt;140 mg/dL likely occurs in approximately one-eighth to one-quarter of hospitalized patients (Pratiwi et al., 2021; Seisa et al., 2022; Barmanray et al., 2024). Tracking patient blood-glucose levels and implementing appropriate interventions may reduce complications associated with both hyperglycemia and hypoglycemia (ADA, 2013; Cook et al., 2009; Korytkowski et al., 2022; Moghissi et al., 2009).
"/>
  <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="cohort"/>
          <display value="Cohort"/>
        </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="process"/>
          <display value="Process"/>
        </coding>
      </valueCodeableConcept>
    </extension>
    <population id="InitialPopulation_1">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="initial-population"/>
          <display value="Initial Population"/>
        </coding>
      </code>
      <description
                   value="All inpatient encounters, as well as ED and OBS encounters that end within 1 hour of the start of the inpatient encounter, for patients of all ages where at least one diabetes medication was ordered or administered during the encounter that is during the measurement period.
"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Initial Population"/>
      </criteria>
    </population>
  </group>
  <supplementalData id="sde-encounter-locations">
    <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 Encounter Locations
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Encounter Locations"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-location">
    <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 Location
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Location"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-medication">
    <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 Medication
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Medication"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-blood-glucose-observation">
    <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 Blood Glucose Observation
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Blood Glucose Observation"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-chief-complaint">
    <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 Chief Complaint
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Chief Complaint"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-condition">
    <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 Condition
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Condition"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-coverage">
    <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 Coverage
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Coverage"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-initial-population-encounters">
    <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 Initial Population Encounters
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Initial Population Encounters"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-medication-administration">
    <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 Medication Administration
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Medication Administration"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-medication-request">
    <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 Medication Request
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Medication Request"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-minimal-patient">
    <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 Minimal Patient
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Minimal Patient"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-service-request">
    <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 Service Request
"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Service Request"/>
    </criteria>
  </supplementalData>
  <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>
</Measure>