eCQM QICore Content Subset Implementation Guide
2024.0.0 - CI Build

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

: Hospital Harm - Severe HyperglycemiaFHIR - TTL Representation

Active as of 2024-09-09

Raw ttl | Download

@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

 a fhir:Measure ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR"] ; # 
  fhir:meta [
    ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/computable-measure-cqfm"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/computable-measure-cqfm>     ] [
fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/publishable-measure-cqfm"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/publishable-measure-cqfm>     ] [
fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/executable-measure-cqfm"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/executable-measure-cqfm>     ] )
  ] ; # 
  fhir:text [
fhir:status [ fhir:v "extensions" ] ;
fhir:div "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n  <table class=\"narrative-table\">\n    <tbody>\n<tr>\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Knowledge Artifact Metadata</th>\n\n</tr>\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Name (machine-readable)</th>\n\n<td class=\"content-container\">HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n</tr>\n\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Title (human-readable)</th>\n\n<td class=\"content-container\">Hospital Harm - Severe HyperglycemiaFHIR</td>\n</tr>\n\n\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Status</th>\n\n<td class=\"content-container\">Active</td>\n</tr>\n\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Experimental</th>\n\n<td class=\"content-container\">false</td>\n</tr>\n\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Description</th>\n\n<td class=\"content-container\"><div><p>This measure assesses the number of inpatient hospital days for patients age 18 and older with a hyperglycemic event (harm) per the total qualifying inpatient hospital days for that encounter</p>\n</div></td>\n</tr>\n\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Purpose</th>\n\n<td class=\"content-container\"><div><p>UNKNOWN</p>\n</div></td>\n</tr>\n\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Clinical Usage</th>\n\n<td class=\"content-container\">The measure is using mg/dL as the unit of measurement for glucose results.\n\nWhen evaluating for days with a glucose level &gt;300 mg/dL, the first 24-hour period after admission to the hospital is not evaluated to account for potentially poor glucose control outside of the hospital setting or that preceded the start of hospital care. The admission starts in the emergency department (ED) or observation when the transition between the ED encounter, observation encounter, and the inpatient encounter are within an hour or less of each other.\n\nThis measure evaluates the first 10 days of an eligible inpatient hospitalization in determining eligible days for the denominator and numerator (i.e., the length of stay is truncated to &lt;=10 days when the length exceeds 10 days). Patients admitted for longer length of stays are more likely to have more complex medical conditions.  \n\nThe “Days in Hospitalization” logic within Measure Observation 1 (associated with the denominator), in conjunction with other logic, returns the day number (e.g., day 1 to day 10) for each day within the hospitalization period to determine the eligible hospital days (e.g., from day 2 to day 10). \n\nThe “Days in Hospitalization” logic within Measure Observation 2 (associated with the numerator), in conjunction with other logic, returns the day number (e.g., day 1 to day 10) for each day within the hospitalization period to determine the eligible hyperglycemic event days (e.g., from day 2 to day 10).\n\nSince the measure does not count any hyperglycemic events that occur in the first 24 hours, day 1 is not considered an eligible hospital day for the Measure Observations. Eligible days range from day 2 up to day 10.\n\nAlthough the measure does not count any hyperglycemic events that occur in the first 24 hours as a hyperglycemic event day in Measure Observation 2, the first 24 hours of the encounter is considered day 1. This is because if there was a day during the encounter where a glucose result is not found, the measure evaluates the two days preceding to see if each had a glucose value &gt;=200 mg/dL. The measure allows the first 24 hours of the encounter, i.e., day 1, to be one of the preceding days.\n\nMultiple hyperglycemic events can occur during a ‘day’, but this is still considered one hyperglycemic event day.\n\nThe numerator returns the first eligible encounter that meets the qualifying criteria: an inpatient hospitalization with a hyperglycemic event. Only one numerator is counted per encounter. Note that the Numerator returns the encounters, not days, that meet the criteria.\n\nThe specimen source for the glucose test is blood, serum, plasma, or interstitial fluid, and can be obtained by a laboratory test, a Point of Care (POC) test, or a continuous glucose monitor (CGM). Glucose test results from urine specimens are not considered.\n\nThis eCQM is an episode-based measure. An episode is defined as each inpatient hospitalization or encounter that ends during the measurement period.\n\nThis FHIR-based measure has been derived from the QDM-based measure: CMS871v4.\n\nPlease refer to the HL7 QI-Core Implementation Guide(https://hl7.org/fhir/us/qicore/STU4.1.1/) for more information on QI-Core and mapping recommendations from QDM to QI-Core4.1.1 (https://hl7.org/fhir/us/qicore/STU4.1.1/qdm-to-qicore.html).</td>\n</tr>\n\n\n\n\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Effective Period</th>\n\n<td class=\"content-container\">2025-01-01..2025-12-31</td>\n</tr>\n\n\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Use Context</th>\n\n<td class=\"content-container\"><span title=\"{http://terminology.hl7.org/CodeSystem/usage-context-type venue}\">Venue</span> = <span title=\"Codes:{http://hl7.org/fhir/us/cqfmeasures/CodeSystem/intended-venue-codes eh}\">EH</span></td>\n</tr>\n\n\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Measure Developer</th>\n\n<td class=\"content-container\">American Institutes for Research (AIR): <a href=\"https://www.air.org\">https://www.air.org</a></td>\n</tr>\n\n\n\n\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Measure Steward</th>\n\n<td class=\"content-container\">Centers for Medicare &amp; Medicaid Services (CMS)</td>\n</tr>\n\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Steward Contact Details</th>\n\n<td class=\"content-container\"><a href=\"https://www.cms.gov/\">https://www.cms.gov/</a></td>\n</tr>\n\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Copyright</th>\n\n<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. American Institutes for Research(R), formerly IMPAQ International, disclaims all liability for use or accuracy of any third party codes contained in the specifications.</p>\n<p>LOINC(R) copyright 2004-2023 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2023 International Health Terminology Standards Development Organisation. ICD-10 copyright 2023 World Health Organization. All Rights Reserved.</p>\n</div></td>\n</tr>\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Metadata</th>\n\n</tr>\n\n  \n<tr>\n\n<th scope=\"row\" class=\"row-header\">Short Name Identifier</th>\n\n<td class=\"content-container\">CMS871FHIR</td>\n</tr>\n\n\n\n  \n<tr>\n\n<th scope=\"row\" class=\"row-header\">Version Independent Identifier</th>\n\n<td class=\"content-container\">urn:uuid:c44ca609-d795-4715-a8fc-1b0b30e46048</td>\n</tr>\n\n\n\n  \n<tr>\n\n<th scope=\"row\" class=\"row-header\">Version Specific Identifier</th>\n\n<td class=\"content-container\">urn:uuid:c7dbf77f-5869-42a0-b5e6-12e18004d2f4</td>\n</tr>\n\n\n\n  \n    \n    \n<tr>\n\n<th scope=\"row\" class=\"row-header\">Publisher (CMS) Identifier</th>\n\n<td class=\"content-container\">871FHIR</td>\n</tr>\n\n  \n\n\n  \n<tr>\n\n<th scope=\"row\" class=\"row-header\">Identifier</th>\n\n<td class=\"content-container\">Endorser/3533e (use: official, )</td>\n</tr>\n\n\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Version Number</th>\n\n<td class=\"content-container\">0.1.000</td>\n</tr>\n\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Measure Scoring</th>\n\n<td class=\"content-container\"><span title=\"Codes:{http://terminology.hl7.org/CodeSystem/measure-scoring ratio}\">Ratio</span></td>\n</tr>\n\n\n\n\n\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Rationale</th>\n\n<td class=\"content-container\"><div><p>Hyperglycemia, i.e., elevated glucose level, is common among hospitalized patients, especially those with preexisting diabetes (Umpierrez et al., 2012) and account for over 30% of noncritically ill hospitalized patients (Korytkowski, 2022). Hyperglycemia can also affect individuals with no prior history of diabetes and may be induced by medications such as steroids, or parenteral (intravenous) or enteral (tube) feeding.</p>\n<p>Severe hyperglycemia, i.e., extremely elevated glucose level, is significantly associated with a range of harms, including increased in-hospital mortality, infection rates, and hospital length of stay (Pasquel, et al., 2021; Umpierrez et al., 2012, 2015). Lower rates of inpatient severe hyperglycemia may not only improve care for patients, but also reduce costs for healthcare payers (Krinsley et al., 2016). The rate of hyperglycemia varies across hospitals, suggesting opportunities for improvement in inpatient glycemic management (Seisa et al., 2022; Bersoux et al., 2013). The rate of inpatient hyperglycemia can be considered a marker for quality of hospital care, since inpatient hyperglycemia is largely avoidable with proper glycemic management. The use of evidence-based standardized protocols and insulin management protocols have been shown to improve glycemic control and safety (Leroy et al., 2020; Maynard et al., 2015).</p>\n<p>From the Endocrine Society clinical practice guideline on the Management of Hyperglycemia in Hospitalized Patients in Non-critical Care Setting, 2022:\nRecommendation 1.1\nIn adults with insulin-treated diabetes hospitalized for noncritical illness who are at high risk of hypoglycemia, we suggest the use of real-time continuous glucose monitoring (CGM) with confirmatory bedside point-of-care blood glucose (POC-BG) monitoring for adjustments in insulin dosing rather than point-of-care blood glucose (POC-BG) testing alone in hospital settings where resources and training are available.</p>\n</div></td>\n</tr>\n\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Clinical Recommendation Statement</th>\n\n<td class=\"content-container\"><div><p>Multiple guidelines address recommended levels of glycemic control, though these do not define severe hyperglycemia:</p>\n<p>From Section 16, Diabetes Care in the Hospital, in the Standards of Medical Care in Diabetes by the American Diabetes Association, (American Diabetes Association, 2023):</p>\n<p>16.4 Insulin therapy should be initiated for the treatment of persistent hyperglycemia starting at a threshold ≥180 mg/dL (10.0 mmol/L) (checked on two occasions). Once insulin therapy is started, a target glucose range of 140–180 mg/dL (7.8–10.0 mmol/L) is recommended for most critically ill and noncritically ill patients.</p>\n<p>16.5 More stringent goals, such as 110–140 mg/dL (6.1–7.8 mmol/L) or 100–180 mg/dL (5.6–10.0 mmol/L), may be appropriate for selected patients and are acceptable if they can be achieved without significant hypoglycemia.</p>\n<p>From the Endocrine Society clinical practice guideline on the Management of Hyperglycemia in Hospitalized Patients in Non-critical Care Setting (2022):</p>\n<p>Recommendation 10.1\nIn adults with no prior history of diabetes hospitalized for noncritical illness with hyperglycemia [defined as blood glucose (BG) &gt; 140 mg/dL (7.8 mmol/L)] during hospitalization, we suggest initial therapy with correctional insulin over scheduled insulin therapy (defined as basal or basal/bolus insulin) to maintain glucose targets in the range of 100 to 180 mg/dL (5.6 to 10.0 mmol/L). For patients with persistent hyperglycemia [≥2 point-of-care blood glucose (POC-BG) measurements ≥ 180 mg/dL (≥10.0 mmol/L) in a 24-hour period on correctional insulin alone], we suggest the addition of scheduled insulin therapy.</p>\n<p>Recommendation 10.2\nIn adults with diabetes treated with diet or noninsulin diabetes medications prior to admission, we suggest initial therapy with correctional insulin or scheduled insulin therapy to maintain glucose targets in the range of 100 to 180 mg/dL (5.6 to 10.0 mmol/L). For hospitalized adults started on correctional insulin alone and with persistent hyperglycemia [≥2 point-of-care blood glucose (POC-BG) measurements ≥ 180 mg/dL in a 24-hour period (≥10.0 mmol/L)], we suggest addition of scheduled insulin therapy. We suggest initiation of scheduled insulin therapy for patients with confirmed admission blood glucose (BG) ≥ 180 mg/dL (≥10.0 mmol/L).</p>\n<p>Recommendation 10.3\nIn adults with insulin-treated diabetes prior to admission who are hospitalized for noncritical illness, we recommend continuation of the scheduled insulin regimen modified for nutritional status and severity of illness to maintain glucose targets in the range of 100 to 180 mg/dL (5.6 to 10.0 mmol/L).</p>\n<p>Remarks\nReductions in the dose of basal insulin (by 10% to 20%) at time of hospitalization may be required for patients on basal heavy insulin regimens (defined as doses of basal insulin ≥ 0.6 to 1.0 units/kg/day), in which basal insulin is being used inappropriately to cover meal-related excursions in BG.</p>\n<p>There is no clinically accepted cutoff for severe hyperglycemia. Studies have used thresholds of &gt;140, &gt;180 , &gt;300, &gt;350 and &gt;400 mg/dL, among other values (American Diabetes Association, 2023; Umpierrez et al, 2012, 2015; Jamesen et al., 2015; Donihi et al., 2011; Mendez et al, 2015; Seisa et al., 2022). BGL &lt;180 mg/dL is associated with lower rates of mortality and stroke compared with a target glucose &lt;200 mg/dL (Sathya et al., 2013). Glycemic goals may also differ among hospitalized patients. For inpatient management of hyperglycemia in noncritical care, the expert consensus recommends a target range of 100–180 mg/dL (5.6–10.0 mmol/L) for noncritically ill patients with “new” hyperglycemia as well as people with known diabetes prior to admission. Glycemic levels &gt;250 mg/dL (13.9 mmol/L) may be acceptable in terminally ill patients with short life expectancy. In these individuals, less aggressive insulin regimens to minimize glucosuria, dehydration, and electrolyte disturbances are often more appropriate. (ElSayed et al., 2023). In an older patient with a prior history of severe hypoglycemia, some degree of hyperglycemia may be tolerated to maximize safety. Intensive insulin therapy to target glucose of 100 and 140mg/dLin the ICU didn’t significantly reduce perioperative complications compared with target glucose of 141and180mg/dL after coronary artery bypass surgery (Umpierrez et al., 2015). The current recommendation is to maintain a blood glucose level between 140-180 mg/dL (7.8-10.0 mmol/L) in both cardiac and non-cardiac ICU patients (Sreedharan et al., 2022).</p>\n<p>For patients who present with hyperglycemic crises, neurologic status must be monitored closely, with frequent re-examination. Care should be taken to prevent over-correction of hyperglycemia and hyperosmolarity following initial fluid resuscitation of these patients to prevent cerebral edema, which carries a high mortality rate. (Gosmanov et al., 2021).</p>\n<p>From the Endocrine Society clinical practice guideline on the Management of Hyperglycemia in Hospitalized Patients in Non-critical Care Setting, 2022:\nRecommendation 1.1\nIn adults with insulin-treated diabetes hospitalized for noncritical illness who are at high risk of hypoglycemia, we suggest the use of real-time continuous glucose monitoring (CGM) with confirmatory bedside point-of-care blood glucose (POC-BG) monitoring for adjustments in insulin dosing rather than point-of-care blood glucose (POC-BG) testing alone in hospital settings where resources and training are available.</p>\n</div></td>\n</tr>\n\n\n\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Guidance</th>\n\n<td class=\"content-container\"><div><p>The measure is using mg/dL as the unit of measurement for glucose results.</p>\n<p>When evaluating for days with a glucose level &gt;300 mg/dL, the first 24-hour period after admission to the hospital is not evaluated to account for potentially poor glucose control outside of the hospital setting or that preceded the start of hospital care. The admission starts in the emergency department (ED) or observation when the transition between the ED encounter, observation encounter, and the inpatient encounter are within an hour or less of each other.</p>\n<p>This measure evaluates the first 10 days of an eligible inpatient hospitalization in determining eligible days for the denominator and numerator (i.e., the length of stay is truncated to &lt;=10 days when the length exceeds 10 days). Patients admitted for longer length of stays are more likely to have more complex medical conditions.</p>\n<p>The “Days in Hospitalization” logic within Measure Observation 1 (associated with the denominator), in conjunction with other logic, returns the day number (e.g., day 1 to day 10) for each day within the hospitalization period to determine the eligible hospital days (e.g., from day 2 to day 10).</p>\n<p>The “Days in Hospitalization” logic within Measure Observation 2 (associated with the numerator), in conjunction with other logic, returns the day number (e.g., day 1 to day 10) for each day within the hospitalization period to determine the eligible hyperglycemic event days (e.g., from day 2 to day 10).</p>\n<p>Since the measure does not count any hyperglycemic events that occur in the first 24 hours, day 1 is not considered an eligible hospital day for the Measure Observations. Eligible days range from day 2 up to day 10.</p>\n<p>Although the measure does not count any hyperglycemic events that occur in the first 24 hours as a hyperglycemic event day in Measure Observation 2, the first 24 hours of the encounter is considered day 1. This is because if there was a day during the encounter where a glucose result is not found, the measure evaluates the two days preceding to see if each had a glucose value &gt;=200 mg/dL. The measure allows the first 24 hours of the encounter, i.e., day 1, to be one of the preceding days.</p>\n<p>Multiple hyperglycemic events can occur during a ‘day’, but this is still considered one hyperglycemic event day.</p>\n<p>The numerator returns the first eligible encounter that meets the qualifying criteria: an inpatient hospitalization with a hyperglycemic event. Only one numerator is counted per encounter. Note that the Numerator returns the encounters, not days, that meet the criteria.</p>\n<p>The specimen source for the glucose test is blood, serum, plasma, or interstitial fluid, and can be obtained by a laboratory test, a Point of Care (POC) test, or a continuous glucose monitor (CGM). Glucose test results from urine specimens are not considered.</p>\n<p>This eCQM is an episode-based measure. An episode is defined as each inpatient hospitalization or encounter that ends during the measurement period.</p>\n<p>This FHIR-based measure has been derived from the QDM-based measure: CMS871v4.</p>\n<p>Please refer to the HL7 QI-Core Implementation Guide(https://hl7.org/fhir/us/qicore/STU4.1.1/) for more information on QI-Core and mapping recommendations from QDM to QI-Core4.1.1 (https://hl7.org/fhir/us/qicore/STU4.1.1/qdm-to-qicore.html).</p>\n</div></td>\n</tr>\n\n\n  \n    \n<tr>\n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Guidance</th>\n\n<td class=\"content-container\">For every patient evaluated by this measure also identify payer, race, ethnicity and sex; SDE Ethnicity \n SDE Payer \n SDE Race \n SDE Sex \n </td>\n</tr>\n\n  \n\n\n\n\n\n  \n    \n    <tr>\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Population Criteria (ID: 6501fe8dda013638e7b3dc0d)</th>\n\n</tr>\n  \n  \n  \n  \n    <tr>\n      \n        \n<th scope=\"row\" class=\"row-header\">Initial Population</th>\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: 9B922C53-7F1B-4AF5-96E6-1A1E4AF7909C\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\">Inpatient hospitalizations for patients age 18 and older that end during the measurement period, as well as either: \n\n - A diagnosis of diabetes that starts before or during the encounter; or \n - Administration of at least one dose of insulin or any hypoglycemic medication during the encounter; or \n - Presence of at least one glucose value &gt;=200 mg/dL at any time during the encounter</p>\n        \n        \n          \n            \n            <em>Logic Definition</em>: <a href=\"#hospitalharmhyperglycemiainhospitalizedpatientsfhir-initial-population\">Initial Population</a> \n          \n        \n      </td>\n    </tr>\n  \n\n  \n    <tr>\n      \n        \n<th scope=\"row\" class=\"row-header\">Denominator</th>\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: 6402512C-2305-42DC-B5F6-A226B5057B89\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\">Equals Initial Population</p>\n        \n        \n          \n            \n            <em>Logic Definition</em>: <a href=\"#hospitalharmhyperglycemiainhospitalizedpatientsfhir-denominator\">Denominator</a> \n          \n        \n      </td>\n    </tr>\n  \n\n  \n    <tr>\n      \n        \n<th scope=\"row\" class=\"row-header\">Denominator Exclusion</th>\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: 0F4405D3-B373-4620-A9CC-D29558C39E85\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\">-Inpatient hospitalizations for patients with a glucose result of &gt;=1000 mg/dL anytime between 1 hour prior to the start of the encounter to 6 hours after the start of the encounter\n-Inpatient hospitalizations for patients who have comfort care measures ordered or provided during the encounter\n-Inpatient hospitalizations for patients who have a discharge disposition to home or to a health care facility for hospice care\n</p>\n        \n        \n          \n            \n            <em>Logic Definition</em>: <a href=\"#hospitalharmhyperglycemiainhospitalizedpatientsfhir-denominator-exclusions\">Denominator Exclusions</a> \n          \n        \n      </td>\n    </tr>\n  \n\n  \n    <tr>\n      \n        \n<th scope=\"row\" class=\"row-header\">Numerator</th>\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: 340EA45E-2411-4192-9C9D-3DF8D89A1D97\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\">Inpatient hospitalizations with a hyperglycemic event within the first 10 days of the encounter minus the first 24 hours, and minus the last period before discharge from the hospital if less than 24 hours\n\nA hyperglycemic event is defined as: \n\n - A day with at least one glucose value &gt;300 mg/dL; \nOR\n - A day where a glucose test and result was not found, and it was preceded by two consecutive days where at least one glucose value during each of the two days was &gt;=200 mg/dL</p>\n        \n        \n          \n            \n            <em>Logic Definition</em>: <a href=\"#hospitalharmhyperglycemiainhospitalizedpatientsfhir-numerator\">Numerator</a> \n          \n        \n      </td>\n    </tr>\n  \n\n  \n    <tr>\n      \n        \n<th scope=\"row\" class=\"row-header\">Measure Observation</th>\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: 68900484-66a1-4da3-9b02-1a10a5fd592b\n        <br/>\n        \n        \n          <em>Description</em>: No description provided\n        \n        \n          \n            \n            <em>Logic Definition</em>: <a href=\"#hospitalharmhyperglycemiainhospitalizedpatientsfhir-denominator-observations\">Denominator Observations</a> \n          \n        \n      </td>\n    </tr>\n  \n\n  \n    <tr>\n      \n        \n<th scope=\"row\" class=\"row-header\">Measure Observation</th>\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: f1bc37e5-f64f-4ed8-b965-2011f1181225\n        <br/>\n        \n        \n          <em>Description</em>: No description provided\n        \n        \n          \n            \n            <em>Logic Definition</em>: <a href=\"#hospitalharmhyperglycemiainhospitalizedpatientsfhir-numerator-observations\">Numerator Observations</a> \n          \n        \n      </td>\n    </tr>\n  \n\n  \n  \n  \n<tr>\n\n<th scope=\"row\" class=\"row-header\">Population Basis</th>\n\n<td class=\"content-container\">Encounter</td>\n</tr>\n\n\n\n  \n<tr>\n\n<th scope=\"row\" class=\"row-header\">Scoring</th>\n\n<td class=\"content-container\"><span title=\"Codes:{http://terminology.hl7.org/CodeSystem/measure-scoring ratio}\">Ratio</span></td>\n</tr>\n\n\n\n\n\n\n\n  \n<tr>\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n<td class=\"content-container\"><span title=\"Codes:{http://terminology.hl7.org/CodeSystem/measure-type outcome}\">Outcome</span></td>\n</tr>\n\n\n\n\n  \n<tr>\n\n<th scope=\"row\" class=\"row-header\">Rate Aggregation</th>\n\n<td class=\"content-container\">None</td>\n</tr>\n\n\n\n  \n<tr>\n\n<th scope=\"row\" class=\"row-header\">Improvement Notation</th>\n\n<td class=\"content-container\"><span title=\"Codes:{http://terminology.hl7.org/CodeSystem/measure-improvement-notation decrease}\">decrease</span></td>\n</tr>\n\n\n\n\n  <tr>\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Supplemental Data Elements</th>\n\n</tr>\n\n\n<tr>\n  \n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\n  <td class=\"content-container\">\n    \n      <em>ID</em>: sde-ethnicity\n      \n      <br/>\n      \n    \n    \n      \n        \n          <em>Usage Code</em>: <span title=\"Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}\">Supplemental Data</span>\n        \n        <br/>\n      \n    \n    \n      <em>Description</em>: SDE Ethnicity\n    \n    \n      \n        <br/>\n        \n        <em>Logic Definition</em>: <a href=\"#hospitalharmhyperglycemiainhospitalizedpatientsfhir-sde-ethnicity\">SDE Ethnicity</a> \n      \n    \n  </td>\n</tr>\n\n<tr>\n  \n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\n  <td class=\"content-container\">\n    \n      <em>ID</em>: sde-payer\n      \n      <br/>\n      \n    \n    \n      \n        \n          <em>Usage Code</em>: <span title=\"Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}\">Supplemental Data</span>\n        \n        <br/>\n      \n    \n    \n      <em>Description</em>: SDE Payer\n    \n    \n      \n        <br/>\n        \n        <em>Logic Definition</em>: <a href=\"#hospitalharmhyperglycemiainhospitalizedpatientsfhir-sde-payer\">SDE Payer</a> \n      \n    \n  </td>\n</tr>\n\n<tr>\n  \n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\n  <td class=\"content-container\">\n    \n      <em>ID</em>: sde-race\n      \n      <br/>\n      \n    \n    \n      \n        \n          <em>Usage Code</em>: <span title=\"Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}\">Supplemental Data</span>\n        \n        <br/>\n      \n    \n    \n      <em>Description</em>: SDE Race\n    \n    \n      \n        <br/>\n        \n        <em>Logic Definition</em>: <a href=\"#hospitalharmhyperglycemiainhospitalizedpatientsfhir-sde-race\">SDE Race</a> \n      \n    \n  </td>\n</tr>\n\n<tr>\n  \n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\n  <td class=\"content-container\">\n    \n      <em>ID</em>: sde-sex\n      \n      <br/>\n      \n    \n    \n      \n        \n          <em>Usage Code</em>: <span title=\"Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}\">Supplemental Data</span>\n        \n        <br/>\n      \n    \n    \n      <em>Description</em>: SDE Sex\n    \n    \n      \n        <br/>\n        \n        <em>Logic Definition</em>: <a href=\"#hospitalharmhyperglycemiainhospitalizedpatientsfhir-sde-sex\">SDE Sex</a> \n      \n    \n  </td>\n</tr>\n\n\n<tr>\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Logic</th>\n\n</tr>\n\n<tr>\n\n<th scope=\"row\" class=\"row-header\">Primary Library</th>\n\n<td class=\"content-container\"><a href=\"Library-HospitalHarmHyperglycemiainHospitalizedPatientsFHIR.html\">HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</a></td>\n</tr>\n\n\n\n\n  \n  \n\n<tr>\n  \n  \n  \n  \n  \n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Library SDE\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <code>Library/SupplementalDataElements|3.5.000</code>\n    <br/>\n    <em>Canonical URL</em>: <tt>Library/SupplementalDataElements|3.5.000</tt>\n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Library FHIRHelpers\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <code>Library/FHIRHelpers|4.4.000</code>\n    <br/>\n    <em>Canonical URL</em>: <tt>Library/FHIRHelpers|4.4.000</tt>\n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Library CQMCommon\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <code>Library/CQMCommon|2.2.000</code>\n    <br/>\n    <em>Canonical URL</em>: <tt>Library/CQMCommon|2.2.000</tt>\n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Library QICoreCommon\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <code>Library/QICoreCommon|2.1.000</code>\n    <br/>\n    <em>Canonical URL</em>: <tt>Library/QICoreCommon|2.1.000</tt>\n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system AdministrativeGender\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://hl7.org/fhir/R4/codesystem-administrative-gender.html\">AdministrativeGender</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://hl7.org/fhir/administrative-gender</tt>\n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Encounter Inpatient\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion\">Encounter Inpatient</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307</tt>\n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Observation Services\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.143/expansion\">Observation Services</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143</tt>\n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Emergency Department Visit\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <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>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292</tt>\n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Diabetes\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.464.1003.103.12.1001/expansion\">Diabetes</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.103.12.1001</tt>\n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Hypoglycemics Treatment Medications\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1196.394/expansion\">http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1196.394</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1196.394</tt>\n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Glucose Lab Test Mass Per Volume\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1248.34/expansion\">http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.34</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.34</tt>\n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Payer Type\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion\">Payer</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591</tt>\n    \n  </td>\n</tr>\n\n\n  \n  <tr>\n    <th scope=\"row\" class=\"row-header\">Direct Reference Code</th>\n    <td class=\"content-container\">\n      \n        <em>Display</em>: Male\n        <br/>\n      \n      <em>Code</em>: M\n      <br/>\n      <em>System</em>: <tt>http://hl7.org/fhir/administrative-gender</tt>\n    </td>\n  </tr>\n\n  <tr>\n    <th scope=\"row\" class=\"row-header\">Direct Reference Code</th>\n    <td class=\"content-container\">\n      \n        <em>Display</em>: Female\n        <br/>\n      \n      <em>Code</em>: F\n      <br/>\n      <em>System</em>: <tt>http://hl7.org/fhir/administrative-gender</tt>\n    </td>\n  </tr>\n\n  \n  <tr>\n  \n<th scope=\"row\" class=\"row-header\">Parameter</th>\n\n  <td class=\"content-container\">\n    <em>Name</em>: Measurement Period\n    <br/>\n    <em>Use</em>: In\n    <br/>\n    <em>Min Cardinality</em>: 0\n    <br/>\n    <em>Max Cardinality</em>: 1\n    <br/>\n    <em>Type</em>: Period\n  </td>\n</tr>\n  \n  <tr>\n  \n<th scope=\"row\" class=\"row-header\">Parameter</th>\n\n  <td class=\"content-container\">\n    <em>Name</em>: SDE Sex\n    <br/>\n    <em>Use</em>: Out\n    <br/>\n    <em>Min Cardinality</em>: 0\n    <br/>\n    <em>Max Cardinality</em>: 1\n    <br/>\n    <em>Type</em>: Coding\n  </td>\n</tr>\n  \n  <tr>\n  \n<th scope=\"row\" class=\"row-header\">Parameter</th>\n\n  <td class=\"content-container\">\n    <em>Name</em>: Numerator\n    <br/>\n    <em>Use</em>: Out\n    <br/>\n    <em>Min Cardinality</em>: 0\n    <br/>\n    <em>Max Cardinality</em>: *\n    <br/>\n    <em>Type</em>: Resource\n  </td>\n</tr>\n  \n  <tr>\n  \n<th scope=\"row\" class=\"row-header\">Parameter</th>\n\n  <td class=\"content-container\">\n    <em>Name</em>: Denominator\n    <br/>\n    <em>Use</em>: Out\n    <br/>\n    <em>Min Cardinality</em>: 0\n    <br/>\n    <em>Max Cardinality</em>: *\n    <br/>\n    <em>Type</em>: Resource\n  </td>\n</tr>\n  \n  <tr>\n  \n<th scope=\"row\" class=\"row-header\">Parameter</th>\n\n  <td class=\"content-container\">\n    <em>Name</em>: SDE Payer\n    <br/>\n    <em>Use</em>: Out\n    <br/>\n    <em>Min Cardinality</em>: 0\n    <br/>\n    <em>Max Cardinality</em>: *\n    <br/>\n    <em>Type</em>: Resource\n  </td>\n</tr>\n  \n  <tr>\n  \n<th scope=\"row\" class=\"row-header\">Parameter</th>\n\n  <td class=\"content-container\">\n    <em>Name</em>: Initial Population\n    <br/>\n    <em>Use</em>: Out\n    <br/>\n    <em>Min Cardinality</em>: 0\n    <br/>\n    <em>Max Cardinality</em>: *\n    <br/>\n    <em>Type</em>: Resource\n  </td>\n</tr>\n  \n  <tr>\n  \n<th scope=\"row\" class=\"row-header\">Parameter</th>\n\n  <td class=\"content-container\">\n    <em>Name</em>: SDE Ethnicity\n    <br/>\n    <em>Use</em>: Out\n    <br/>\n    <em>Min Cardinality</em>: 0\n    <br/>\n    <em>Max Cardinality</em>: 1\n    <br/>\n    <em>Type</em>: Resource\n  </td>\n</tr>\n  \n  <tr>\n  \n<th scope=\"row\" class=\"row-header\">Parameter</th>\n\n  <td class=\"content-container\">\n    <em>Name</em>: Denominator Exclusions\n    <br/>\n    <em>Use</em>: Out\n    <br/>\n    <em>Min Cardinality</em>: 0\n    <br/>\n    <em>Max Cardinality</em>: *\n    <br/>\n    <em>Type</em>: Resource\n  </td>\n</tr>\n  \n  <tr>\n  \n<th scope=\"row\" class=\"row-header\">Parameter</th>\n\n  <td class=\"content-container\">\n    <em>Name</em>: SDE Race\n    <br/>\n    <em>Use</em>: Out\n    <br/>\n    <em>Min Cardinality</em>: 0\n    <br/>\n    <em>Max Cardinality</em>: 1\n    <br/>\n    <em>Type</em>: Resource\n  </td>\n</tr>\n  \n  \n  <tr>\n    <th colspan=\"2\" scope=\"row\" class=\"section-header\"><a name=\"effective-data-requirements\"> </a>Measure Logic Data Requirements</th>\n  </tr>\n  \n  \n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Patient\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-patient.html\">QICorePatient</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: ethnicity, race\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-encounter.html\">QICoreEncounter</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, status, status.value, period\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: type</span>\n    <br/>\n  \n  \n  \n    <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>\n    <br/> \n  \n  \n  \n  \n    <span class=\"tab-one\"><em>Path</em>: status.value</span>\n    <br/>\n  \n  \n  \n  \n    <span class=\"tab-one\"><em>Code</em>: </span>\n    <br/>\n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-encounter.html\">QICoreEncounter</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, status, status.value, period\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: type</span>\n    <br/>\n  \n  \n  \n    <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>\n    <br/> \n  \n  \n  \n  \n    <span class=\"tab-one\"><em>Path</em>: status.value</span>\n    <br/>\n  \n  \n  \n  \n    <span class=\"tab-one\"><em>Code</em>: </span>\n    <br/>\n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-encounter.html\">QICoreEncounter</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, period, status, status.value, hospitalizationPeriod, encounter\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: type</span>\n    <br/>\n  \n  \n  \n    <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>\n    <br/> \n  \n  \n  \n  \n    <span class=\"tab-one\"><em>Path</em>: status.value</span>\n    <br/>\n  \n  \n  \n  \n    <span class=\"tab-one\"><em>Code</em>: </span>\n    <br/>\n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Condition\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-condition.html\">QICoreCondition</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: code</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.464.1003.103.12.1001/expansion\">Diabetes</a>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: MedicationAdministration\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-medicationadministration.html\">QICoreMedicationAdministration</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: medication, status, status.value, effective\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: medication</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1196.394/expansion\">http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1196.394</a>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Observation\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-observation.html\">QICoreObservation</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, effective, status, status.value, value, id, id.value\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: code</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1248.34/expansion\">http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.34</a>\n    <br/> \n  \n  \n  \n  \n    <span class=\"tab-one\"><em>Path</em>: status.value</span>\n    <br/>\n  \n  \n  \n  \n    <span class=\"tab-one\"><em>Code</em>: </span>\n    <br/>\n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Observation\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-observation.html\">QICoreObservation</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, effective, value, status, status.value, id, id.value\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: code</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1248.34/expansion\">http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.34</a>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Coverage\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-coverage.html\">QICoreCoverage</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, period\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: type</span>\n    <br/>\n  \n  \n  \n    <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</a>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n  \n  <tr>\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Logic Definitions</th>\n\n</tr>\n  \n          \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"supplementaldataelements-sde-sex\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> SupplementalDataElements</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;SDE Sex&quot;:\n  case\n    when Patient.gender = 'male' then &quot;M&quot;\n    when Patient.gender = 'female' then &quot;F&quot;\n    else null\n  end</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-sde-sex\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;SDE Sex&quot;:\n  SDE.&quot;SDE Sex&quot;</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-qualifying-encounter\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Qualifying Encounter&quot;:\n  [&quot;Encounter&quot;: &quot;Encounter Inpatient&quot;] InpatientEncounter\n    where AgeInYearsAt(date from start of InpatientEncounter.period) &gt;= 18\n      and InpatientEncounter.period ends during day of &quot;Measurement Period&quot;\n      and InpatientEncounter.status = 'finished'</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-encounter-with-hospitalization-period\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/**\n * Create paring of encounters to hospitalization period so this calculation can be inspected and the result \n * can be reused, making the logic faster.*/\n\n\ndefine &quot;Encounter with Hospitalization Period&quot;:\n  &quot;Qualifying Encounter&quot; QualifyingHospitalization\n    return Tuple {\n      encounter: QualifyingHospitalization,\n      hospitalizationPeriod: CQMCommon.&quot;HospitalizationWithObservation&quot; ( QualifyingHospitalization )\n    }</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-encounter-with-existing-diabetes-diagnosis\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/**\n * Using the already calculated pairing of hospitalization periods with encounters, filter on ones with \n * diabetes and return the encounter.*/\n\n\ndefine &quot;Encounter with Existing Diabetes Diagnosis&quot;:\n  &quot;Encounter with Hospitalization Period&quot; Hospitalization\n    with [&quot;Condition&quot;: &quot;Diabetes&quot;] Diabetes\n      such that ( QICoreCommon.&quot;ToPrevalenceInterval&quot; ( Diabetes ) starts before end of Hospitalization.hospitalizationPeriod )\n    return Hospitalization.encounter</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-encounter-with-hypoglycemic-medication\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/**\n * Using the already calculated pairing of hospitalization periods with encounters, filter on ones with \n * hypoglycemic medicatons and return the encounter.*/\n\n\ndefine &quot;Encounter with Hypoglycemic Medication&quot;:\n  from\n    &quot;Encounter with Hospitalization Period&quot; Hospitalization,\n    [&quot;MedicationAdministration&quot;: &quot;Hypoglycemics Treatment Medications&quot;] HypoglycemicMed\n    where HypoglycemicMed.status = 'completed'\n      and HypoglycemicMed.status != 'not-done'\n      and QICoreCommon.&quot;ToInterval&quot; ( HypoglycemicMed.effective ) during Hospitalization.hospitalizationPeriod\n    return Hospitalization.encounter</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-encounter-with-elevated-glucose-greater-than-or-equal-to-200\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/**\n * Using the already calculated pairing of hospitalization periods with encounters, filter on ones with \n * any elevated (&gt;= 200) blood glucose reading during the hospitalization*/\n\n\ndefine &quot;Encounter with Elevated Glucose Greater Than or Equal to 200&quot;:\n  &quot;Encounter with Hospitalization Period&quot; Hospitalization\n    with [&quot;Observation&quot;: &quot;Glucose Lab Test Mass Per Volume&quot;] GlucoseTest\n      such that QICoreCommon.&quot;Earliest&quot; ( GlucoseTest.effective ) during Hospitalization.hospitalizationPeriod\n        and GlucoseTest.status in { 'final', 'amended', 'corrected' }\n        and GlucoseTest.status != 'cancelled'\n        and GlucoseTest.value &gt;= 200 'mg/dL'\n    return Hospitalization.encounter</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-initial-population\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Initial Population&quot;:\n  &quot;Encounter with Existing Diabetes Diagnosis&quot;\n    union &quot;Encounter with Hypoglycemic Medication&quot;\n    union &quot;Encounter with Elevated Glucose Greater Than or Equal to 200&quot;</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-denominator\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Denominator&quot;:\n  &quot;Initial Population&quot;</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-measurement-population\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Measurement Population&quot;:\n  &quot;Denominator&quot;</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-days-in-hospitalization\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/***/\n\n\ndefine &quot;Days in Hospitalization&quot;:\n  &quot;Measurement Population&quot; EligibleInpatientHospitalization\n    let period: CQMCommon.&quot;HospitalizationWithObservation&quot; ( EligibleInpatientHospitalization ),\n    relevantPeriod: &quot;Hospital Days Max 10&quot;(period)\n    return Tuple {\n      encounter: EligibleInpatientHospitalization,\n      hospitalizationPeriod: period,\n      relevantPeriod: relevantPeriod,\n      relevantDays: &quot;Days In Period&quot;(relevantPeriod)\n    }</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-days-with-glucose-results\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Days with Glucose Results&quot;:\n  &quot;Days in Hospitalization&quot; InpatientHospitalDays\n    return Tuple {\n      encounter: InpatientHospitalDays.encounter,\n      relevantPeriod: InpatientHospitalDays.relevantPeriod,\n      relevantDays: ( InpatientHospitalDays.relevantDays EncounterDay\n          return Tuple {\n            dayNumber: EncounterDay.dayNumber,\n            dayPeriod: EncounterDay.dayPeriod,\n            hasSevereResult: exists ( [&quot;Observation&quot;: &quot;Glucose Lab Test Mass Per Volume&quot;] GlucoseTest\n                where GlucoseTest.status in { 'final', 'amended', 'corrected' }\n                  and GlucoseTest.status != 'cancelled'\n                  and GlucoseTest.value &gt; 300 'mg/dL'\n                  and QICoreCommon.&quot;Earliest&quot; ( GlucoseTest.effective ) during EncounterDay.dayPeriod\n            ),\n            hasElevatedResult: exists ( [&quot;Observation&quot;: &quot;Glucose Lab Test Mass Per Volume&quot;] GlucoseTest\n                where GlucoseTest.status in { 'final', 'amended', 'corrected' }\n                  and GlucoseTest.status != 'cancelled'\n                  and GlucoseTest.value &gt;= 200 'mg/dL'\n                  and QICoreCommon.&quot;Earliest&quot; ( GlucoseTest.effective ) during EncounterDay.dayPeriod\n            ),\n            hasNoGlucoseTest: not exists ( [&quot;Observation&quot;: &quot;Glucose Lab Test Mass Per Volume&quot;] GlucoseTest\n                where GlucoseTest.status in { 'final', 'amended', 'corrected' }\n                  and GlucoseTest.status != 'cancelled'\n                  and QICoreCommon.&quot;Earliest&quot; ( GlucoseTest.effective ) during EncounterDay.dayPeriod\n            )\n          }\n      )\n    }</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-days-with-hyperglycemic-events\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*# hyper days uses &quot;Relevant Encounters With Glucose Result Days&quot; to find if hyper event on each day. Skips 1st day in 'RelevantDays`. Returns boolean based on: Today high result OR Today no result AND Yesterday high result AND 2 days ago high result*/\n\n\ndefine &quot;Days with Hyperglycemic Events&quot;:\n  &quot;Days with Glucose Results&quot; EncounterWithResultDays\n    let eligibleEventDays: EncounterWithResultDays.relevantDays EncounterDay\n      where EncounterDay.dayNumber &gt; 1\n      return Tuple {\n        dayIndex: EncounterDay.dayNumber,\n        dayPeriod: EncounterDay.dayPeriod,\n        hasHyperglycemicEvent: ( EncounterDay.hasSevereResult\n            or ( EncounterDay.hasNoGlucoseTest\n                and EncounterWithResultDays.relevantDays[EncounterDay.dayNumber - 2].hasElevatedResult\n                and EncounterWithResultDays.relevantDays[EncounterDay.dayNumber - 3].hasElevatedResult\n            )\n        )\n      }\n    return Tuple {\n      encounter: EncounterWithResultDays.encounter,\n      relevantPeriod: EncounterWithResultDays.relevantPeriod,\n      eligibleEventDays: eligibleEventDays\n    }</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-encounter-with-hyperglycemic-events\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/***/\n\n\ndefine &quot;Encounter with Hyperglycemic Events&quot;:\n  &quot;Days with Hyperglycemic Events&quot; HyperglycemicEventDays\n    where exists ( HyperglycemicEventDays.eligibleEventDays EligibleEventDay\n        where EligibleEventDay.hasHyperglycemicEvent\n    )\n    return HyperglycemicEventDays.encounter</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-numerator\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Numerator&quot;:\n  &quot;Encounter with Hyperglycemic Events&quot;</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"supplementaldataelements-sde-payer\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> SupplementalDataElements</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;SDE Payer&quot;:\n  [Coverage: type in &quot;Payer Type&quot;] Payer\n    return {\n      code: Payer.type,\n      period: Payer.period\n    }</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-sde-payer\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;SDE Payer&quot;:\n  SDE.&quot;SDE Payer&quot;</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"supplementaldataelements-sde-ethnicity\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> SupplementalDataElements</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;SDE Ethnicity&quot;:\n  Patient.ethnicity E\n    return Tuple {\n      codes: { E.ombCategory } union E.detailed,\n      display: E.text\n    }</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-sde-ethnicity\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;SDE Ethnicity&quot;:\n  SDE.&quot;SDE Ethnicity&quot;</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-glucose-greater-than-or-equal-to-1000-within-1-hour-prior-to-and-6-hours-after-encounter-start\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start&quot;:\n  from\n    &quot;Initial Population&quot; InpatientHospitalization,\n    [&quot;Observation&quot;: &quot;Glucose Lab Test Mass Per Volume&quot;] GlucoseTest\n    let HospitalizationInterval: CQMCommon.&quot;HospitalizationWithObservation&quot; ( InpatientHospitalization ),\n    GlucoseTestTime: QICoreCommon.&quot;Earliest&quot; ( GlucoseTest.effective )\n    where GlucoseTest.value as Quantity &gt;= 1000 'mg/dL'\n      and GlucoseTest.status in { 'final', 'amended', 'corrected' }\n      and GlucoseTestTime during Interval[( start of HospitalizationInterval - 1 hour ), ( start of HospitalizationInterval + 6 hours )]\n    return GlucoseTest</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-glucose-tests-earlier-than-glucose-greater-than-or-equal-to-1000-within-1-hour-prior-to-and-6-hours-after-encounter-start\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Glucose Tests Earlier Than Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start&quot;:\n  from\n    &quot;Initial Population&quot; InpatientHospitalization,\n    &quot;Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start&quot; GlucoseResult1000,\n    [&quot;Observation&quot;: &quot;Glucose Lab Test Mass Per Volume&quot;] EarlierGlucoseTest\n    let HospitalizationInterval: CQMCommon.&quot;HospitalizationWithObservation&quot; ( InpatientHospitalization ),\n    GlucoseTest1000Time: QICoreCommon.&quot;Earliest&quot; ( GlucoseResult1000.effective ),\n    EarlierGlucoseTestTime: QICoreCommon.&quot;Earliest&quot; ( EarlierGlucoseTest.effective )\n    where GlucoseTest1000Time during Interval[( start of HospitalizationInterval - 1 hour ), ( start of HospitalizationInterval + 6 hour )]\n      and EarlierGlucoseTestTime during Interval[( start of HospitalizationInterval - 1 hour ), GlucoseTest1000Time )\n      and EarlierGlucoseTest.id !~ GlucoseResult1000.id\n    return GlucoseResult1000</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-initial-glucose-greater-than-or-equal-to-1000-within-1-hour-prior-to-and-6-hours-after-encounter-start\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Initial Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start&quot;:\n  &quot;Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start&quot; GlucoseResult1000\n    where not ( GlucoseResult1000.id in &quot;Glucose Tests Earlier Than Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start&quot;.id )</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-encounter-with-first-glucose-greater-than-or-equal-to-1000\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Encounter with First Glucose Greater Than or Equal to 1000&quot;:\n  &quot;Initial Population&quot; InpatientHospitalization\n    with &quot;Initial Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start&quot; FirstGlucoseResult\n      such that FirstGlucoseResult.value as Quantity &gt;= 1000 'mg/dL'\n        and QICoreCommon.&quot;Earliest&quot; ( FirstGlucoseResult.effective ) during Interval[( start of CQMCommon.&quot;HospitalizationWithObservation&quot; ( InpatientHospitalization ) - 1 hour ), ( start of CQMCommon.&quot;HospitalizationWithObservation&quot; ( InpatientHospitalization ) + 6 hours )]</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-denominator-exclusions\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Denominator Exclusions&quot;:\n  &quot;Encounter with First Glucose Greater Than or Equal to 1000&quot;</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"supplementaldataelements-sde-race\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> SupplementalDataElements</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;SDE Race&quot;:\n  Patient.race R\n    return Tuple {\n      codes: R.ombCategory union R.detailed,\n      display: R.text\n    }</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-sde-race\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;SDE Race&quot;:\n  SDE.&quot;SDE Race&quot;</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"cqmcommon-hospitalizationwithobservation\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CQMCommon</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@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\n@deprecated: This function is deprecated. Use the fluent function `hospitalizationWithObservation()` instead.\n*/\ndefine function &quot;HospitalizationWithObservation&quot;(TheEncounter Encounter ):\n  TheEncounter Visit\n  		let ObsVisit: Last([Encounter: &quot;Observation Services&quot;] LastObs\n  				where LastObs.status = 'finished'\n            and LastObs.period ends 1 hour or less on or before start of Visit.period\n  				sort by end of period\n  			),\n  			VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),\n  			EDVisit: Last([Encounter: &quot;Emergency Department Visit&quot;] LastED\n  				where LastED.status = 'finished'\n            and LastED.period ends 1 hour or less on or before VisitStart\n  				sort by end of period\n  			)\n  		return Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"qicorecommon-toprevalenceinterval\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> QICoreCommon</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Returns an interval representing the normalized prevalence period of a given Condition.\n@comment: Uses the ToInterval and ToAbatementInterval functions to determine the widest potential interval from\nonset to abatement as specified in the given Condition. If the condition is active, or has an abatement date the resulting \ninterval will have a closed ending boundary. Otherwise, the resulting interval will have an open ending boundary.\n@deprecated: This function is deprecated. Use the `prevalenceInterval()` fluent function instead\n*/\ndefine function ToPrevalenceInterval(condition Condition):\nif condition.clinicalStatus ~ &quot;active&quot;\n  or condition.clinicalStatus ~ &quot;recurrence&quot;\n  or condition.clinicalStatus ~ &quot;relapse&quot; then\n  Interval[start of ToInterval(condition.onset), end of ToAbatementInterval(condition)]\nelse\n   (end of ToAbatementInterval(condition)) abatementDate\n    return if abatementDate is null then\n      Interval[start of ToInterval(condition.onset), abatementDate)\n    else\n      Interval[start of ToInterval(condition.onset), abatementDate]</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"qicorecommon-earliest\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> QICoreCommon</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Given an interval, return the starting point if the interval has a starting boundary specified,\notherwise, return the ending point\n@deprecated: This function is deprecated. Use the fluent function `earliest()` instead\n*/\ndefine function &quot;Earliest&quot;(choice Choice&lt;DateTime, Quantity, Interval&lt;DateTime&gt;, Interval&lt;Quantity&gt;&gt; ):\n  (choice.toInterval()) period\n    return\n      if (HasStart(period)) then start of period\n      else end of period</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-hospital-days-max-10\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/**\n * Crops an interval to a maximum length of 10 days.*/\n\n\ndefine function &quot;Hospital Days Max 10&quot;(Period Interval&lt;DateTime&gt;):\n  Interval[start of Period, Min({ \n    end of Period, start of Period + 10 days }\n  )]</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-days-in-period\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/**\n * Creates a list of 24 hour long intervals in an interval paired with the index (1 indexed) to which 24 hour interval it is.*/\n\n\ndefine function &quot;Days In Period&quot;(Period Interval&lt;DateTime&gt;):\n  ( &quot;Interval To Day Numbers&quot;(Period) ) DayNumber\n    let startPeriod: start of Period + ( 24 hours * ( DayNumber - 1 ) ),\n    endPeriod: if ( hours between startPeriod and end of Period &lt; 24 ) then startPeriod \n      else start of Period + ( 24 hours * DayNumber )\n    return Tuple {\n      dayNumber: DayNumber,\n      dayPeriod: Interval[startPeriod, endPeriod )\n    }</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-interval-to-day-numbers\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/**\n * Creates a list of integers from 1 to how many days are in the interval. Note, this wont create an index for\n * the final day if it is less than 24 hours. This also includes the first 24 hour period.*/\n\n\ndefine function &quot;Interval To Day Numbers&quot;(Period Interval&lt;DateTime&gt;):\n  ( expand { Interval[1, duration in days between start of Period and end of Period]} ) DayExpand\n    return end of DayExpand</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-denominator-observations\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/**\n * Counts the number of eligible days in an encounter. This simply filters and counts the data built in\n * &quot;Relevant Encounters With Hyperglycemic Event Days&quot;.*/\n\n\ndefine function &quot;Denominator Observations&quot;(QualifyingEncounter Encounter):\n  if QualifyingEncounter.id in &quot;Denominator Exclusions&quot;.id then singleton from ( &quot;Days with Hyperglycemic Events&quot; EncounterWithEventDays\n      where EncounterWithEventDays.encounter = QualifyingEncounter\n      return 0\n  ) \n    else singleton from ( &quot;Days with Hyperglycemic Events&quot; EncounterWithEventDays\n      where EncounterWithEventDays.encounter = QualifyingEncounter\n      return Count(EncounterWithEventDays.eligibleEventDays)\n  )</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"fhirhelpers-tostring\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function ToString(value uri): value.value</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"fhirhelpers-tocode\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.\n*/\ndefine function ToCode(coding FHIR.Coding):\n    if coding is null then\n        null\n    else\n        System.Code {\n          code: coding.code.value,\n          system: coding.system.value,\n          version: coding.version.value,\n          display: coding.display.value\n        }</code></pre>\n  </td>\n\n</tr>\n        \n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n      \n      <a name=\"hospitalharmhyperglycemiainhospitalizedpatientsfhir-numerator-observations\"> </a>\n    \n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> HospitalHarmHyperglycemiainHospitalizedPatientsFHIR</td>\n\n</tr>\n<tr>\n\n  <td>\n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/**\n * Counts the number of eligible days with a hyperglycemic event in an encounter. This simply filters and counts the data built in\n * &quot;Relevant Encounters With Hyperglycemic Event Days&quot;.*/\n\n\ndefine function &quot;Numerator Observations&quot;(QualifyingEncounter Encounter):\n  if QualifyingEncounter.id in &quot;Denominator Exclusions&quot;.id then singleton from ( &quot;Days with Hyperglycemic Events&quot; EncounterWithEventDays\n      where EncounterWithEventDays.encounter = QualifyingEncounter\n      return 0\n  ) \n    else singleton from ( &quot;Days with Hyperglycemic Events&quot; EncounterWithEventDays\n      where EncounterWithEventDays.encounter = QualifyingEncounter\n      return Count(EncounterWithEventDays.eligibleEventDays EligibleEventDay\n          where EligibleEventDay.hasHyperglycemicEvent\n      )\n  )</code></pre>\n  </td>\n\n</tr>\n\n  \n\n<tr>\n  <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.4.6 of the sample-content-ig Liquid templates</th>\n</tr>\n    </tbody>\n  </table>\n</div>"
  ] ; # 
  fhir:contained ( [
a fhir:Library ;
fhir:id [ fhir:v "effective-data-requirements" ] ;
    ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-directReferenceCode"^^xsd:anyURI ] ;
fhir:value [
a fhir:Coding ;
fhir:system [ fhir:v "http://hl7.org/fhir/administrative-gender"^^xsd:anyURI ] ;
fhir:code [ fhir:v "M" ] ;
fhir:display [ fhir:v "Male" ]       ]     ] [
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-directReferenceCode"^^xsd:anyURI ] ;
fhir:value [
a fhir:Coding ;
fhir:system [ fhir:v "http://hl7.org/fhir/administrative-gender"^^xsd:anyURI ] ;
fhir:code [ fhir:v "F" ] ;
fhir:display [ fhir:v "Female" ]       ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "SupplementalDataElements" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "SDE Sex" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"SDE Sex\":\n  case\n    when Patient.gender = 'male' then \"M\"\n    when Patient.gender = 'female' then \"F\"\n    else null\n  end" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "0"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "SDE Sex" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"SDE Sex\":\n  SDE.\"SDE Sex\"" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "1"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Qualifying Encounter" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Qualifying Encounter\":\n  [\"Encounter\": \"Encounter Inpatient\"] InpatientEncounter\n    where AgeInYearsAt(date from start of InpatientEncounter.period) >= 18\n      and InpatientEncounter.period ends during day of \"Measurement Period\"\n      and InpatientEncounter.status = 'finished'" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "2"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Encounter with Hospitalization Period" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/**\n * Create paring of encounters to hospitalization period so this calculation can be inspected and the result \n * can be reused, making the logic faster.*/\n\n\ndefine \"Encounter with Hospitalization Period\":\n  \"Qualifying Encounter\" QualifyingHospitalization\n    return Tuple {\n      encounter: QualifyingHospitalization,\n      hospitalizationPeriod: CQMCommon.\"HospitalizationWithObservation\" ( QualifyingHospitalization )\n    }" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "3"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Encounter with Existing Diabetes Diagnosis" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/**\n * Using the already calculated pairing of hospitalization periods with encounters, filter on ones with \n * diabetes and return the encounter.*/\n\n\ndefine \"Encounter with Existing Diabetes Diagnosis\":\n  \"Encounter with Hospitalization Period\" Hospitalization\n    with [\"Condition\": \"Diabetes\"] Diabetes\n      such that ( QICoreCommon.\"ToPrevalenceInterval\" ( Diabetes ) starts before end of Hospitalization.hospitalizationPeriod )\n    return Hospitalization.encounter" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "4"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Encounter with Hypoglycemic Medication" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/**\n * Using the already calculated pairing of hospitalization periods with encounters, filter on ones with \n * hypoglycemic medicatons and return the encounter.*/\n\n\ndefine \"Encounter with Hypoglycemic Medication\":\n  from\n    \"Encounter with Hospitalization Period\" Hospitalization,\n    [\"MedicationAdministration\": \"Hypoglycemics Treatment Medications\"] HypoglycemicMed\n    where HypoglycemicMed.status = 'completed'\n      and HypoglycemicMed.status != 'not-done'\n      and QICoreCommon.\"ToInterval\" ( HypoglycemicMed.effective ) during Hospitalization.hospitalizationPeriod\n    return Hospitalization.encounter" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "5"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Encounter with Elevated Glucose Greater Than or Equal to 200" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/**\n * Using the already calculated pairing of hospitalization periods with encounters, filter on ones with \n * any elevated (>= 200) blood glucose reading during the hospitalization*/\n\n\ndefine \"Encounter with Elevated Glucose Greater Than or Equal to 200\":\n  \"Encounter with Hospitalization Period\" Hospitalization\n    with [\"Observation\": \"Glucose Lab Test Mass Per Volume\"] GlucoseTest\n      such that QICoreCommon.\"Earliest\" ( GlucoseTest.effective ) during Hospitalization.hospitalizationPeriod\n        and GlucoseTest.status in { 'final', 'amended', 'corrected' }\n        and GlucoseTest.status != 'cancelled'\n        and GlucoseTest.value >= 200 'mg/dL'\n    return Hospitalization.encounter" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "6"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Initial Population" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Initial Population\":\n  \"Encounter with Existing Diabetes Diagnosis\"\n    union \"Encounter with Hypoglycemic Medication\"\n    union \"Encounter with Elevated Glucose Greater Than or Equal to 200\"" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "7"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Denominator" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Denominator\":\n  \"Initial Population\"" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "8"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Measurement Population" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Measurement Population\":\n  \"Denominator\"" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "9"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Days in Hospitalization" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/***/\n\n\ndefine \"Days in Hospitalization\":\n  \"Measurement Population\" EligibleInpatientHospitalization\n    let period: CQMCommon.\"HospitalizationWithObservation\" ( EligibleInpatientHospitalization ),\n    relevantPeriod: \"Hospital Days Max 10\"(period)\n    return Tuple {\n      encounter: EligibleInpatientHospitalization,\n      hospitalizationPeriod: period,\n      relevantPeriod: relevantPeriod,\n      relevantDays: \"Days In Period\"(relevantPeriod)\n    }" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "10"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Days with Glucose Results" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Days with Glucose Results\":\n  \"Days in Hospitalization\" InpatientHospitalDays\n    return Tuple {\n      encounter: InpatientHospitalDays.encounter,\n      relevantPeriod: InpatientHospitalDays.relevantPeriod,\n      relevantDays: ( InpatientHospitalDays.relevantDays EncounterDay\n          return Tuple {\n            dayNumber: EncounterDay.dayNumber,\n            dayPeriod: EncounterDay.dayPeriod,\n            hasSevereResult: exists ( [\"Observation\": \"Glucose Lab Test Mass Per Volume\"] GlucoseTest\n                where GlucoseTest.status in { 'final', 'amended', 'corrected' }\n                  and GlucoseTest.status != 'cancelled'\n                  and GlucoseTest.value > 300 'mg/dL'\n                  and QICoreCommon.\"Earliest\" ( GlucoseTest.effective ) during EncounterDay.dayPeriod\n            ),\n            hasElevatedResult: exists ( [\"Observation\": \"Glucose Lab Test Mass Per Volume\"] GlucoseTest\n                where GlucoseTest.status in { 'final', 'amended', 'corrected' }\n                  and GlucoseTest.status != 'cancelled'\n                  and GlucoseTest.value >= 200 'mg/dL'\n                  and QICoreCommon.\"Earliest\" ( GlucoseTest.effective ) during EncounterDay.dayPeriod\n            ),\n            hasNoGlucoseTest: not exists ( [\"Observation\": \"Glucose Lab Test Mass Per Volume\"] GlucoseTest\n                where GlucoseTest.status in { 'final', 'amended', 'corrected' }\n                  and GlucoseTest.status != 'cancelled'\n                  and QICoreCommon.\"Earliest\" ( GlucoseTest.effective ) during EncounterDay.dayPeriod\n            )\n          }\n      )\n    }" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "11"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Days with Hyperglycemic Events" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/*# hyper days uses \"Relevant Encounters With Glucose Result Days\" to find if hyper event on each day. Skips 1st day in 'RelevantDays`. Returns boolean based on: Today high result OR Today no result AND Yesterday high result AND 2 days ago high result*/\n\n\ndefine \"Days with Hyperglycemic Events\":\n  \"Days with Glucose Results\" EncounterWithResultDays\n    let eligibleEventDays: EncounterWithResultDays.relevantDays EncounterDay\n      where EncounterDay.dayNumber > 1\n      return Tuple {\n        dayIndex: EncounterDay.dayNumber,\n        dayPeriod: EncounterDay.dayPeriod,\n        hasHyperglycemicEvent: ( EncounterDay.hasSevereResult\n            or ( EncounterDay.hasNoGlucoseTest\n                and EncounterWithResultDays.relevantDays[EncounterDay.dayNumber - 2].hasElevatedResult\n                and EncounterWithResultDays.relevantDays[EncounterDay.dayNumber - 3].hasElevatedResult\n            )\n        )\n      }\n    return Tuple {\n      encounter: EncounterWithResultDays.encounter,\n      relevantPeriod: EncounterWithResultDays.relevantPeriod,\n      eligibleEventDays: eligibleEventDays\n    }" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "12"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Encounter with Hyperglycemic Events" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/***/\n\n\ndefine \"Encounter with Hyperglycemic Events\":\n  \"Days with Hyperglycemic Events\" HyperglycemicEventDays\n    where exists ( HyperglycemicEventDays.eligibleEventDays EligibleEventDay\n        where EligibleEventDay.hasHyperglycemicEvent\n    )\n    return HyperglycemicEventDays.encounter" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "13"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Numerator" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Numerator\":\n  \"Encounter with Hyperglycemic Events\"" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "14"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "SupplementalDataElements" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "SDE Payer" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"SDE Payer\":\n  [Coverage: type in \"Payer Type\"] Payer\n    return {\n      code: Payer.type,\n      period: Payer.period\n    }" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "15"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "SDE Payer" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"SDE Payer\":\n  SDE.\"SDE Payer\"" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "16"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "SupplementalDataElements" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "SDE Ethnicity" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"SDE Ethnicity\":\n  Patient.ethnicity E\n    return Tuple {\n      codes: { E.ombCategory } union E.detailed,\n      display: E.text\n    }" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "17"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "SDE Ethnicity" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"SDE Ethnicity\":\n  SDE.\"SDE Ethnicity\"" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "18"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\":\n  from\n    \"Initial Population\" InpatientHospitalization,\n    [\"Observation\": \"Glucose Lab Test Mass Per Volume\"] GlucoseTest\n    let HospitalizationInterval: CQMCommon.\"HospitalizationWithObservation\" ( InpatientHospitalization ),\n    GlucoseTestTime: QICoreCommon.\"Earliest\" ( GlucoseTest.effective )\n    where GlucoseTest.value as Quantity >= 1000 'mg/dL'\n      and GlucoseTest.status in { 'final', 'amended', 'corrected' }\n      and GlucoseTestTime during Interval[( start of HospitalizationInterval - 1 hour ), ( start of HospitalizationInterval + 6 hours )]\n    return GlucoseTest" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "19"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Glucose Tests Earlier Than Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Glucose Tests Earlier Than Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\":\n  from\n    \"Initial Population\" InpatientHospitalization,\n    \"Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\" GlucoseResult1000,\n    [\"Observation\": \"Glucose Lab Test Mass Per Volume\"] EarlierGlucoseTest\n    let HospitalizationInterval: CQMCommon.\"HospitalizationWithObservation\" ( InpatientHospitalization ),\n    GlucoseTest1000Time: QICoreCommon.\"Earliest\" ( GlucoseResult1000.effective ),\n    EarlierGlucoseTestTime: QICoreCommon.\"Earliest\" ( EarlierGlucoseTest.effective )\n    where GlucoseTest1000Time during Interval[( start of HospitalizationInterval - 1 hour ), ( start of HospitalizationInterval + 6 hour )]\n      and EarlierGlucoseTestTime during Interval[( start of HospitalizationInterval - 1 hour ), GlucoseTest1000Time )\n      and EarlierGlucoseTest.id !~ GlucoseResult1000.id\n    return GlucoseResult1000" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "20"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Initial Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Initial Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\":\n  \"Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\" GlucoseResult1000\n    where not ( GlucoseResult1000.id in \"Glucose Tests Earlier Than Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\".id )" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "21"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Encounter with First Glucose Greater Than or Equal to 1000" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Encounter with First Glucose Greater Than or Equal to 1000\":\n  \"Initial Population\" InpatientHospitalization\n    with \"Initial Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\" FirstGlucoseResult\n      such that FirstGlucoseResult.value as Quantity >= 1000 'mg/dL'\n        and QICoreCommon.\"Earliest\" ( FirstGlucoseResult.effective ) during Interval[( start of CQMCommon.\"HospitalizationWithObservation\" ( InpatientHospitalization ) - 1 hour ), ( start of CQMCommon.\"HospitalizationWithObservation\" ( InpatientHospitalization ) + 6 hours )]" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "22"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Denominator Exclusions" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Denominator Exclusions\":\n  \"Encounter with First Glucose Greater Than or Equal to 1000\"" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "23"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "SupplementalDataElements" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "SDE Race" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"SDE Race\":\n  Patient.race R\n    return Tuple {\n      codes: R.ombCategory union R.detailed,\n      display: R.text\n    }" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "24"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "SDE Race" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"SDE Race\":\n  SDE.\"SDE Race\"" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "25"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "CQMCommon" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalizationWithObservation" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/*\n@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\n@deprecated: This function is deprecated. Use the fluent function `hospitalizationWithObservation()` instead.\n*/\ndefine function \"HospitalizationWithObservation\"(TheEncounter Encounter ):\n  TheEncounter Visit\n  		let ObsVisit: Last([Encounter: \"Observation Services\"] LastObs\n  				where LastObs.status = 'finished'\n            and LastObs.period ends 1 hour or less on or before start of Visit.period\n  				sort by end of period\n  			),\n  			VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),\n  			EDVisit: Last([Encounter: \"Emergency Department Visit\"] LastED\n  				where LastED.status = 'finished'\n            and LastED.period ends 1 hour or less on or before VisitStart\n  				sort by end of period\n  			)\n  		return Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "26"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "QICoreCommon" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "ToPrevalenceInterval" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/*\n@description: Returns an interval representing the normalized prevalence period of a given Condition.\n@comment: Uses the ToInterval and ToAbatementInterval functions to determine the widest potential interval from\nonset to abatement as specified in the given Condition. If the condition is active, or has an abatement date the resulting \ninterval will have a closed ending boundary. Otherwise, the resulting interval will have an open ending boundary.\n@deprecated: This function is deprecated. Use the `prevalenceInterval()` fluent function instead\n*/\ndefine function ToPrevalenceInterval(condition Condition):\nif condition.clinicalStatus ~ \"active\"\n  or condition.clinicalStatus ~ \"recurrence\"\n  or condition.clinicalStatus ~ \"relapse\" then\n  Interval[start of ToInterval(condition.onset), end of ToAbatementInterval(condition)]\nelse\n   (end of ToAbatementInterval(condition)) abatementDate\n    return if abatementDate is null then\n      Interval[start of ToInterval(condition.onset), abatementDate)\n    else\n      Interval[start of ToInterval(condition.onset), abatementDate]" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "27"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "QICoreCommon" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Earliest" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/*\n@description: Given an interval, return the starting point if the interval has a starting boundary specified,\notherwise, return the ending point\n@deprecated: This function is deprecated. Use the fluent function `earliest()` instead\n*/\ndefine function \"Earliest\"(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>> ):\n  (choice.toInterval()) period\n    return\n      if (HasStart(period)) then start of period\n      else end of period" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "28"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Hospital Days Max 10" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/**\n * Crops an interval to a maximum length of 10 days.*/\n\n\ndefine function \"Hospital Days Max 10\"(Period Interval<DateTime>):\n  Interval[start of Period, Min({ \n    end of Period, start of Period + 10 days }\n  )]" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "29"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Days In Period" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/**\n * Creates a list of 24 hour long intervals in an interval paired with the index (1 indexed) to which 24 hour interval it is.*/\n\n\ndefine function \"Days In Period\"(Period Interval<DateTime>):\n  ( \"Interval To Day Numbers\"(Period) ) DayNumber\n    let startPeriod: start of Period + ( 24 hours * ( DayNumber - 1 ) ),\n    endPeriod: if ( hours between startPeriod and end of Period < 24 ) then startPeriod \n      else start of Period + ( 24 hours * DayNumber )\n    return Tuple {\n      dayNumber: DayNumber,\n      dayPeriod: Interval[startPeriod, endPeriod )\n    }" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "30"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Interval To Day Numbers" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/**\n * Creates a list of integers from 1 to how many days are in the interval. Note, this wont create an index for\n * the final day if it is less than 24 hours. This also includes the first 24 hour period.*/\n\n\ndefine function \"Interval To Day Numbers\"(Period Interval<DateTime>):\n  ( expand { Interval[1, duration in days between start of Period and end of Period]} ) DayExpand\n    return end of DayExpand" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "31"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Denominator Observations" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/**\n * Counts the number of eligible days in an encounter. This simply filters and counts the data built in\n * \"Relevant Encounters With Hyperglycemic Event Days\".*/\n\n\ndefine function \"Denominator Observations\"(QualifyingEncounter Encounter):\n  if QualifyingEncounter.id in \"Denominator Exclusions\".id then singleton from ( \"Days with Hyperglycemic Events\" EncounterWithEventDays\n      where EncounterWithEventDays.encounter = QualifyingEncounter\n      return 0\n  ) \n    else singleton from ( \"Days with Hyperglycemic Events\" EncounterWithEventDays\n      where EncounterWithEventDays.encounter = QualifyingEncounter\n      return Count(EncounterWithEventDays.eligibleEventDays)\n  )" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "32"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "FHIRHelpers" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "ToString" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define function ToString(value uri): value.value" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "33"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "FHIRHelpers" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "ToCode" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/*\n@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.\n*/\ndefine function ToCode(coding FHIR.Coding):\n    if coding is null then\n        null\n    else\n        System.Code {\n          code: coding.code.value,\n          system: coding.system.value,\n          version: coding.version.value,\n          display: coding.display.value\n        }" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "34"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] [
      ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR" ]       ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Numerator Observations" ]       ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/**\n * Counts the number of eligible days with a hyperglycemic event in an encounter. This simply filters and counts the data built in\n * \"Relevant Encounters With Hyperglycemic Event Days\".*/\n\n\ndefine function \"Numerator Observations\"(QualifyingEncounter Encounter):\n  if QualifyingEncounter.id in \"Denominator Exclusions\".id then singleton from ( \"Days with Hyperglycemic Events\" EncounterWithEventDays\n      where EncounterWithEventDays.encounter = QualifyingEncounter\n      return 0\n  ) \n    else singleton from ( \"Days with Hyperglycemic Events\" EncounterWithEventDays\n      where EncounterWithEventDays.encounter = QualifyingEncounter\n      return Count(EncounterWithEventDays.eligibleEventDays EligibleEventDay\n          where EligibleEventDay.hasHyperglycemicEvent\n      )\n  )" ]       ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "35"^^xsd:integer ]       ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]     ] ) ;
fhir:name [ fhir:v "EffectiveDataRequirements" ] ;
fhir:status [ fhir:v "active" ] ;
fhir:type [
      ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/library-type"^^xsd:anyURI ] ;
fhir:code [ fhir:v "module-definition" ]       ] )     ] ;
    ( fhir:relatedArtifact [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Library SDE" ] ;
fhir:resource [ fhir:v "Library/SupplementalDataElements|3.5.000"^^xsd:anyURI ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Library FHIRHelpers" ] ;
fhir:resource [ fhir:v "Library/FHIRHelpers|4.4.000"^^xsd:anyURI ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Library CQMCommon" ] ;
fhir:resource [ fhir:v "Library/CQMCommon|2.2.000"^^xsd:anyURI ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Library QICoreCommon" ] ;
fhir:resource [ fhir:v "Library/QICoreCommon|2.1.000"^^xsd:anyURI ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Code system AdministrativeGender" ] ;
fhir:resource [
fhir:v "http://hl7.org/fhir/administrative-gender"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/administrative-gender>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Encounter Inpatient" ] ;
fhir:resource [
fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"^^xsd:anyURI ;
fhir:link <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Observation Services" ] ;
fhir:resource [
fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"^^xsd:anyURI ;
fhir:link <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Emergency Department Visit" ] ;
fhir:resource [
fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"^^xsd:anyURI ;
fhir:link <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Diabetes" ] ;
fhir:resource [
fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.103.12.1001"^^xsd:anyURI ;
fhir:link <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.103.12.1001>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Hypoglycemics Treatment Medications" ] ;
fhir:resource [
fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1196.394"^^xsd:anyURI ;
fhir:link <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1196.394>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Glucose Lab Test Mass Per Volume" ] ;
fhir:resource [
fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.34"^^xsd:anyURI ;
fhir:link <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.34>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Payer Type" ] ;
fhir:resource [
fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"^^xsd:anyURI ;
fhir:link <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591>       ]     ] ) ;
    ( fhir:parameter [
fhir:name [ fhir:v "Measurement Period" ] ;
fhir:use [ fhir:v "in" ] ;
fhir:min [ fhir:v "0"^^xsd:integer ] ;
fhir:max [ fhir:v "1" ] ;
fhir:type [ fhir:v "Period" ]     ] [
fhir:name [ fhir:v "SDE Sex" ] ;
fhir:use [ fhir:v "out" ] ;
fhir:min [ fhir:v "0"^^xsd:integer ] ;
fhir:max [ fhir:v "1" ] ;
fhir:type [ fhir:v "Coding" ]     ] [
fhir:name [ fhir:v "Numerator" ] ;
fhir:use [ fhir:v "out" ] ;
fhir:min [ fhir:v "0"^^xsd:integer ] ;
fhir:max [ fhir:v "*" ] ;
fhir:type [ fhir:v "Resource" ]     ] [
fhir:name [ fhir:v "Denominator" ] ;
fhir:use [ fhir:v "out" ] ;
fhir:min [ fhir:v "0"^^xsd:integer ] ;
fhir:max [ fhir:v "*" ] ;
fhir:type [ fhir:v "Resource" ]     ] [
fhir:name [ fhir:v "SDE Payer" ] ;
fhir:use [ fhir:v "out" ] ;
fhir:min [ fhir:v "0"^^xsd:integer ] ;
fhir:max [ fhir:v "*" ] ;
fhir:type [ fhir:v "Resource" ]     ] [
fhir:name [ fhir:v "Initial Population" ] ;
fhir:use [ fhir:v "out" ] ;
fhir:min [ fhir:v "0"^^xsd:integer ] ;
fhir:max [ fhir:v "*" ] ;
fhir:type [ fhir:v "Resource" ]     ] [
fhir:name [ fhir:v "SDE Ethnicity" ] ;
fhir:use [ fhir:v "out" ] ;
fhir:min [ fhir:v "0"^^xsd:integer ] ;
fhir:max [ fhir:v "1" ] ;
fhir:type [ fhir:v "Resource" ]     ] [
fhir:name [ fhir:v "Denominator Exclusions" ] ;
fhir:use [ fhir:v "out" ] ;
fhir:min [ fhir:v "0"^^xsd:integer ] ;
fhir:max [ fhir:v "*" ] ;
fhir:type [ fhir:v "Resource" ]     ] [
fhir:name [ fhir:v "SDE Race" ] ;
fhir:use [ fhir:v "out" ] ;
fhir:min [ fhir:v "0"^^xsd:integer ] ;
fhir:max [ fhir:v "1" ] ;
fhir:type [ fhir:v "Resource" ]     ] ) ;
    ( fhir:dataRequirement [
fhir:type [ fhir:v "Patient" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient>       ] ) ;
      ( fhir:mustSupport [ fhir:v "ethnicity" ] [ fhir:v "race" ] )     ] [
fhir:type [ fhir:v "Encounter" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter>       ] ) ;
      ( fhir:mustSupport [ fhir:v "type" ] [ fhir:v "status" ] [ fhir:v "status.value" ] [ fhir:v "period" ] ) ;
      ( fhir:codeFilter [
fhir:path [ fhir:v "type" ] ;
fhir:valueSet [
fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"^^xsd:anyURI ;
fhir:link <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143>         ]       ] [
fhir:path [ fhir:v "status.value" ] ;
        ( fhir:code [
fhir:code [ fhir:v "finished" ]         ] )       ] )     ] [
fhir:type [ fhir:v "Encounter" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter>       ] ) ;
      ( fhir:mustSupport [ fhir:v "type" ] [ fhir:v "status" ] [ fhir:v "status.value" ] [ fhir:v "period" ] ) ;
      ( fhir:codeFilter [
fhir:path [ fhir:v "type" ] ;
fhir:valueSet [
fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"^^xsd:anyURI ;
fhir:link <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292>         ]       ] [
fhir:path [ fhir:v "status.value" ] ;
        ( fhir:code [
fhir:code [ fhir:v "finished" ]         ] )       ] ) ;
      ( fhir:dateFilter [
fhir:path [ fhir:v "period" ] ;
fhir:value [
a fhir:Period ;
          ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/uv/crmi-analysisException"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Error attempting to determine filter value: toFhirValue not implemented for Subtract" ]           ] )         ]       ] )     ] [
fhir:type [ fhir:v "Encounter" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter>       ] ) ;
      ( fhir:mustSupport [ fhir:v "type" ] [ fhir:v "period" ] [ fhir:v "status" ] [ fhir:v "status.value" ] [ fhir:v "hospitalizationPeriod" ] [ fhir:v "encounter" ] ) ;
      ( fhir:codeFilter [
fhir:path [ fhir:v "type" ] ;
fhir:valueSet [
fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"^^xsd:anyURI ;
fhir:link <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307>         ]       ] [
fhir:path [ fhir:v "status.value" ] ;
        ( fhir:code [
fhir:code [ fhir:v "finished" ]         ] )       ] ) ;
      ( fhir:dateFilter [
fhir:path [ fhir:v "period" ] ;
fhir:value [
a fhir:Period ;
          ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-expression"^^xsd:anyURI ] ;
fhir:value [
a fhir:Expression ;
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "Measurement Period" ]             ]           ] )         ]       ] )     ] [
fhir:type [ fhir:v "Condition" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition>       ] ) ;
      ( fhir:mustSupport [ fhir:v "code" ] ) ;
      ( fhir:codeFilter [
fhir:path [ fhir:v "code" ] ;
fhir:valueSet [
fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.103.12.1001"^^xsd:anyURI ;
fhir:link <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.103.12.1001>         ]       ] )     ] [
fhir:type [ fhir:v "MedicationAdministration" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationadministration"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationadministration>       ] ) ;
      ( fhir:mustSupport [ fhir:v "medication" ] [ fhir:v "status" ] [ fhir:v "status.value" ] [ fhir:v "effective" ] ) ;
      ( fhir:codeFilter [
fhir:path [ fhir:v "medication" ] ;
fhir:valueSet [
fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1196.394"^^xsd:anyURI ;
fhir:link <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1196.394>         ]       ] )     ] [
fhir:type [ fhir:v "Observation" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation>       ] ) ;
      ( fhir:mustSupport [ fhir:v "code" ] [ fhir:v "effective" ] [ fhir:v "status" ] [ fhir:v "status.value" ] [ fhir:v "value" ] [ fhir:v "id" ] [ fhir:v "id.value" ] ) ;
      ( fhir:codeFilter [
fhir:path [ fhir:v "code" ] ;
fhir:valueSet [
fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.34"^^xsd:anyURI ;
fhir:link <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.34>         ]       ] [
fhir:path [ fhir:v "status.value" ] ;
        ( fhir:code [
fhir:code [ fhir:v "cancelled" ]         ] )       ] )     ] [
fhir:type [ fhir:v "Observation" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation>       ] ) ;
      ( fhir:mustSupport [ fhir:v "code" ] [ fhir:v "effective" ] [ fhir:v "value" ] [ fhir:v "status" ] [ fhir:v "status.value" ] [ fhir:v "id" ] [ fhir:v "id.value" ] ) ;
      ( fhir:codeFilter [
fhir:path [ fhir:v "code" ] ;
fhir:valueSet [
fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.34"^^xsd:anyURI ;
fhir:link <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.34>         ]       ] )     ] [
fhir:type [ fhir:v "Coverage" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage>       ] ) ;
      ( fhir:mustSupport [ fhir:v "type" ] [ fhir:v "period" ] ) ;
      ( fhir:codeFilter [
fhir:path [ fhir:v "type" ] ;
fhir:valueSet [
fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"^^xsd:anyURI ;
fhir:link <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591>         ]       ] )     ] )
  ] ) ; # 
  fhir:extension ( [
fhir:id [ fhir:v "supplementalDataGuidance" ] ;
    ( fhir:extension [
fhir:url [ fhir:v "guidance"^^xsd:anyURI ] ;
fhir:value [ fhir:v "For every patient evaluated by this measure also identify payer, race, ethnicity and sex; SDE Ethnicity \n SDE Payer \n SDE Race \n SDE Sex \n " ]     ] [
fhir:url [ fhir:v "usage"^^xsd:anyURI ] ;
fhir:value [
a fhir:CodeableConcept ;
        ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/measure-data-usage"^^xsd:anyURI ] ;
fhir:code [ fhir:v "supplemental-data" ] ;
fhir:display [ fhir:v "Supplemental Data" ]         ] ) ;
fhir:text [ fhir:v "Supplemental Data Guidance" ]       ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-supplementalDataGuidance"^^xsd:anyURI ]
  ] [
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-softwaresystem"^^xsd:anyURI ] ;
fhir:value [
a fhir:Reference ;
fhir:reference [ fhir:v "Device/cqf-tooling" ]     ]
  ] [
fhir:id [ fhir:v "effective-data-requirements" ] ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-effectiveDataRequirements"^^xsd:anyURI ] ;
fhir:value [
a fhir:Reference ;
fhir:reference [ fhir:v "#effective-data-requirements" ]     ]
  ] ) ; # 
  fhir:url [ fhir:v "https://madie.cms.gov/Measure/HospitalHarmHyperglycemiainHospitalizedPatientsFHIR"^^xsd:anyURI] ; # 
  fhir:identifier ( [
fhir:use [ fhir:v "usual" ] ;
fhir:type [
      ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type"^^xsd:anyURI ] ;
fhir:code [ fhir:v "short-name" ] ;
fhir:display [ fhir:v "Short Name" ]       ] )     ] ;
fhir:system [ fhir:v "https://madie.cms.gov/measure/shortName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "CMS871FHIR" ]
  ] [
fhir:use [ fhir:v "official" ] ;
fhir:type [
      ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type"^^xsd:anyURI ] ;
fhir:code [ fhir:v "version-independent" ] ;
fhir:display [ fhir:v "Version Independent" ]       ] )     ] ;
fhir:system [ fhir:v "urn:ietf:rfc:3986"^^xsd:anyURI ] ;
fhir:value [ fhir:v "urn:uuid:c44ca609-d795-4715-a8fc-1b0b30e46048" ]
  ] [
fhir:use [ fhir:v "official" ] ;
fhir:type [
      ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type"^^xsd:anyURI ] ;
fhir:code [ fhir:v "version-specific" ] ;
fhir:display [ fhir:v "Version Specific" ]       ] )     ] ;
fhir:system [ fhir:v "urn:ietf:rfc:3986"^^xsd:anyURI ] ;
fhir:value [ fhir:v "urn:uuid:c7dbf77f-5869-42a0-b5e6-12e18004d2f4" ]
  ] [
fhir:use [ fhir:v "official" ] ;
fhir:type [
      ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type"^^xsd:anyURI ] ;
fhir:code [ fhir:v "endorser" ] ;
fhir:display [ fhir:v "Endorser" ]       ] )     ] ;
fhir:system [ fhir:v "https://madie.cms.gov/measure/cbeId"^^xsd:anyURI ] ;
fhir:value [ fhir:v "3533e" ] ;
fhir:assigner [
fhir:display [ fhir:v "CMS Consensus Based Entity" ]     ]
  ] [
fhir:use [ fhir:v "official" ] ;
fhir:type [
      ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type"^^xsd:anyURI ] ;
fhir:code [ fhir:v "publisher" ] ;
fhir:display [ fhir:v "Publisher" ]       ] )     ] ;
fhir:system [ fhir:v "https://madie.cms.gov/measure/cmsId"^^xsd:anyURI ] ;
fhir:value [ fhir:v "871FHIR" ] ;
fhir:assigner [
fhir:display [ fhir:v "CMS" ]     ]
  ] ) ; # 
  fhir:version [ fhir:v "0.1.000"] ; # 
  fhir:name [ fhir:v "HospitalHarmHyperglycemiainHospitalizedPatientsFHIR"] ; # 
  fhir:title [ fhir:v "Hospital Harm - Severe HyperglycemiaFHIR"] ; # 
  fhir:status [ fhir:v "active"] ; # 
  fhir:experimental [ fhir:v "false"^^xsd:boolean] ; # 
  fhir:date [ fhir:v "2024-09-09T19:21:02+00:00"^^xsd:dateTime] ; # 
  fhir:publisher [ fhir:v "Centers for Medicare & Medicaid Services (CMS)"] ; # 
  fhir:contact ( [
    ( fhir:telecom [
fhir:system [ fhir:v "url" ] ;
fhir:value [ fhir:v "https://www.cms.gov/" ]     ] )
  ] ) ; # 
  fhir:description [ fhir:v "This measure assesses the number of inpatient hospital days for patients age 18 and older with a hyperglycemic event (harm) per the total qualifying inpatient hospital days for that encounter"] ; # 
  fhir:useContext ( [
fhir:code [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/usage-context-type"^^xsd:anyURI ] ;
fhir:code [ fhir:v "venue" ] ;
fhir:display [ fhir:v "Venue" ]     ] ;
fhir:value [
a fhir:CodeableConcept ;
      ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/CodeSystem/intended-venue-codes"^^xsd:anyURI ] ;
fhir:code [ fhir:v "eh" ] ;
fhir:display [ fhir:v "EH" ]       ] )     ]
  ] ) ; # 
  fhir:purpose [ fhir:v "UNKNOWN"] ; # 
  fhir:usage [ fhir:v "The measure is using mg/dL as the unit of measurement for glucose results.\n\nWhen evaluating for days with a glucose level >300 mg/dL, the first 24-hour period after admission to the hospital is not evaluated to account for potentially poor glucose control outside of the hospital setting or that preceded the start of hospital care. The admission starts in the emergency department (ED) or observation when the transition between the ED encounter, observation encounter, and the inpatient encounter are within an hour or less of each other.\n\nThis measure evaluates the first 10 days of an eligible inpatient hospitalization in determining eligible days for the denominator and numerator (i.e., the length of stay is truncated to <=10 days when the length exceeds 10 days). Patients admitted for longer length of stays are more likely to have more complex medical conditions.  \n\nThe “Days in Hospitalization” logic within Measure Observation 1 (associated with the denominator), in conjunction with other logic, returns the day number (e.g., day 1 to day 10) for each day within the hospitalization period to determine the eligible hospital days (e.g., from day 2 to day 10). \n\nThe “Days in Hospitalization” logic within Measure Observation 2 (associated with the numerator), in conjunction with other logic, returns the day number (e.g., day 1 to day 10) for each day within the hospitalization period to determine the eligible hyperglycemic event days (e.g., from day 2 to day 10).\n\nSince the measure does not count any hyperglycemic events that occur in the first 24 hours, day 1 is not considered an eligible hospital day for the Measure Observations. Eligible days range from day 2 up to day 10.\n\nAlthough the measure does not count any hyperglycemic events that occur in the first 24 hours as a hyperglycemic event day in Measure Observation 2, the first 24 hours of the encounter is considered day 1. This is because if there was a day during the encounter where a glucose result is not found, the measure evaluates the two days preceding to see if each had a glucose value >=200 mg/dL. The measure allows the first 24 hours of the encounter, i.e., day 1, to be one of the preceding days.\n\nMultiple hyperglycemic events can occur during a ‘day’, but this is still considered one hyperglycemic event day.\n\nThe numerator returns the first eligible encounter that meets the qualifying criteria: an inpatient hospitalization with a hyperglycemic event. Only one numerator is counted per encounter. Note that the Numerator returns the encounters, not days, that meet the criteria.\n\nThe specimen source for the glucose test is blood, serum, plasma, or interstitial fluid, and can be obtained by a laboratory test, a Point of Care (POC) test, or a continuous glucose monitor (CGM). Glucose test results from urine specimens are not considered.\n\nThis eCQM is an episode-based measure. An episode is defined as each inpatient hospitalization or encounter that ends during the measurement period.\n\nThis FHIR-based measure has been derived from the QDM-based measure: CMS871v4.\n\nPlease refer to the HL7 QI-Core Implementation Guide(https://hl7.org/fhir/us/qicore/STU4.1.1/) for more information on QI-Core and mapping recommendations from QDM to QI-Core4.1.1 (https://hl7.org/fhir/us/qicore/STU4.1.1/qdm-to-qicore.html)."] ; # 
  fhir:copyright [ fhir:v "Limited proprietary coding is contained in the Measure specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets. American Institutes for Research(R), formerly IMPAQ International, disclaims all liability for use or accuracy of any third party codes contained in the specifications.\n\nLOINC(R) copyright 2004-2023 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2023 International Health Terminology Standards Development Organisation. ICD-10 copyright 2023 World Health Organization. All Rights Reserved."] ; # 
  fhir:effectivePeriod [
fhir:start [ fhir:v "2025-01-01"^^xsd:date ] ;
fhir:end [ fhir:v "2025-12-31"^^xsd:date ]
  ] ; # 
  fhir:author ( [
fhir:name [ fhir:v "American Institutes for Research (AIR)" ] ;
    ( fhir:telecom [
fhir:system [ fhir:v "url" ] ;
fhir:value [ fhir:v "https://www.air.org" ]     ] )
  ] ) ; # 
  fhir:library ( [
fhir:v "https://madie.cms.gov/Library/HospitalHarmHyperglycemiainHospitalizedPatientsFHIR"^^xsd:anyURI ;
fhir:link <https://madie.cms.gov/Library/HospitalHarmHyperglycemiainHospitalizedPatientsFHIR>
  ] ) ; # 
  fhir:disclaimer [ fhir:v "This performance measure is not a clinical guideline and does not establish a standard of medical care, and has not been tested for all potential applications.\n\nTHE MEASURES AND SPECIFICATIONS ARE PROVIDED \"AS IS\" WITHOUT WARRANTY OF ANY KIND.\n\nDue to technical limitations, registered trademarks are indicated by (R) or [R] and unregistered trademarks are indicated by (TM) or [TM]."] ; # 
  fhir:scoring [
    ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/measure-scoring"^^xsd:anyURI ] ;
fhir:code [ fhir:v "ratio" ] ;
fhir:display [ fhir:v "Ratio" ]     ] ) ;
fhir:text [ fhir:v "Ratio" ]
  ] ; # 
  fhir:rationale [ fhir:v "Hyperglycemia, i.e., elevated glucose level, is common among hospitalized patients, especially those with preexisting diabetes (Umpierrez et al., 2012) and account for over 30% of noncritically ill hospitalized patients (Korytkowski, 2022). Hyperglycemia can also affect individuals with no prior history of diabetes and may be induced by medications such as steroids, or parenteral (intravenous) or enteral (tube) feeding.\n\nSevere hyperglycemia, i.e., extremely elevated glucose level, is significantly associated with a range of harms, including increased in-hospital mortality, infection rates, and hospital length of stay (Pasquel, et al., 2021; Umpierrez et al., 2012, 2015). Lower rates of inpatient severe hyperglycemia may not only improve care for patients, but also reduce costs for healthcare payers (Krinsley et al., 2016). The rate of hyperglycemia varies across hospitals, suggesting opportunities for improvement in inpatient glycemic management (Seisa et al., 2022; Bersoux et al., 2013). The rate of inpatient hyperglycemia can be considered a marker for quality of hospital care, since inpatient hyperglycemia is largely avoidable with proper glycemic management. The use of evidence-based standardized protocols and insulin management protocols have been shown to improve glycemic control and safety (Leroy et al., 2020; Maynard et al., 2015).\n\nFrom the Endocrine Society clinical practice guideline on the Management of Hyperglycemia in Hospitalized Patients in Non-critical Care Setting, 2022:\nRecommendation 1.1\nIn adults with insulin-treated diabetes hospitalized for noncritical illness who are at high risk of hypoglycemia, we suggest the use of real-time continuous glucose monitoring (CGM) with confirmatory bedside point-of-care blood glucose (POC-BG) monitoring for adjustments in insulin dosing rather than point-of-care blood glucose (POC-BG) testing alone in hospital settings where resources and training are available."] ; # 
  fhir:clinicalRecommendationStatement [ fhir:v "Multiple guidelines address recommended levels of glycemic control, though these do not define severe hyperglycemia: \n\nFrom Section 16, Diabetes Care in the Hospital, in the Standards of Medical Care in Diabetes by the American Diabetes Association, (American Diabetes Association, 2023): \n\n16.4 Insulin therapy should be initiated for the treatment of persistent hyperglycemia starting at a threshold ≥180 mg/dL (10.0 mmol/L) (checked on two occasions). Once insulin therapy is started, a target glucose range of 140–180 mg/dL (7.8–10.0 mmol/L) is recommended for most critically ill and noncritically ill patients.\n\n16.5 More stringent goals, such as 110–140 mg/dL (6.1–7.8 mmol/L) or 100–180 mg/dL (5.6–10.0 mmol/L), may be appropriate for selected patients and are acceptable if they can be achieved without significant hypoglycemia.\n\nFrom the Endocrine Society clinical practice guideline on the Management of Hyperglycemia in Hospitalized Patients in Non-critical Care Setting (2022): \n\nRecommendation 10.1\nIn adults with no prior history of diabetes hospitalized for noncritical illness with hyperglycemia [defined as blood glucose (BG) > 140 mg/dL (7.8 mmol/L)] during hospitalization, we suggest initial therapy with correctional insulin over scheduled insulin therapy (defined as basal or basal/bolus insulin) to maintain glucose targets in the range of 100 to 180 mg/dL (5.6 to 10.0 mmol/L). For patients with persistent hyperglycemia [≥2 point-of-care blood glucose (POC-BG) measurements ≥ 180 mg/dL (≥10.0 mmol/L) in a 24-hour period on correctional insulin alone], we suggest the addition of scheduled insulin therapy. \n\nRecommendation 10.2\nIn adults with diabetes treated with diet or noninsulin diabetes medications prior to admission, we suggest initial therapy with correctional insulin or scheduled insulin therapy to maintain glucose targets in the range of 100 to 180 mg/dL (5.6 to 10.0 mmol/L). For hospitalized adults started on correctional insulin alone and with persistent hyperglycemia [≥2 point-of-care blood glucose (POC-BG) measurements ≥ 180 mg/dL in a 24-hour period (≥10.0 mmol/L)], we suggest addition of scheduled insulin therapy. We suggest initiation of scheduled insulin therapy for patients with confirmed admission blood glucose (BG) ≥ 180 mg/dL (≥10.0 mmol/L). \n\nRecommendation 10.3\nIn adults with insulin-treated diabetes prior to admission who are hospitalized for noncritical illness, we recommend continuation of the scheduled insulin regimen modified for nutritional status and severity of illness to maintain glucose targets in the range of 100 to 180 mg/dL (5.6 to 10.0 mmol/L).\n\nRemarks\nReductions in the dose of basal insulin (by 10% to 20%) at time of hospitalization may be required for patients on basal heavy insulin regimens (defined as doses of basal insulin ≥ 0.6 to 1.0 units/kg/day), in which basal insulin is being used inappropriately to cover meal-related excursions in BG.\n\nThere is no clinically accepted cutoff for severe hyperglycemia. Studies have used thresholds of >140, >180 , >300, >350 and >400 mg/dL, among other values (American Diabetes Association, 2023; Umpierrez et al, 2012, 2015; Jamesen et al., 2015; Donihi et al., 2011; Mendez et al, 2015; Seisa et al., 2022). BGL <180 mg/dL is associated with lower rates of mortality and stroke compared with a target glucose <200 mg/dL (Sathya et al., 2013). Glycemic goals may also differ among hospitalized patients. For inpatient management of hyperglycemia in noncritical care, the expert consensus recommends a target range of 100–180 mg/dL (5.6–10.0 mmol/L) for noncritically ill patients with “new” hyperglycemia as well as people with known diabetes prior to admission. Glycemic levels >250 mg/dL (13.9 mmol/L) may be acceptable in terminally ill patients with short life expectancy. In these individuals, less aggressive insulin regimens to minimize glucosuria, dehydration, and electrolyte disturbances are often more appropriate. (ElSayed et al., 2023). In an older patient with a prior history of severe hypoglycemia, some degree of hyperglycemia may be tolerated to maximize safety. Intensive insulin therapy to target glucose of 100 and 140mg/dLin the ICU didn’t significantly reduce perioperative complications compared with target glucose of 141and180mg/dL after coronary artery bypass surgery (Umpierrez et al., 2015). The current recommendation is to maintain a blood glucose level between 140-180 mg/dL (7.8-10.0 mmol/L) in both cardiac and non-cardiac ICU patients (Sreedharan et al., 2022). \n\nFor patients who present with hyperglycemic crises, neurologic status must be monitored closely, with frequent re-examination. Care should be taken to prevent over-correction of hyperglycemia and hyperosmolarity following initial fluid resuscitation of these patients to prevent cerebral edema, which carries a high mortality rate. (Gosmanov et al., 2021).\n\nFrom the Endocrine Society clinical practice guideline on the Management of Hyperglycemia in Hospitalized Patients in Non-critical Care Setting, 2022:\nRecommendation 1.1\nIn adults with insulin-treated diabetes hospitalized for noncritical illness who are at high risk of hypoglycemia, we suggest the use of real-time continuous glucose monitoring (CGM) with confirmatory bedside point-of-care blood glucose (POC-BG) monitoring for adjustments in insulin dosing rather than point-of-care blood glucose (POC-BG) testing alone in hospital settings where resources and training are available."] ; # 
  fhir:guidance [ fhir:v "The measure is using mg/dL as the unit of measurement for glucose results.\n\nWhen evaluating for days with a glucose level >300 mg/dL, the first 24-hour period after admission to the hospital is not evaluated to account for potentially poor glucose control outside of the hospital setting or that preceded the start of hospital care. The admission starts in the emergency department (ED) or observation when the transition between the ED encounter, observation encounter, and the inpatient encounter are within an hour or less of each other.\n\nThis measure evaluates the first 10 days of an eligible inpatient hospitalization in determining eligible days for the denominator and numerator (i.e., the length of stay is truncated to <=10 days when the length exceeds 10 days). Patients admitted for longer length of stays are more likely to have more complex medical conditions.  \n\nThe “Days in Hospitalization” logic within Measure Observation 1 (associated with the denominator), in conjunction with other logic, returns the day number (e.g., day 1 to day 10) for each day within the hospitalization period to determine the eligible hospital days (e.g., from day 2 to day 10). \n\nThe “Days in Hospitalization” logic within Measure Observation 2 (associated with the numerator), in conjunction with other logic, returns the day number (e.g., day 1 to day 10) for each day within the hospitalization period to determine the eligible hyperglycemic event days (e.g., from day 2 to day 10).\n\nSince the measure does not count any hyperglycemic events that occur in the first 24 hours, day 1 is not considered an eligible hospital day for the Measure Observations. Eligible days range from day 2 up to day 10.\n\nAlthough the measure does not count any hyperglycemic events that occur in the first 24 hours as a hyperglycemic event day in Measure Observation 2, the first 24 hours of the encounter is considered day 1. This is because if there was a day during the encounter where a glucose result is not found, the measure evaluates the two days preceding to see if each had a glucose value >=200 mg/dL. The measure allows the first 24 hours of the encounter, i.e., day 1, to be one of the preceding days.\n\nMultiple hyperglycemic events can occur during a ‘day’, but this is still considered one hyperglycemic event day.\n\nThe numerator returns the first eligible encounter that meets the qualifying criteria: an inpatient hospitalization with a hyperglycemic event. Only one numerator is counted per encounter. Note that the Numerator returns the encounters, not days, that meet the criteria.\n\nThe specimen source for the glucose test is blood, serum, plasma, or interstitial fluid, and can be obtained by a laboratory test, a Point of Care (POC) test, or a continuous glucose monitor (CGM). Glucose test results from urine specimens are not considered.\n\nThis eCQM is an episode-based measure. An episode is defined as each inpatient hospitalization or encounter that ends during the measurement period.\n\nThis FHIR-based measure has been derived from the QDM-based measure: CMS871v4.\n\nPlease refer to the HL7 QI-Core Implementation Guide(https://hl7.org/fhir/us/qicore/STU4.1.1/) for more information on QI-Core and mapping recommendations from QDM to QI-Core4.1.1 (https://hl7.org/fhir/us/qicore/STU4.1.1/qdm-to-qicore.html)."] ; # 
  fhir:group ( [
fhir:id [ fhir:v "6501fe8dda013638e7b3dc0d" ] ;
    ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-scoring"^^xsd:anyURI ] ;
fhir:value [
a fhir:CodeableConcept ;
        ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/measure-scoring"^^xsd:anyURI ] ;
fhir:code [ fhir:v "ratio" ] ;
fhir:display [ fhir:v "Ratio" ]         ] )       ]     ] [
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-populationBasis"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Encounter" ]     ] [
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-type"^^xsd:anyURI ] ;
fhir:value [
a fhir:CodeableConcept ;
        ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/measure-type"^^xsd:anyURI ] ;
fhir:code [ fhir:v "outcome" ] ;
fhir:display [ fhir:v "Outcome" ]         ] )       ]     ] [
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-rateAggregation"^^xsd:anyURI ] ;
fhir:value [ fhir:v "None" ]     ] [
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-improvementNotation"^^xsd:anyURI ] ;
fhir:value [
a fhir:CodeableConcept ;
        ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/measure-improvement-notation"^^xsd:anyURI ] ;
fhir:code [ fhir:v "decrease" ] ;
fhir:display [ fhir:v "decrease" ]         ] )       ]     ] ) ;
    ( fhir:population [
fhir:id [ fhir:v "9B922C53-7F1B-4AF5-96E6-1A1E4AF7909C" ] ;
fhir:code [
        ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/measure-population"^^xsd:anyURI ] ;
fhir:code [ fhir:v "initial-population" ] ;
fhir:display [ fhir:v "Initial Population" ]         ] )       ] ;
fhir:description [ fhir:v "Inpatient hospitalizations for patients age 18 and older that end during the measurement period, as well as either: \n\n - A diagnosis of diabetes that starts before or during the encounter; or \n - Administration of at least one dose of insulin or any hypoglycemic medication during the encounter; or \n - Presence of at least one glucose value >=200 mg/dL at any time during the encounter" ] ;
fhir:criteria [
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "Initial Population" ]       ]     ] [
fhir:id [ fhir:v "6402512C-2305-42DC-B5F6-A226B5057B89" ] ;
fhir:code [
        ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/measure-population"^^xsd:anyURI ] ;
fhir:code [ fhir:v "denominator" ] ;
fhir:display [ fhir:v "Denominator" ]         ] )       ] ;
fhir:description [ fhir:v "Equals Initial Population" ] ;
fhir:criteria [
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "Denominator" ]       ]     ] [
fhir:id [ fhir:v "0F4405D3-B373-4620-A9CC-D29558C39E85" ] ;
fhir:code [
        ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/measure-population"^^xsd:anyURI ] ;
fhir:code [ fhir:v "denominator-exclusion" ] ;
fhir:display [ fhir:v "Denominator Exclusion" ]         ] )       ] ;
fhir:description [ fhir:v "-Inpatient hospitalizations for patients with a glucose result of >=1000 mg/dL anytime between 1 hour prior to the start of the encounter to 6 hours after the start of the encounter\n-Inpatient hospitalizations for patients who have comfort care measures ordered or provided during the encounter\n-Inpatient hospitalizations for patients who have a discharge disposition to home or to a health care facility for hospice care\n" ] ;
fhir:criteria [
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "Denominator Exclusions" ]       ]     ] [
fhir:id [ fhir:v "340EA45E-2411-4192-9C9D-3DF8D89A1D97" ] ;
fhir:code [
        ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/measure-population"^^xsd:anyURI ] ;
fhir:code [ fhir:v "numerator" ] ;
fhir:display [ fhir:v "Numerator" ]         ] )       ] ;
fhir:description [ fhir:v "Inpatient hospitalizations with a hyperglycemic event within the first 10 days of the encounter minus the first 24 hours, and minus the last period before discharge from the hospital if less than 24 hours\n\nA hyperglycemic event is defined as: \n\n - A day with at least one glucose value >300 mg/dL; \nOR\n - A day where a glucose test and result was not found, and it was preceded by two consecutive days where at least one glucose value during each of the two days was >=200 mg/dL" ] ;
fhir:criteria [
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "Numerator" ]       ]     ] [
fhir:id [ fhir:v "68900484-66a1-4da3-9b02-1a10a5fd592b" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-aggregateMethod"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Sum" ]       ] [
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-criteriaReference"^^xsd:anyURI ] ;
fhir:value [ fhir:v "6402512C-2305-42DC-B5F6-A226B5057B89" ]       ] ) ;
fhir:code [
        ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/measure-population"^^xsd:anyURI ] ;
fhir:code [ fhir:v "measure-observation" ] ;
fhir:display [ fhir:v "Measure Observation" ]         ] )       ] ;
fhir:criteria [
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "Denominator Observations" ]       ]     ] [
fhir:id [ fhir:v "f1bc37e5-f64f-4ed8-b965-2011f1181225" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-aggregateMethod"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Sum" ]       ] [
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-criteriaReference"^^xsd:anyURI ] ;
fhir:value [ fhir:v "340EA45E-2411-4192-9C9D-3DF8D89A1D97" ]       ] ) ;
fhir:code [
        ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/measure-population"^^xsd:anyURI ] ;
fhir:code [ fhir:v "measure-observation" ] ;
fhir:display [ fhir:v "Measure Observation" ]         ] )       ] ;
fhir:criteria [
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "Numerator Observations" ]       ]     ] )
  ] ) ; # 
  fhir:supplementalData ( [
fhir:id [ fhir:v "sde-ethnicity" ] ;
    ( fhir:usage [
      ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/measure-data-usage"^^xsd:anyURI ] ;
fhir:code [ fhir:v "supplemental-data" ]       ] )     ] ) ;
fhir:description [ fhir:v "SDE Ethnicity" ] ;
fhir:criteria [
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "SDE Ethnicity" ]     ]
  ] [
fhir:id [ fhir:v "sde-payer" ] ;
    ( fhir:usage [
      ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/measure-data-usage"^^xsd:anyURI ] ;
fhir:code [ fhir:v "supplemental-data" ]       ] )     ] ) ;
fhir:description [ fhir:v "SDE Payer" ] ;
fhir:criteria [
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "SDE Payer" ]     ]
  ] [
fhir:id [ fhir:v "sde-race" ] ;
    ( fhir:usage [
      ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/measure-data-usage"^^xsd:anyURI ] ;
fhir:code [ fhir:v "supplemental-data" ]       ] )     ] ) ;
fhir:description [ fhir:v "SDE Race" ] ;
fhir:criteria [
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "SDE Race" ]     ]
  ] [
fhir:id [ fhir:v "sde-sex" ] ;
    ( fhir:usage [
      ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/measure-data-usage"^^xsd:anyURI ] ;
fhir:code [ fhir:v "supplemental-data" ]       ] )     ] ) ;
fhir:description [ fhir:v "SDE Sex" ] ;
fhir:criteria [
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "SDE Sex" ]     ]
  ] ) . #