{
  "resourceType": "Bundle",
  "type": "transaction",
  "entry": [ {
    "fullUrl": "https://madie.cms.gov/Measure/CMS986FHIRMalnutritionScore",
    "resource": {
      "resourceType": "Measure",
      "id": "CMS986FHIRMalnutritionScore",
      "meta": {
        "profile": [ "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablemeasure", "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/computable-measure-cqfm", "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/publishable-measure-cqfm", "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/executable-measure-cqfm", "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cql-measure-cqfm", "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/elm-measure-cqfm", "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cv-measure-cqfm" ]
      },
      "text": {
        "status": "extensions",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"col-12\">\n  <table class=\"narrative-table\">\n    <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Metadata</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Title</th>\n\n\n<td class=\"content-container\">Malnutrition Care ScoreFHIR</td>\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n<td class=\"content-container\">1.0.000</td>\n</tr>\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Short Name</th>\n\n\n<td class=\"content-container\">CMS986FHIR</td>\n</tr>\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">GUID (Version Independent)</th>\n\n\n<td class=\"content-container\">urn:uuid:eed68e80-b466-4369-be87-166ada45f7c5</td>\n</tr>\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">GUID (Version Specific)</th>\n\n\n<td class=\"content-container\">urn:uuid:c3828a9c-88b0-4a19-8b78-bb07f56ed929</td>\n</tr>\n\n\n\n  \n    \n    \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">CMS Identifier</th>\n\n\n<td class=\"content-container\">986FHIR</td>\n</tr>\n\n  \n\n\n  \n    \n    \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">CMS Consensus Based Entity Identifier</th>\n\n\n<td class=\"content-container\">3592e</td>\n</tr>\n\n  \n\n\n\n  \n    \n    \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Effective Period</th>\n\n\n<td class=\"content-container\">2026-01-01 through 2026-12-31</td>\n</tr>\n\n  \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Steward (Publisher)</th>\n\n\n<td class=\"content-container\">Academy of Nutrition and Dietetics</td>\n</tr>\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Developer</th>\n\n\n<td class=\"content-container\">Academy of Nutrition and Dietetics</td>\n</tr>\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Description</th>\n\n\n<td class=\"content-container\">This measure assesses the percentage of eligible encounters of adults aged 18 years and older at the start of the eligible encounter during the measurement period, with a length of stay equal to or greater than 24 hours, who received optimal malnutrition care where care performed was appropriate to the patient's level of malnutrition risk and severity. Malnutrition care best practices recommend that for each eligible encounter, adult inpatients are (1) screened for malnutrition risk or for a dietitian referral order to be placed, (2) assessed by a registered dietitian (RD) or registered dietitian nutritionist (RDN) to confirm findings of malnutrition risk, and if identified with a &quot;moderate&quot; or &quot;severe&quot; malnutrition status in the current performed nutrition assessment, (3) receive a &quot;moderate&quot; or &quot;severe&quot; malnutrition diagnosis by a physician or eligible clinician as defined by the Centers for Medicare &amp; Medicaid Services (CMS), and (4) have a current nutrition care plan performed by an RD/RDN.</td>\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Purpose</th>\n\n\n<td class=\"content-container\">Percentage of hospitalizations where a patient 18 years of age or older, admitted for 24-hours or more, received optimal malnutrition care</td>\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Copyright</th>\n\n\n<td class=\"content-container\">Copyright (C) Academy of Nutrition and Dietetics 2025 Limited proprietary coding is contained in the measure specifications for convenience. Users of the proprietary code sets should obtain all necessary licenses from the owners of these code sets. LOINC(R) copyright 2004-2024 Regenstrief Institute, Inc. ICD-10 copyright 2024 World Health Organization. This material contains SNOMED Clinical Terms (R) (SNOMED CT [R]) copyright 2004-2024. International Health Terminology Standards Development Organisation. All Rights Reserved.</td>\n</tr>\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Disclaimer</th>\n\n\n<td class=\"content-container\">This performance measure is not a clinical guideline, does not establish a standard of medical care, and has not been tested for all potential applications. THE MEASURE AND SPECIFICATIONS ARE PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND. Due to technical limitations, copyright is indicated by (C) or [C], registered trademarks are indicated by (R) or [R], and unregistered trademarks are indicated by (TM) or [TM].</td>\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Rationale</th>\n\n\n<td class=\"content-container\"><p>Malnutrition has been documented in approximately one-third of patients in developed countries upon admission to the hospital, and, if left untreated, can significantly impact important clinical outcomes (Mogensen et al., 2019). Adult patients with malnutrition have a significantly longer hospital length of stay (LOS) and a significantly higher likelihood of 30-day readmission when compared to their well-nourished counterparts (Lengfelder et al., 2022). Furthermore, hospitalized adults with malnutrition have an increased likelihood of all-cause mortality within 2 years of diagnosis (Trollebo et al., 2024) and an increase in in-hospital death when compared to patients without a diagnosis of malnutrition (Compher et al., 2024). These consequences demonstrate the importance of addressing malnutrition in hospitalized patients to improve outcomes.</p>\n<p>The components of this measure are supported by clinical guidance which recommend <strong>(1) malnutrition screening</strong> for patients admitted into the acute inpatient care setting; <strong>(2) nutrition assessment </strong>for patients identified at risk for malnutrition or with a dietitian referral order to form the basis for appropriate nutrition interventions; <strong>(3) appropriate recognition, diagnosis, and documentation</strong> of the nutrition status of a patient in order to <strong>(4) address their condition with an appropriate plan of care</strong> and communicate patient needs to other care providers (Swan et al., 2019).</p>\n<p>The process for risk identification, assessment, diagnosis, and treatment of malnutrition necessitates a multi-disciplinary care team that begins with the identification of an initial risk population for a more thorough assessment by the RD/RDN. The RD/RDN, in turn, provides the necessary treatment recommendations to address nutrition problems utilizing a nutrition diagnosis and care plan, along with the clinical indicators that inform a medical diagnosis of malnutrition completed by a physician or eligible clinician as defined by CMS. The four measure observations individually provide a portion of the necessary information on the quality of care for patients at risk for or with malnutrition. Therefore, the four components are summed and averaged according to a patient's degree of malnutrition and/or malnutrition risk to determine an encounter-level Malnutrition Care Score.</p>\n<p>High performance on this measure requires malnutrition risk screening and/or referral to RDNs for appropriate nutrition assessment for identified patients during the current hospitalization. For patients identified with moderate or severe malnutrition by nutrition assessment, best practice also recommends a medical diagnosis by a physician or other eligible clinician and the execution of the nutrition care plan by an RD/RDN. Evidence demonstrates that malnutrition pathways, which include a standardized protocol for screening, assessment, diagnosis, and care planning results in improved patient outcomes for malnourished patients (Pacetti et al., 2025).</p></td>\n</tr>\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Clinical Recommendation Statement</th>\n\n\n<td class=\"content-container\"><p>American Society for Parenteral and Enteral Nutrition (ASPEN) clinical guidelines on nutrition screening, assessment, and intervention in adults indicate that screening for nutrition risk is suggested for hospitalized patients (Mueller et al., 2011). This guideline places nutrition assessment and screening in the context of intervention as part of nutrition care. Screening those individuals at risk for malnutrition is the first step in nutrition care, as malnutrition risk, identified by nutrition screening, is associated with longer length of hospital stay, complications, and mortality. Malnutrition screening is also a predictor of mortality risk.</p>\n<p>Additionally, the Academy of Nutrition and Dietetics-ASPEN Indicators of Malnutrition (AAIM) provide a framework with significant validity in diagnosing malnutrition in hospitalized patients and supporting evidence that suggests that malnourished patients have more complications, longer hospitalizations, greater incidence of 30-day readmission, and higher incidence of mortality than patients with optimal nutrition status (Compher et al., 2024; Jimenez et al., 2024).</p>\n<p>Nutrition intervention is recommended for patients identified by assessment as at risk for malnutrition or malnourished. Nutrition intervention with associated monitoring and evaluation plans in patients identified as at risk for malnutrition or malnourished improves clinical outcomes. Nutrition interventions and their associated monitoring and evaluation plans in malnourished patients are associated with improved nutrition status, nutrient intake, physical function, and quality of life. Hospital readmissions, inpatient length of stay, and complications were reduced with increased nutrition support interventions.</p></td>\n</tr>\n\n\n\n\n<tr>\n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Citation</th>\n\n\n  \n  \n  \n  <td class=\"content-container\">\n    \n    \n    \n    <p>Compher, C., Jensen, G. L., Malone, A., Morgan, S., Becker, S., Cresta, L., Paul, A. M., &amp; Steiber, A. (2024). Systematic Review of Content Validity and Meta-analysis of Predictive Validity for Clinical Outcomes Associated with Malnutrition Identified by The Academy of Nutrition and Dietetics and American Society for Parenteral and Enteral Nutrition Indicators of Malnutrition. <em>Journal of the Academy of Nutrition and Dietetics</em>. https://doi.org/10.1016/j.jand.2024.02.002</p>\n    \n    \n    \n    \n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Citation</th>\n\n\n  \n  \n  \n  <td class=\"content-container\">\n    \n    \n    \n    <p>Jimenez, E. Y., Lamers-Johnson, E., Long, J. M., Woodcock, L., Bliss, C., &amp; Steiber, A. L. (2024). Predictive Validity of the Academy of Nutrition and Dietetics/American Society for Parental Nutrition Indicators to Diagnose Malnutrition and the Screening Tool for Risk on Nutritional Status and Growth among Hospitalized Children Relative to Medical Outcomes. <em>The Journal of Pediatrics</em>, 276, 114288. https://doi.org/10.1016/j.jpeds.2024.114288</p>\n    \n    \n    \n    \n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Citation</th>\n\n\n  \n  \n  \n  <td class=\"content-container\">\n    \n    \n    \n    <p>Lengfelder, L., Mahlke, S., Moore, L., Zhang, X., Williams, G., &amp; Lee, J. (2022). Prevalence and Impact of Malnutrition on Length of stay, readmission, and Discharge Destination. <em>Journal of Parenteral and Enteral Nutrition</em>, 46(6). https://doi.org/10.1002/jpen.2322</p>\n    \n    \n    \n    \n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Citation</th>\n\n\n  \n  \n  \n  <td class=\"content-container\">\n    \n    \n    \n    <p>Pacetti, E. J., McMurray, D., &amp; Baca, J. (2025). Quality Improvement in Acute Care Malnutrition: Impact on Payment and Patient Outcomes. <em>Journal of the Academy of Nutrition and Dietetics</em>, 125(9), S24-S35. https://doi.org/10.1016/j.jand.2025.05.018</p>\n    \n    \n    \n    \n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Citation</th>\n\n\n  \n  \n  \n  <td class=\"content-container\">\n    \n    \n    \n    <p>Swan, W. I., Pertel, D. G., Hotson, B., Lloyd, L., Orrevall, Y., Trostler, N., Vivanti, A., Howarter, K. B., &amp; Papoutsakis, C. (2019). Nutrition Care Process (NCP) Update Part 2: Developing and Using the NCP Terminology to Demonstrate Efficacy of Nutrition Care and Related Outcomes. <em>Journal of the Academy of Nutrition and Dietetics</em>, 119(5), 840-855. https://doi.org/10.1016/j.jand.2018.10.025</p>\n    \n    \n    \n    \n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Citation</th>\n\n\n  \n  \n  \n  <td class=\"content-container\">\n    \n    \n    \n    <p>Trollebo, M. A., Tangvik, R. J., Skeie, E., Gronning, M. K., Nygard, O., Eagan, T. M. L., &amp; Dierkes, J. (2024). Malnutrition as a prognostic factor for 2-year mortality in hospitalized patients in Norway: A matched cohort study. <em>Journal of Parenteral and Enteral Nutrition</em>, 48(3), 308-317. https://doi.org/10.1002/jpen.2619</p>\n    \n    \n    \n    \n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Citation</th>\n\n\n  \n  \n  \n  <td class=\"content-container\">\n    \n    \n    \n    Mogensen, K.M., Malone, A., Becker, P., Cutrell, S., Frank, L., Gonzales, K., Hudson, L., Miller, S., Guenter, P. (2019) Academy of Nutrition and Dietetics/American Society for Parenteral and Enteral Nutrition Consensus Malnutrition Characteristics: Usability and Association With Outcomes. Nutrition in Clinical Practice, 34 (5), 657-665. https://doi.org/10.1002/ncp.10310\n    \n    \n    \n    \n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Citation</th>\n\n\n  \n  \n  \n  <td class=\"content-container\">\n    \n    \n    \n    Mueller, C., Compher, C., Druyan, M.E., &amp; the ASPEN Board of Directors. (2011). ASPEN clinical guidelines on nutrition screening, assessment, and intervention in adults: Journal of Parenteral and Enteral Nutrition, 35(1), 16-24. https://doi.org/10.1177/0148607110389335\n    \n    \n    \n    \n    \n    \n    \n  </td>\n</tr>\n\n\n\n\n\n\n  \n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Definition</th>\n\n\n<td class=\"content-container\">Malnutrition Diagnosis: A documented diagnosis that identifies and describes a specific nutrition problem(s) that can be resolved or improved through nutrition intervention(s), monitoring, and evaluation. For the inpatient or acute care setting, the Malnutrition Diagnosis is identified by the physician or other eligible clinician as defined by CMS based on the scope of practice regulations within the respective state, commonwealth, or territory of care delivery.</td>\n</tr>\n\n\n  \n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Definition</th>\n\n\n<td class=\"content-container\">Malnutrition Risk Screening: The process of identifying and referring those individuals and populations who are at risk for nutrition-related problems, are appropriate for nutrition care services, and would benefit from nutrition interventions. For the inpatient or acute care setting, the Malnutrition Risk Screening can be completed by any eligible healthcare clinician as defined by local, state and federal guidelines.</td>\n</tr>\n\n\n  \n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Definition</th>\n\n\n<td class=\"content-container\">Nutrition Assessment: A systematic approach for collecting, classifying, and synthesizing important and relevant data to describe nutritional status related nutritional problems, and their causes. This assessment includes review of the &quot;whole&quot; patient and evaluates the anthropometrics (i.e., body measurements and proportions), biochemical data (i.e., laboratory findings), clinical observations, and diet history (also known as 'ABCD'). For the inpatient or acute care setting, the Nutrition Assessment is performed by a RD or RDN.</td>\n</tr>\n\n\n  \n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Definition</th>\n\n\n<td class=\"content-container\">Nutrition Care Plan: A documented plan based on information collected during the Nutrition Assessment of individualized nutrition recommendations, interventions, and monitoring and evaluation plans that are directed toward resolving the Malnutrition Diagnosis by altering or eliminating the nutrition etiology. The Nutrition Care Plan may encompass the interventions of Food and Nutrient Delivery, Nutrition Education, Nutrition Counseling, Coordination of Nutrition Care, and Population Based Nutrition Action, along with a plan for monitoring and evaluation, and is documented by the RD or RDN.</td>\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Guidance (Usage)</th>\n\n\n<td class=\"content-container\"><p>This measure is constructed of four clinically eligible components that are aggregated as an arithmetic average of eligible encounters and expressed as a percentage. The four populations used to calculate the four components may differ and the measure observations for the four components do not need to be performed sequentially. This dQM is an episode-based measure. An episode is defined as each eligible encounter with a length of stay of greater than or equal to 24 hours among individuals 18 years of age and older at the start of the inpatient encounter. This FHIR-based measure has been derived from the QDM-based measure: CMS986v5. Please refer to the HL7 QI-Core Implementation Guide (<em>https://hl7.org/fhir/us/qicore/STU6/</em>) for more information on QI-Core and mapping recommendations from QDM to QI-Core STU 6. (<em>https://hl7.org/fhir/us/qicore/STU6/qdm-to-qicore.html</em>).</p></td>\n</tr>\n\n\n\n  \n  \n  \n    \n    <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate) (ID: Group_1)</th>\n\n\n</tr>\n  \n  \n    \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Summary</th>\n\n\n<td class=\"content-container\"><p>Population Criteria 1</p></td>\n</tr>\n\n  \n  \n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Basis</th>\n\n\n<td class=\"content-container\">Encounter</td>\n</tr>\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Scoring</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-scoring#continuous-variable: 'Continuous Variable']</td>\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-type#intermediate-outcome: 'Intermediate Outcome']</td>\n</tr>\n\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Improvement Notation</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-improvement-notation#increase: 'Increased score indicates improvement']</td>\n</tr>\n\n\n  \n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Initial Population</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: InitialPopulation_1\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Eligible encounters during the measurement period with length of stay of 24 hours or more among individuals 18 years of age and older at the start of the inpatient encounter</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_1-InitialPopulation_1\">Initial Population</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Population</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasurePopulation_1\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Equals Initial Population</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_1-MeasurePopulation_1\">Measure Population</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Population Exclusion</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasurePopulationExclusion_1\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Encounters with hospice care ordered during the inpatient qualifying encounter and encounters with a discharge disposition of hospice</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_1-MeasurePopulationExclusion_1\">Measure Population Exclusion</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Observation</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasureObservation_1\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Component Measure 1: Eligible encounters for patients with a current &quot;Malnutrition Risk Screening&quot; performed by an eligible healthcare clinician or with a Dietitian Referral.</p>\n<p>Measure Observation 1 is Encounters with Malnutrition Risk Screening or with a Dietitian Referral.</p>\n<p>Measure Observation 1 identifies eligible encounters where a &quot;Malnutrition Risk Screening&quot; was performed during the encounter (including associated observation or emergency department encounters) with an identified Malnutrition Screening Finding of Not At Risk or At Risk Result. It also identifies an eligible encounter where there is a Dietitian Referral, whether there is a Malnutrition Risk Screening performed or not.</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_1-MeasureObservation_1\">Measure Observation 1</a> \n            \n          \n          \n        \n        \n          <br/><em>Input Population</em>: MeasurePopulation_1\n        \n        \n          <em>AggregateMethod</em>: Sum\n        \n      </td>\n    </tr>\n  \n\n  \n\n  \n  \n  \n    \n    <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate) (ID: Group_2)</th>\n\n\n</tr>\n  \n  \n    \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Summary</th>\n\n\n<td class=\"content-container\"><p>Nutrition Assessment</p></td>\n</tr>\n\n  \n  \n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Basis</th>\n\n\n<td class=\"content-container\">Encounter</td>\n</tr>\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Scoring</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-scoring#continuous-variable: 'Continuous Variable']</td>\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-type#intermediate-outcome: 'Intermediate Outcome']</td>\n</tr>\n\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Improvement Notation</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-improvement-notation#increase: 'Increased score indicates improvement']</td>\n</tr>\n\n\n  \n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Initial Population</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: InitialPopulation_2\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Eligible encounters during the measurement period with length of stay of 24 hours or more among individuals 18 years of age and older at the start of the inpatient encounter</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_2-InitialPopulation_2\">Initial Population</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Population</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasurePopulation_2\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Equals Initial Population</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_2-MeasurePopulation_2\">Measure Population</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Population Exclusion</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasurePopulationExclusion_2\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Encounters with hospice care ordered during the inpatient qualifying encounter and encounters with a discharge disposition of hospice</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_2-MeasurePopulationExclusion_2\">Measure Population Exclusion</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Observation</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasureObservation_2\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Component Measure 2: Eligible encounters for patients with a documented &quot;Nutrition Assessment&quot; performed by an RD/RDN, after a Malnutrition Screening Finding of At Risk Result or a Dietitian Referral order from a physician or eligible clinician during the current encounter. Measure Observation 2 includes Encounter With Most Recent Nutrition Assessment and Identified Status if the Encounter also contains Completed Malnutrition Risk Screening or Dietitian Referral Measure Observation 2 identifies eligible encounters in which a malnutrition risk screening with an At Risk result or a dietitian referral was completed during the encounter (or associated observation or emergency department encounters) and a Nutrition Assessment was subsequently completed with an identified Nutrition Assessment Status Finding of Well Nourished or Not Malnourished or Mildly Malnourished, Nutrition Assessment Status Finding of Moderately Malnourished, or Nutrition Assessment Status Finding of Severely Malnourished.</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_2-MeasureObservation_2\">Measure Observation 2</a> \n            \n          \n          \n        \n        \n          <br/><em>Input Population</em>: MeasurePopulation_2\n        \n        \n          <em>AggregateMethod</em>: Sum\n        \n      </td>\n    </tr>\n  \n\n  \n\n  \n  \n  \n    \n    <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate) (ID: Group_3)</th>\n\n\n</tr>\n  \n  \n    \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Summary</th>\n\n\n<td class=\"content-container\"><p>Malnutrition Diagnosis</p></td>\n</tr>\n\n  \n  \n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Basis</th>\n\n\n<td class=\"content-container\">Encounter</td>\n</tr>\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Scoring</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-scoring#continuous-variable: 'Continuous Variable']</td>\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-type#intermediate-outcome: 'Intermediate Outcome']</td>\n</tr>\n\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Improvement Notation</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-improvement-notation#increase: 'Increased score indicates improvement']</td>\n</tr>\n\n\n  \n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Initial Population</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: InitialPopulation_3\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Eligible encounters during the measurement period with length of stay of 24 hours or more among individuals 18 years of age and older at the start of the inpatient encounter</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_3-InitialPopulation_3\">Initial Population</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Population</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasurePopulation_3\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Equals Initial Population</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_3-MeasurePopulation_3\">Measure Population</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Population Exclusion</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasurePopulationExclusion_3\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Encounters with hospice care ordered during the inpatient qualifying encounter and encounters with a discharge disposition of hospice</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_3-MeasurePopulationExclusion_3\">Measure Population Exclusion</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Observation</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasureObservation_3\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Component Measure 3: Eligible encounters for patients with a documented &quot;Malnutrition Diagnosis&quot; based on the most recent Nutrition Assessment finding of Moderately Malnourished or Severely Malnourished. Measure Observation 3 includes Encounters with a most recent Nutrition Assessment and Identified Status of Moderately Malnourished or Severely Malnourished, that also identified an active medical malnutrition diagnosis during the encounter (including preceding observation or emergency department encounters) and a Malnutrition Risk Screening At Risk result or with a Dietitian Referral</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_3-MeasureObservation_3\">Measure Observation 3</a> \n            \n          \n          \n        \n        \n          <br/><em>Input Population</em>: MeasurePopulation_3\n        \n        \n          <em>AggregateMethod</em>: Sum\n        \n      </td>\n    </tr>\n  \n\n  \n\n  \n  \n  \n    \n    <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate) (ID: Group_4)</th>\n\n\n</tr>\n  \n  \n    \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Summary</th>\n\n\n<td class=\"content-container\"><p>Nutrition Care Plan</p></td>\n</tr>\n\n  \n  \n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Basis</th>\n\n\n<td class=\"content-container\">Encounter</td>\n</tr>\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Scoring</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-scoring#continuous-variable: 'Continuous Variable']</td>\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-type#intermediate-outcome: 'Intermediate Outcome']</td>\n</tr>\n\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Improvement Notation</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-improvement-notation#increase: 'Increased score indicates improvement']</td>\n</tr>\n\n\n  \n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Initial Population</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: InitialPopulation_4\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Eligible encounters during the measurement period with length of stay of 24 hours or more among individuals 18 years of age and older at the start of the inpatient encounter</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_4-InitialPopulation_4\">Initial Population</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Population</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasurePopulation_4\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Equals Initial Population</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_4-MeasurePopulation_4\">Measure Population</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Population Exclusion</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasurePopulationExclusion_4\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Encounters with hospice care ordered during the inpatient qualifying encounter and encounters with a discharge disposition of hospice</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_4-MeasurePopulationExclusion_4\">Measure Population Exclusion</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Observation</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasureObservation_4\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Component Measure 4: Eligible encounters for patients with a documented &quot;Nutrition Care Plan&quot; based on the most recent Nutrition Assessment finding of Moderately Malnourished or Severely Malnourished.</p>\n<p>Measure Observation 4 identifies Encounters with a most recent Nutrition Assessment and Identified Status of Moderately Malnourished or Severely Malnourished, that also include a documented Nutrition Care Plan and a Malnutrition Risk Screening At Risk result or with a Dietitian Referral.</p>\n<p>Measure Observation 4 identifies eligible encounters where a &quot;Nutrition Care Plan&quot; was performed during the encounter (including preceding observation or emergency department encounters).</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_4-MeasureObservation_4\">Measure Observation 4</a> \n            \n          \n          \n        \n        \n          <br/><em>Input Population</em>: MeasurePopulation_4\n        \n        \n          <em>AggregateMethod</em>: Sum\n        \n      </td>\n    </tr>\n  \n\n  \n\n  \n  \n  \n    \n    <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate) (ID: Group_5)</th>\n\n\n</tr>\n  \n  \n    \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Summary</th>\n\n\n<td class=\"content-container\"><p>Total Malnutrition Care Components</p></td>\n</tr>\n\n  \n  \n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Basis</th>\n\n\n<td class=\"content-container\">Encounter</td>\n</tr>\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Scoring</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-scoring#continuous-variable: 'Continuous Variable']</td>\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-type#intermediate-outcome: 'Intermediate Outcome']</td>\n</tr>\n\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Improvement Notation</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-improvement-notation#increase: 'Increased score indicates improvement']</td>\n</tr>\n\n\n  \n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Initial Population</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: InitialPopulation_5\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Eligible encounters during the measurement period with length of stay of 24 hours or more among individuals 18 years of age and older at the start of the inpatient encounter</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_5-InitialPopulation_5\">Initial Population</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Population</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasurePopulation_5\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Equals Initial Population</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_5-MeasurePopulation_5\">Measure Population</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Population Exclusion</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasurePopulationExclusion_5\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Encounters with hospice care ordered during the inpatient qualifying encounter and encounters with a discharge disposition of hospice</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_5-MeasurePopulationExclusion_5\">Measure Population Exclusion</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Observation</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasureObservation_5\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Population 5 &quot;Measure Observation Total Malnutrition Components Score&quot; Calculations-For each eligible encounter, Population Criteria 5 represents the subtotal of Measure Observations performed for Population Criteria 1, 2, 3, and 4. Possible values may be 0, 1, 2, 3, or 4. Population 5 &quot;Measure Observation Total Malnutrition Components Score&quot; is (&quot;Measure Observation 1&quot; plus &quot;Measure Observation 2&quot; plus &quot;Measure Observation 3&quot; plus &quot;Measure Observation 4&quot;)</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_5-MeasureObservation_5\">Measure Observation Total Malnutrition Components Score</a> \n            \n          \n          \n        \n        \n          <br/><em>Input Population</em>: MeasurePopulation_5\n        \n        \n          <em>AggregateMethod</em>: Count\n        \n      </td>\n    </tr>\n  \n\n  \n\n  \n  \n  \n    \n    <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate) (ID: Group_6)</th>\n\n\n</tr>\n  \n  \n    \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Summary</th>\n\n\n<td class=\"content-container\"><p>Encounter Malnutrition Care Score</p></td>\n</tr>\n\n  \n  \n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Basis</th>\n\n\n<td class=\"content-container\">Encounter</td>\n</tr>\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Scoring</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-scoring#continuous-variable: 'Continuous Variable']</td>\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-type#intermediate-outcome: 'Intermediate Outcome']</td>\n</tr>\n\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Improvement Notation</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/measure-improvement-notation#increase: 'Increased score indicates improvement']</td>\n</tr>\n\n\n  \n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Initial Population</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: InitialPopulation_6\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Eligible encounters during the measurement period with length of stay of 24 hours or more among individuals 18 years of age and older at the start of the inpatient encounter</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_6-InitialPopulation_6\">Initial Population</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Population</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasurePopulation_6\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Equals Initial Population</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_6-MeasurePopulation_6\">Measure Population</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Population Exclusion</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasurePopulationExclusion_6\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Encounters with hospice care ordered during the inpatient qualifying encounter and encounters with a discharge disposition of hospice</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_6-MeasurePopulationExclusion_6\">Measure Population Exclusion</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Observation</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: MeasureObservation_6\n        <br/>\n        \n        \n          <em>Description</em>:\n          <p style=\"white-space: pre-line\" class=\"tab-one\"><p>Population 6 &quot;Measure Observation Total Malnutrition Care Score as Percentage&quot; Calculations:-For each eligible encounter, Population Criteria 6 represents the sum of performed Measure Observations 1, 2, 3, and 4 divided by the number of clinically eligible occurrences. Population 6 &quot;Measure Observation Total Malnutrition Care Score as Percentage&quot; is 100 multiplied by (&quot;Measure Observation Total Malnutrition Components Score&quot; divided by &quot;Total Malnutrition Care Score Eligible Occurrences&quot;). Possible values may be 0, 50, 75, or 100 percent. &quot;Total Malnutrition Care Score Eligible Occurrences&quot; is always 4 except in the following instances: -The &quot;Total Malnutrition Care Score Eligible Occurrences&quot; is 1 if ---A &quot;Malnutrition Risk Screening&quot; was performed and a Malnutrition Screening Finding of Not At Risk was identified and &quot;Dietitian Referral&quot; was not ordered. - The &quot;Total Malnutrition Care Score Eligible Occurrences&quot; is 2 ---If the most recent &quot;Nutrition Assessment&quot; performed has a result of Not or Mildly Malnourished. And, --- A &quot;Malnutrition Risk Screening&quot; was performed and a Malnutrition Screening Finding of At Risk was identified or a &quot;Dietitian Referral&quot; was ordered or a Dietitian Referral was ordered but a Nutrition Assessment was not performed.</p></p>\n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#Group_6-MeasureObservation_6\">Measure Observation Total Malnutrition Care Score as Percentage</a> \n            \n          \n          \n        \n        \n          <br/><em>Input Population</em>: MeasurePopulation_6\n        \n        \n          <em>AggregateMethod</em>: Average\n        \n      </td>\n    </tr>\n  \n\n  \n\n\n  \n    \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Guidance</th>\n\n\n<td class=\"content-container\">For every patient evaluated by this measure also identify payer, race, ethnicity and sex</td>\n</tr>\n\n  \n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Supplemental Data Elements</th>\n\n\n</tr>\n\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\n\n  <td class=\"content-container\">\n    \n      <em>ID</em>: sde-payer-type\n      \n      <br/>\n      \n    \n    \n      \n        \n          <em>Usage Code</em>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data]\n        \n        <br/>\n      \n    \n    \n      <em>Description</em>: SDE Payer Type\n    \n    \n      \n        <br/>\n        \n          \n          <em>Logic Definition</em>: <a href=\"#cms986fhirmalnutritionscore-sde-payer-type\">SDE Payer Type</a> \n        \n      \n    \n  </td>\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\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>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data]\n        \n        <br/>\n      \n    \n    \n      <em>Description</em>: SDE Race\n    \n    \n      \n        <br/>\n        \n          \n          <em>Logic Definition</em>: <a href=\"#cms986fhirmalnutritionscore-sde-race\">SDE Race</a> \n        \n      \n    \n  </td>\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\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>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data]\n        \n        <br/>\n      \n    \n    \n      <em>Description</em>: SDE Ethnicity\n    \n    \n      \n        <br/>\n        \n          \n          <em>Logic Definition</em>: <a href=\"#cms986fhirmalnutritionscore-sde-ethnicity\">SDE Ethnicity</a> \n        \n      \n    \n  </td>\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\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>: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data]\n        \n        <br/>\n      \n    \n    \n      <em>Description</em>: SDE Sex\n    \n    \n      \n        <br/>\n        \n          \n          <em>Logic Definition</em>: <a href=\"#cms986fhirmalnutritionscore-sde-sex\">SDE Sex</a> \n        \n      \n    \n  </td>\n</tr>\n\n\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Logic</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Primary Library</th>\n\n\n<td class=\"content-container\">https://madie.cms.gov/Library/CMS986FHIRMalnutritionScore</td>\n</tr>\n\n\n\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Contents</th>\n  <td class=\"content-container\">\n    <em><a href=\"#population-criteria\">Population Criteria</a></em>\n    <br/>\n    <em><a href=\"#definitions\">Logic Definitions</a></em>\n    <br/>\n    <em><a href=\"#terminology\">Terminology</a></em>\n    <br/>\n    <em><a href=\"#dependencies\">Dependencies</a></em>\n    <br/>\n    <em><a href=\"#data-requirements\">Data Requirements</a></em>\n    <br/>\n  </td>\n</tr>\n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"population-criteria\"> </a>Population Criteria</th>\n\n\n</tr>\n  \n  \n  \n\n  \n  \n  \n    \n    <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate) (ID: Group_1)</th>\n\n\n</tr>\n  \n  \n  \n  \n    \n      \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Initial Population\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_1-InitialPopulation_1\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Initial Population&quot;:\n  [Encounter: &quot;Encounter Inpatient&quot;] EncounterInpatient\n    where EncounterInpatient.period ends during day of &quot;Measurement Period&quot;\n      and AgeInYearsAt(date from start of EncounterInpatient.period) &gt;= 18\n      and ( duration in hours of EncounterInpatient.period &gt;= 24 )\n      and EncounterInpatient.status = 'finished'</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-initial-population\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Population\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_1-MeasurePopulation_1\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Measure Population&quot;:\n  &quot;Initial Population&quot;</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-population\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Population Exclusion\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_1-MeasurePopulationExclusion_1\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Measure Population Exclusion&quot;:\n  &quot;Encounters with Discharge for Hospice Care&quot;\n    union &quot;Encounters with Hospice during Eligible Encounter&quot;</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-population-exclusion\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Observation\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_1-MeasureObservation_1\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function &quot;Measure Observation 1&quot;(MalnutritionRiskScreening Encounter):\n  if &quot;Encounters with Malnutrition Risk Screening or with Dietitian Referral&quot; contains MalnutritionRiskScreening then 1 \n    else 0</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-observation-1\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n  \n\n\n  \n  \n  \n    \n    <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate) (ID: Group_2)</th>\n\n\n</tr>\n  \n  \n  \n  \n    \n      \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Initial Population\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_2-InitialPopulation_2\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Initial Population&quot;:\n  [Encounter: &quot;Encounter Inpatient&quot;] EncounterInpatient\n    where EncounterInpatient.period ends during day of &quot;Measurement Period&quot;\n      and AgeInYearsAt(date from start of EncounterInpatient.period) &gt;= 18\n      and ( duration in hours of EncounterInpatient.period &gt;= 24 )\n      and EncounterInpatient.status = 'finished'</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-initial-population\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Population\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_2-MeasurePopulation_2\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Measure Population&quot;:\n  &quot;Initial Population&quot;</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-population\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Population Exclusion\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_2-MeasurePopulationExclusion_2\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Measure Population Exclusion&quot;:\n  &quot;Encounters with Discharge for Hospice Care&quot;\n    union &quot;Encounters with Hospice during Eligible Encounter&quot;</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-population-exclusion\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Observation\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_2-MeasureObservation_2\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function &quot;Measure Observation 2&quot;(NutritionAssessment Encounter):\n  if &quot;Encounters with Malnutrition Not At Risk Screening and without Dietitian Referral&quot; contains NutritionAssessment then 0 \n    else if &quot;Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral&quot; contains NutritionAssessment then if &quot;Encounter With Most Recent Nutrition Assessment And Identified Status&quot; contains NutritionAssessment then 1 \n    else 0 \n    else 0</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-observation-2\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n  \n\n\n  \n  \n  \n    \n    <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate) (ID: Group_3)</th>\n\n\n</tr>\n  \n  \n  \n  \n    \n      \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Initial Population\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_3-InitialPopulation_3\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Initial Population&quot;:\n  [Encounter: &quot;Encounter Inpatient&quot;] EncounterInpatient\n    where EncounterInpatient.period ends during day of &quot;Measurement Period&quot;\n      and AgeInYearsAt(date from start of EncounterInpatient.period) &gt;= 18\n      and ( duration in hours of EncounterInpatient.period &gt;= 24 )\n      and EncounterInpatient.status = 'finished'</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-initial-population\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Population\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_3-MeasurePopulation_3\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Measure Population&quot;:\n  &quot;Initial Population&quot;</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-population\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Population Exclusion\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_3-MeasurePopulationExclusion_3\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Measure Population Exclusion&quot;:\n  &quot;Encounters with Discharge for Hospice Care&quot;\n    union &quot;Encounters with Hospice during Eligible Encounter&quot;</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-population-exclusion\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Observation\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_3-MeasureObservation_3\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function &quot;Measure Observation 3&quot;(MalnutritionDiagnosis Encounter):\n  if &quot;Encounters with Malnutrition Not At Risk Screening and without Dietitian Referral&quot; contains MalnutritionDiagnosis then 0 \n    else if &quot;Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral&quot; contains MalnutritionDiagnosis then if &quot;Encounters with Malnutrition Diagnosis&quot; contains MalnutritionDiagnosis then if &quot;Encounter With Most Recent Nutrition Assessment Status of Not or Mildly Malnourished&quot; contains MalnutritionDiagnosis then 0 \n    else if &quot;Encounter With Most Recent Nutrition Assessment Status of Moderately Or Severely Malnourished&quot; contains MalnutritionDiagnosis then 1 \n    else 0 \n    else 0 \n    else 0</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-observation-3\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n  \n\n\n  \n  \n  \n    \n    <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate) (ID: Group_4)</th>\n\n\n</tr>\n  \n  \n  \n  \n    \n      \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Initial Population\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_4-InitialPopulation_4\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Initial Population&quot;:\n  [Encounter: &quot;Encounter Inpatient&quot;] EncounterInpatient\n    where EncounterInpatient.period ends during day of &quot;Measurement Period&quot;\n      and AgeInYearsAt(date from start of EncounterInpatient.period) &gt;= 18\n      and ( duration in hours of EncounterInpatient.period &gt;= 24 )\n      and EncounterInpatient.status = 'finished'</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-initial-population\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Population\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_4-MeasurePopulation_4\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Measure Population&quot;:\n  &quot;Initial Population&quot;</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-population\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Population Exclusion\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_4-MeasurePopulationExclusion_4\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Measure Population Exclusion&quot;:\n  &quot;Encounters with Discharge for Hospice Care&quot;\n    union &quot;Encounters with Hospice during Eligible Encounter&quot;</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-population-exclusion\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Observation\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_4-MeasureObservation_4\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function &quot;Measure Observation 4&quot;(NutritionCarePlan Encounter):\n  if &quot;Encounters with Malnutrition Not At Risk Screening and without Dietitian Referral&quot; contains NutritionCarePlan then 0 \n    else if &quot;Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral&quot; contains NutritionCarePlan then if &quot;Encounters with Nutrition Care Plan&quot; contains NutritionCarePlan then if &quot;Encounter With Most Recent Nutrition Assessment Status of Not or Mildly Malnourished&quot; contains NutritionCarePlan then 0 \n    else if &quot;Encounter With Most Recent Nutrition Assessment Status of Moderately Or Severely Malnourished&quot; contains NutritionCarePlan then 1 \n    else 0 \n    else 0 \n    else 0</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-observation-4\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n  \n\n\n  \n  \n  \n    \n    <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate) (ID: Group_5)</th>\n\n\n</tr>\n  \n  \n  \n  \n    \n      \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Initial Population\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_5-InitialPopulation_5\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Initial Population&quot;:\n  [Encounter: &quot;Encounter Inpatient&quot;] EncounterInpatient\n    where EncounterInpatient.period ends during day of &quot;Measurement Period&quot;\n      and AgeInYearsAt(date from start of EncounterInpatient.period) &gt;= 18\n      and ( duration in hours of EncounterInpatient.period &gt;= 24 )\n      and EncounterInpatient.status = 'finished'</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-initial-population\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Population\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_5-MeasurePopulation_5\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Measure Population&quot;:\n  &quot;Initial Population&quot;</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-population\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Population Exclusion\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_5-MeasurePopulationExclusion_5\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Measure Population Exclusion&quot;:\n  &quot;Encounters with Discharge for Hospice Care&quot;\n    union &quot;Encounters with Hospice during Eligible Encounter&quot;</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-population-exclusion\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Observation\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_5-MeasureObservation_5\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function &quot;Measure Observation Total Malnutrition Components Score&quot;(QualifyingEncounter Encounter):\n  Sum({ &quot;Measure Observation 1&quot;(QualifyingEncounter), &quot;Measure Observation 2&quot;(QualifyingEncounter), &quot;Measure Observation 3&quot;(QualifyingEncounter), &quot;Measure Observation 4&quot;(QualifyingEncounter) })</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-observation-total-malnutrition-components-score\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n  \n\n\n  \n  \n  \n    \n    <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate) (ID: Group_6)</th>\n\n\n</tr>\n  \n  \n  \n  \n    \n      \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Initial Population\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_6-InitialPopulation_6\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Initial Population&quot;:\n  [Encounter: &quot;Encounter Inpatient&quot;] EncounterInpatient\n    where EncounterInpatient.period ends during day of &quot;Measurement Period&quot;\n      and AgeInYearsAt(date from start of EncounterInpatient.period) &gt;= 18\n      and ( duration in hours of EncounterInpatient.period &gt;= 24 )\n      and EncounterInpatient.status = 'finished'</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-initial-population\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Population\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_6-MeasurePopulation_6\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Measure Population&quot;:\n  &quot;Initial Population&quot;</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-population\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Population Exclusion\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_6-MeasurePopulationExclusion_6\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Measure Population Exclusion&quot;:\n  &quot;Encounters with Discharge for Hospice Care&quot;\n    union &quot;Encounters with Hospice during Eligible Encounter&quot;</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-population-exclusion\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n  \n    \n      \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Observation\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"Group_6-MeasureObservation_6\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function &quot;Measure Observation Total Malnutrition Care Score as Percentage&quot;(QualifyingEncounter Encounter):\n  100 * ( &quot;Measure Observation Total Malnutrition Components Score&quot;(QualifyingEncounter) / &quot;Total Malnutrition Care Score Eligible Occurrences&quot;(QualifyingEncounter) )</code></pre>\n    \n      \n      <a href=\"#cms986fhirmalnutritionscore-measure-observation-total-malnutrition-care-score-as-percentage\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n      \n    \n  \n\n  \n  \n\n  \n  \n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"definitions\"> </a>Logic Definitions</th>\n\n\n</tr>\n  \n  \n          \n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"supplementaldataelements-sde-race\"> </a>\n    \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\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"supplementaldataelements-sde-sex\"> </a>\n    \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.sex = '248153007' then &quot;Male (finding)&quot;\n    when Patient.sex = '248152002' then &quot;Female (finding)&quot;\n    else null\n  end</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"supplementaldataelements-sde-payer\"> </a>\n    \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\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"supplementaldataelements-sde-ethnicity\"> </a>\n    \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\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n\n        \n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"fhirhelpers-tointerval\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)\nvalue to a CQL DateTime Interval\n@comment: If the start value of the given period is unspecified, the starting\nboundary of the resulting interval will be open (meaning the start of the interval\nis unknown, as opposed to interpreted as the beginning of time).\n*/\ndefine function ToInterval(period FHIR.Period):\n    if period is null then\n        null\n    else\n        if period.&quot;start&quot; is null then\n            Interval(period.&quot;start&quot;.value, period.&quot;end&quot;.value]\n        else\n            Interval[period.&quot;start&quot;.value, period.&quot;end&quot;.value]</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"fhirhelpers-tostring\"> </a>\n    \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\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"fhirhelpers-tocode\"> </a>\n    \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\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"fhirhelpers-toconcept\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.\n*/\ndefine function ToConcept(concept FHIR.CodeableConcept):\n    if concept is null then\n        null\n    else\n        System.Concept {\n            codes: concept.coding C return ToCode(C),\n            display: concept.text.value\n        }</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n\n        \n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> Status</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"status-verified\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">//This library contains functions used to constrain FHIR resource elements for measures authored by NCQA, based on QICore 6.0.0 resources including IG and authoring patterns. The functions may appear similar to some QICoreCommon functions but differ in that they have constraints that are relevant for measures authored by NCQA.\n\n//Condition\n//Returns conditions in the given list that either have no verification status or have a verification status of confirmed, unconfirmed, provisional, or differential\ndefine fluent function verified(conditions List&lt;Choice&lt;ConditionProblemsHealthConcerns, ConditionEncounterDiagnosis&gt;&gt;):\n  conditions C\n    where C.verificationStatus is not null implies\n      (C.verificationStatus ~ &quot;confirmed&quot;\n        or C.verificationStatus ~ &quot;unconfirmed&quot;\n        or C.verificationStatus ~ &quot;provisional&quot;\n        or C.verificationStatus ~ &quot;differential&quot;\n      )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n\n        \n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"cqmcommon-hospitalizationwithobservation\"> </a>\n    \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*/\ndefine fluent function hospitalizationWithObservation(TheEncounter Encounter ):\n  TheEncounter Visit\n  \t\tlet ObsVisit: Last([Encounter: &quot;Observation Services&quot;] LastObs\n  \t\t\t\twhere LastObs.status = 'finished'\n            and LastObs.period ends 1 hour or less on or before start of Visit.period\n  \t\t\t\tsort by end of period\n  \t\t\t),\n  \t\t\tVisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),\n  \t\t\tEDVisit: Last([Encounter: &quot;Emergency Department Visit&quot;] LastED\n  \t\t\t\twhere LastED.status = 'finished'\n            and LastED.period ends 1 hour or less on or before VisitStart\n  \t\t\t\tsort by end of period\n  \t\t\t)\n  \t\treturn Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"cqmcommon-encounterdiagnosis\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*  \n@description: Returns the Condition resources referenced by the diagnosis element of the Encounter  \n*/\ndefine fluent function encounterDiagnosis(Encounter Encounter ):\n  Encounter.reasonReference D\n    return singleton from (([ConditionEncounterDiagnosis] union [ConditionProblemsHealthConcerns]) C where D.references(C.id))</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n\n        \n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"qicorecommon-tointerval\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval\n@comment: Normalizes a choice type of DateTime, Quanitty, Interval&lt;DateTime&gt;, or Interval&lt;Quantity&gt; types\nto an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible\nrepresentations for timing-valued elements in QICore, allowing this function to be used across any resource.\nThe input can be provided as a DateTime, Quantity, Interval&lt;DateTime&gt; or Interval&lt;Quantity&gt;.\nThe intent of this function is to provide a clear and concise mechanism to treat single\nelements that have multiple possible representations as intervals so that logic doesn't have to account\nfor the variability. More complex calculations (such as medication request period or dispense period\ncalculation) need specific guidance and consideration. That guidance may make use of this function, but\nthe focus of this function is on single element calculations where the semantics are unambiguous.\nIf the input is a DateTime, the result a DateTime Interval beginning and ending on that DateTime.\nIf the input is a Quantity, the quantity is expected to be a calendar-duration interpreted as an Age,\nand the result is a DateTime Interval beginning on the Date the patient turned that age and ending immediately before one year later.\nIf the input is a DateTime Interval, the result is the input.\nIf the input is a Quantity Interval, the quantities are expected to be calendar-durations interpreted as an Age, and the result\nis a DateTime Interval beginning on the date the patient turned the age given as the start of the quantity interval, and ending\nimmediately before one year later than the date the patient turned the age given as the end of the quantity interval.\nIf the input is a Timing, an error will be thrown indicating that Timing calculations are not implemented. Any other input will reslt in a null DateTime Interval\n*/\ndefine fluent function toInterval(choice Choice&lt;DateTime, Quantity, Interval&lt;DateTime&gt;, Interval&lt;Quantity&gt;, Timing&gt;):\n  case\n\t  when choice is DateTime then\n    \tInterval[choice as DateTime, choice as DateTime]\n\t\twhen choice is Interval&lt;DateTime&gt; then\n  \t\tchoice as Interval&lt;DateTime&gt;\n\t\twhen choice is Quantity then\n\t\t  Interval[Patient.birthDate + (choice as Quantity),\n\t\t\t  Patient.birthDate + (choice as Quantity) + 1 year)\n\t\twhen choice is Interval&lt;Quantity&gt; then\n\t\t  Interval[Patient.birthDate + (choice.low as Quantity),\n\t\t\t  Patient.birthDate + (choice.high as Quantity) + 1 year)\n\t\twhen choice is Timing then\n      Message(null, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported') as Interval&lt;DateTime&gt;\n\t\telse\n\t\t\tnull as Interval&lt;DateTime&gt;\n\tend</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"qicorecommon-latest\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Given an interval, returns the ending point if the interval has an ending boundary specified,\notherwise, returns the starting point\n*/\ndefine fluent function latest(choice Choice&lt;DateTime, Quantity, Interval&lt;DateTime&gt;, Interval&lt;Quantity&gt;&gt; ):\n  (choice.toInterval()) period\n    return\n      if (period.&quot;hasEnd&quot;()) then end of period\n      else start of period</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"qicorecommon-hasend\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Given an interval, returns true if the interval has an ending boundary specified\n(i.e. the end of the interval is not null and not the maximum DateTime value)\n*/\ndefine fluent function hasEnd(period Interval&lt;DateTime&gt; ):\n  not (\n    end of period is null\n      or end of period = maximum DateTime\n  )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"qicorecommon-prevalenceinterval\"> </a>\n    \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*/\ndefine fluent function prevalenceInterval(condition Choice&lt;&quot;ConditionEncounterDiagnosis&quot;, &quot;ConditionProblemsHealthConcerns&quot;&gt;):\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 condition.onset.toInterval(), end of condition.abatementInterval()]\nelse\n    (end of condition.abatementInterval()) abatementDate\n    return if abatementDate is null then\n      Interval[start of condition.onset.toInterval(), abatementDate)\n    else\n      Interval[start of condition.onset.toInterval(), abatementDate]</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"qicorecommon-abatementinterval\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Returns an interval representing the normalized abatement of a given Condition.\n@comment: If the abatement element of the Condition is represented as a DateTime, the result\nis an interval beginning and ending on that DateTime.\nIf the abatement is represented as a Quantity, the quantity is expected to be a calendar-duration and is interpreted as the age of the patient. The\nresult is an interval from the date the patient turned that age to immediately before one year later.\nIf the abatement is represented as a Quantity Interval, the quantities are expected to be calendar-durations and are interpreted as an age range during\nwhich the abatement occurred. The result is an interval from the date the patient turned the starting age of the quantity interval, and ending immediately\nbefore one year later than the date the patient turned the ending age of the quantity interval.\n*/\ndefine fluent function abatementInterval(condition Choice&lt;&quot;ConditionEncounterDiagnosis&quot;, &quot;ConditionProblemsHealthConcerns&quot;&gt;):\n\tif condition.abatement is DateTime then\n\t  Interval[condition.abatement as DateTime, condition.abatement as DateTime]\n\telse if condition.abatement is Quantity then\n\t\tInterval[Patient.birthDate + (condition.abatement as Quantity),\n\t\t\tPatient.birthDate + (condition.abatement as Quantity) + 1 year)\n\telse if condition.abatement is Interval&lt;Quantity&gt; then\n\t  Interval[Patient.birthDate + (condition.abatement.low as Quantity),\n\t\t  Patient.birthDate + (condition.abatement.high as Quantity) + 1 year)\n\telse if condition.abatement is Interval&lt;DateTime&gt; then\n\t  Interval[condition.abatement.low, condition.abatement.high)\n\telse null as Interval&lt;DateTime&gt;</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"qicorecommon-references\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Returns true if the given reference is to the given resourceId\n@comment: Returns true if the `resourceId` parameter exactly equals the tail of the given reference.\nNOTE: This function assumes resources from the same source server.\n*/\ndefine fluent function references(reference Reference, resourceId String):\n  resourceId = Last(Split(reference.reference, '/'))</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"qicorecommon-earliest\"> </a>\n    \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*/\ndefine fluent function earliest(choice Choice&lt;DateTime, Quantity, Interval&lt;DateTime&gt;, Interval&lt;Quantity&gt;&gt; ):\n  (choice.toInterval()) period\n    return\n      if (period.&quot;hasStart&quot;()) then start of period\n      else end of period</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\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    \n    \n    \n    \n      <a name=\"qicorecommon-hasstart\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Given an interval, return true if the interval has a starting boundary specified\n(i.e. the start of the interval is not null and not the minimum DateTime value)\n*/\ndefine fluent function hasStart(period Interval&lt;DateTime&gt; ):\n  not ( start of period is null\n      or start of period = minimum DateTime\n  )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n\n        \n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-initial-population\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Initial Population&quot;:\n  [Encounter: &quot;Encounter Inpatient&quot;] EncounterInpatient\n    where EncounterInpatient.period ends during day of &quot;Measurement Period&quot;\n      and AgeInYearsAt(date from start of EncounterInpatient.period) &gt;= 18\n      and ( duration in hours of EncounterInpatient.period &gt;= 24 )\n      and EncounterInpatient.status = 'finished'</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-measure-population\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Measure Population&quot;:\n  &quot;Initial Population&quot;</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-encounters-with-discharge-for-hospice-care\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Encounters with Discharge for Hospice Care&quot;:\n  &quot;Measure Population&quot; QualifyingEncounter\n    where QualifyingEncounter.hospitalization.dischargeDisposition in &quot;Hospice Care Referral or Admission&quot;</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-intervention-hospice-care\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*define &quot;Intervention Hospice Care&quot;:\n    ( [&quot;ServiceRequest&quot;: &quot;Hospice Status&quot;] HospiceStatusOrder\n    where HospiceStatusOrder.status in { 'active', 'completed', 'on-hold' }\n        and HospiceStatusOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }\n  )\n    union ( [&quot;Procedure&quot;: &quot;Hospice Status&quot;] HospiceStatusPerformed\n            where HospiceStatusPerformed.status in { 'completed', 'in-progress' } \n           )\n\ndefine &quot;Encounters with Hospice during Eligible Encounter&quot;:\n    &quot;Measure Population&quot; QualifyingEncounter\n    with &quot;Intervention Hospice Care&quot; HospiceStatus\n            such that Coalesce (start of HospiceStatus.performed.toInterval(), HospiceStatus.authoredOn) during day of QualifyingEncounter.hospitalizationWithObservation ( )\n*/\n//Testing definitions based on Codev comment\n\n\n\ndefine &quot;Intervention Hospice Care&quot;:\n  ( [&quot;ServiceRequest&quot;: &quot;Hospice Status&quot;] HospiceStatusOrder\n      where HospiceStatusOrder.status in { 'active', 'completed', 'on-hold' }\n        and HospiceStatusOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }\n      return HospiceStatusOrder.authoredOn\n  )\n    union ( [&quot;Procedure&quot;: &quot;Hospice Status&quot;] HospiceStatusPerformed\n        where HospiceStatusPerformed.status in { 'completed', 'in-progress' }\n        return start of HospiceStatusPerformed.performed.toInterval ( )\n    )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-encounters-with-hospice-during-eligible-encounter\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Encounters with Hospice during Eligible Encounter&quot;:\n  &quot;Measure Population&quot; QualifyingEncounter\n    with &quot;Intervention Hospice Care&quot; HospiceStatusDate\n      such that HospiceStatusDate during day of QualifyingEncounter.hospitalizationWithObservation ( )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-measure-population-exclusion\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Measure Population Exclusion&quot;:\n  &quot;Encounters with Discharge for Hospice Care&quot;\n    union &quot;Encounters with Hospice during Eligible Encounter&quot;</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-sde-race\"> </a>\n    \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\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-sde-sex\"> </a>\n    \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\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-encounters-with-malnutrition-risk-screening-not-at-risk\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Encounters with Malnutrition Risk Screening Not At Risk&quot;:\n  &quot;Measure Population&quot; QualifyingEncounter\n    with [&quot;ObservationScreeningAssessment&quot;: &quot;Malnutrition Risk Screening&quot;] MalnutritionRiskScreening\n      such that MalnutritionRiskScreening.status in { 'final', 'amended', 'corrected' }\n        and MalnutritionRiskScreening.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\n        and ( MalnutritionRiskScreening.value as Concept in &quot;Malnutrition Screening Finding of Not At Risk Result&quot; )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-encounters-with-malnutrition-risk-screening-at-risk\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Encounters with Malnutrition Risk Screening At Risk&quot;:\n  &quot;Measure Population&quot; QualifyingEncounter\n    with [&quot;ObservationScreeningAssessment&quot;: &quot;Malnutrition Risk Screening&quot;] MalnutritionRiskScreening\n      such that MalnutritionRiskScreening.status in { 'final', 'amended', 'corrected' }\n        and MalnutritionRiskScreening.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\n        and ( MalnutritionRiskScreening.value as Concept in &quot;Malnutrition Screening Finding of At Risk Result&quot; )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-encounters-with-malnutrition-risk-screening\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Encounters with Malnutrition Risk Screening&quot;:\n  &quot;Encounters with Malnutrition Risk Screening Not At Risk&quot;\n    union &quot;Encounters with Malnutrition Risk Screening At Risk&quot;</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-intervention-dietitian-referral\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*define &quot;Intervention Dietitian Referral&quot;:\n( [&quot;ServiceRequest&quot;: &quot;Dietitian Referral&quot;] DietitianReferralOrder\n    where DietitianReferralOrder.status in { 'active', 'completed', 'on-hold' }\n        and DietitianReferralOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }\n  \n  )\n    union ( [&quot;Procedure&quot;: &quot;Dietitian Referral&quot;] DietitianReferralPerformed\n            where DietitianReferralPerformed.status in { 'completed', 'in-progress' } \n           )\n\ndefine &quot;Encounters with Dietitian Referral&quot;:\n    &quot;Measure Population&quot; QualifyingEncounter\n    with &quot;Intervention Dietitian Referral&quot; DietitianReferral\n            such that Coalesce (start of DietitianReferral.performed.toInterval(), DietitianReferral.authoredOn) during day of QualifyingEncounter.hospitalizationWithObservation ( )\n*/\n//New definition from Codev comments\n\n\n\ndefine &quot;Intervention Dietitian Referral&quot;:\n  ( [&quot;ServiceRequest&quot;: &quot;Dietitian Referral&quot;] DietitianReferralOrder\n      where DietitianReferralOrder.status in { 'active', 'completed', 'on-hold' }\n        and DietitianReferralOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }\n      return DietitianReferralOrder.authoredOn\n  )\n    union ( [&quot;Procedure&quot;: &quot;Dietitian Referral&quot;] DietitianReferralPerformed\n        where DietitianReferralPerformed.status in { 'completed', 'in-progress' }\n        return start of DietitianReferralPerformed.performed.toInterval ( )\n    )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-encounters-with-dietitian-referral\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Encounters with Dietitian Referral&quot;:\n  &quot;Measure Population&quot; QualifyingEncounter\n    with &quot;Intervention Dietitian Referral&quot; DietitianReferralDate\n      such that DietitianReferralDate during day of QualifyingEncounter.hospitalizationWithObservation ( )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-encounters-with-malnutrition-risk-screening-or-with-dietitian-referral\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Encounters with Malnutrition Risk Screening or with Dietitian Referral&quot;:\n  &quot;Encounters with Malnutrition Risk Screening&quot;\n    union &quot;Encounters with Dietitian Referral&quot;</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-encounters-with-malnutrition-not-at-risk-screening-and-without-dietitian-referral\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Encounters with Malnutrition Not At Risk Screening and without Dietitian Referral&quot;:\n  &quot;Encounters with Malnutrition Risk Screening Not At Risk&quot;\n    except &quot;Encounters with Dietitian Referral&quot;</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-encounters-with-malnutrition-risk-screening-at-risk-or-with-dietitian-referral\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral&quot;:\n  &quot;Encounters with Malnutrition Risk Screening At Risk&quot;\n    union &quot;Encounters with Dietitian Referral&quot;</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-encounter-with-most-recent-nutrition-assessment-and-identified-status\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Encounter With Most Recent Nutrition Assessment And Identified Status&quot;:\n  &quot;Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral&quot; QualifyingEncounter\n    with [&quot;ObservationScreeningAssessment&quot;: &quot;Nutrition Assessment&quot;] NutritionAssessment\n      such that ( NutritionAssessment.status in { 'final', 'amended', 'corrected' }\n          and NutritionAssessment.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\n          and ( NutritionAssessment.value as Concept in &quot;Nutrition Assessment Status Finding of Well Nourished or Not Malnourished or Mildly Malnourished&quot;\n              or ( NutritionAssessment.value as Concept in &quot;Nutrition Assessment Status Finding of Moderately Malnourished&quot; )\n              or ( NutritionAssessment.value as Concept in &quot;Nutrition Assessment Status Finding of Severely Malnourished&quot; )\n          )\n          and NutritionAssessment.effective.latest ( ) same day as &quot;Last Nutrition Assessment Day During Encounter&quot;(QualifyingEncounter)\n      )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-has-malnutrition-diagnosis\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Has Malnutrition Diagnosis&quot;:\n  [ConditionProblemsHealthConcerns: &quot;Malnutrition Diagnosis&quot;] MalnutritionDiagnosis\n    where MalnutritionDiagnosis.prevalenceInterval ( ) overlaps &quot;Measurement Period&quot;\n      and MalnutritionDiagnosis.isVerified ( )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-encounters-with-encounter-diagnosis-of-malnutrition-diagnosis\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Encounters With Encounter Diagnosis Of Malnutrition Diagnosis&quot;:\n  &quot;Measure Population&quot; QualifyingEncounter\n    where QualifyingEncounter.reasonCode in &quot;Malnutrition Diagnosis&quot;\n      or QualifyingEncounter.encounterDiagnosis ( ).verified ( ).code in &quot;Malnutrition Diagnosis&quot;</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-encounters-with-malnutrition-diagnosis\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Encounters with Malnutrition Diagnosis&quot;:\n  ( &quot;Measure Population&quot; QualifyingEncounter\n      where exists ( &quot;Has Malnutrition Diagnosis&quot; MalnutritionDiagnosis\n          where MalnutritionDiagnosis.prevalenceInterval ( ) overlaps day of QualifyingEncounter.hospitalizationWithObservation ( )\n      )\n  )\n    union &quot;Encounters With Encounter Diagnosis Of Malnutrition Diagnosis&quot;</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-encounter-with-most-recent-nutrition-assessment-status-of-not-or-mildly-malnourished\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Encounter With Most Recent Nutrition Assessment Status of Not or Mildly Malnourished&quot;:\n  &quot;Measure Population&quot; QualifyingEncounter\n    with [&quot;ObservationScreeningAssessment&quot;: &quot;Nutrition Assessment&quot;] NutritionAssessment\n      such that ( NutritionAssessment.status in { 'final', 'amended', 'corrected' }\n          and NutritionAssessment.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\n          and ( NutritionAssessment.value as Concept in &quot;Nutrition Assessment Status Finding of Well Nourished or Not Malnourished or Mildly Malnourished&quot; )\n          and NutritionAssessment.effective.latest ( ) same day as &quot;Last Nutrition Assessment Day During Encounter&quot;(QualifyingEncounter)\n      )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-encounter-with-most-recent-nutrition-assessment-status-of-moderately-or-severely-malnourished\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Encounter With Most Recent Nutrition Assessment Status of Moderately Or Severely Malnourished&quot;:\n  &quot;Measure Population&quot; QualifyingEncounter\n    with [&quot;ObservationScreeningAssessment&quot;: &quot;Nutrition Assessment&quot;] NutritionAssessment\n      such that NutritionAssessment.status in { 'final', 'amended', 'corrected' }\n        and NutritionAssessment.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\n        and ( NutritionAssessment.value as Concept in &quot;Nutrition Assessment Status Finding of Moderately Malnourished&quot;\n            or NutritionAssessment.value as Concept in &quot;Nutrition Assessment Status Finding of Severely Malnourished&quot;\n        )\n        and NutritionAssessment.effective.latest ( ) same day as &quot;Last Nutrition Assessment Day During Encounter&quot;(QualifyingEncounter)</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-encounters-with-nutrition-care-plan\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Encounters with Nutrition Care Plan&quot;:\n  &quot;Measure Population&quot; QualifyingEncounter\n    with [&quot;Procedure&quot;: &quot;Nutrition Care Plan&quot;] NutritionCarePlan\n      such that NutritionCarePlan.status in { 'completed', 'in-progress' }\n        and NutritionCarePlan.performed.earliest ( ) during QualifyingEncounter.hospitalizationWithObservation ( )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-sde-payer-type\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;SDE Payer Type&quot;:\n  SDE.&quot;SDE Payer&quot;</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-sde-ethnicity\"> </a>\n    \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\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-measure-observation-1\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function &quot;Measure Observation 1&quot;(MalnutritionRiskScreening Encounter):\n  if &quot;Encounters with Malnutrition Risk Screening or with Dietitian Referral&quot; contains MalnutritionRiskScreening then 1 \n    else 0</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-measure-observation-total-malnutrition-components-score\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function &quot;Measure Observation Total Malnutrition Components Score&quot;(QualifyingEncounter Encounter):\n  Sum({ &quot;Measure Observation 1&quot;(QualifyingEncounter), &quot;Measure Observation 2&quot;(QualifyingEncounter), &quot;Measure Observation 3&quot;(QualifyingEncounter), &quot;Measure Observation 4&quot;(QualifyingEncounter) })</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-measure-observation-2\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function &quot;Measure Observation 2&quot;(NutritionAssessment Encounter):\n  if &quot;Encounters with Malnutrition Not At Risk Screening and without Dietitian Referral&quot; contains NutritionAssessment then 0 \n    else if &quot;Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral&quot; contains NutritionAssessment then if &quot;Encounter With Most Recent Nutrition Assessment And Identified Status&quot; contains NutritionAssessment then 1 \n    else 0 \n    else 0</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-last-nutrition-assessment-day-during-encounter\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*define function &quot;Last Nutrition Assessment Day During Encounter&quot;(QualifyingEncounter Encounter):\n  Max(&quot;Nutrition Assessment Performed&quot; NutritionAssessmentTuple\n    where NutritionAssessmentTuple.HospEncId = QualifyingEncounter.id\n    return NutritionAssessmentTuple.NutrAssessTimingLatest\n  )\n\ndefine &quot;Nutrition Assessment Performed&quot;:\n    from\n    &quot;Measure Population&quot; QualifyingEncounter,\n    [&quot;ObservationScreeningAssessment&quot;: &quot;Nutrition Assessment&quot;] NutritionAssessment\n        where NutritionAssessment.status in { 'final', 'amended', 'corrected' }\n            and NutritionAssessment.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\n            and NutritionAssessment.value is not null\n            return Tuple {\n        HospEncId: QualifyingEncounter.id,\n        NutrAssessTimingLatest: NutritionAssessment.effective.latest()\n        }\n*/\n//Test definition per CODev feedback\n\n\n\ndefine function &quot;Last Nutrition Assessment Day During Encounter&quot;(QualifyingEncounter Encounter):\n  Max([&quot;ObservationScreeningAssessment&quot;: &quot;Nutrition Assessment&quot;] NutritionAssessment\n      where NutritionAssessment.status in { 'final', 'amended', 'corrected' }\n        and NutritionAssessment.effective.toInterval() during QualifyingEncounter.hospitalizationWithObservation()\n        and NutritionAssessment.value is not null\n      return NutritionAssessment.effective.latest()\n  )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-measure-observation-3\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function &quot;Measure Observation 3&quot;(MalnutritionDiagnosis Encounter):\n  if &quot;Encounters with Malnutrition Not At Risk Screening and without Dietitian Referral&quot; contains MalnutritionDiagnosis then 0 \n    else if &quot;Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral&quot; contains MalnutritionDiagnosis then if &quot;Encounters with Malnutrition Diagnosis&quot; contains MalnutritionDiagnosis then if &quot;Encounter With Most Recent Nutrition Assessment Status of Not or Mildly Malnourished&quot; contains MalnutritionDiagnosis then 0 \n    else if &quot;Encounter With Most Recent Nutrition Assessment Status of Moderately Or Severely Malnourished&quot; contains MalnutritionDiagnosis then 1 \n    else 0 \n    else 0 \n    else 0</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-isverified\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define fluent function isVerified(condition Choice&lt;QICore.ConditionProblemsHealthConcerns, QICore.ConditionEncounterDiagnosis&gt;):\n  condition.verificationStatus is not null implies ( condition.verificationStatus ~ QICoreCommon.&quot;confirmed&quot;\n      or condition.verificationStatus ~ QICoreCommon.&quot;unconfirmed&quot;\n      or condition.verificationStatus ~ QICoreCommon.&quot;provisional&quot;\n      or condition.verificationStatus ~ QICoreCommon.&quot;differential&quot;\n  )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-measure-observation-4\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function &quot;Measure Observation 4&quot;(NutritionCarePlan Encounter):\n  if &quot;Encounters with Malnutrition Not At Risk Screening and without Dietitian Referral&quot; contains NutritionCarePlan then 0 \n    else if &quot;Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral&quot; contains NutritionCarePlan then if &quot;Encounters with Nutrition Care Plan&quot; contains NutritionCarePlan then if &quot;Encounter With Most Recent Nutrition Assessment Status of Not or Mildly Malnourished&quot; contains NutritionCarePlan then 0 \n    else if &quot;Encounter With Most Recent Nutrition Assessment Status of Moderately Or Severely Malnourished&quot; contains NutritionCarePlan then 1 \n    else 0 \n    else 0 \n    else 0</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-measure-observation-total-malnutrition-care-score-as-percentage\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function &quot;Measure Observation Total Malnutrition Care Score as Percentage&quot;(QualifyingEncounter Encounter):\n  100 * ( &quot;Measure Observation Total Malnutrition Components Score&quot;(QualifyingEncounter) / &quot;Total Malnutrition Care Score Eligible Occurrences&quot;(QualifyingEncounter) )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CMS986FHIRMalnutritionScore</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cms986fhirmalnutritionscore-total-malnutrition-care-score-eligible-occurrences\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function &quot;Total Malnutrition Care Score Eligible Occurrences&quot;(QualifyingEncounter Encounter):\n  if &quot;Encounters with Malnutrition Risk Screening or with Dietitian Referral&quot; contains QualifyingEncounter\n    and &quot;Encounters with Malnutrition Risk Screening Not At Risk&quot; contains QualifyingEncounter\n    and not ( &quot;Encounters with Dietitian Referral&quot; contains QualifyingEncounter ) then 1 \n    else if ( &quot;Encounters with Malnutrition Risk Screening or with Dietitian Referral&quot; contains QualifyingEncounter\n      and &quot;Encounters with Malnutrition Risk Screening At Risk&quot; contains QualifyingEncounter\n      or &quot;Encounters with Dietitian Referral&quot; contains QualifyingEncounter\n  )\n    and &quot;Encounter With Most Recent Nutrition Assessment Status of Not or Mildly Malnourished&quot; contains QualifyingEncounter\n    or not ( &quot;Encounter With Most Recent Nutrition Assessment And Identified Status&quot; contains QualifyingEncounter ) then 2 \n    else 4</code></pre>\n  </td>\n\n</tr>\n\n\n\n\n\n  \n  \n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"terminology\"> </a>Terminology</th>\n\n\n</tr>\n  \n  \n  \n\n \n\n \n\n \n\n \n\n \n\n \n\n\n<tr>\n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Code System</th>\n\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system SNOMEDCT\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: http://snomed.info/sct\n    <br/>\n    <em>Canonical URL</em>: <tt>http://snomed.info/sct</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Code System</th>\n\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system ConditionClinicalStatusCodes\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: http://terminology.hl7.org/CodeSystem/condition-clinical\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Code System</th>\n\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system ConditionVerificationStatusCodes\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: http://terminology.hl7.org/CodeSystem/condition-ver-status\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-ver-status</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\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>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307\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\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Hospice Care Referral or Admission\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1116.365\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1116.365</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Hospice Status\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.101\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.101</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\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>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143\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\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\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>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292\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\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Malnutrition Risk Screening\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.92\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.92</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Malnutrition Screening Finding of Not At Risk Result\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.34\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.34</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Malnutrition Screening Finding of At Risk Result\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.89\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.89</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Dietitian Referral\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.91\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.91</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Nutrition Assessment\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.21\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.21</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Nutrition Assessment Status Finding of Well Nourished or Not Malnourished or Mildly Malnourished\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.96\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.96</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Nutrition Assessment Status Finding of Moderately Malnourished\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.47\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.47</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Nutrition Assessment Status Finding of Severely Malnourished\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.43\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.43</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Malnutrition Diagnosis\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.55\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.55</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Nutrition Care Plan\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.93\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.93</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\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>: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591\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  \n  <tr>\n    <th scope=\"row\" class=\"row-header\">Direct Reference Code</th>\n    <td class=\"content-container\">\n      \n        <em>Display</em>: Male (finding)\n        <br/>\n      \n      <em>Code</em>: 248153007\n      <br/>\n      <em>System</em>: <tt>http://snomed.info/sct</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 (finding)\n        <br/>\n      \n      <em>Code</em>: 248152002\n      <br/>\n      <em>System</em>: <tt>http://snomed.info/sct</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>: Active\n        <br/>\n      \n      <em>Code</em>: active\n      <br/>\n      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical</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>: Recurrence\n        <br/>\n      \n      <em>Code</em>: recurrence\n      <br/>\n      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical</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>: Relapse\n        <br/>\n      \n      <em>Code</em>: relapse\n      <br/>\n      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical</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>: Confirmed\n        <br/>\n      \n      <em>Code</em>: confirmed\n      <br/>\n      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-ver-status</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>: Unconfirmed\n        <br/>\n      \n      <em>Code</em>: unconfirmed\n      <br/>\n      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-ver-status</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>: Provisional\n        <br/>\n      \n      <em>Code</em>: provisional\n      <br/>\n      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-ver-status</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>: Differential\n        <br/>\n      \n      <em>Code</em>: differential\n      <br/>\n      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-ver-status</tt>\n    </td>\n  </tr>\n\n  \n  \n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"dependencies\"> </a>Dependencies</th>\n\n\n</tr>\n  \n  \n  \n\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  <td class=\"content-container\">\n    \n    <em>Description</em>: QICore model information\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: http://hl7.org/fhir/Library/QICore-ModelInfo\n    <br/>\n    <em>Canonical URL</em>: <tt>http://hl7.org/fhir/Library/QICore-ModelInfo</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\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>: https://madie.cms.gov/Library/FHIRHelpers|4.4.000\n    <br/>\n    <em>Canonical URL</em>: <tt>https://madie.cms.gov/Library/FHIRHelpers|4.4.000</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\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>: https://madie.cms.gov/Library/QICoreCommon|4.0.000\n    <br/>\n    <em>Canonical URL</em>: <tt>https://madie.cms.gov/Library/QICoreCommon|4.0.000</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\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>: https://madie.cms.gov/Library/CQMCommon|4.1.000\n    <br/>\n    <em>Canonical URL</em>: <tt>https://madie.cms.gov/Library/CQMCommon|4.1.000</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\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>: https://madie.cms.gov/Library/SupplementalDataElements|5.1.000\n    <br/>\n    <em>Canonical URL</em>: <tt>https://madie.cms.gov/Library/SupplementalDataElements|5.1.000</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  <td class=\"content-container\">\n    \n    <em>Description</em>: Library Status\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: https://madie.cms.gov/Library/Status|1.15.000\n    <br/>\n    <em>Canonical URL</em>: <tt>https://madie.cms.gov/Library/Status|1.15.000</tt>\n    \n  </td>\n</tr>\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n\n  \n  \n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"data-requirements\"> </a>Data Requirements</th>\n\n\n</tr>\n  \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    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: birthDate, birthDate.value, url, extension\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    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter\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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143\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>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter\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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292\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>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, period, status, status.value, hospitalization, hospitalization.dischargeDisposition, reasonCode\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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307\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>: ServiceRequest\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, status, status.value, intent, intent.value, authoredOn, authoredOn.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.101\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>: ServiceRequest\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, status, status.value, intent, intent.value, authoredOn, authoredOn.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.91\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>: Procedure\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, status, status.value, performed\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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.101\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>: Procedure\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, status, status.value, performed\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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.91\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>: Procedure\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, status, status.value, performed\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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.93\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    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-screening-assessment\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, status, status.value, effective, 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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.92\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    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-screening-assessment\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, status, status.value, effective, 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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.21\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>: Condition\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns\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>: Condition\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns\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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.55\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>: Condition\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-encounter-diagnosis\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    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage\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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n  \n  \n\n<tr>\n  <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.4.9 of the sample-content-ig Liquid templates</th>\n</tr>\n\n    </tbody>\n  </table>\n</div>"
      },
      "contained": [ {
        "resourceType": "Library",
        "id": "effective-data-requirements",
        "extension": [ {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
          "valueCoding": {
            "system": "http://snomed.info/sct",
            "code": "248153007",
            "display": "Male (finding)"
          }
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
          "valueCoding": {
            "system": "http://snomed.info/sct",
            "code": "248152002",
            "display": "Female (finding)"
          }
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
          "valueCoding": {
            "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
            "code": "active",
            "display": "Active"
          }
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
          "valueCoding": {
            "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
            "code": "recurrence",
            "display": "Recurrence"
          }
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
          "valueCoding": {
            "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
            "code": "relapse",
            "display": "Relapse"
          }
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
          "valueCoding": {
            "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
            "code": "confirmed",
            "display": "Confirmed"
          }
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
          "valueCoding": {
            "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
            "code": "unconfirmed",
            "display": "Unconfirmed"
          }
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
          "valueCoding": {
            "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
            "code": "provisional",
            "display": "Provisional"
          }
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
          "valueCoding": {
            "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
            "code": "differential",
            "display": "Differential"
          }
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Initial Population"
          }, {
            "url": "statement",
            "valueString": "define \"Initial Population\":\n  [Encounter: \"Encounter Inpatient\"] EncounterInpatient\n    where EncounterInpatient.period ends during day of \"Measurement Period\"\n      and AgeInYearsAt(date from start of EncounterInpatient.period) >= 18\n      and ( duration in hours of EncounterInpatient.period >= 24 )\n      and EncounterInpatient.status = 'finished'"
          }, {
            "url": "displaySequence",
            "valueInteger": 0
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Measure Population"
          }, {
            "url": "statement",
            "valueString": "define \"Measure Population\":\n  \"Initial Population\""
          }, {
            "url": "displaySequence",
            "valueInteger": 1
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Encounters with Discharge for Hospice Care"
          }, {
            "url": "statement",
            "valueString": "define \"Encounters with Discharge for Hospice Care\":\n  \"Measure Population\" QualifyingEncounter\n    where QualifyingEncounter.hospitalization.dischargeDisposition in \"Hospice Care Referral or Admission\""
          }, {
            "url": "displaySequence",
            "valueInteger": 2
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Intervention Hospice Care"
          }, {
            "url": "statement",
            "valueString": "/*define \"Intervention Hospice Care\":\n    ( [\"ServiceRequest\": \"Hospice Status\"] HospiceStatusOrder\n    where HospiceStatusOrder.status in { 'active', 'completed', 'on-hold' }\n        and HospiceStatusOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }\n  )\n    union ( [\"Procedure\": \"Hospice Status\"] HospiceStatusPerformed\n            where HospiceStatusPerformed.status in { 'completed', 'in-progress' } \n           )\n\ndefine \"Encounters with Hospice during Eligible Encounter\":\n    \"Measure Population\" QualifyingEncounter\n    with \"Intervention Hospice Care\" HospiceStatus\n            such that Coalesce (start of HospiceStatus.performed.toInterval(), HospiceStatus.authoredOn) during day of QualifyingEncounter.hospitalizationWithObservation ( )\n*/\n//Testing definitions based on Codev comment\n\n\n\ndefine \"Intervention Hospice Care\":\n  ( [\"ServiceRequest\": \"Hospice Status\"] HospiceStatusOrder\n      where HospiceStatusOrder.status in { 'active', 'completed', 'on-hold' }\n        and HospiceStatusOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }\n      return HospiceStatusOrder.authoredOn\n  )\n    union ( [\"Procedure\": \"Hospice Status\"] HospiceStatusPerformed\n        where HospiceStatusPerformed.status in { 'completed', 'in-progress' }\n        return start of HospiceStatusPerformed.performed.toInterval ( )\n    )"
          }, {
            "url": "displaySequence",
            "valueInteger": 3
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Encounters with Hospice during Eligible Encounter"
          }, {
            "url": "statement",
            "valueString": "define \"Encounters with Hospice during Eligible Encounter\":\n  \"Measure Population\" QualifyingEncounter\n    with \"Intervention Hospice Care\" HospiceStatusDate\n      such that HospiceStatusDate during day of QualifyingEncounter.hospitalizationWithObservation ( )"
          }, {
            "url": "displaySequence",
            "valueInteger": 4
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Measure Population Exclusion"
          }, {
            "url": "statement",
            "valueString": "define \"Measure Population Exclusion\":\n  \"Encounters with Discharge for Hospice Care\"\n    union \"Encounters with Hospice during Eligible Encounter\""
          }, {
            "url": "displaySequence",
            "valueInteger": 5
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "SupplementalDataElements"
          }, {
            "url": "name",
            "valueString": "SDE Race"
          }, {
            "url": "statement",
            "valueString": "define \"SDE Race\":\n  Patient.race R\n    return Tuple {\n      codes: R.ombCategory union R.detailed,\n      display: R.text\n    }"
          }, {
            "url": "displaySequence",
            "valueInteger": 6
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "SDE Race"
          }, {
            "url": "statement",
            "valueString": "define \"SDE Race\":\n  SDE.\"SDE Race\""
          }, {
            "url": "displaySequence",
            "valueInteger": 7
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "SupplementalDataElements"
          }, {
            "url": "name",
            "valueString": "SDE Sex"
          }, {
            "url": "statement",
            "valueString": "define \"SDE Sex\":\n  case\n    when Patient.sex = '248153007' then \"Male (finding)\"\n    when Patient.sex = '248152002' then \"Female (finding)\"\n    else null\n  end"
          }, {
            "url": "displaySequence",
            "valueInteger": 8
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "SDE Sex"
          }, {
            "url": "statement",
            "valueString": "define \"SDE Sex\":\n  SDE.\"SDE Sex\""
          }, {
            "url": "displaySequence",
            "valueInteger": 9
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Encounters with Malnutrition Risk Screening Not At Risk"
          }, {
            "url": "statement",
            "valueString": "define \"Encounters with Malnutrition Risk Screening Not At Risk\":\n  \"Measure Population\" QualifyingEncounter\n    with [\"ObservationScreeningAssessment\": \"Malnutrition Risk Screening\"] MalnutritionRiskScreening\n      such that MalnutritionRiskScreening.status in { 'final', 'amended', 'corrected' }\n        and MalnutritionRiskScreening.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\n        and ( MalnutritionRiskScreening.value as Concept in \"Malnutrition Screening Finding of Not At Risk Result\" )"
          }, {
            "url": "displaySequence",
            "valueInteger": 10
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Encounters with Malnutrition Risk Screening At Risk"
          }, {
            "url": "statement",
            "valueString": "define \"Encounters with Malnutrition Risk Screening At Risk\":\n  \"Measure Population\" QualifyingEncounter\n    with [\"ObservationScreeningAssessment\": \"Malnutrition Risk Screening\"] MalnutritionRiskScreening\n      such that MalnutritionRiskScreening.status in { 'final', 'amended', 'corrected' }\n        and MalnutritionRiskScreening.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\n        and ( MalnutritionRiskScreening.value as Concept in \"Malnutrition Screening Finding of At Risk Result\" )"
          }, {
            "url": "displaySequence",
            "valueInteger": 11
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Encounters with Malnutrition Risk Screening"
          }, {
            "url": "statement",
            "valueString": "define \"Encounters with Malnutrition Risk Screening\":\n  \"Encounters with Malnutrition Risk Screening Not At Risk\"\n    union \"Encounters with Malnutrition Risk Screening At Risk\""
          }, {
            "url": "displaySequence",
            "valueInteger": 12
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Intervention Dietitian Referral"
          }, {
            "url": "statement",
            "valueString": "/*define \"Intervention Dietitian Referral\":\n( [\"ServiceRequest\": \"Dietitian Referral\"] DietitianReferralOrder\n    where DietitianReferralOrder.status in { 'active', 'completed', 'on-hold' }\n        and DietitianReferralOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }\n  \n  )\n    union ( [\"Procedure\": \"Dietitian Referral\"] DietitianReferralPerformed\n            where DietitianReferralPerformed.status in { 'completed', 'in-progress' } \n           )\n\ndefine \"Encounters with Dietitian Referral\":\n    \"Measure Population\" QualifyingEncounter\n    with \"Intervention Dietitian Referral\" DietitianReferral\n            such that Coalesce (start of DietitianReferral.performed.toInterval(), DietitianReferral.authoredOn) during day of QualifyingEncounter.hospitalizationWithObservation ( )\n*/\n//New definition from Codev comments\n\n\n\ndefine \"Intervention Dietitian Referral\":\n  ( [\"ServiceRequest\": \"Dietitian Referral\"] DietitianReferralOrder\n      where DietitianReferralOrder.status in { 'active', 'completed', 'on-hold' }\n        and DietitianReferralOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }\n      return DietitianReferralOrder.authoredOn\n  )\n    union ( [\"Procedure\": \"Dietitian Referral\"] DietitianReferralPerformed\n        where DietitianReferralPerformed.status in { 'completed', 'in-progress' }\n        return start of DietitianReferralPerformed.performed.toInterval ( )\n    )"
          }, {
            "url": "displaySequence",
            "valueInteger": 13
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Encounters with Dietitian Referral"
          }, {
            "url": "statement",
            "valueString": "define \"Encounters with Dietitian Referral\":\n  \"Measure Population\" QualifyingEncounter\n    with \"Intervention Dietitian Referral\" DietitianReferralDate\n      such that DietitianReferralDate during day of QualifyingEncounter.hospitalizationWithObservation ( )"
          }, {
            "url": "displaySequence",
            "valueInteger": 14
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Encounters with Malnutrition Risk Screening or with Dietitian Referral"
          }, {
            "url": "statement",
            "valueString": "define \"Encounters with Malnutrition Risk Screening or with Dietitian Referral\":\n  \"Encounters with Malnutrition Risk Screening\"\n    union \"Encounters with Dietitian Referral\""
          }, {
            "url": "displaySequence",
            "valueInteger": 15
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Encounters with Malnutrition Not At Risk Screening and without Dietitian Referral"
          }, {
            "url": "statement",
            "valueString": "define \"Encounters with Malnutrition Not At Risk Screening and without Dietitian Referral\":\n  \"Encounters with Malnutrition Risk Screening Not At Risk\"\n    except \"Encounters with Dietitian Referral\""
          }, {
            "url": "displaySequence",
            "valueInteger": 16
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral"
          }, {
            "url": "statement",
            "valueString": "define \"Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral\":\n  \"Encounters with Malnutrition Risk Screening At Risk\"\n    union \"Encounters with Dietitian Referral\""
          }, {
            "url": "displaySequence",
            "valueInteger": 17
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Encounter With Most Recent Nutrition Assessment And Identified Status"
          }, {
            "url": "statement",
            "valueString": "define \"Encounter With Most Recent Nutrition Assessment And Identified Status\":\n  \"Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral\" QualifyingEncounter\n    with [\"ObservationScreeningAssessment\": \"Nutrition Assessment\"] NutritionAssessment\n      such that ( NutritionAssessment.status in { 'final', 'amended', 'corrected' }\n          and NutritionAssessment.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\n          and ( NutritionAssessment.value as Concept in \"Nutrition Assessment Status Finding of Well Nourished or Not Malnourished or Mildly Malnourished\"\n              or ( NutritionAssessment.value as Concept in \"Nutrition Assessment Status Finding of Moderately Malnourished\" )\n              or ( NutritionAssessment.value as Concept in \"Nutrition Assessment Status Finding of Severely Malnourished\" )\n          )\n          and NutritionAssessment.effective.latest ( ) same day as \"Last Nutrition Assessment Day During Encounter\"(QualifyingEncounter)\n      )"
          }, {
            "url": "displaySequence",
            "valueInteger": 18
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Has Malnutrition Diagnosis"
          }, {
            "url": "statement",
            "valueString": "define \"Has Malnutrition Diagnosis\":\n  [ConditionProblemsHealthConcerns: \"Malnutrition Diagnosis\"] MalnutritionDiagnosis\n    where MalnutritionDiagnosis.prevalenceInterval ( ) overlaps \"Measurement Period\"\n      and MalnutritionDiagnosis.isVerified ( )"
          }, {
            "url": "displaySequence",
            "valueInteger": 19
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Encounters With Encounter Diagnosis Of Malnutrition Diagnosis"
          }, {
            "url": "statement",
            "valueString": "define \"Encounters With Encounter Diagnosis Of Malnutrition Diagnosis\":\n  \"Measure Population\" QualifyingEncounter\n    where QualifyingEncounter.reasonCode in \"Malnutrition Diagnosis\"\n      or QualifyingEncounter.encounterDiagnosis ( ).verified ( ).code in \"Malnutrition Diagnosis\""
          }, {
            "url": "displaySequence",
            "valueInteger": 20
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Encounters with Malnutrition Diagnosis"
          }, {
            "url": "statement",
            "valueString": "define \"Encounters with Malnutrition Diagnosis\":\n  ( \"Measure Population\" QualifyingEncounter\n      where exists ( \"Has Malnutrition Diagnosis\" MalnutritionDiagnosis\n          where MalnutritionDiagnosis.prevalenceInterval ( ) overlaps day of QualifyingEncounter.hospitalizationWithObservation ( )\n      )\n  )\n    union \"Encounters With Encounter Diagnosis Of Malnutrition Diagnosis\""
          }, {
            "url": "displaySequence",
            "valueInteger": 21
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Encounter With Most Recent Nutrition Assessment Status of Not or Mildly Malnourished"
          }, {
            "url": "statement",
            "valueString": "define \"Encounter With Most Recent Nutrition Assessment Status of Not or Mildly Malnourished\":\n  \"Measure Population\" QualifyingEncounter\n    with [\"ObservationScreeningAssessment\": \"Nutrition Assessment\"] NutritionAssessment\n      such that ( NutritionAssessment.status in { 'final', 'amended', 'corrected' }\n          and NutritionAssessment.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\n          and ( NutritionAssessment.value as Concept in \"Nutrition Assessment Status Finding of Well Nourished or Not Malnourished or Mildly Malnourished\" )\n          and NutritionAssessment.effective.latest ( ) same day as \"Last Nutrition Assessment Day During Encounter\"(QualifyingEncounter)\n      )"
          }, {
            "url": "displaySequence",
            "valueInteger": 22
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Encounter With Most Recent Nutrition Assessment Status of Moderately Or Severely Malnourished"
          }, {
            "url": "statement",
            "valueString": "define \"Encounter With Most Recent Nutrition Assessment Status of Moderately Or Severely Malnourished\":\n  \"Measure Population\" QualifyingEncounter\n    with [\"ObservationScreeningAssessment\": \"Nutrition Assessment\"] NutritionAssessment\n      such that NutritionAssessment.status in { 'final', 'amended', 'corrected' }\n        and NutritionAssessment.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\n        and ( NutritionAssessment.value as Concept in \"Nutrition Assessment Status Finding of Moderately Malnourished\"\n            or NutritionAssessment.value as Concept in \"Nutrition Assessment Status Finding of Severely Malnourished\"\n        )\n        and NutritionAssessment.effective.latest ( ) same day as \"Last Nutrition Assessment Day During Encounter\"(QualifyingEncounter)"
          }, {
            "url": "displaySequence",
            "valueInteger": 23
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Encounters with Nutrition Care Plan"
          }, {
            "url": "statement",
            "valueString": "define \"Encounters with Nutrition Care Plan\":\n  \"Measure Population\" QualifyingEncounter\n    with [\"Procedure\": \"Nutrition Care Plan\"] NutritionCarePlan\n      such that NutritionCarePlan.status in { 'completed', 'in-progress' }\n        and NutritionCarePlan.performed.earliest ( ) during QualifyingEncounter.hospitalizationWithObservation ( )"
          }, {
            "url": "displaySequence",
            "valueInteger": 24
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "SupplementalDataElements"
          }, {
            "url": "name",
            "valueString": "SDE Payer"
          }, {
            "url": "statement",
            "valueString": "define \"SDE Payer\":\n  [Coverage: type in \"Payer Type\"] Payer\n    return {\n      code: Payer.type,\n      period: Payer.period\n    }"
          }, {
            "url": "displaySequence",
            "valueInteger": 25
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "SDE Payer Type"
          }, {
            "url": "statement",
            "valueString": "define \"SDE Payer Type\":\n  SDE.\"SDE Payer\""
          }, {
            "url": "displaySequence",
            "valueInteger": 26
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "SupplementalDataElements"
          }, {
            "url": "name",
            "valueString": "SDE Ethnicity"
          }, {
            "url": "statement",
            "valueString": "define \"SDE Ethnicity\":\n  Patient.ethnicity E\n    return Tuple {\n      codes: { E.ombCategory } union E.detailed,\n      display: E.text\n    }"
          }, {
            "url": "displaySequence",
            "valueInteger": 27
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "SDE Ethnicity"
          }, {
            "url": "statement",
            "valueString": "define \"SDE Ethnicity\":\n  SDE.\"SDE Ethnicity\""
          }, {
            "url": "displaySequence",
            "valueInteger": 28
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "FHIRHelpers"
          }, {
            "url": "name",
            "valueString": "ToInterval"
          }, {
            "url": "statement",
            "valueString": "/*\n@description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)\nvalue to a CQL DateTime Interval\n@comment: If the start value of the given period is unspecified, the starting\nboundary of the resulting interval will be open (meaning the start of the interval\nis unknown, as opposed to interpreted as the beginning of time).\n*/\ndefine function ToInterval(period FHIR.Period):\n    if period is null then\n        null\n    else\n        if period.\"start\" is null then\n            Interval(period.\"start\".value, period.\"end\".value]\n        else\n            Interval[period.\"start\".value, period.\"end\".value]"
          }, {
            "url": "displaySequence",
            "valueInteger": 29
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "QICoreCommon"
          }, {
            "url": "name",
            "valueString": "toInterval"
          }, {
            "url": "statement",
            "valueString": "/*\n@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval\n@comment: Normalizes a choice type of DateTime, Quanitty, Interval<DateTime>, or Interval<Quantity> types\nto an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible\nrepresentations for timing-valued elements in QICore, allowing this function to be used across any resource.\nThe input can be provided as a DateTime, Quantity, Interval<DateTime> or Interval<Quantity>.\nThe intent of this function is to provide a clear and concise mechanism to treat single\nelements that have multiple possible representations as intervals so that logic doesn't have to account\nfor the variability. More complex calculations (such as medication request period or dispense period\ncalculation) need specific guidance and consideration. That guidance may make use of this function, but\nthe focus of this function is on single element calculations where the semantics are unambiguous.\nIf the input is a DateTime, the result a DateTime Interval beginning and ending on that DateTime.\nIf the input is a Quantity, the quantity is expected to be a calendar-duration interpreted as an Age,\nand the result is a DateTime Interval beginning on the Date the patient turned that age and ending immediately before one year later.\nIf the input is a DateTime Interval, the result is the input.\nIf the input is a Quantity Interval, the quantities are expected to be calendar-durations interpreted as an Age, and the result\nis a DateTime Interval beginning on the date the patient turned the age given as the start of the quantity interval, and ending\nimmediately before one year later than the date the patient turned the age given as the end of the quantity interval.\nIf the input is a Timing, an error will be thrown indicating that Timing calculations are not implemented. Any other input will reslt in a null DateTime Interval\n*/\ndefine fluent function toInterval(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>, Timing>):\n  case\n\t  when choice is DateTime then\n    \tInterval[choice as DateTime, choice as DateTime]\n\t\twhen choice is Interval<DateTime> then\n  \t\tchoice as Interval<DateTime>\n\t\twhen choice is Quantity then\n\t\t  Interval[Patient.birthDate + (choice as Quantity),\n\t\t\t  Patient.birthDate + (choice as Quantity) + 1 year)\n\t\twhen choice is Interval<Quantity> then\n\t\t  Interval[Patient.birthDate + (choice.low as Quantity),\n\t\t\t  Patient.birthDate + (choice.high as Quantity) + 1 year)\n\t\twhen choice is Timing then\n      Message(null, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported') as Interval<DateTime>\n\t\telse\n\t\t\tnull as Interval<DateTime>\n\tend"
          }, {
            "url": "displaySequence",
            "valueInteger": 30
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CQMCommon"
          }, {
            "url": "name",
            "valueString": "hospitalizationWithObservation"
          }, {
            "url": "statement",
            "valueString": "/*\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*/\ndefine fluent function hospitalizationWithObservation(TheEncounter Encounter ):\n  TheEncounter Visit\n  \t\tlet ObsVisit: Last([Encounter: \"Observation Services\"] LastObs\n  \t\t\t\twhere LastObs.status = 'finished'\n            and LastObs.period ends 1 hour or less on or before start of Visit.period\n  \t\t\t\tsort by end of period\n  \t\t\t),\n  \t\t\tVisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),\n  \t\t\tEDVisit: Last([Encounter: \"Emergency Department Visit\"] LastED\n  \t\t\t\twhere LastED.status = 'finished'\n            and LastED.period ends 1 hour or less on or before VisitStart\n  \t\t\t\tsort by end of period\n  \t\t\t)\n  \t\treturn Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]"
          }, {
            "url": "displaySequence",
            "valueInteger": 31
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "FHIRHelpers"
          }, {
            "url": "name",
            "valueString": "ToString"
          }, {
            "url": "statement",
            "valueString": "define function ToString(value uri): value.value"
          }, {
            "url": "displaySequence",
            "valueInteger": 32
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "FHIRHelpers"
          }, {
            "url": "name",
            "valueString": "ToCode"
          }, {
            "url": "statement",
            "valueString": "/*\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        }"
          }, {
            "url": "displaySequence",
            "valueInteger": 33
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Measure Observation 1"
          }, {
            "url": "statement",
            "valueString": "define function \"Measure Observation 1\"(MalnutritionRiskScreening Encounter):\n  if \"Encounters with Malnutrition Risk Screening or with Dietitian Referral\" contains MalnutritionRiskScreening then 1 \n    else 0"
          }, {
            "url": "displaySequence",
            "valueInteger": 34
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Measure Observation Total Malnutrition Components Score"
          }, {
            "url": "statement",
            "valueString": "define function \"Measure Observation Total Malnutrition Components Score\"(QualifyingEncounter Encounter):\n  Sum({ \"Measure Observation 1\"(QualifyingEncounter), \"Measure Observation 2\"(QualifyingEncounter), \"Measure Observation 3\"(QualifyingEncounter), \"Measure Observation 4\"(QualifyingEncounter) })"
          }, {
            "url": "displaySequence",
            "valueInteger": 35
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Measure Observation 2"
          }, {
            "url": "statement",
            "valueString": "define function \"Measure Observation 2\"(NutritionAssessment Encounter):\n  if \"Encounters with Malnutrition Not At Risk Screening and without Dietitian Referral\" contains NutritionAssessment then 0 \n    else if \"Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral\" contains NutritionAssessment then if \"Encounter With Most Recent Nutrition Assessment And Identified Status\" contains NutritionAssessment then 1 \n    else 0 \n    else 0"
          }, {
            "url": "displaySequence",
            "valueInteger": 36
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "QICoreCommon"
          }, {
            "url": "name",
            "valueString": "latest"
          }, {
            "url": "statement",
            "valueString": "/*\n@description: Given an interval, returns the ending point if the interval has an ending boundary specified,\notherwise, returns the starting point\n*/\ndefine fluent function latest(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>> ):\n  (choice.toInterval()) period\n    return\n      if (period.\"hasEnd\"()) then end of period\n      else start of period"
          }, {
            "url": "displaySequence",
            "valueInteger": 37
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "QICoreCommon"
          }, {
            "url": "name",
            "valueString": "hasEnd"
          }, {
            "url": "statement",
            "valueString": "/*\n@description: Given an interval, returns true if the interval has an ending boundary specified\n(i.e. the end of the interval is not null and not the maximum DateTime value)\n*/\ndefine fluent function hasEnd(period Interval<DateTime> ):\n  not (\n    end of period is null\n      or end of period = maximum DateTime\n  )"
          }, {
            "url": "displaySequence",
            "valueInteger": 38
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Last Nutrition Assessment Day During Encounter"
          }, {
            "url": "statement",
            "valueString": "/*define function \"Last Nutrition Assessment Day During Encounter\"(QualifyingEncounter Encounter):\n  Max(\"Nutrition Assessment Performed\" NutritionAssessmentTuple\n    where NutritionAssessmentTuple.HospEncId = QualifyingEncounter.id\n    return NutritionAssessmentTuple.NutrAssessTimingLatest\n  )\n\ndefine \"Nutrition Assessment Performed\":\n    from\n    \"Measure Population\" QualifyingEncounter,\n    [\"ObservationScreeningAssessment\": \"Nutrition Assessment\"] NutritionAssessment\n        where NutritionAssessment.status in { 'final', 'amended', 'corrected' }\n            and NutritionAssessment.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\n            and NutritionAssessment.value is not null\n            return Tuple {\n        HospEncId: QualifyingEncounter.id,\n        NutrAssessTimingLatest: NutritionAssessment.effective.latest()\n        }\n*/\n//Test definition per CODev feedback\n\n\n\ndefine function \"Last Nutrition Assessment Day During Encounter\"(QualifyingEncounter Encounter):\n  Max([\"ObservationScreeningAssessment\": \"Nutrition Assessment\"] NutritionAssessment\n      where NutritionAssessment.status in { 'final', 'amended', 'corrected' }\n        and NutritionAssessment.effective.toInterval() during QualifyingEncounter.hospitalizationWithObservation()\n        and NutritionAssessment.value is not null\n      return NutritionAssessment.effective.latest()\n  )"
          }, {
            "url": "displaySequence",
            "valueInteger": 39
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Measure Observation 3"
          }, {
            "url": "statement",
            "valueString": "define function \"Measure Observation 3\"(MalnutritionDiagnosis Encounter):\n  if \"Encounters with Malnutrition Not At Risk Screening and without Dietitian Referral\" contains MalnutritionDiagnosis then 0 \n    else if \"Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral\" contains MalnutritionDiagnosis then if \"Encounters with Malnutrition Diagnosis\" contains MalnutritionDiagnosis then if \"Encounter With Most Recent Nutrition Assessment Status of Not or Mildly Malnourished\" contains MalnutritionDiagnosis then 0 \n    else if \"Encounter With Most Recent Nutrition Assessment Status of Moderately Or Severely Malnourished\" contains MalnutritionDiagnosis then 1 \n    else 0 \n    else 0 \n    else 0"
          }, {
            "url": "displaySequence",
            "valueInteger": 40
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "QICoreCommon"
          }, {
            "url": "name",
            "valueString": "prevalenceInterval"
          }, {
            "url": "statement",
            "valueString": "/*\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*/\ndefine fluent function prevalenceInterval(condition Choice<\"ConditionEncounterDiagnosis\", \"ConditionProblemsHealthConcerns\">):\nif condition.clinicalStatus ~ \"active\"\n  or condition.clinicalStatus ~ \"recurrence\"\n  or condition.clinicalStatus ~ \"relapse\" then\n  Interval[start of condition.onset.toInterval(), end of condition.abatementInterval()]\nelse\n    (end of condition.abatementInterval()) abatementDate\n    return if abatementDate is null then\n      Interval[start of condition.onset.toInterval(), abatementDate)\n    else\n      Interval[start of condition.onset.toInterval(), abatementDate]"
          }, {
            "url": "displaySequence",
            "valueInteger": 41
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "QICoreCommon"
          }, {
            "url": "name",
            "valueString": "abatementInterval"
          }, {
            "url": "statement",
            "valueString": "/*\n@description: Returns an interval representing the normalized abatement of a given Condition.\n@comment: If the abatement element of the Condition is represented as a DateTime, the result\nis an interval beginning and ending on that DateTime.\nIf the abatement is represented as a Quantity, the quantity is expected to be a calendar-duration and is interpreted as the age of the patient. The\nresult is an interval from the date the patient turned that age to immediately before one year later.\nIf the abatement is represented as a Quantity Interval, the quantities are expected to be calendar-durations and are interpreted as an age range during\nwhich the abatement occurred. The result is an interval from the date the patient turned the starting age of the quantity interval, and ending immediately\nbefore one year later than the date the patient turned the ending age of the quantity interval.\n*/\ndefine fluent function abatementInterval(condition Choice<\"ConditionEncounterDiagnosis\", \"ConditionProblemsHealthConcerns\">):\n\tif condition.abatement is DateTime then\n\t  Interval[condition.abatement as DateTime, condition.abatement as DateTime]\n\telse if condition.abatement is Quantity then\n\t\tInterval[Patient.birthDate + (condition.abatement as Quantity),\n\t\t\tPatient.birthDate + (condition.abatement as Quantity) + 1 year)\n\telse if condition.abatement is Interval<Quantity> then\n\t  Interval[Patient.birthDate + (condition.abatement.low as Quantity),\n\t\t  Patient.birthDate + (condition.abatement.high as Quantity) + 1 year)\n\telse if condition.abatement is Interval<DateTime> then\n\t  Interval[condition.abatement.low, condition.abatement.high)\n\telse null as Interval<DateTime>"
          }, {
            "url": "displaySequence",
            "valueInteger": 42
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "isVerified"
          }, {
            "url": "statement",
            "valueString": "define fluent function isVerified(condition Choice<QICore.ConditionProblemsHealthConcerns, QICore.ConditionEncounterDiagnosis>):\n  condition.verificationStatus is not null implies ( condition.verificationStatus ~ QICoreCommon.\"confirmed\"\n      or condition.verificationStatus ~ QICoreCommon.\"unconfirmed\"\n      or condition.verificationStatus ~ QICoreCommon.\"provisional\"\n      or condition.verificationStatus ~ QICoreCommon.\"differential\"\n  )"
          }, {
            "url": "displaySequence",
            "valueInteger": 43
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "FHIRHelpers"
          }, {
            "url": "name",
            "valueString": "ToConcept"
          }, {
            "url": "statement",
            "valueString": "/*\n@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.\n*/\ndefine function ToConcept(concept FHIR.CodeableConcept):\n    if concept is null then\n        null\n    else\n        System.Concept {\n            codes: concept.coding C return ToCode(C),\n            display: concept.text.value\n        }"
          }, {
            "url": "displaySequence",
            "valueInteger": 44
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "Status"
          }, {
            "url": "name",
            "valueString": "verified"
          }, {
            "url": "statement",
            "valueString": "//This library contains functions used to constrain FHIR resource elements for measures authored by NCQA, based on QICore 6.0.0 resources including IG and authoring patterns. The functions may appear similar to some QICoreCommon functions but differ in that they have constraints that are relevant for measures authored by NCQA.\n\n//Condition\n//Returns conditions in the given list that either have no verification status or have a verification status of confirmed, unconfirmed, provisional, or differential\ndefine fluent function verified(conditions List<Choice<ConditionProblemsHealthConcerns, ConditionEncounterDiagnosis>>):\n  conditions C\n    where C.verificationStatus is not null implies\n      (C.verificationStatus ~ \"confirmed\"\n        or C.verificationStatus ~ \"unconfirmed\"\n        or C.verificationStatus ~ \"provisional\"\n        or C.verificationStatus ~ \"differential\"\n      )"
          }, {
            "url": "displaySequence",
            "valueInteger": 45
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CQMCommon"
          }, {
            "url": "name",
            "valueString": "encounterDiagnosis"
          }, {
            "url": "statement",
            "valueString": "/*  \n@description: Returns the Condition resources referenced by the diagnosis element of the Encounter  \n*/\ndefine fluent function encounterDiagnosis(Encounter Encounter ):\n  Encounter.reasonReference D\n    return singleton from (([ConditionEncounterDiagnosis] union [ConditionProblemsHealthConcerns]) C where D.references(C.id))"
          }, {
            "url": "displaySequence",
            "valueInteger": 46
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "QICoreCommon"
          }, {
            "url": "name",
            "valueString": "references"
          }, {
            "url": "statement",
            "valueString": "/*\n@description: Returns true if the given reference is to the given resourceId\n@comment: Returns true if the `resourceId` parameter exactly equals the tail of the given reference.\nNOTE: This function assumes resources from the same source server.\n*/\ndefine fluent function references(reference Reference, resourceId String):\n  resourceId = Last(Split(reference.reference, '/'))"
          }, {
            "url": "displaySequence",
            "valueInteger": 47
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Measure Observation 4"
          }, {
            "url": "statement",
            "valueString": "define function \"Measure Observation 4\"(NutritionCarePlan Encounter):\n  if \"Encounters with Malnutrition Not At Risk Screening and without Dietitian Referral\" contains NutritionCarePlan then 0 \n    else if \"Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral\" contains NutritionCarePlan then if \"Encounters with Nutrition Care Plan\" contains NutritionCarePlan then if \"Encounter With Most Recent Nutrition Assessment Status of Not or Mildly Malnourished\" contains NutritionCarePlan then 0 \n    else if \"Encounter With Most Recent Nutrition Assessment Status of Moderately Or Severely Malnourished\" contains NutritionCarePlan then 1 \n    else 0 \n    else 0 \n    else 0"
          }, {
            "url": "displaySequence",
            "valueInteger": 48
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "QICoreCommon"
          }, {
            "url": "name",
            "valueString": "earliest"
          }, {
            "url": "statement",
            "valueString": "/*\n@description: Given an interval, return the starting point if the interval has a starting boundary specified,\notherwise, return the ending point\n*/\ndefine fluent function earliest(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>> ):\n  (choice.toInterval()) period\n    return\n      if (period.\"hasStart\"()) then start of period\n      else end of period"
          }, {
            "url": "displaySequence",
            "valueInteger": 49
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "QICoreCommon"
          }, {
            "url": "name",
            "valueString": "hasStart"
          }, {
            "url": "statement",
            "valueString": "/*\n@description: Given an interval, return true if the interval has a starting boundary specified\n(i.e. the start of the interval is not null and not the minimum DateTime value)\n*/\ndefine fluent function hasStart(period Interval<DateTime> ):\n  not ( start of period is null\n      or start of period = minimum DateTime\n  )"
          }, {
            "url": "displaySequence",
            "valueInteger": 50
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Measure Observation Total Malnutrition Care Score as Percentage"
          }, {
            "url": "statement",
            "valueString": "define function \"Measure Observation Total Malnutrition Care Score as Percentage\"(QualifyingEncounter Encounter):\n  100 * ( \"Measure Observation Total Malnutrition Components Score\"(QualifyingEncounter) / \"Total Malnutrition Care Score Eligible Occurrences\"(QualifyingEncounter) )"
          }, {
            "url": "displaySequence",
            "valueInteger": 51
          } ]
        }, {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition",
          "extension": [ {
            "url": "libraryName",
            "valueString": "CMS986FHIRMalnutritionScore"
          }, {
            "url": "name",
            "valueString": "Total Malnutrition Care Score Eligible Occurrences"
          }, {
            "url": "statement",
            "valueString": "define function \"Total Malnutrition Care Score Eligible Occurrences\"(QualifyingEncounter Encounter):\n  if \"Encounters with Malnutrition Risk Screening or with Dietitian Referral\" contains QualifyingEncounter\n    and \"Encounters with Malnutrition Risk Screening Not At Risk\" contains QualifyingEncounter\n    and not ( \"Encounters with Dietitian Referral\" contains QualifyingEncounter ) then 1 \n    else if ( \"Encounters with Malnutrition Risk Screening or with Dietitian Referral\" contains QualifyingEncounter\n      and \"Encounters with Malnutrition Risk Screening At Risk\" contains QualifyingEncounter\n      or \"Encounters with Dietitian Referral\" contains QualifyingEncounter\n  )\n    and \"Encounter With Most Recent Nutrition Assessment Status of Not or Mildly Malnourished\" contains QualifyingEncounter\n    or not ( \"Encounter With Most Recent Nutrition Assessment And Identified Status\" contains QualifyingEncounter ) then 2 \n    else 4"
          }, {
            "url": "displaySequence",
            "valueInteger": 52
          } ]
        } ],
        "name": "EffectiveDataRequirements",
        "status": "active",
        "type": {
          "coding": [ {
            "system": "http://terminology.hl7.org/CodeSystem/library-type",
            "code": "module-definition"
          } ]
        },
        "relatedArtifact": [ {
          "type": "depends-on",
          "display": "QICore model information",
          "resource": "http://hl7.org/fhir/Library/QICore-ModelInfo"
        }, {
          "type": "depends-on",
          "display": "Library FHIRHelpers",
          "resource": "https://madie.cms.gov/Library/FHIRHelpers|4.4.000"
        }, {
          "type": "depends-on",
          "display": "Library QICoreCommon",
          "resource": "https://madie.cms.gov/Library/QICoreCommon|4.0.000"
        }, {
          "type": "depends-on",
          "display": "Library CQMCommon",
          "resource": "https://madie.cms.gov/Library/CQMCommon|4.1.000"
        }, {
          "type": "depends-on",
          "display": "Library SDE",
          "resource": "https://madie.cms.gov/Library/SupplementalDataElements|5.1.000"
        }, {
          "type": "depends-on",
          "display": "Library Status",
          "resource": "https://madie.cms.gov/Library/Status|1.15.000"
        }, {
          "type": "depends-on",
          "display": "Code system SNOMEDCT",
          "resource": "http://snomed.info/sct"
        }, {
          "type": "depends-on",
          "display": "Code system ConditionClinicalStatusCodes",
          "resource": "http://terminology.hl7.org/CodeSystem/condition-clinical"
        }, {
          "type": "depends-on",
          "display": "Code system ConditionVerificationStatusCodes",
          "resource": "http://terminology.hl7.org/CodeSystem/condition-ver-status"
        }, {
          "type": "depends-on",
          "display": "Value set Encounter Inpatient",
          "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"
        }, {
          "type": "depends-on",
          "display": "Value set Hospice Care Referral or Admission",
          "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1116.365"
        }, {
          "type": "depends-on",
          "display": "Value set Hospice Status",
          "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.101"
        }, {
          "type": "depends-on",
          "display": "Value set Observation Services",
          "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"
        }, {
          "type": "depends-on",
          "display": "Value set Emergency Department Visit",
          "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"
        }, {
          "type": "depends-on",
          "display": "Value set Malnutrition Risk Screening",
          "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.92"
        }, {
          "type": "depends-on",
          "display": "Value set Malnutrition Screening Finding of Not At Risk Result",
          "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.34"
        }, {
          "type": "depends-on",
          "display": "Value set Malnutrition Screening Finding of At Risk Result",
          "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.89"
        }, {
          "type": "depends-on",
          "display": "Value set Dietitian Referral",
          "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.91"
        }, {
          "type": "depends-on",
          "display": "Value set Nutrition Assessment",
          "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.21"
        }, {
          "type": "depends-on",
          "display": "Value set Nutrition Assessment Status Finding of Well Nourished or Not Malnourished or Mildly Malnourished",
          "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.96"
        }, {
          "type": "depends-on",
          "display": "Value set Nutrition Assessment Status Finding of Moderately Malnourished",
          "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.47"
        }, {
          "type": "depends-on",
          "display": "Value set Nutrition Assessment Status Finding of Severely Malnourished",
          "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.43"
        }, {
          "type": "depends-on",
          "display": "Value set Malnutrition Diagnosis",
          "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.55"
        }, {
          "type": "depends-on",
          "display": "Value set Nutrition Care Plan",
          "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.93"
        }, {
          "type": "depends-on",
          "display": "Value set Payer Type",
          "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"
        } ],
        "parameter": [ {
          "name": "Measurement Period",
          "use": "in",
          "min": 0,
          "max": "1",
          "type": "Period"
        }, {
          "name": "Measure Population Exclusion",
          "use": "out",
          "min": 0,
          "max": "*",
          "type": "Resource"
        }, {
          "name": "Initial Population",
          "use": "out",
          "min": 0,
          "max": "*",
          "type": "Resource"
        }, {
          "name": "Measure Population",
          "use": "out",
          "min": 0,
          "max": "*",
          "type": "Resource"
        }, {
          "name": "SDE Race",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "Resource"
        }, {
          "name": "SDE Sex",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "Coding"
        }, {
          "name": "SDE Payer Type",
          "use": "out",
          "min": 0,
          "max": "*",
          "type": "Resource"
        }, {
          "name": "SDE Ethnicity",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "Resource"
        } ],
        "dataRequirement": [ {
          "type": "Patient",
          "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient" ],
          "mustSupport": [ "birthDate", "birthDate.value", "url", "extension" ]
        }, {
          "type": "Encounter",
          "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ],
          "mustSupport": [ "type", "status", "status.value", "period" ],
          "codeFilter": [ {
            "path": "type",
            "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"
          } ]
        }, {
          "type": "Encounter",
          "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ],
          "mustSupport": [ "type", "status", "status.value", "period" ],
          "codeFilter": [ {
            "path": "type",
            "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"
          } ]
        }, {
          "type": "Encounter",
          "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ],
          "mustSupport": [ "type", "period", "status", "status.value", "hospitalization", "hospitalization.dischargeDisposition", "reasonCode" ],
          "codeFilter": [ {
            "path": "type",
            "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"
          } ]
        }, {
          "type": "ServiceRequest",
          "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest" ],
          "mustSupport": [ "code", "status", "status.value", "intent", "intent.value", "authoredOn", "authoredOn.value" ],
          "codeFilter": [ {
            "path": "code",
            "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.101"
          } ]
        }, {
          "type": "ServiceRequest",
          "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest" ],
          "mustSupport": [ "code", "status", "status.value", "intent", "intent.value", "authoredOn", "authoredOn.value" ],
          "codeFilter": [ {
            "path": "code",
            "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.91"
          } ]
        }, {
          "type": "Procedure",
          "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure" ],
          "mustSupport": [ "code", "status", "status.value", "performed" ],
          "codeFilter": [ {
            "path": "code",
            "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.101"
          } ]
        }, {
          "type": "Procedure",
          "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure" ],
          "mustSupport": [ "code", "status", "status.value", "performed" ],
          "codeFilter": [ {
            "path": "code",
            "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.91"
          } ]
        }, {
          "type": "Procedure",
          "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure" ],
          "mustSupport": [ "code", "status", "status.value", "performed" ],
          "codeFilter": [ {
            "path": "code",
            "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.93"
          } ]
        }, {
          "type": "Observation",
          "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-screening-assessment" ],
          "mustSupport": [ "code", "status", "status.value", "effective", "value" ],
          "codeFilter": [ {
            "path": "code",
            "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.92"
          } ]
        }, {
          "type": "Observation",
          "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-screening-assessment" ],
          "mustSupport": [ "code", "status", "status.value", "effective", "value" ],
          "codeFilter": [ {
            "path": "code",
            "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.21"
          } ]
        }, {
          "type": "Condition",
          "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns" ]
        }, {
          "type": "Condition",
          "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns" ],
          "mustSupport": [ "code" ],
          "codeFilter": [ {
            "path": "code",
            "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.55"
          } ]
        }, {
          "type": "Condition",
          "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-encounter-diagnosis" ]
        }, {
          "type": "Coverage",
          "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage" ],
          "mustSupport": [ "type", "period" ],
          "codeFilter": [ {
            "path": "type",
            "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"
          } ]
        } ]
      } ],
      "extension": [ {
        "id": "supplementalDataGuidance",
        "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-supplementalDataGuidance",
        "extension": [ {
          "url": "guidance",
          "valueString": "For every patient evaluated by this measure also identify payer, race, ethnicity and sex"
        }, {
          "url": "usage",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-data-usage",
              "code": "supplemental-data",
              "display": "Supplemental Data"
            } ],
            "text": "Supplemental Data Guidance"
          }
        } ]
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-definitionTerm",
        "extension": [ {
          "url": "term",
          "valueString": "Malnutrition Diagnosis"
        }, {
          "url": "definition",
          "valueMarkdown": "A documented diagnosis that identifies and describes a specific nutrition problem(s) that can be resolved or improved through nutrition intervention(s), monitoring, and evaluation. For the inpatient or acute care setting, the Malnutrition Diagnosis is identified by the physician or other eligible clinician as defined by CMS based on the scope of practice regulations within the respective state, commonwealth, or territory of care delivery.\n"
        } ]
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-definitionTerm",
        "extension": [ {
          "url": "term",
          "valueString": "Malnutrition Risk Screening"
        }, {
          "url": "definition",
          "valueMarkdown": "The process of identifying and referring those individuals and populations who are at risk for nutrition-related problems, are appropriate for nutrition care services, and would benefit from nutrition interventions. For the inpatient or acute care setting, the Malnutrition Risk Screening can be completed by any eligible healthcare clinician as defined by local, state and federal guidelines.\n"
        } ]
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-definitionTerm",
        "extension": [ {
          "url": "term",
          "valueString": "Nutrition Assessment"
        }, {
          "url": "definition",
          "valueMarkdown": "A systematic approach for collecting, classifying, and synthesizing important and relevant data to describe nutritional status related nutritional problems, and their causes. This assessment includes review of the \"whole\" patient and evaluates the anthropometrics (i.e., body measurements and proportions), biochemical data (i.e., laboratory findings), clinical observations, and diet history (also known as 'ABCD'). For the inpatient or acute care setting, the Nutrition Assessment is performed by a RD or RDN.\n"
        } ]
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-definitionTerm",
        "extension": [ {
          "url": "term",
          "valueString": "Nutrition Care Plan"
        }, {
          "url": "definition",
          "valueMarkdown": "A documented plan based on information collected during the Nutrition Assessment of individualized nutrition recommendations, interventions, and monitoring and evaluation plans that are directed toward resolving the Malnutrition Diagnosis by altering or eliminating the nutrition etiology. The Nutrition Care Plan may encompass the interventions of Food and Nutrient Delivery, Nutrition Education, Nutrition Counseling, Coordination of Nutrition Care, and Population Based Nutrition Action, along with a plan for monitoring and evaluation, and is documented by the RD or RDN.\n"
        } ]
      }, {
        "url": "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements",
        "valueReference": {
          "reference": "#effective-data-requirements"
        }
      } ],
      "url": "https://madie.cms.gov/Measure/CMS986FHIRMalnutritionScore",
      "identifier": [ {
        "use": "usual",
        "type": {
          "coding": [ {
            "system": "http://terminology.hl7.org/CodeSystem/artifact-identifier-type",
            "code": "short-name",
            "display": "Short Name"
          } ]
        },
        "system": "https://madie.cms.gov/measure/shortName",
        "value": "CMS986FHIR"
      }, {
        "use": "official",
        "type": {
          "coding": [ {
            "system": "http://terminology.hl7.org/CodeSystem/artifact-identifier-type",
            "code": "version-independent",
            "display": "Version Independent"
          } ]
        },
        "system": "urn:ietf:rfc:3986",
        "value": "urn:uuid:eed68e80-b466-4369-be87-166ada45f7c5"
      }, {
        "use": "official",
        "type": {
          "coding": [ {
            "system": "http://terminology.hl7.org/CodeSystem/artifact-identifier-type",
            "code": "version-specific",
            "display": "Version Specific"
          } ]
        },
        "system": "urn:ietf:rfc:3986",
        "value": "urn:uuid:c3828a9c-88b0-4a19-8b78-bb07f56ed929"
      }, {
        "use": "official",
        "type": {
          "coding": [ {
            "system": "http://terminology.hl7.org/CodeSystem/artifact-identifier-type",
            "code": "endorser",
            "display": "Endorser"
          } ]
        },
        "system": "https://madie.cms.gov/measure/cbeId",
        "value": "3592e",
        "assigner": {
          "display": "CMS Consensus Based Entity"
        }
      }, {
        "use": "official",
        "type": {
          "coding": [ {
            "system": "http://terminology.hl7.org/CodeSystem/artifact-identifier-type",
            "code": "publisher",
            "display": "Publisher"
          } ]
        },
        "system": "https://madie.cms.gov/measure/cmsId",
        "value": "986FHIR",
        "assigner": {
          "display": "CMS"
        }
      } ],
      "version": "1.0.000",
      "name": "CMS986FHIRMalnutritionScore",
      "title": "Malnutrition Care ScoreFHIR\n",
      "status": "active",
      "experimental": false,
      "date": "2025-11-24T17:18:42+00:00",
      "publisher": "Academy of Nutrition and Dietetics",
      "contact": [ {
        "telecom": [ {
          "system": "url",
          "value": "www.eatrightpro.org"
        } ]
      } ],
      "description": "This measure assesses the percentage of eligible encounters of adults aged 18 years and older at the start of the eligible encounter during the measurement period, with a length of stay equal to or greater than 24 hours, who received optimal malnutrition care where care performed was appropriate to the patient's level of malnutrition risk and severity. Malnutrition care best practices recommend that for each eligible encounter, adult inpatients are (1) screened for malnutrition risk or for a dietitian referral order to be placed, (2) assessed by a registered dietitian (RD) or registered dietitian nutritionist (RDN) to confirm findings of malnutrition risk, and if identified with a \"moderate\" or \"severe\" malnutrition status in the current performed nutrition assessment, (3) receive a \"moderate\" or \"severe\" malnutrition diagnosis by a physician or eligible clinician as defined by the Centers for Medicare \\& Medicaid Services (CMS), and (4) have a current nutrition care plan performed by an RD/RDN.\n",
      "purpose": "Percentage of hospitalizations where a patient 18 years of age or older, admitted for 24-hours or more, received optimal malnutrition care\n",
      "usage": "This measure is constructed of four clinically eligible components that are aggregated as an arithmetic average of eligible encounters and expressed as a percentage. The four populations used to calculate the four components may differ and the measure observations for the four components do not need to be performed sequentially. This dQM is an episode-based measure. An episode is defined as each eligible encounter with a length of stay of greater than or equal to 24 hours among individuals 18 years of age and older at the start of the inpatient encounter. This FHIR-based measure has been derived from the QDM-based measure: CMS986v5. Please refer to the HL7 QI-Core Implementation Guide (*https://hl7.org/fhir/us/qicore/STU6/* ) for more information on QI-Core and mapping recommendations from QDM to QI-Core STU 6. (*https://hl7.org/fhir/us/qicore/STU6/qdm-to-qicore.html*).\n",
      "copyright": "Copyright (C) Academy of Nutrition and Dietetics 2025 Limited proprietary coding is contained in the measure specifications for convenience. Users of the proprietary code sets should obtain all necessary licenses from the owners of these code sets. LOINC(R) copyright 2004-2024 Regenstrief Institute, Inc. ICD-10 copyright 2024 World Health Organization. This material contains SNOMED Clinical Terms (R) (SNOMED CT \\[R\\]) copyright 2004-2024. International Health Terminology Standards Development Organisation. All Rights Reserved.\n",
      "effectivePeriod": {
        "start": "2026-01-01",
        "end": "2026-12-31"
      },
      "author": [ {
        "name": "Academy of Nutrition and Dietetics",
        "telecom": [ {
          "system": "url",
          "value": "www.eatrightpro.org"
        } ]
      } ],
      "relatedArtifact": [ {
        "type": "citation",
        "citation": "Compher, C., Jensen, G. L., Malone, A., Morgan, S., Becker, S., Cresta, L., Paul, A. M., \\& Steiber, A. (2024). Systematic Review of Content Validity and Meta-analysis of Predictive Validity for Clinical Outcomes Associated with Malnutrition Identified by The Academy of Nutrition and Dietetics and American Society for Parenteral and Enteral Nutrition Indicators of Malnutrition. *Journal of the Academy of Nutrition and Dietetics*. https://doi.org/10.1016/j.jand.2024.02.002\n"
      }, {
        "type": "citation",
        "citation": "Jimenez, E. Y., Lamers-Johnson, E., Long, J. M., Woodcock, L., Bliss, C., \\& Steiber, A. L. (2024). Predictive Validity of the Academy of Nutrition and Dietetics/American Society for Parental Nutrition Indicators to Diagnose Malnutrition and the Screening Tool for Risk on Nutritional Status and Growth among Hospitalized Children Relative to Medical Outcomes. *The Journal of Pediatrics*, 276, 114288. https://doi.org/10.1016/j.jpeds.2024.114288\n"
      }, {
        "type": "citation",
        "citation": "Lengfelder, L., Mahlke, S., Moore, L., Zhang, X., Williams, G., \\& Lee, J. (2022). Prevalence and Impact of Malnutrition on Length of stay, readmission, and Discharge Destination. *Journal of Parenteral and Enteral Nutrition*, 46(6). https://doi.org/10.1002/jpen.2322\n"
      }, {
        "type": "citation",
        "citation": "Pacetti, E. J., McMurray, D., \\& Baca, J. (2025). Quality Improvement in Acute Care Malnutrition: Impact on Payment and Patient Outcomes. *Journal of the Academy of Nutrition and Dietetics*, 125(9), S24-S35. https://doi.org/10.1016/j.jand.2025.05.018\n"
      }, {
        "type": "citation",
        "citation": "Swan, W. I., Pertel, D. G., Hotson, B., Lloyd, L., Orrevall, Y., Trostler, N., Vivanti, A., Howarter, K. B., \\& Papoutsakis, C. (2019). Nutrition Care Process (NCP) Update Part 2: Developing and Using the NCP Terminology to Demonstrate Efficacy of Nutrition Care and Related Outcomes. *Journal of the Academy of Nutrition and Dietetics*, 119(5), 840-855. https://doi.org/10.1016/j.jand.2018.10.025\n"
      }, {
        "type": "citation",
        "citation": "Trollebo, M. A., Tangvik, R. J., Skeie, E., Gronning, M. K., Nygard, O., Eagan, T. M. L., \\& Dierkes, J. (2024). Malnutrition as a prognostic factor for 2-year mortality in hospitalized patients in Norway: A matched cohort study. *Journal of Parenteral and Enteral Nutrition*, 48(3), 308-317. https://doi.org/10.1002/jpen.2619\n"
      }, {
        "type": "citation",
        "citation": "Mogensen, K.M., Malone, A., Becker, P., Cutrell, S., Frank, L., Gonzales, K., Hudson, L., Miller, S., Guenter, P. (2019) Academy of Nutrition and Dietetics/American Society for Parenteral and Enteral Nutrition Consensus Malnutrition Characteristics: Usability and Association With Outcomes. Nutrition in Clinical Practice, 34 (5), 657-665. https://doi.org/10.1002/ncp.10310\n"
      }, {
        "type": "citation",
        "citation": "Mueller, C., Compher, C., Druyan, M.E., \\& the ASPEN Board of Directors. (2011). ASPEN clinical guidelines on nutrition screening, assessment, and intervention in adults: Journal of Parenteral and Enteral Nutrition, 35(1), 16-24. https://doi.org/10.1177/0148607110389335\n"
      } ],
      "library": [ "https://madie.cms.gov/Library/CMS986FHIRMalnutritionScore" ],
      "disclaimer": "This performance measure is not a clinical guideline, does not establish a standard of medical care, and has not been tested for all potential applications. THE MEASURE AND SPECIFICATIONS ARE PROVIDED \"AS IS\" WITHOUT WARRANTY OF ANY KIND. Due to technical limitations, copyright is indicated by (C) or \\[C\\], registered trademarks are indicated by (R) or \\[R\\], and unregistered trademarks are indicated by (TM) or \\[TM\\].\n",
      "rationale": "Malnutrition has been documented in approximately one-third of patients in developed countries upon admission to the hospital, and, if left untreated, can significantly impact important clinical outcomes (Mogensen et al., 2019). Adult patients with malnutrition have a significantly longer hospital length of stay (LOS) and a significantly higher likelihood of 30-day readmission when compared to their well-nourished counterparts (Lengfelder et al., 2022). Furthermore, hospitalized adults with malnutrition have an increased likelihood of all-cause mortality within 2 years of diagnosis (Trollebo et al., 2024) and an increase in in-hospital death when compared to patients without a diagnosis of malnutrition (Compher et al., 2024). These consequences demonstrate the importance of addressing malnutrition in hospitalized patients to improve outcomes.\n\nThe components of this measure are supported by clinical guidance which recommend **(1) malnutrition screening** for patients admitted into the acute inpatient care setting; **(2) nutrition assessment** for patients identified at risk for malnutrition or with a dietitian referral order to form the basis for appropriate nutrition interventions; **(3) appropriate recognition, diagnosis, and documentation** of the nutrition status of a patient in order to **(4) address their condition with an appropriate plan of care** and communicate patient needs to other care providers (Swan et al., 2019).\n\nThe process for risk identification, assessment, diagnosis, and treatment of malnutrition necessitates a multi-disciplinary care team that begins with the identification of an initial risk population for a more thorough assessment by the RD/RDN. The RD/RDN, in turn, provides the necessary treatment recommendations to address nutrition problems utilizing a nutrition diagnosis and care plan, along with the clinical indicators that inform a medical diagnosis of malnutrition completed by a physician or eligible clinician as defined by CMS. The four measure observations individually provide a portion of the necessary information on the quality of care for patients at risk for or with malnutrition. Therefore, the four components are summed and averaged according to a patient's degree of malnutrition and/or malnutrition risk to determine an encounter-level Malnutrition Care Score.\n\nHigh performance on this measure requires malnutrition risk screening and/or referral to RDNs for appropriate nutrition assessment for identified patients during the current hospitalization. For patients identified with moderate or severe malnutrition by nutrition assessment, best practice also recommends a medical diagnosis by a physician or other eligible clinician and the execution of the nutrition care plan by an RD/RDN. Evidence demonstrates that malnutrition pathways, which include a standardized protocol for screening, assessment, diagnosis, and care planning results in improved patient outcomes for malnourished patients (Pacetti et al., 2025).\n",
      "clinicalRecommendationStatement": "American Society for Parenteral and Enteral Nutrition (ASPEN) clinical guidelines on nutrition screening, assessment, and intervention in adults indicate that screening for nutrition risk is suggested for hospitalized patients (Mueller et al., 2011). This guideline places nutrition assessment and screening in the context of intervention as part of nutrition care. Screening those individuals at risk for malnutrition is the first step in nutrition care, as malnutrition risk, identified by nutrition screening, is associated with longer length of hospital stay, complications, and mortality. Malnutrition screening is also a predictor of mortality risk.\n\nAdditionally, the Academy of Nutrition and Dietetics-ASPEN Indicators of Malnutrition (AAIM) provide a framework with significant validity in diagnosing malnutrition in hospitalized patients and supporting evidence that suggests that malnourished patients have more complications, longer hospitalizations, greater incidence of 30-day readmission, and higher incidence of mortality than patients with optimal nutrition status (Compher et al., 2024; Jimenez et al., 2024).\n\nNutrition intervention is recommended for patients identified by assessment as at risk for malnutrition or malnourished. Nutrition intervention with associated monitoring and evaluation plans in patients identified as at risk for malnutrition or malnourished improves clinical outcomes. Nutrition interventions and their associated monitoring and evaluation plans in malnourished patients are associated with improved nutrition status, nutrient intake, physical function, and quality of life. Hospital readmissions, inpatient length of stay, and complications were reduced with increased nutrition support interventions.\n",
      "group": [ {
        "id": "Group_1",
        "extension": [ {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-scoring",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-scoring",
              "code": "continuous-variable",
              "display": "Continuous Variable"
            } ]
          }
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-populationBasis",
          "valueCode": "Encounter"
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-type",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-type",
              "code": "intermediate-outcome",
              "display": "Intermediate Outcome"
            } ]
          }
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-improvementNotation",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-improvement-notation",
              "code": "increase",
              "display": "Increased score indicates improvement"
            } ]
          }
        } ],
        "description": "Population Criteria 1\n",
        "population": [ {
          "id": "InitialPopulation_1",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "initial-population",
              "display": "Initial Population"
            } ]
          },
          "description": "Eligible encounters during the measurement period with length of stay of 24 hours or more among individuals 18 years of age and older at the start of the inpatient encounter\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Initial Population"
          }
        }, {
          "id": "MeasurePopulation_1",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-population",
              "display": "Measure Population"
            } ]
          },
          "description": "Equals Initial Population\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Population"
          }
        }, {
          "id": "MeasurePopulationExclusion_1",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-population-exclusion",
              "display": "Measure Population Exclusion"
            } ]
          },
          "description": "Encounters with hospice care ordered during the inpatient qualifying encounter and encounters with a discharge disposition of hospice\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Population Exclusion"
          }
        }, {
          "id": "MeasureObservation_1",
          "extension": [ {
            "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-aggregateMethod",
            "valueCode": "Sum"
          }, {
            "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-criteriaReference",
            "valueString": "MeasurePopulation_1"
          } ],
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-observation",
              "display": "Measure Observation"
            } ]
          },
          "description": "Component Measure 1: Eligible encounters for patients with a current \"Malnutrition Risk Screening\" performed by an eligible healthcare clinician or with a Dietitian Referral.\n\nMeasure Observation 1 is Encounters with Malnutrition Risk Screening or with a Dietitian Referral.\n\nMeasure Observation 1 identifies eligible encounters where a \"Malnutrition Risk Screening\" was performed during the encounter (including associated observation or emergency department encounters) with an identified Malnutrition Screening Finding of Not At Risk or At Risk Result. It also identifies an eligible encounter where there is a Dietitian Referral, whether there is a Malnutrition Risk Screening performed or not.\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Observation 1"
          }
        } ]
      }, {
        "id": "Group_2",
        "extension": [ {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-scoring",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-scoring",
              "code": "continuous-variable",
              "display": "Continuous Variable"
            } ]
          }
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-populationBasis",
          "valueCode": "Encounter"
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-type",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-type",
              "code": "intermediate-outcome",
              "display": "Intermediate Outcome"
            } ]
          }
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-improvementNotation",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-improvement-notation",
              "code": "increase",
              "display": "Increased score indicates improvement"
            } ]
          }
        } ],
        "description": "Nutrition Assessment\n",
        "population": [ {
          "id": "InitialPopulation_2",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "initial-population",
              "display": "Initial Population"
            } ]
          },
          "description": "Eligible encounters during the measurement period with length of stay of 24 hours or more among individuals 18 years of age and older at the start of the inpatient encounter\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Initial Population"
          }
        }, {
          "id": "MeasurePopulation_2",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-population",
              "display": "Measure Population"
            } ]
          },
          "description": "Equals Initial Population\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Population"
          }
        }, {
          "id": "MeasurePopulationExclusion_2",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-population-exclusion",
              "display": "Measure Population Exclusion"
            } ]
          },
          "description": "Encounters with hospice care ordered during the inpatient qualifying encounter and encounters with a discharge disposition of hospice\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Population Exclusion"
          }
        }, {
          "id": "MeasureObservation_2",
          "extension": [ {
            "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-aggregateMethod",
            "valueCode": "Sum"
          }, {
            "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-criteriaReference",
            "valueString": "MeasurePopulation_2"
          } ],
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-observation",
              "display": "Measure Observation"
            } ]
          },
          "description": "Component Measure 2: Eligible encounters for patients with a documented \"Nutrition Assessment\" performed by an RD/RDN, after a Malnutrition Screening Finding of At Risk Result or a Dietitian Referral order from a physician or eligible clinician during the current encounter. Measure Observation 2 includes Encounter With Most Recent Nutrition Assessment and Identified Status if the Encounter also contains Completed Malnutrition Risk Screening or Dietitian Referral Measure Observation 2 identifies eligible encounters in which a malnutrition risk screening with an At Risk result or a dietitian referral was completed during the encounter (or associated observation or emergency department encounters) and a Nutrition Assessment was subsequently completed with an identified Nutrition Assessment Status Finding of Well Nourished or Not Malnourished or Mildly Malnourished, Nutrition Assessment Status Finding of Moderately Malnourished, or Nutrition Assessment Status Finding of Severely Malnourished.\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Observation 2"
          }
        } ]
      }, {
        "id": "Group_3",
        "extension": [ {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-scoring",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-scoring",
              "code": "continuous-variable",
              "display": "Continuous Variable"
            } ]
          }
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-populationBasis",
          "valueCode": "Encounter"
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-type",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-type",
              "code": "intermediate-outcome",
              "display": "Intermediate Outcome"
            } ]
          }
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-improvementNotation",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-improvement-notation",
              "code": "increase",
              "display": "Increased score indicates improvement"
            } ]
          }
        } ],
        "description": "Malnutrition Diagnosis\n",
        "population": [ {
          "id": "InitialPopulation_3",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "initial-population",
              "display": "Initial Population"
            } ]
          },
          "description": "Eligible encounters during the measurement period with length of stay of 24 hours or more among individuals 18 years of age and older at the start of the inpatient encounter\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Initial Population"
          }
        }, {
          "id": "MeasurePopulation_3",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-population",
              "display": "Measure Population"
            } ]
          },
          "description": "Equals Initial Population\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Population"
          }
        }, {
          "id": "MeasurePopulationExclusion_3",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-population-exclusion",
              "display": "Measure Population Exclusion"
            } ]
          },
          "description": "Encounters with hospice care ordered during the inpatient qualifying encounter and encounters with a discharge disposition of hospice\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Population Exclusion"
          }
        }, {
          "id": "MeasureObservation_3",
          "extension": [ {
            "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-aggregateMethod",
            "valueCode": "Sum"
          }, {
            "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-criteriaReference",
            "valueString": "MeasurePopulation_3"
          } ],
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-observation",
              "display": "Measure Observation"
            } ]
          },
          "description": "Component Measure 3: Eligible encounters for patients with a documented \"Malnutrition Diagnosis\" based on the most recent Nutrition Assessment finding of Moderately Malnourished or Severely Malnourished. Measure Observation 3 includes Encounters with a most recent Nutrition Assessment and Identified Status of Moderately Malnourished or Severely Malnourished, that also identified an active medical malnutrition diagnosis during the encounter (including preceding observation or emergency department encounters) and a Malnutrition Risk Screening At Risk result or with a Dietitian Referral\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Observation 3"
          }
        } ]
      }, {
        "id": "Group_4",
        "extension": [ {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-scoring",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-scoring",
              "code": "continuous-variable",
              "display": "Continuous Variable"
            } ]
          }
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-populationBasis",
          "valueCode": "Encounter"
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-type",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-type",
              "code": "intermediate-outcome",
              "display": "Intermediate Outcome"
            } ]
          }
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-improvementNotation",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-improvement-notation",
              "code": "increase",
              "display": "Increased score indicates improvement"
            } ]
          }
        } ],
        "description": "Nutrition Care Plan\n",
        "population": [ {
          "id": "InitialPopulation_4",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "initial-population",
              "display": "Initial Population"
            } ]
          },
          "description": "Eligible encounters during the measurement period with length of stay of 24 hours or more among individuals 18 years of age and older at the start of the inpatient encounter\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Initial Population"
          }
        }, {
          "id": "MeasurePopulation_4",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-population",
              "display": "Measure Population"
            } ]
          },
          "description": "Equals Initial Population\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Population"
          }
        }, {
          "id": "MeasurePopulationExclusion_4",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-population-exclusion",
              "display": "Measure Population Exclusion"
            } ]
          },
          "description": "Encounters with hospice care ordered during the inpatient qualifying encounter and encounters with a discharge disposition of hospice\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Population Exclusion"
          }
        }, {
          "id": "MeasureObservation_4",
          "extension": [ {
            "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-aggregateMethod",
            "valueCode": "Sum"
          }, {
            "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-criteriaReference",
            "valueString": "MeasurePopulation_4"
          } ],
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-observation",
              "display": "Measure Observation"
            } ]
          },
          "description": "Component Measure 4: Eligible encounters for patients with a documented \"Nutrition Care Plan\" based on the most recent Nutrition Assessment finding of Moderately Malnourished or Severely Malnourished.\n\nMeasure Observation 4 identifies Encounters with a most recent Nutrition Assessment and Identified Status of Moderately Malnourished or Severely Malnourished, that also include a documented Nutrition Care Plan and a Malnutrition Risk Screening At Risk result or with a Dietitian Referral.\n\nMeasure Observation 4 identifies eligible encounters where a \"Nutrition Care Plan\" was performed during the encounter (including preceding observation or emergency department encounters).\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Observation 4"
          }
        } ]
      }, {
        "id": "Group_5",
        "extension": [ {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-scoring",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-scoring",
              "code": "continuous-variable",
              "display": "Continuous Variable"
            } ]
          }
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-populationBasis",
          "valueCode": "Encounter"
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-type",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-type",
              "code": "intermediate-outcome",
              "display": "Intermediate Outcome"
            } ]
          }
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-improvementNotation",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-improvement-notation",
              "code": "increase",
              "display": "Increased score indicates improvement"
            } ]
          }
        } ],
        "description": "Total Malnutrition Care Components\n",
        "population": [ {
          "id": "InitialPopulation_5",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "initial-population",
              "display": "Initial Population"
            } ]
          },
          "description": "Eligible encounters during the measurement period with length of stay of 24 hours or more among individuals 18 years of age and older at the start of the inpatient encounter\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Initial Population"
          }
        }, {
          "id": "MeasurePopulation_5",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-population",
              "display": "Measure Population"
            } ]
          },
          "description": "Equals Initial Population\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Population"
          }
        }, {
          "id": "MeasurePopulationExclusion_5",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-population-exclusion",
              "display": "Measure Population Exclusion"
            } ]
          },
          "description": "Encounters with hospice care ordered during the inpatient qualifying encounter and encounters with a discharge disposition of hospice\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Population Exclusion"
          }
        }, {
          "id": "MeasureObservation_5",
          "extension": [ {
            "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-aggregateMethod",
            "valueCode": "Count"
          }, {
            "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-criteriaReference",
            "valueString": "MeasurePopulation_5"
          } ],
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-observation",
              "display": "Measure Observation"
            } ]
          },
          "description": "Population 5 \"Measure Observation Total Malnutrition Components Score\" Calculations-For each eligible encounter, Population Criteria 5 represents the subtotal of Measure Observations performed for Population Criteria 1, 2, 3, and 4. Possible values may be 0, 1, 2, 3, or 4. Population 5 \"Measure Observation Total Malnutrition Components Score\" is (\"Measure Observation 1\" plus \"Measure Observation 2\" plus \"Measure Observation 3\" plus \"Measure Observation 4\")\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Observation Total Malnutrition Components Score"
          }
        } ]
      }, {
        "id": "Group_6",
        "extension": [ {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-scoring",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-scoring",
              "code": "continuous-variable",
              "display": "Continuous Variable"
            } ]
          }
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-populationBasis",
          "valueCode": "Encounter"
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-type",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-type",
              "code": "intermediate-outcome",
              "display": "Intermediate Outcome"
            } ]
          }
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-improvementNotation",
          "valueCodeableConcept": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-improvement-notation",
              "code": "increase",
              "display": "Increased score indicates improvement"
            } ]
          }
        } ],
        "description": "Encounter Malnutrition Care Score\n",
        "population": [ {
          "id": "InitialPopulation_6",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "initial-population",
              "display": "Initial Population"
            } ]
          },
          "description": "Eligible encounters during the measurement period with length of stay of 24 hours or more among individuals 18 years of age and older at the start of the inpatient encounter\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Initial Population"
          }
        }, {
          "id": "MeasurePopulation_6",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-population",
              "display": "Measure Population"
            } ]
          },
          "description": "Equals Initial Population\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Population"
          }
        }, {
          "id": "MeasurePopulationExclusion_6",
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-population-exclusion",
              "display": "Measure Population Exclusion"
            } ]
          },
          "description": "Encounters with hospice care ordered during the inpatient qualifying encounter and encounters with a discharge disposition of hospice\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Population Exclusion"
          }
        }, {
          "id": "MeasureObservation_6",
          "extension": [ {
            "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-aggregateMethod",
            "valueCode": "Average"
          }, {
            "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-criteriaReference",
            "valueString": "MeasurePopulation_6"
          } ],
          "code": {
            "coding": [ {
              "system": "http://terminology.hl7.org/CodeSystem/measure-population",
              "code": "measure-observation",
              "display": "Measure Observation"
            } ]
          },
          "description": "Population 6 \"Measure Observation Total Malnutrition Care Score as Percentage\" Calculations:-For each eligible encounter, Population Criteria 6 represents the sum of performed Measure Observations 1, 2, 3, and 4 divided by the number of clinically eligible occurrences. Population 6 \"Measure Observation Total Malnutrition Care Score as Percentage\" is 100 multiplied by (\"Measure Observation Total Malnutrition Components Score\" divided by \"Total Malnutrition Care Score Eligible Occurrences\"). Possible values may be 0, 50, 75, or 100 percent. \"Total Malnutrition Care Score Eligible Occurrences\" is always 4 except in the following instances: -The \"Total Malnutrition Care Score Eligible Occurrences\" is 1 if ---A \"Malnutrition Risk Screening\" was performed and a Malnutrition Screening Finding of Not At Risk was identified and \"Dietitian Referral\" was not ordered. - The \"Total Malnutrition Care Score Eligible Occurrences\" is 2 ---If the most recent \"Nutrition Assessment\" performed has a result of Not or Mildly Malnourished. And, --- A \"Malnutrition Risk Screening\" was performed and a Malnutrition Screening Finding of At Risk was identified or a \"Dietitian Referral\" was ordered or a Dietitian Referral was ordered but a Nutrition Assessment was not performed.\n",
          "criteria": {
            "language": "text/cql-identifier",
            "expression": "Measure Observation Total Malnutrition Care Score as Percentage"
          }
        } ]
      } ],
      "supplementalData": [ {
        "id": "sde-payer-type",
        "usage": [ {
          "coding": [ {
            "system": "http://terminology.hl7.org/CodeSystem/measure-data-usage",
            "code": "supplemental-data"
          } ]
        } ],
        "description": "SDE Payer Type\n",
        "criteria": {
          "language": "text/cql-identifier",
          "expression": "SDE Payer Type"
        }
      }, {
        "id": "sde-race",
        "usage": [ {
          "coding": [ {
            "system": "http://terminology.hl7.org/CodeSystem/measure-data-usage",
            "code": "supplemental-data"
          } ]
        } ],
        "description": "SDE Race\n",
        "criteria": {
          "language": "text/cql-identifier",
          "expression": "SDE Race"
        }
      }, {
        "id": "sde-ethnicity",
        "usage": [ {
          "coding": [ {
            "system": "http://terminology.hl7.org/CodeSystem/measure-data-usage",
            "code": "supplemental-data"
          } ]
        } ],
        "description": "SDE Ethnicity\n",
        "criteria": {
          "language": "text/cql-identifier",
          "expression": "SDE Ethnicity"
        }
      }, {
        "id": "sde-sex",
        "extension": [ {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType",
          "valueCode": "individual"
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType",
          "valueCode": "subject-list"
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType",
          "valueCode": "summary"
        }, {
          "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-includeInReportType",
          "valueCode": "data-collection"
        } ],
        "usage": [ {
          "coding": [ {
            "system": "http://terminology.hl7.org/CodeSystem/measure-data-usage",
            "code": "supplemental-data"
          } ]
        } ],
        "description": "SDE Sex\n",
        "criteria": {
          "language": "text/cql-identifier",
          "expression": "SDE Sex"
        }
      } ]
    },
    "request": {
      "method": "POST",
      "url": "Measure/CMS986FHIRMalnutritionScore"
    }
  }, {
    "fullUrl": "https://madie.cms.gov/Library/CMS986FHIRMalnutritionScore",
    "resource": {
      "resourceType": "Library",
      "id": "CMS986FHIRMalnutritionScore",
      "meta": {
        "profile": [ "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-computablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-executablelibrary", "http://hl7.org/fhir/uv/cql/StructureDefinition/cql-library", "http://hl7.org/fhir/uv/cql/StructureDefinition/elm-json-library", "http://hl7.org/fhir/uv/cql/StructureDefinition/elm-xml-library" ]
      },
      "language": "en",
      "text": {
        "status": "extensions",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"col-12\">\n  <table class=\"narrative-table\">\n    <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Metadata</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Title</th>\n\n\n<td class=\"content-container\">CMS986FHIRMalnutritionScore</td>\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n<td class=\"content-container\">1.0.000</td>\n</tr>\n\n\n\n\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Identifier</th>\n\n\n<td class=\"content-container\">CMS986FHIRMalnutritionScore</td>\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Steward (Publisher)</th>\n\n\n<td class=\"content-container\">Academy of Nutrition and Dietetics</td>\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Description</th>\n\n\n<td class=\"content-container\">CMS986FHIRMalnutritionScore</td>\n</tr>\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/library-type#logic-library]</td>\n</tr>\n\n\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: ServiceRequest\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, status, status.value, intent, intent.value, authoredOn, authoredOn.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.101\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>: ServiceRequest\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, status, status.value, intent, intent.value, authoredOn, authoredOn.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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.91\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>: Procedure\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, status, status.value, performed\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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.101\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>: Procedure\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, status, status.value, performed\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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.91\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>: Condition\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns\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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.55\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>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, period, status, status.value\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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Library Content</th>\n\n\n</tr>\n  \n    \n    <tr>\n      <th scope=\"row\" class=\"row-header\">CQL Content</th>\n      <td>\n        <a name=\"cql-content\"> </a>\n        <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">library CMS986FHIRMalnutritionScore version '1.0.000'\r\n\r\nusing QICore version '6.0.0'\r\n\r\ninclude FHIRHelpers version '4.4.000' called FHIRHelpers\r\ninclude SupplementalDataElements version '5.1.000' called SDE\r\ninclude QICoreCommon version '4.0.000' called QICoreCommon\r\ninclude CQMCommon version '4.1.000' called CQMCommon\r\ninclude Status version '1.15.000' called Status\r\n\r\nvalueset &quot;Encounter Inpatient&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'\r\nvalueset &quot;Hospice Status&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.101'\r\nvalueset &quot;Hospice Care Referral or Admission&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1116.365'\r\nvalueset &quot;Dietitian Referral&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.91'\r\nvalueset &quot;Malnutrition Diagnosis&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.55'\r\nvalueset &quot;Malnutrition Risk Screening&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.92'\r\nvalueset &quot;Malnutrition Screening Finding of At Risk Result&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.89'\r\nvalueset &quot;Malnutrition Screening Finding of Not At Risk Result&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.34'\r\nvalueset &quot;Nutrition Assessment&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.21'\r\nvalueset &quot;Nutrition Assessment Status Finding of Moderately Malnourished&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.47'\r\nvalueset &quot;Nutrition Assessment Status Finding of Well Nourished or Not Malnourished or Mildly Malnourished&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.96'\r\nvalueset &quot;Nutrition Assessment Status Finding of Severely Malnourished&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.43'\r\nvalueset &quot;Nutrition Care Plan&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.93'\r\n\r\nparameter &quot;Measurement Period&quot; Interval&lt;DateTime&gt;\r\n\r\ncontext Patient\r\n\r\ndefine &quot;SDE Ethnicity&quot;:\r\n  SDE.&quot;SDE Ethnicity&quot;\r\n\r\ndefine &quot;SDE Payer Type&quot;:\r\n  SDE.&quot;SDE Payer&quot;\r\n\r\ndefine &quot;SDE Race&quot;:\r\n  SDE.&quot;SDE Race&quot;\r\n\r\ndefine &quot;SDE Sex&quot;:\r\n  SDE.&quot;SDE Sex&quot;\r\n\r\ndefine &quot;Measure Population&quot;:\r\n  &quot;Initial Population&quot;\r\n\r\ndefine &quot;Initial Population&quot;:\r\n  [Encounter: &quot;Encounter Inpatient&quot;] EncounterInpatient\r\n    where EncounterInpatient.period ends during day of &quot;Measurement Period&quot;\r\n      and AgeInYearsAt(date from start of EncounterInpatient.period) &gt;= 18\r\n      and ( duration in hours of EncounterInpatient.period &gt;= 24 )\r\n      and EncounterInpatient.status = 'finished'\r\n\r\ndefine &quot;Measure Population Exclusion&quot;:\r\n  &quot;Encounters with Discharge for Hospice Care&quot;\r\n    union &quot;Encounters with Hospice during Eligible Encounter&quot;\r\n\r\ndefine &quot;Encounters with Discharge for Hospice Care&quot;:\r\n  &quot;Measure Population&quot; QualifyingEncounter\r\n    where QualifyingEncounter.hospitalization.dischargeDisposition in &quot;Hospice Care Referral or Admission&quot;\n\n/*define &quot;Intervention Hospice Care&quot;:\n    ( [&quot;ServiceRequest&quot;: &quot;Hospice Status&quot;] HospiceStatusOrder\n    where HospiceStatusOrder.status in { 'active', 'completed', 'on-hold' }\n        and HospiceStatusOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }\n  )\n    union ( [&quot;Procedure&quot;: &quot;Hospice Status&quot;] HospiceStatusPerformed\n            where HospiceStatusPerformed.status in { 'completed', 'in-progress' } \n           )\n\ndefine &quot;Encounters with Hospice during Eligible Encounter&quot;:\n    &quot;Measure Population&quot; QualifyingEncounter\n    with &quot;Intervention Hospice Care&quot; HospiceStatus\n            such that Coalesce (start of HospiceStatus.performed.toInterval(), HospiceStatus.authoredOn) during day of QualifyingEncounter.hospitalizationWithObservation ( )\n*/\n//Testing definitions based on Codev comment\r\n\r\n\r\n\r\ndefine &quot;Intervention Hospice Care&quot;:\r\n  ( [&quot;ServiceRequest&quot;: &quot;Hospice Status&quot;] HospiceStatusOrder\r\n      where HospiceStatusOrder.status in { 'active', 'completed', 'on-hold' }\r\n        and HospiceStatusOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }\r\n      return HospiceStatusOrder.authoredOn\r\n  )\r\n    union ( [&quot;Procedure&quot;: &quot;Hospice Status&quot;] HospiceStatusPerformed\r\n        where HospiceStatusPerformed.status in { 'completed', 'in-progress' }\r\n        return start of HospiceStatusPerformed.performed.toInterval ( )\r\n    )\r\n\r\ndefine &quot;Encounters with Hospice during Eligible Encounter&quot;:\r\n  &quot;Measure Population&quot; QualifyingEncounter\r\n    with &quot;Intervention Hospice Care&quot; HospiceStatusDate\r\n      such that HospiceStatusDate during day of QualifyingEncounter.hospitalizationWithObservation ( )\n\n/*define &quot;Intervention Dietitian Referral&quot;:\n( [&quot;ServiceRequest&quot;: &quot;Dietitian Referral&quot;] DietitianReferralOrder\n    where DietitianReferralOrder.status in { 'active', 'completed', 'on-hold' }\n        and DietitianReferralOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }\n  \n  )\n    union ( [&quot;Procedure&quot;: &quot;Dietitian Referral&quot;] DietitianReferralPerformed\n            where DietitianReferralPerformed.status in { 'completed', 'in-progress' } \n           )\n\ndefine &quot;Encounters with Dietitian Referral&quot;:\n    &quot;Measure Population&quot; QualifyingEncounter\n    with &quot;Intervention Dietitian Referral&quot; DietitianReferral\n            such that Coalesce (start of DietitianReferral.performed.toInterval(), DietitianReferral.authoredOn) during day of QualifyingEncounter.hospitalizationWithObservation ( )\n*/\n//New definition from Codev comments\r\n\r\n\r\n\r\ndefine &quot;Intervention Dietitian Referral&quot;:\r\n  ( [&quot;ServiceRequest&quot;: &quot;Dietitian Referral&quot;] DietitianReferralOrder\r\n      where DietitianReferralOrder.status in { 'active', 'completed', 'on-hold' }\r\n        and DietitianReferralOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }\r\n      return DietitianReferralOrder.authoredOn\r\n  )\r\n    union ( [&quot;Procedure&quot;: &quot;Dietitian Referral&quot;] DietitianReferralPerformed\r\n        where DietitianReferralPerformed.status in { 'completed', 'in-progress' }\r\n        return start of DietitianReferralPerformed.performed.toInterval ( )\r\n    )\r\n\r\ndefine &quot;Encounters with Dietitian Referral&quot;:\r\n  &quot;Measure Population&quot; QualifyingEncounter\r\n    with &quot;Intervention Dietitian Referral&quot; DietitianReferralDate\r\n      such that DietitianReferralDate during day of QualifyingEncounter.hospitalizationWithObservation ( )\r\n\r\ndefine &quot;Encounters with Malnutrition Risk Screening&quot;:\r\n  &quot;Encounters with Malnutrition Risk Screening Not At Risk&quot;\r\n    union &quot;Encounters with Malnutrition Risk Screening At Risk&quot;\r\n\r\ndefine &quot;Encounters with Malnutrition Risk Screening or with Dietitian Referral&quot;:\r\n  &quot;Encounters with Malnutrition Risk Screening&quot;\r\n    union &quot;Encounters with Dietitian Referral&quot;\r\n\r\ndefine &quot;Encounters with Malnutrition Risk Screening Not At Risk&quot;:\r\n  &quot;Measure Population&quot; QualifyingEncounter\r\n    with [&quot;ObservationScreeningAssessment&quot;: &quot;Malnutrition Risk Screening&quot;] MalnutritionRiskScreening\r\n      such that MalnutritionRiskScreening.status in { 'final', 'amended', 'corrected' }\r\n        and MalnutritionRiskScreening.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\r\n        and ( MalnutritionRiskScreening.value as Concept in &quot;Malnutrition Screening Finding of Not At Risk Result&quot; )\r\n\r\ndefine &quot;Encounters with Malnutrition Not At Risk Screening and without Dietitian Referral&quot;:\r\n  &quot;Encounters with Malnutrition Risk Screening Not At Risk&quot;\r\n    except &quot;Encounters with Dietitian Referral&quot;\r\n\r\ndefine &quot;Encounters with Malnutrition Risk Screening At Risk&quot;:\r\n  &quot;Measure Population&quot; QualifyingEncounter\r\n    with [&quot;ObservationScreeningAssessment&quot;: &quot;Malnutrition Risk Screening&quot;] MalnutritionRiskScreening\r\n      such that MalnutritionRiskScreening.status in { 'final', 'amended', 'corrected' }\r\n        and MalnutritionRiskScreening.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\r\n        and ( MalnutritionRiskScreening.value as Concept in &quot;Malnutrition Screening Finding of At Risk Result&quot; )\r\n\r\ndefine &quot;Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral&quot;:\r\n  &quot;Encounters with Malnutrition Risk Screening At Risk&quot;\r\n    union &quot;Encounters with Dietitian Referral&quot;\n   \n\n/*define function &quot;Last Nutrition Assessment Day During Encounter&quot;(QualifyingEncounter Encounter):\n  Max(&quot;Nutrition Assessment Performed&quot; NutritionAssessmentTuple\n    where NutritionAssessmentTuple.HospEncId = QualifyingEncounter.id\n    return NutritionAssessmentTuple.NutrAssessTimingLatest\n  )\n\ndefine &quot;Nutrition Assessment Performed&quot;:\n    from\n    &quot;Measure Population&quot; QualifyingEncounter,\n    [&quot;ObservationScreeningAssessment&quot;: &quot;Nutrition Assessment&quot;] NutritionAssessment\n        where NutritionAssessment.status in { 'final', 'amended', 'corrected' }\n            and NutritionAssessment.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\n            and NutritionAssessment.value is not null\n            return Tuple {\n        HospEncId: QualifyingEncounter.id,\n        NutrAssessTimingLatest: NutritionAssessment.effective.latest()\n        }\n*/\n//Test definition per CODev feedback\r\n\r\n\r\n\r\ndefine function &quot;Last Nutrition Assessment Day During Encounter&quot;(QualifyingEncounter Encounter):\r\n  Max([&quot;ObservationScreeningAssessment&quot;: &quot;Nutrition Assessment&quot;] NutritionAssessment\r\n      where NutritionAssessment.status in { 'final', 'amended', 'corrected' }\r\n        and NutritionAssessment.effective.toInterval() during QualifyingEncounter.hospitalizationWithObservation()\r\n        and NutritionAssessment.value is not null\r\n      return NutritionAssessment.effective.latest()\r\n  )\r\n\r\ndefine &quot;Encounter With Most Recent Nutrition Assessment And Identified Status&quot;:\r\n  &quot;Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral&quot; QualifyingEncounter\r\n    with [&quot;ObservationScreeningAssessment&quot;: &quot;Nutrition Assessment&quot;] NutritionAssessment\r\n      such that ( NutritionAssessment.status in { 'final', 'amended', 'corrected' }\r\n          and NutritionAssessment.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\r\n          and ( NutritionAssessment.value as Concept in &quot;Nutrition Assessment Status Finding of Well Nourished or Not Malnourished or Mildly Malnourished&quot;\r\n              or ( NutritionAssessment.value as Concept in &quot;Nutrition Assessment Status Finding of Moderately Malnourished&quot; )\r\n              or ( NutritionAssessment.value as Concept in &quot;Nutrition Assessment Status Finding of Severely Malnourished&quot; )\r\n          )\r\n          and NutritionAssessment.effective.latest ( ) same day as &quot;Last Nutrition Assessment Day During Encounter&quot;(QualifyingEncounter)\r\n      )\r\n\r\ndefine &quot;Encounter With Most Recent Nutrition Assessment Status of Moderately Or Severely Malnourished&quot;:\r\n  &quot;Measure Population&quot; QualifyingEncounter\r\n    with [&quot;ObservationScreeningAssessment&quot;: &quot;Nutrition Assessment&quot;] NutritionAssessment\r\n      such that NutritionAssessment.status in { 'final', 'amended', 'corrected' }\r\n        and NutritionAssessment.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\r\n        and ( NutritionAssessment.value as Concept in &quot;Nutrition Assessment Status Finding of Moderately Malnourished&quot;\r\n            or NutritionAssessment.value as Concept in &quot;Nutrition Assessment Status Finding of Severely Malnourished&quot;\r\n        )\r\n        and NutritionAssessment.effective.latest ( ) same day as &quot;Last Nutrition Assessment Day During Encounter&quot;(QualifyingEncounter)\r\n\r\ndefine &quot;Encounter With Most Recent Nutrition Assessment Status of Not or Mildly Malnourished&quot;:\r\n  &quot;Measure Population&quot; QualifyingEncounter\r\n    with [&quot;ObservationScreeningAssessment&quot;: &quot;Nutrition Assessment&quot;] NutritionAssessment\r\n      such that ( NutritionAssessment.status in { 'final', 'amended', 'corrected' }\r\n          and NutritionAssessment.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\r\n          and ( NutritionAssessment.value as Concept in &quot;Nutrition Assessment Status Finding of Well Nourished or Not Malnourished or Mildly Malnourished&quot; )\r\n          and NutritionAssessment.effective.latest ( ) same day as &quot;Last Nutrition Assessment Day During Encounter&quot;(QualifyingEncounter)\r\n      )\r\n\r\ndefine &quot;Encounters with Malnutrition Diagnosis&quot;:\r\n  ( &quot;Measure Population&quot; QualifyingEncounter\r\n      where exists ( &quot;Has Malnutrition Diagnosis&quot; MalnutritionDiagnosis\r\n          where MalnutritionDiagnosis.prevalenceInterval ( ) overlaps day of QualifyingEncounter.hospitalizationWithObservation ( )\r\n      )\r\n  )\r\n    union &quot;Encounters With Encounter Diagnosis Of Malnutrition Diagnosis&quot;\r\n\r\ndefine &quot;Has Malnutrition Diagnosis&quot;:\r\n  [ConditionProblemsHealthConcerns: &quot;Malnutrition Diagnosis&quot;] MalnutritionDiagnosis\r\n    where MalnutritionDiagnosis.prevalenceInterval ( ) overlaps &quot;Measurement Period&quot;\r\n      and MalnutritionDiagnosis.isVerified ( )\r\n\r\ndefine &quot;Encounters With Encounter Diagnosis Of Malnutrition Diagnosis&quot;:\r\n  &quot;Measure Population&quot; QualifyingEncounter\r\n    where QualifyingEncounter.reasonCode in &quot;Malnutrition Diagnosis&quot;\r\n      or QualifyingEncounter.encounterDiagnosis ( ).verified ( ).code in &quot;Malnutrition Diagnosis&quot;\r\n\r\ndefine fluent function isVerified(condition Choice&lt;QICore.ConditionProblemsHealthConcerns, QICore.ConditionEncounterDiagnosis&gt;):\r\n  condition.verificationStatus is not null implies ( condition.verificationStatus ~ QICoreCommon.&quot;confirmed&quot;\r\n      or condition.verificationStatus ~ QICoreCommon.&quot;unconfirmed&quot;\r\n      or condition.verificationStatus ~ QICoreCommon.&quot;provisional&quot;\r\n      or condition.verificationStatus ~ QICoreCommon.&quot;differential&quot;\r\n  )\r\n\r\ndefine &quot;Encounters with Nutrition Care Plan&quot;:\r\n  &quot;Measure Population&quot; QualifyingEncounter\r\n    with [&quot;Procedure&quot;: &quot;Nutrition Care Plan&quot;] NutritionCarePlan\r\n      such that NutritionCarePlan.status in { 'completed', 'in-progress' }\r\n        and NutritionCarePlan.performed.earliest ( ) during QualifyingEncounter.hospitalizationWithObservation ( )\r\n\r\ndefine function &quot;Measure Observation 1&quot;(MalnutritionRiskScreening Encounter):\r\n  if &quot;Encounters with Malnutrition Risk Screening or with Dietitian Referral&quot; contains MalnutritionRiskScreening then 1 \r\n    else 0\r\n\r\ndefine function &quot;Measure Observation 2&quot;(NutritionAssessment Encounter):\r\n  if &quot;Encounters with Malnutrition Not At Risk Screening and without Dietitian Referral&quot; contains NutritionAssessment then 0 \r\n    else if &quot;Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral&quot; contains NutritionAssessment then if &quot;Encounter With Most Recent Nutrition Assessment And Identified Status&quot; contains NutritionAssessment then 1 \r\n    else 0 \r\n    else 0\r\n\r\ndefine function &quot;Measure Observation 3&quot;(MalnutritionDiagnosis Encounter):\r\n  if &quot;Encounters with Malnutrition Not At Risk Screening and without Dietitian Referral&quot; contains MalnutritionDiagnosis then 0 \r\n    else if &quot;Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral&quot; contains MalnutritionDiagnosis then if &quot;Encounters with Malnutrition Diagnosis&quot; contains MalnutritionDiagnosis then if &quot;Encounter With Most Recent Nutrition Assessment Status of Not or Mildly Malnourished&quot; contains MalnutritionDiagnosis then 0 \r\n    else if &quot;Encounter With Most Recent Nutrition Assessment Status of Moderately Or Severely Malnourished&quot; contains MalnutritionDiagnosis then 1 \r\n    else 0 \r\n    else 0 \r\n    else 0\r\n\r\ndefine function &quot;Measure Observation 4&quot;(NutritionCarePlan Encounter):\r\n  if &quot;Encounters with Malnutrition Not At Risk Screening and without Dietitian Referral&quot; contains NutritionCarePlan then 0 \r\n    else if &quot;Encounters with Malnutrition Risk Screening At Risk or with Dietitian Referral&quot; contains NutritionCarePlan then if &quot;Encounters with Nutrition Care Plan&quot; contains NutritionCarePlan then if &quot;Encounter With Most Recent Nutrition Assessment Status of Not or Mildly Malnourished&quot; contains NutritionCarePlan then 0 \r\n    else if &quot;Encounter With Most Recent Nutrition Assessment Status of Moderately Or Severely Malnourished&quot; contains NutritionCarePlan then 1 \r\n    else 0 \r\n    else 0 \r\n    else 0\r\n\r\ndefine function &quot;Total Malnutrition Care Score Eligible Occurrences&quot;(QualifyingEncounter Encounter):\r\n  if &quot;Encounters with Malnutrition Risk Screening or with Dietitian Referral&quot; contains QualifyingEncounter\r\n    and &quot;Encounters with Malnutrition Risk Screening Not At Risk&quot; contains QualifyingEncounter\r\n    and not ( &quot;Encounters with Dietitian Referral&quot; contains QualifyingEncounter ) then 1 \r\n    else if ( &quot;Encounters with Malnutrition Risk Screening or with Dietitian Referral&quot; contains QualifyingEncounter\r\n      and &quot;Encounters with Malnutrition Risk Screening At Risk&quot; contains QualifyingEncounter\r\n      or &quot;Encounters with Dietitian Referral&quot; contains QualifyingEncounter\r\n  )\r\n    and &quot;Encounter With Most Recent Nutrition Assessment Status of Not or Mildly Malnourished&quot; contains QualifyingEncounter\r\n    or not ( &quot;Encounter With Most Recent Nutrition Assessment And Identified Status&quot; contains QualifyingEncounter ) then 2 \r\n    else 4\r\n\r\ndefine function &quot;Measure Observation Total Malnutrition Components Score&quot;(QualifyingEncounter Encounter):\r\n  Sum({ &quot;Measure Observation 1&quot;(QualifyingEncounter), &quot;Measure Observation 2&quot;(QualifyingEncounter), &quot;Measure Observation 3&quot;(QualifyingEncounter), &quot;Measure Observation 4&quot;(QualifyingEncounter) })\r\n\r\ndefine function &quot;Measure Observation Total Malnutrition Care Score as Percentage&quot;(QualifyingEncounter Encounter):\r\n  100 * ( &quot;Measure Observation Total Malnutrition Components Score&quot;(QualifyingEncounter) / &quot;Total Malnutrition Care Score Eligible Occurrences&quot;(QualifyingEncounter) )</code></pre>\n      </td>\n    </tr>\n    \n    \n    \n  \n\n<tr>\n  <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.4.9 of the sample-content-ig Liquid templates</th>\n</tr>\n\n    </tbody>\n  </table>\n</div>"
      },
      "url": "https://madie.cms.gov/Library/CMS986FHIRMalnutritionScore",
      "identifier": [ {
        "use": "official",
        "system": "https://madie.cms.gov/login",
        "value": "CMS986FHIRMalnutritionScore"
      } ],
      "version": "1.0.000",
      "name": "CMS986FHIRMalnutritionScore",
      "title": "CMS986FHIRMalnutritionScore",
      "status": "active",
      "experimental": false,
      "type": {
        "coding": [ {
          "system": "http://terminology.hl7.org/CodeSystem/library-type",
          "code": "logic-library"
        } ]
      },
      "date": "2025-11-24T17:18:50+00:00",
      "publisher": "Academy of Nutrition and Dietetics",
      "description": "CMS986FHIRMalnutritionScore",
      "relatedArtifact": [ {
        "type": "depends-on",
        "display": "QICore model information",
        "resource": "http://hl7.org/fhir/Library/QICore-ModelInfo"
      }, {
        "type": "depends-on",
        "display": "Library FHIRHelpers",
        "resource": "https://madie.cms.gov/Library/FHIRHelpers|4.4.000"
      }, {
        "type": "depends-on",
        "display": "Library QICoreCommon",
        "resource": "https://madie.cms.gov/Library/QICoreCommon|4.0.000"
      }, {
        "type": "depends-on",
        "display": "Library CQMCommon",
        "resource": "https://madie.cms.gov/Library/CQMCommon|4.1.000"
      }, {
        "type": "depends-on",
        "display": "Library SDE",
        "resource": "https://madie.cms.gov/Library/SupplementalDataElements|5.1.000"
      }, {
        "type": "depends-on",
        "display": "Library Status",
        "resource": "https://madie.cms.gov/Library/Status|1.15.000"
      }, {
        "type": "depends-on",
        "display": "Value set Encounter Inpatient",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"
      }, {
        "type": "depends-on",
        "display": "Value set Hospice Care Referral or Admission",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1116.365"
      }, {
        "type": "depends-on",
        "display": "Value set Hospice Status",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.101"
      }, {
        "type": "depends-on",
        "display": "Value set Malnutrition Risk Screening",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.92"
      }, {
        "type": "depends-on",
        "display": "Value set Malnutrition Screening Finding of Not At Risk Result",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.34"
      }, {
        "type": "depends-on",
        "display": "Value set Malnutrition Screening Finding of At Risk Result",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.89"
      }, {
        "type": "depends-on",
        "display": "Value set Dietitian Referral",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.91"
      }, {
        "type": "depends-on",
        "display": "Value set Nutrition Assessment",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.21"
      }, {
        "type": "depends-on",
        "display": "Value set Nutrition Assessment Status Finding of Well Nourished or Not Malnourished or Mildly Malnourished",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.96"
      }, {
        "type": "depends-on",
        "display": "Value set Nutrition Assessment Status Finding of Moderately Malnourished",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.47"
      }, {
        "type": "depends-on",
        "display": "Value set Nutrition Assessment Status Finding of Severely Malnourished",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.43"
      }, {
        "type": "depends-on",
        "display": "Value set Malnutrition Diagnosis",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.55"
      }, {
        "type": "depends-on",
        "display": "Value set Nutrition Care Plan",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.93"
      } ],
      "dataRequirement": [ {
        "type": "ServiceRequest",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest" ],
        "mustSupport": [ "code", "status", "status.value", "intent", "intent.value", "authoredOn", "authoredOn.value" ],
        "codeFilter": [ {
          "path": "code",
          "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.101"
        } ]
      }, {
        "type": "ServiceRequest",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest" ],
        "mustSupport": [ "code", "status", "status.value", "intent", "intent.value", "authoredOn", "authoredOn.value" ],
        "codeFilter": [ {
          "path": "code",
          "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.91"
        } ]
      }, {
        "type": "Procedure",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure" ],
        "mustSupport": [ "code", "status", "status.value", "performed" ],
        "codeFilter": [ {
          "path": "code",
          "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.101"
        } ]
      }, {
        "type": "Procedure",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure" ],
        "mustSupport": [ "code", "status", "status.value", "performed" ],
        "codeFilter": [ {
          "path": "code",
          "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.91"
        } ]
      }, {
        "type": "Condition",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns" ],
        "mustSupport": [ "code" ],
        "codeFilter": [ {
          "path": "code",
          "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.55"
        } ]
      }, {
        "type": "Encounter",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ],
        "mustSupport": [ "type", "period", "status", "status.value" ],
        "codeFilter": [ {
          "path": "type",
          "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"
        } ]
      } ],
      "content": [ {
        "contentType": "text/cql",
        "data": "[encoded data, 23632 characters]"
      }, {
        "contentType": "application/elm+json",
        "data": "[encoded data, 1029844 characters]"
      } ]
    },
    "request": {
      "method": "POST",
      "url": "Library/CMS986FHIRMalnutritionScore"
    }
  }, {
    "fullUrl": "https://madie.cms.gov/Library/CQMCommon",
    "resource": {
      "resourceType": "Library",
      "id": "CQMCommon",
      "meta": {
        "profile": [ "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-computablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-executablelibrary", "http://hl7.org/fhir/uv/cql/StructureDefinition/cql-library", "http://hl7.org/fhir/uv/cql/StructureDefinition/elm-json-library", "http://hl7.org/fhir/uv/cql/StructureDefinition/elm-xml-library" ]
      },
      "language": "en",
      "text": {
        "status": "extensions",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"col-12\">\n  <table class=\"narrative-table\">\n    <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Metadata</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Title</th>\n\n\n<td class=\"content-container\">CQMCommon</td>\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n<td class=\"content-container\">4.1.000</td>\n</tr>\n\n\n\n\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Identifier</th>\n\n\n<td class=\"content-container\">67dda0df9e9ab93ec36dad4f</td>\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Steward (Publisher)</th>\n\n\n<td class=\"content-container\">ICF</td>\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Description</th>\n\n\n<td class=\"content-container\">This library contains declarations that are commonly used in eCQMs and shared across the logic of multiple measures, such as the Encounter Inpatient value set, and the Inpatient Encounter population criteria definition. This library also contains functions for calculating hospitalization duration as well as hospital arrival and departure times.</td>\n</tr>\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/library-type#logic-library]</td>\n</tr>\n\n\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Location\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-location\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>: Condition\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-encounter-diagnosis\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>: Condition\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns\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>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, status, status.value, period, rank, rank.value, use, condition, location, location.type, diagnosis, diagnosis.code, onAdmission\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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307\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>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, status, status.value, period, rank, rank.value, use, condition, location, location.type, diagnosis, diagnosis.code, onAdmission\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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143\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>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, status, status.value, period, rank, rank.value, use, condition, location, location.type, diagnosis, diagnosis.code, onAdmission\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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292\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>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, period, rank, rank.value, use, condition, location, location.type, diagnosis, diagnosis.code, onAdmission\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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.38\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>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: period, rank, rank.value, use, condition, location, location.type, diagnosis, diagnosis.code, type, onAdmission\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>: Claim\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-claim\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: status, status.value, use, use.value, item\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>: MedicationRequest\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: medication\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>: Medication\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medication\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code\n    <br/>\n   \n   \n  </td>\n</tr>\n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Library Content</th>\n\n\n</tr>\n  \n    \n    <tr>\n      <th scope=\"row\" class=\"row-header\">CQL Content</th>\n      <td>\n        <a name=\"cql-content\"> </a>\n        <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">library CQMCommon version '4.1.000'\n\nusing QICore version '6.0.0'\n\ninclude FHIRHelpers version '4.4.000' called FHIRHelpers\ninclude QICoreCommon version '4.0.000' called QICoreCommon\n\ncodesystem DiagnosisRole: 'http://terminology.hl7.org/CodeSystem/diagnosis-role'\ncodesystem &quot;Diagnosis Type&quot;: 'http://terminology.hl7.org/CodeSystem/ex-diagnosistype'\ncodesystem &quot;Procedure Type&quot;: 'http://terminology.hl7.org/CodeSystem/ex-procedure-type'\ncodesystem &quot;Present On Admission Indicators&quot;: 'https://www.cms.gov/Medicare/Medicare-Fee-for-Service-Payment/HospitalAcqCond/Coding'\n\nvalueset &quot;Emergency Department Visit&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292'\nvalueset &quot;Encounter Inpatient&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'\nvalueset &quot;Intensive Care Unit&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.206'\nvalueset &quot;Observation Services&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143'\nvalueset &quot;Outpatient Surgery Service&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.38'\nvalueset &quot;Present on Admission or Clinically Undetermined&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.197'\n\ncode &quot;Billing&quot;: 'billing' from DiagnosisRole display 'Billing'\ncode &quot;Admitting Diagnosis&quot;: 'admitting' from &quot;Diagnosis Type&quot; display 'Admitting Diagnosis'\ncode &quot;Clinical Diagnosis&quot;: 'clinical' from &quot;Diagnosis Type&quot; display 'Clinical Diagnosis'\ncode &quot;Differential Diagnosis&quot;: 'differential' from &quot;Diagnosis Type&quot; display 'Differential Diagnosis'\ncode &quot;Discharge Diagnosis&quot;: 'discharge' from &quot;Diagnosis Type&quot; display 'Discharge Diagnosis'\ncode &quot;Laboratory Diagnosis&quot;: 'laboratory' from &quot;Diagnosis Type&quot; display 'Laboratory Diagnosis'\ncode &quot;Nursing Diagnosis&quot;: 'nursing' from &quot;Diagnosis Type&quot; display 'Nursing Diagnosis'\ncode &quot;Prenatal Diagnosis&quot;: 'prenatal' from &quot;Diagnosis Type&quot; display 'Prenatal Diagnosis'\ncode &quot;Principal Diagnosis&quot;: 'principal' from &quot;Diagnosis Type&quot; display 'Principal Diagnosis'\ncode &quot;Radiology Diagnosis&quot;: 'radiology' from &quot;Diagnosis Type&quot; display 'Radiology Diagnosis'\ncode &quot;Remote Diagnosis&quot;: 'remote' from &quot;Diagnosis Type&quot; display 'Remote Diagnosis'\ncode &quot;Retrospective Diagnosis&quot;: 'retrospective' from &quot;Diagnosis Type&quot; display 'Retrospetive Diagnosis'\ncode &quot;Self Diagnosis&quot;: 'self' from &quot;Diagnosis Type&quot; display 'Self Diagnosis'\ncode &quot;Primary procedure&quot;: 'primary' from &quot;Procedure Type&quot; display 'Primary procedure'\ncode &quot;POA-Y&quot;: 'Y' from &quot;Present On Admission Indicators&quot; display 'POA-Y'\ncode &quot;POA-N&quot;: 'N' from &quot;Present On Admission Indicators&quot; display 'POA-N'\ncode &quot;POA-W&quot;: 'W' from &quot;Present On Admission Indicators&quot; display 'POA-W'\ncode &quot;POA-1&quot;: '1' from &quot;Present On Admission Indicators&quot; display 'POA-1'\ncode &quot;POA-U&quot;: 'U' from &quot;Present On Admission Indicators&quot; display 'POA-U'\n\nparameter &quot;Measurement Period&quot; Interval&lt;DateTime&gt;\n\ncontext Patient\n\ndefine &quot;Inpatient Encounter&quot;:\n  [Encounter: &quot;Encounter Inpatient&quot;] EncounterInpatient\n    where EncounterInpatient.status = 'finished'\n      and EncounterInpatient.period ends during day of &quot;Measurement Period&quot;\n\n/*\n@description: Returns an interval of date values extracted from the input interval of date-time values\n@comment: This function returns an interval constructed using the `date from` extractor on the start\nand end values of the input date-time interval. Note that using a precision specifier such as `day of`\nas part of a timing phrase is preferred to communicate intent to perform day-level comparison, as well\nas for general readability.\n*/\ndefine function &quot;ToDateInterval&quot;(period Interval&lt;DateTime&gt;):\n  Interval[date from start of period, date from end of period]\n\n/*\n@description: Calculates the difference in calendar days between the start and end of the given interval.\n@deprecated: This function in deprecated. Use the fluent function `lengthInDays()` instead.\n*/\ndefine function &quot;LengthInDays&quot;(Value Interval&lt;DateTime&gt; ):\n  difference in days between start of Value and end of Value\n\n/*\n@description: Calculates the difference in calendar days between the start and end of the given interval.\n*/\ndefine fluent function lengthInDays(Value Interval&lt;DateTime&gt; ):\n  difference in days between start of Value and end of Value\n\n/*\n@description: Returns the most recent emergency department visit, if any, that occurs 1 hour or less prior to the given encounter.\n@deprecated: This function is deprecated. Use the fluent function `edVisit()` instead.\n*/\ndefine function &quot;ED Visit&quot;(TheEncounter Encounter ):\n  Last(\n    [Encounter: &quot;Emergency Department Visit&quot;] EDVisit\n      where EDVisit.status = 'finished'\n        and EDVisit.period ends 1 hour or less on or before start of TheEncounter.period\n      sort by end of period\n    )\n\n/*\n@description: Returns the most recent emergency department visit, if any, that occurs 1 hour or less prior to the given encounter.\n*/\ndefine fluent function edVisit(TheEncounter Encounter ):\n  Last(\n    [Encounter: &quot;Emergency Department Visit&quot;] EDVisit\n      where EDVisit.status = 'finished'\n        and EDVisit.period ends 1 hour or less on or before start of TheEncounter.period\n      sort by end of period\n    )\n\n/*\n@description: Hospitalization returns the total interval for admission to discharge for the given encounter, or for the admission of any immediately prior emergency department visit to the discharge of the given encounter.\n@deprecated: This function is deprecated. Use the fluent function `hospitalization()` instead.\n*/\ndefine function &quot;Hospitalization&quot;(TheEncounter Encounter ):\n  ( &quot;ED Visit&quot;(TheEncounter) ) X\n    return\n        if X is null then TheEncounter.period\n        else Interval[start of X.period, end of TheEncounter.period)\n\n/*\n@description: Hospitalization returns the total interval for admission to discharge for the given encounter, or for the admission of any immediately prior emergency department visit to the discharge of the given encounter.\n*/\ndefine fluent function hospitalization(TheEncounter Encounter ):\n  (TheEncounter.&quot;edVisit&quot;()) X\n    return\n        if X is null then TheEncounter.period\n        else Interval[start of X.period, end of TheEncounter.period]\n\n/*\n@description: Returns list of all locations within an encounter, including locations for immediately prior ED visit.\n@deprecated: This function is deprecated. Use the fluent function `hospitalizationLocations()` instead.\n*/\ndefine function &quot;Hospitalization Locations&quot;(TheEncounter Encounter ):\n  ( &quot;ED Visit&quot;(TheEncounter) ) EDEncounter\n    return\n        if EDEncounter is null then TheEncounter.location\n        else flatten { EDEncounter.location, TheEncounter.location }\n\n/*\n@description: Returns list of all locations within an encounter, including locations for immediately prior ED visit.\n*/\ndefine fluent function hospitalizationLocations(TheEncounter Encounter ):\n  ( TheEncounter.&quot;edVisit&quot;()) EDEncounter\n    return\n        if EDEncounter is null then TheEncounter.location\n        else flatten { EDEncounter.location, TheEncounter.location }\n\n/*\n@description: Returns the length of stay in days (i.e. the number of days between admission and discharge) for the given encounter, or from the admission of any immediately prior emergency department visit to the discharge of the encounter\n@deprecated: This function is deprecated. Use the fluent function `hospitalizationLengthOfStay()` instead.\n*/\ndefine function &quot;Hospitalization Length of Stay&quot;(TheEncounter Encounter ):\n  LengthInDays(&quot;Hospitalization&quot;(TheEncounter))\n\n/*\n@description: Returns the length of stay in days (i.e. the number of days between admission and discharge) for the given encounter, or from the admission of any immediately prior emergency department visit to the discharge of the encounter\n*/\ndefine fluent function hospitalizationLengthOfStay(TheEncounter Encounter ):\n   TheEncounter.&quot;hospitalization&quot;().&quot;lengthInDays&quot;()\n\n/*\n@description: Returns admission time for an encounter or for immediately prior emergency department visit.\n@deprecated: This function is deprecated. Use the fluent function `hospitalAdmissionTime()` instead.\n*/\ndefine function &quot;Hospital Admission Time&quot;(TheEncounter Encounter ):\n  start of &quot;Hospitalization&quot;(TheEncounter)\n\n/*\n@description: Returns admission time for an encounter or for immediately prior emergency department visit.\n*/\ndefine fluent function hospitalAdmissionTime(TheEncounter Encounter ):\n  start of (TheEncounter.&quot;hospitalization&quot;())\n\n/*\n@description: Hospital Discharge Time returns the discharge time for an encounter\n@deprecated: This function is deprecated. Use the fluent function `hospitalDischargeTime()` instead.\n*/\ndefine function &quot;Hospital Discharge Time&quot;(TheEncounter Encounter ):\n  end of TheEncounter.period\n\n/*\n@description: Hospital Discharge Time returns the discharge time for an encounter\n*/\ndefine fluent function hospitalDischargeTime(TheEncounter Encounter ):\n  end of TheEncounter.period\n\n/*\n@description: Returns earliest arrival time for an encounter including any prior ED visit.\n@deprecated: This function is deprecated. Use the fluent function `hospitalArrivalTime()` instead.\n*/\ndefine function &quot;Hospital Arrival Time&quot;(TheEncounter Encounter ):\n  start of First(\n  \t    (&quot;Hospitalization Locations&quot;(TheEncounter) ) HospitalLocation\n  \t\t\tsort by start of period\n  \t).period\n\n/*\n@description: Returns earliest arrival time for an encounter including any prior ED visit.\n*/\ndefine fluent function hospitalArrivalTime(TheEncounter Encounter ):\n  start of First(\n  \t    (TheEncounter.&quot;hospitalizationLocations&quot;()) HospitalLocation\n  \t\t\tsort by start of period\n  \t).period\n\n/*\n@description: Returns the latest departure time for encounter including any prior ED visit.\n@deprecated: This function is deprecated. Use the fluent function `hospitalDepartureTime()` instead.\n*/\ndefine function &quot;Hospital Departure Time&quot;(TheEncounter Encounter):\n\tend of Last(\n\t    ( &quot;Hospitalization Locations&quot;(TheEncounter) ) HospitalLocation\n\t\t\tsort by start of period\n\t).period\n\n/*\n@description: Returns the latest departure time for encounter including any prior ED visit.\n*/\ndefine fluent function hospitalDepartureTime(TheEncounter Encounter):\n\tend of Last(\n\t    (TheEncounter.&quot;hospitalizationLocations&quot;()) HospitalLocation\n\t\t\tsort by start of period\n\t).period\n\n/*\n@description: Returns the emergency department arrival time for the encounter.\n@deprecated. This function is deprecated. Use the fluent function `emergencyDepartmentArrivalTime()` instead.\n*/\ndefine function &quot;Emergency Department Arrival Time&quot;(TheEncounter Encounter):\n\tstart of (\n\t    singleton from (\n\t        ( &quot;Hospitalization Locations&quot;(TheEncounter) ) HospitalLocation\n\t\t\t\twhere GetLocation(HospitalLocation.location).type in &quot;Emergency Department Visit&quot;\n\t\t)\n\t).period\n\n/*\n@description: Returns the emergency department arrival time for the encounter.\n*/\ndefine fluent function emergencyDepartmentArrivalTime(TheEncounter Encounter):\n\tstart of (\n\t    singleton from (\n\t        ( (TheEncounter.&quot;hospitalizationLocations&quot;()) ) HospitalLocation\n\t\t\t\twhere GetLocation(HospitalLocation.location).type in &quot;Emergency Department Visit&quot;\n\t\t)\n\t).period\n\n/*\n@description: Hospitalization with Observation and Outpatient Surgery Service returns the total interval from the start of any immediately prior emergency department visit, outpatient surgery visit or observation visit to the discharge of the given encounter.\n@deprecated: This function is deprecated. Use the fluent function `hospitalizationWithObservationAndOutpatientSurgeryService()` instead.\n*/\ndefine function &quot;HospitalizationWithObservationAndOutpatientSurgeryService&quot;(TheEncounter &quot;Encounter&quot; ):\n  TheEncounter Visit\n\t  let ObsVisit: Last([Encounter: &quot;Observation Services&quot;] LastObs\n\t\t  \twhere LastObs.status = 'finished'\n          and LastObs.period ends 1 hour or less on or before start of Visit.period\n\t\t\t  sort by\tend of period\n    \t),\n    \tVisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),\n    \tEDVisit: Last([Encounter: &quot;Emergency Department Visit&quot;] LastED\n\t\t\t  where LastED.status = 'finished'\n          and LastED.period ends 1 hour or less on or before VisitStart\n\t\t\t  sort by\tend of period\n    \t),\n    \tVisitStartWithED: Coalesce(start of EDVisit.period, VisitStart),\n    \tOutpatientSurgeryVisit: Last([Encounter: &quot;Outpatient Surgery Service&quot;] LastSurgeryOP\n\t\t\t  where LastSurgeryOP.period ends 1 hour or less on or before VisitStartWithED\n\t\t\t  sort by\tend of period\n    \t)\n  \treturn Interval[Coalesce(start of OutpatientSurgeryVisit.period, VisitStartWithED), end of Visit.period]\n\n/*\n@description: Hospitalization with Observation and Outpatient Surgery Service returns the total interval from the start of any immediately prior emergency department visit, outpatient surgery visit or observation visit to the discharge of the given encounter.\n*/\ndefine fluent function hospitalizationWithObservationAndOutpatientSurgeryService(TheEncounter &quot;Encounter&quot; ):\n  TheEncounter Visit\n\t  let ObsVisit: Last([Encounter: &quot;Observation Services&quot;] LastObs\n\t\t  \twhere LastObs.status = 'finished'\n          and LastObs.period ends 1 hour or less on or before start of Visit.period\n\t\t\t  sort by\tend of period\n    \t),\n    \tVisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),\n    \tEDVisit: Last([Encounter: &quot;Emergency Department Visit&quot;] LastED\n\t\t\t  where LastED.status = 'finished'\n          and LastED.period ends 1 hour or less on or before VisitStart\n\t\t\t  sort by\tend of period\n    \t),\n    \tVisitStartWithED: Coalesce(start of EDVisit.period, VisitStart),\n    \tOutpatientSurgeryVisit: Last([Encounter: &quot;Outpatient Surgery Service&quot;] LastSurgeryOP\n\t\t\t  where LastSurgeryOP.period ends 1 hour or less on or before VisitStartWithED\n\t\t\t  sort by\tend of period\n    \t)\n  \treturn Interval[Coalesce(start of OutpatientSurgeryVisit.period, VisitStartWithED), end of Visit.period]\n\n/*\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  \t\tlet ObsVisit: Last([Encounter: &quot;Observation Services&quot;] LastObs\n  \t\t\t\twhere LastObs.status = 'finished'\n            and LastObs.period ends 1 hour or less on or before start of Visit.period\n  \t\t\t\tsort by end of period\n  \t\t\t),\n  \t\t\tVisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),\n  \t\t\tEDVisit: Last([Encounter: &quot;Emergency Department Visit&quot;] LastED\n  \t\t\t\twhere LastED.status = 'finished'\n            and LastED.period ends 1 hour or less on or before VisitStart\n  \t\t\t\tsort by end of period\n  \t\t\t)\n  \t\treturn Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]\n\n/*\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*/\ndefine fluent function hospitalizationWithObservation(TheEncounter Encounter ):\n  TheEncounter Visit\n  \t\tlet ObsVisit: Last([Encounter: &quot;Observation Services&quot;] LastObs\n  \t\t\t\twhere LastObs.status = 'finished'\n            and LastObs.period ends 1 hour or less on or before start of Visit.period\n  \t\t\t\tsort by end of period\n  \t\t\t),\n  \t\t\tVisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),\n  \t\t\tEDVisit: Last([Encounter: &quot;Emergency Department Visit&quot;] LastED\n  \t\t\t\twhere LastED.status = 'finished'\n            and LastED.period ends 1 hour or less on or before VisitStart\n  \t\t\t\tsort by end of period\n  \t\t\t)\n  \t\treturn Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]\n\n/*\n@description: Hospitalization with Observation Length of Stay returns the length in days 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 `hospitalizationWithObservationLengthofStay()` instead.\n*/\ndefine function &quot;HospitalizationWithObservationLengthofStay&quot;(TheEncounter &quot;Encounter&quot; ):\n  &quot;LengthInDays&quot;(&quot;HospitalizationWithObservation&quot;(TheEncounter))\n\n/*\n@description: Hospitalization with Observation Length of Stay returns the length in days from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter\n*/\ndefine fluent function hospitalizationWithObservationLengthofStay(TheEncounter &quot;Encounter&quot; ):\n  ((TheEncounter.&quot;hospitalizationWithObservation&quot;().&quot;lengthInDays&quot;()))\n\n/*\n@description: First Inpatient Intensive Care Unit returns the first intensive care unit for the given encounter, without considering any immediately prior emergency department visit.\n@deprecated: This function is deprecated. Use the fluent function `firstInpatientIntensiveCareUnit()` instead.\n*/\ndefine function &quot;FirstInpatientIntensiveCareUnit&quot;(Encounter Encounter ):\n  First((Encounter.location)HospitalLocation\n  \t\t\twhere GetLocation(HospitalLocation.location).type in &quot;Intensive Care Unit&quot;\n  \t\t\t\tand HospitalLocation.period during Encounter.period\n  \t\t\tsort by start of period\n  \t)\n\n/*\n@description: First Inpatient Intensive Care Unit returns the first intensive care unit for the given encounter, without considering any immediately prior emergency department visit.\n*/\ndefine fluent function firstInpatientIntensiveCareUnit(Encounter Encounter ):\n  First((Encounter.location)HospitalLocation\n  \t\t\twhere GetLocation(HospitalLocation.location).type in &quot;Intensive Care Unit&quot;\n  \t\t\t\tand HospitalLocation.period during Encounter.period\n  \t\t\tsort by start of period\n  \t)\n\n/*\n@description: Returns the Condition resource referenced by the `diagnosis.condition` element of the Encounter\n@deprecated: This function is deprecated. Use the fluent function `encounterDiagnosis()` instead.\n*/\ndefine function &quot;EncounterDiagnosis&quot;(Encounter Encounter ):\n  Encounter.diagnosis D\n\treturn singleton from (([ConditionEncounterDiagnosis] union [ConditionProblemsHealthConcerns]) C where D.condition.references(C.id))\n\n/*  \n@description: Returns the Condition resources referenced by the diagnosis element of the Encounter  \n*/\ndefine fluent function encounterDiagnosis(Encounter Encounter ):\n  Encounter.reasonReference D\n    return singleton from (([ConditionEncounterDiagnosis] union [ConditionProblemsHealthConcerns]) C where D.references(C.id))\n\n\n/*\n@description: Returns the Condition resource for the given reference\n@deprecated: This function is deprecated. Use the fluent function `getCondition()` instead\n*/\ndefine function &quot;GetCondition&quot;(reference Reference):\n  singleton from (([ConditionEncounterDiagnosis] union [ConditionProblemsHealthConcerns]) C where reference.references(C.id))\n\n/*\n@description: Returns the Condition resource for the given reference\n*/\ndefine fluent function getCondition(reference Reference):\n  singleton from (([ConditionEncounterDiagnosis] union [ConditionProblemsHealthConcerns]) C where reference.references(C.id))\n\n/*\n@description: Returns the condition that is specified as the principal diagnosis for the encounter\n@deprecated: This function is deprecated. Use the fluent function `principalDiagnosis()` instead.\n*/\ndefine function &quot;PrincipalDiagnosis&quot;(Encounter Encounter):\n\tsingleton from (\n\t(Encounter.diagnosis D where D.rank = 1 and D.use ~ &quot;Billing&quot;) PD\n      return singleton from (([ConditionEncounterDiagnosis] union [ConditionProblemsHealthConcerns]) C where PD.condition.references(C.id))\n\t)\n\n/*\n@description: Returns the claim diagnosis element that is specified as the principal diagnosis for the encounter\n @comment: See the QICore 6 Authoring Patterns discussion on [Principal Diagnosis and Present on Admission](https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns-QICore-v6.0.0#conditions-present-on-admission-and-principal-diagnoses) for more information\n*/\ndefine fluent function principalDiagnosis(encounter Encounter):\nsingleton from (\n     (encounter.claimDiagnosis()) CD\n       where CD.type.includesCode(&quot;Principal Diagnosis&quot;)\n   )\n/*\n@description: Returns the claim diagnosis elements for the given encounter\n@comment: See the QICore 6 Authoring Patterns discussion on [Principal Diagnosis and Present on Admission](https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns-QICore-v6.0.0#conditions-present-on-admission-and-principal-diagnoses) for more information\n*/\ndefine fluent function claimDiagnosis(encounter Encounter):\n  encounter E\n    let \n      claim: ([Claim] C where C.status = 'active' and C.use = 'claim' and exists (C.item I where I.encounter.references(E))),\n      claimItem: (claim.item I where I.encounter.references(E))\n    return claim.diagnosis D where D.sequence in claimItem.diagnosisSequence\n\n\n/*\n @description: Returns the condition that is specified as the principal diagnosis for the encounter and has a code in the given valueSet.\n @comment: See the QICore 6 Authoring Patterns discussion on [Principal Diagnosis and Present on Admission](https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns-QICore-v6.0.0#conditions-present-on-admission-and-principal-diagnoses) for more information\n */\n define fluent function hasPrincipalDiagnosisOf(encounter Encounter, valueSet ValueSet):\n   (encounter.principalDiagnosis()) PD\n     return PD.diagnosis in valueSet\n       or PD.diagnosis.getCondition().code in valueSet\n\n/*\n @description: Returns true if the given diagnosis is present on admission, based on the given poaValueSet\n @comment: See the QICore 6 Authoring Patterns discussion on [Principal Diagnosis and Present on Admission](https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns-QICore-v6.0.0#conditions-present-on-admission-and-principal-diagnoses) for more information\n */\n define fluent function isDiagnosisPresentOnAdmission(encounter Encounter, diagnosisValueSet ValueSet, poaValueSet ValueSet):\n   exists (\n     (encounter.claimDiagnosis()) CD\n       where CD.onAdmission in poaValueSet\n         and (\n           CD.diagnosis in diagnosisValueSet\n             or CD.diagnosis.getCondition().code in diagnosisValueSet\n         )\n   )\n\n/*\n@description: Returns the Location resource specified by the given reference\n@deprecated: This function is deprecated. Use the fluent function `getLocation()` instead.\n*/\ndefine function &quot;GetLocation&quot;(reference Reference):\n  singleton from (\n    [Location] L where reference.references(L)\n  )\n\n/*\n@description: Returns the Location resource specified by the given reference.\n*/\ndefine fluent function getLocation(reference Reference):\n  singleton from (\n    [Location] L where reference.references(L)\n  )\n\n/*\n@description: Returns the medication code for the given MedicationRequest\n@deprecated: This function is deprecated. Use the fluent function `getMedicationCode()` instead.\n*/\ndefine function &quot;GetMedicationCode&quot;(request MedicationRequest):\n  if request.medication is Concept then\n  \t  request.medication as Concept\n  \telse\n  \t  (singleton from ([Medication] M where request.medication.references(M))).code\n\n/*\n@description: Returns the medication code for the given MedicationRequest\n*/\ndefine fluent function getMedicationCode(request MedicationRequest):\n  if request.medication is Concept then\n  \t  request.medication as Concept\n  \telse\n  \t  (singleton from ([Medication] M where request.medication.references(M))).code\n  \t  \n/*\n@description: Returns the claim procedure elements for the given encounter\n*/\ndefine fluent function principalProcedure(encounter Encounter):  \t  \n  \t encounter E\n  \t let \n        claim: [Claim] C where C.status = 'active' and C.use = 'claim' and exists (C.item I where I.encounter.references(E)),\n        claimItem: claim.item I where I.encounter.references(E),\n        princProcedure: singleton from (claim.procedure P where P.sequence in claimItem.procedureSequence and P.type.includesCode(&quot;Primary procedure&quot;))\n    return princProcedure</code></pre>\n      </td>\n    </tr>\n    \n    \n    \n  \n\n<tr>\n  <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.4.9 of the sample-content-ig Liquid templates</th>\n</tr>\n\n    </tbody>\n  </table>\n</div>"
      },
      "extension": [ {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/diagnosis-role",
          "code": "billing",
          "display": "Billing"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype",
          "code": "admitting",
          "display": "Admitting Diagnosis"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype",
          "code": "clinical",
          "display": "Clinical Diagnosis"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype",
          "code": "differential",
          "display": "Differential Diagnosis"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype",
          "code": "discharge",
          "display": "Discharge Diagnosis"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype",
          "code": "laboratory",
          "display": "Laboratory Diagnosis"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype",
          "code": "nursing",
          "display": "Nursing Diagnosis"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype",
          "code": "prenatal",
          "display": "Prenatal Diagnosis"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype",
          "code": "principal",
          "display": "Principal Diagnosis"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype",
          "code": "radiology",
          "display": "Radiology Diagnosis"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype",
          "code": "remote",
          "display": "Remote Diagnosis"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype",
          "code": "retrospective",
          "display": "Retrospective Diagnosis"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype",
          "code": "self",
          "display": "Self Diagnosis"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/ex-procedure-type",
          "code": "primary",
          "display": "Primary procedure"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "https://www.cms.gov/Medicare/Medicare-Fee-for-Service-Payment/HospitalAcqCond/Coding",
          "code": "Y",
          "display": "POA-Y"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "https://www.cms.gov/Medicare/Medicare-Fee-for-Service-Payment/HospitalAcqCond/Coding",
          "code": "N",
          "display": "POA-N"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "https://www.cms.gov/Medicare/Medicare-Fee-for-Service-Payment/HospitalAcqCond/Coding",
          "code": "W",
          "display": "POA-W"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "https://www.cms.gov/Medicare/Medicare-Fee-for-Service-Payment/HospitalAcqCond/Coding",
          "code": "1",
          "display": "POA-1"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "https://www.cms.gov/Medicare/Medicare-Fee-for-Service-Payment/HospitalAcqCond/Coding",
          "code": "U",
          "display": "POA-U"
        }
      } ],
      "url": "https://madie.cms.gov/Library/CQMCommon",
      "identifier": [ {
        "use": "official",
        "system": "https://madie.cms.gov/login",
        "value": "67dda0df9e9ab93ec36dad4f"
      } ],
      "version": "4.1.000",
      "name": "CQMCommon",
      "title": "CQMCommon",
      "status": "active",
      "experimental": false,
      "type": {
        "coding": [ {
          "system": "http://terminology.hl7.org/CodeSystem/library-type",
          "code": "logic-library"
        } ]
      },
      "date": "2025-11-24T17:18:53+00:00",
      "publisher": "ICF",
      "description": "This library contains declarations that are commonly used in eCQMs and shared across the logic of multiple measures, such as the Encounter Inpatient value set, and the Inpatient Encounter population criteria definition. This library also contains functions for calculating hospitalization duration as well as hospital arrival and departure times.",
      "relatedArtifact": [ {
        "type": "depends-on",
        "display": "QICore model information",
        "resource": "http://hl7.org/fhir/Library/QICore-ModelInfo"
      }, {
        "type": "depends-on",
        "display": "Library QICoreCommon",
        "resource": "https://madie.cms.gov/Library/QICoreCommon|4.0.000"
      }, {
        "type": "depends-on",
        "display": "Library FHIRHelpers",
        "resource": "https://madie.cms.gov/Library/FHIRHelpers|4.4.000"
      }, {
        "type": "depends-on",
        "display": "Code system DiagnosisRole",
        "resource": "http://terminology.hl7.org/CodeSystem/diagnosis-role"
      }, {
        "type": "depends-on",
        "display": "Code system Diagnosis Type",
        "resource": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype"
      }, {
        "type": "depends-on",
        "display": "Code system Procedure Type",
        "resource": "http://terminology.hl7.org/CodeSystem/ex-procedure-type"
      }, {
        "type": "depends-on",
        "display": "Value set Observation Services",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"
      }, {
        "type": "depends-on",
        "display": "Value set Emergency Department Visit",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"
      }, {
        "type": "depends-on",
        "display": "Value set Outpatient Surgery Service",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.38"
      }, {
        "type": "depends-on",
        "display": "Value set Encounter Inpatient",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"
      }, {
        "type": "depends-on",
        "display": "Value set Intensive Care Unit",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.206"
      } ],
      "dataRequirement": [ {
        "type": "Location",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-location" ]
      }, {
        "type": "Condition",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-encounter-diagnosis" ]
      }, {
        "type": "Condition",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns" ]
      }, {
        "type": "Encounter",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ],
        "mustSupport": [ "type", "status", "status.value", "period", "rank", "rank.value", "use", "condition", "location", "location.type", "diagnosis", "diagnosis.code", "onAdmission" ],
        "codeFilter": [ {
          "path": "type",
          "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"
        } ]
      }, {
        "type": "Encounter",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ],
        "mustSupport": [ "type", "status", "status.value", "period", "rank", "rank.value", "use", "condition", "location", "location.type", "diagnosis", "diagnosis.code", "onAdmission" ],
        "codeFilter": [ {
          "path": "type",
          "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"
        } ]
      }, {
        "type": "Encounter",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ],
        "mustSupport": [ "type", "status", "status.value", "period", "rank", "rank.value", "use", "condition", "location", "location.type", "diagnosis", "diagnosis.code", "onAdmission" ],
        "codeFilter": [ {
          "path": "type",
          "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"
        } ]
      }, {
        "type": "Encounter",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ],
        "mustSupport": [ "type", "period", "rank", "rank.value", "use", "condition", "location", "location.type", "diagnosis", "diagnosis.code", "onAdmission" ],
        "codeFilter": [ {
          "path": "type",
          "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.38"
        } ]
      }, {
        "type": "Encounter",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ],
        "mustSupport": [ "period", "rank", "rank.value", "use", "condition", "location", "location.type", "diagnosis", "diagnosis.code", "type", "onAdmission" ]
      }, {
        "type": "Claim",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-claim" ],
        "mustSupport": [ "status", "status.value", "use", "use.value", "item" ]
      }, {
        "type": "MedicationRequest",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest" ],
        "mustSupport": [ "medication" ]
      }, {
        "type": "Medication",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medication" ],
        "mustSupport": [ "code" ]
      } ],
      "content": [ {
        "contentType": "text/cql",
        "data": "[encoded data, 32192 characters]"
      }, {
        "contentType": "application/elm+xml",
        "data": "[encoded data, 704780 characters]"
      }, {
        "contentType": "application/elm+json",
        "data": "[encoded data, 1082368 characters]"
      } ]
    },
    "request": {
      "method": "POST",
      "url": "Library/CQMCommon"
    }
  }, {
    "fullUrl": "https://madie.cms.gov/Library/SupplementalDataElements",
    "resource": {
      "resourceType": "Library",
      "id": "SupplementalDataElements",
      "meta": {
        "profile": [ "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-computablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-executablelibrary", "http://hl7.org/fhir/uv/cql/StructureDefinition/cql-library", "http://hl7.org/fhir/uv/cql/StructureDefinition/elm-json-library", "http://hl7.org/fhir/uv/cql/StructureDefinition/elm-xml-library" ]
      },
      "language": "en",
      "text": {
        "status": "extensions",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"col-12\">\n  <table class=\"narrative-table\">\n    <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Metadata</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Title</th>\n\n\n<td class=\"content-container\">SupplementalDataElements</td>\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n<td class=\"content-container\">5.1.000</td>\n</tr>\n\n\n\n\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Identifier</th>\n\n\n<td class=\"content-container\">67e5bc4d88f4d211353e632e</td>\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Steward (Publisher)</th>\n\n\n<td class=\"content-container\">ICF</td>\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Description</th>\n\n\n<td class=\"content-container\">This is the QI-Core 6.0.0 version of the Supplemental Data Elements library containing the CMS SDE definitions for Payer, Race, Ethnicity and Sex</td>\n</tr>\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/library-type#logic-library]</td>\n</tr>\n\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    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: extension, url\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>: Coverage\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage\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> http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Library Content</th>\n\n\n</tr>\n  \n    \n    <tr>\n      <th scope=\"row\" class=\"row-header\">CQL Content</th>\n      <td>\n        <a name=\"cql-content\"> </a>\n        <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\r\n@update: GCW 2025-03-27 -&gt;\r\nUpdated to reflect valueset name change from CMS Sex to Federal Administrative Sex\r\n*/\r\nlibrary SupplementalDataElements version '5.1.000'\r\n\r\nusing QICore version '6.0.0'\r\n\r\ninclude FHIRHelpers version '4.4.000' called FHIRHelpers\r\n\r\ncodesystem &quot;SNOMEDCT&quot;: 'http://snomed.info/sct'\r\n\r\nvalueset &quot;Ethnicity&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837'\r\nvalueset &quot;Federal Administrative Sex&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1021.121'\r\nvalueset &quot;Payer Type&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591'\r\nvalueset &quot;Race&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836'\r\n\r\ncode &quot;Male (finding)&quot;: '248153007' from &quot;SNOMEDCT&quot; display 'Male (finding)'\r\ncode &quot;Female (finding)&quot;: '248152002' from &quot;SNOMEDCT&quot; display 'Female (finding)'\r\n\r\ncontext Patient\r\n\r\ndefine &quot;SDE Ethnicity&quot;:\r\n  Patient.ethnicity E\r\n    return Tuple {\r\n      codes: { E.ombCategory } union E.detailed,\r\n      display: E.text\r\n    }\r\n\r\ndefine &quot;SDE Payer&quot;:\r\n  [Coverage: type in &quot;Payer Type&quot;] Payer\r\n    return {\r\n      code: Payer.type,\r\n      period: Payer.period\r\n    }\r\n\r\ndefine &quot;SDE Race&quot;:\r\n  Patient.race R\r\n    return Tuple {\r\n      codes: R.ombCategory union R.detailed,\r\n      display: R.text\r\n    }\r\n\r\ndefine &quot;SDE Sex&quot;:\r\n  case\r\n    when Patient.sex = '248153007' then &quot;Male (finding)&quot;\r\n    when Patient.sex = '248152002' then &quot;Female (finding)&quot;\r\n    else null\r\n  end</code></pre>\n      </td>\n    </tr>\n    \n    \n    \n  \n\n<tr>\n  <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.4.9 of the sample-content-ig Liquid templates</th>\n</tr>\n\n    </tbody>\n  </table>\n</div>"
      },
      "extension": [ {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://snomed.info/sct",
          "code": "248153007",
          "display": "Male (finding)"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://snomed.info/sct",
          "code": "248152002",
          "display": "Female (finding)"
        }
      } ],
      "url": "https://madie.cms.gov/Library/SupplementalDataElements",
      "identifier": [ {
        "use": "official",
        "system": "https://madie.cms.gov/login",
        "value": "67e5bc4d88f4d211353e632e"
      } ],
      "version": "5.1.000",
      "name": "SupplementalDataElements",
      "title": "SupplementalDataElements",
      "status": "active",
      "experimental": false,
      "type": {
        "coding": [ {
          "system": "http://terminology.hl7.org/CodeSystem/library-type",
          "code": "logic-library"
        } ]
      },
      "date": "2025-11-24T17:18:51+00:00",
      "publisher": "ICF",
      "description": "This is the QI-Core 6.0.0 version of the Supplemental Data Elements library containing the CMS SDE definitions for Payer, Race, Ethnicity and Sex",
      "relatedArtifact": [ {
        "type": "depends-on",
        "display": "QICore model information",
        "resource": "http://hl7.org/fhir/Library/QICore-ModelInfo"
      }, {
        "type": "depends-on",
        "display": "Library FHIRHelpers",
        "resource": "https://madie.cms.gov/Library/FHIRHelpers|4.4.000"
      }, {
        "type": "depends-on",
        "display": "Code system SNOMEDCT",
        "resource": "http://snomed.info/sct"
      }, {
        "type": "depends-on",
        "display": "Value set Payer Type",
        "resource": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"
      } ],
      "dataRequirement": [ {
        "type": "Patient",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient" ],
        "mustSupport": [ "extension", "url" ]
      }, {
        "type": "Coverage",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage" ],
        "mustSupport": [ "type", "period" ],
        "codeFilter": [ {
          "path": "type",
          "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"
        } ]
      } ],
      "content": [ {
        "contentType": "text/cql",
        "data": "LyoNCkB1cGRhdGU6IEdDVyAyMDI1LTAzLTI3IC0+DQpVcGRhdGVkIHRvIHJlZmxlY3QgdmFsdWVzZXQgbmFtZSBjaGFuZ2UgZnJvbSBDTVMgU2V4IHRvIEZlZGVyYWwgQWRtaW5pc3RyYXRpdmUgU2V4DQoqLw0KbGlicmFyeSBTdXBwbGVtZW50YWxEYXRhRWxlbWVudHMgdmVyc2lvbiAnNS4xLjAwMCcNCg0KdXNpbmcgUUlDb3JlIHZlcnNpb24gJzYuMC4wJw0KDQppbmNsdWRlIEZISVJIZWxwZXJzIHZlcnNpb24gJzQuNC4wMDAnIGNhbGxlZCBGSElSSGVscGVycw0KDQpjb2Rlc3lzdGVtICJTTk9NRURDVCI6ICdodHRwOi8vc25vbWVkLmluZm8vc2N0Jw0KDQp2YWx1ZXNldCAiRXRobmljaXR5IjogJ2h0dHA6Ly9jdHMubmxtLm5paC5nb3YvZmhpci9WYWx1ZVNldC8yLjE2Ljg0MC4xLjExNDIyMi40LjExLjgzNycNCnZhbHVlc2V0ICJGZWRlcmFsIEFkbWluaXN0cmF0aXZlIFNleCI6ICdodHRwOi8vY3RzLm5sbS5uaWguZ292L2ZoaXIvVmFsdWVTZXQvMi4xNi44NDAuMS4xMTM3NjIuMS40LjEwMjEuMTIxJw0KdmFsdWVzZXQgIlBheWVyIFR5cGUiOiAnaHR0cDovL2N0cy5ubG0ubmloLmdvdi9maGlyL1ZhbHVlU2V0LzIuMTYuODQwLjEuMTE0MjIyLjQuMTEuMzU5MScNCnZhbHVlc2V0ICJSYWNlIjogJ2h0dHA6Ly9jdHMubmxtLm5paC5nb3YvZmhpci9WYWx1ZVNldC8yLjE2Ljg0MC4xLjExNDIyMi40LjExLjgzNicNCg0KY29kZSAiTWFsZSAoZmluZGluZykiOiAnMjQ4MTUzMDA3JyBmcm9tICJTTk9NRURDVCIgZGlzcGxheSAnTWFsZSAoZmluZGluZyknDQpjb2RlICJGZW1hbGUgKGZpbmRpbmcpIjogJzI0ODE1MjAwMicgZnJvbSAiU05PTUVEQ1QiIGRpc3BsYXkgJ0ZlbWFsZSAoZmluZGluZyknDQoNCmNvbnRleHQgUGF0aWVudA0KDQpkZWZpbmUgIlNERSBFdGhuaWNpdHkiOg0KICBQYXRpZW50LmV0aG5pY2l0eSBFDQogICAgcmV0dXJuIFR1cGxlIHsNCiAgICAgIGNvZGVzOiB7IEUub21iQ2F0ZWdvcnkgfSB1bmlvbiBFLmRldGFpbGVkLA0KICAgICAgZGlzcGxheTogRS50ZXh0DQogICAgfQ0KDQpkZWZpbmUgIlNERSBQYXllciI6DQogIFtDb3ZlcmFnZTogdHlwZSBpbiAiUGF5ZXIgVHlwZSJdIFBheWVyDQogICAgcmV0dXJuIHsNCiAgICAgIGNvZGU6IFBheWVyLnR5cGUsDQogICAgICBwZXJpb2Q6IFBheWVyLnBlcmlvZA0KICAgIH0NCg0KZGVmaW5lICJTREUgUmFjZSI6DQogIFBhdGllbnQucmFjZSBSDQogICAgcmV0dXJuIFR1cGxlIHsNCiAgICAgIGNvZGVzOiBSLm9tYkNhdGVnb3J5IHVuaW9uIFIuZGV0YWlsZWQsDQogICAgICBkaXNwbGF5OiBSLnRleHQNCiAgICB9DQoNCmRlZmluZSAiU0RFIFNleCI6DQogIGNhc2UNCiAgICB3aGVuIFBhdGllbnQuc2V4ID0gJzI0ODE1MzAwNycgdGhlbiAiTWFsZSAoZmluZGluZykiDQogICAgd2hlbiBQYXRpZW50LnNleCA9ICcyNDgxNTIwMDInIHRoZW4gIkZlbWFsZSAoZmluZGluZykiDQogICAgZWxzZSBudWxsDQogIGVuZA=="
      }, {
        "contentType": "application/elm+xml",
        "data": "[encoded data, 61716 characters]"
      }, {
        "contentType": "application/elm+json",
        "data": "[encoded data, 121536 characters]"
      } ]
    },
    "request": {
      "method": "POST",
      "url": "Library/SupplementalDataElements"
    }
  }, {
    "fullUrl": "https://madie.cms.gov/Library/Status",
    "resource": {
      "resourceType": "Library",
      "id": "Status",
      "meta": {
        "profile": [ "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-computablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-executablelibrary", "http://hl7.org/fhir/uv/cql/StructureDefinition/cql-library", "http://hl7.org/fhir/uv/cql/StructureDefinition/elm-json-library", "http://hl7.org/fhir/uv/cql/StructureDefinition/elm-xml-library" ]
      },
      "language": "en",
      "text": {
        "status": "extensions",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"col-12\">\n  <table class=\"narrative-table\">\n    <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Metadata</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Title</th>\n\n\n<td class=\"content-container\">Status</td>\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n<td class=\"content-container\">1.15.000</td>\n</tr>\n\n\n\n\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Identifier</th>\n\n\n<td class=\"content-container\">684c4d910d70b65363c69edf</td>\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Steward (Publisher)</th>\n\n\n<td class=\"content-container\">National Committee for Quality Assurance</td>\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Description</th>\n\n\n<td class=\"content-container\">This library contains functions used to constrain FHIR resource elements for measures authored by NCQA, based on QICore 6.0.0 resources including IG and authoring patterns. The functions may appear similar to some QICoreCommon functions but differ in that they have constraints that are relevant for measures authored by NCQA.</td>\n</tr>\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/library-type#logic-library]</td>\n</tr>\n\n\n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Library Content</th>\n\n\n</tr>\n  \n    \n    <tr>\n      <th scope=\"row\" class=\"row-header\">CQL Content</th>\n      <td>\n        <a name=\"cql-content\"> </a>\n        <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">library Status version '1.15.000'\n\nusing QICore version '6.0.0'\n\ninclude FHIRHelpers version '4.4.000' called FHIRHelpers\n\ncodesystem &quot;ObservationCategoryCodes&quot;: 'http://terminology.hl7.org/CodeSystem/observation-category'\ncodesystem &quot;ConditionVerificationStatusCodes&quot;: 'http://terminology.hl7.org/CodeSystem/condition-ver-status'\n\ncode &quot;exam&quot;: 'exam' from &quot;ObservationCategoryCodes&quot; display 'exam'\ncode &quot;imaging&quot;: 'imaging' from &quot;ObservationCategoryCodes&quot; display 'imaging'\ncode &quot;confirmed&quot;: 'confirmed' from ConditionVerificationStatusCodes display 'confirmed'\ncode &quot;unconfirmed&quot;: 'unconfirmed' from ConditionVerificationStatusCodes display 'unconfirmed'\ncode &quot;provisional&quot;: 'provisional' from ConditionVerificationStatusCodes display 'provisional'\ncode &quot;differential&quot;: 'differential' from ConditionVerificationStatusCodes display 'differential'\n\ncontext Patient\n\n//This library contains functions used to constrain FHIR resource elements for measures authored by NCQA, based on QICore 6.0.0 resources including IG and authoring patterns. The functions may appear similar to some QICoreCommon functions but differ in that they have constraints that are relevant for measures authored by NCQA.\n\n//Condition\n//Returns conditions in the given list that either have no verification status or have a verification status of confirmed, unconfirmed, provisional, or differential\ndefine fluent function verified(conditions List&lt;Choice&lt;ConditionProblemsHealthConcerns, ConditionEncounterDiagnosis&gt;&gt;):\n  conditions C\n    where C.verificationStatus is not null implies\n      (C.verificationStatus ~ &quot;confirmed&quot;\n        or C.verificationStatus ~ &quot;unconfirmed&quot;\n        or C.verificationStatus ~ &quot;provisional&quot;\n        or C.verificationStatus ~ &quot;differential&quot;\n      )\n\n//Assessment, Performed\ndefine fluent function isAssessmentPerformed(Obs List&lt;ObservationScreeningAssessment&gt;):\n  Obs O\n    where O.status in { 'final', 'amended', 'corrected' }\n\n//Device, Order - Personal Use Devices\ndefine fluent function isDeviceOrderPersonalUseDevices(DeviceRequest List&lt;DeviceRequest&gt;):\n  DeviceRequest D\n    where D.status in { 'active', 'completed' }\n      and D.intent in {'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'}\n\n//Diagnostic Study, Order\ndefine fluent function isDiagnosticStudyOrder(ServiceRequest List&lt;ServiceRequest&gt;):\n  ServiceRequest S\n    where S.status in { 'active', 'completed' }\n      and S.intent in {'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'}\n      \n//Intervention, Order\ndefine fluent function isInterventionOrder(ServiceRequest List&lt;ServiceRequest&gt;):\n  ServiceRequest S\n    where S.status in { 'active', 'completed' }\n      and S.intent in {'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'}    \n\n//Laboratory Test, Order\ndefine fluent function isLaboratoryTestOrder(ServiceRequest List&lt;ServiceRequest&gt;):\n  ServiceRequest S\n    where S.status in { 'active', 'completed' }\n      and S.intent in {'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'}       \n\n//Diagnostic Study, Performed\ndefine fluent function isDiagnosticStudyPerformed(Obs List&lt;ObservationClinicalResult&gt;):\n  Obs O\n    where O.status in { 'final', 'amended', 'corrected' }\n        and exists ( O.category ObservationCategory\n        where ( ObservationCategory ) ~ &quot;imaging&quot;\n    )\n    \n//Encounter, Performed\n//General usage unless required otherwise by measure intent (e.g., follow-up encounters)\ndefine fluent function isEncounterPerformed(Enc List&lt;Encounter&gt;):\n  Enc E\n    where E.status = 'finished'\n\n//Immunization, Administered\ndefine fluent function isImmunizationAdministered(Immunization List&lt;Immunization&gt;):\n  Immunization I\n    where I.status ~ 'completed'\n\n//Intervention, Performed\ndefine fluent function isInterventionPerformed(Proc List&lt;Procedure&gt;):\n  Proc P\n    where P.status ~ 'completed'\n\n//Procedure, Performed\ndefine fluent function isProcedurePerformed(Proc List&lt;Procedure&gt;):\n  Proc P\n    where P.status ~ 'completed'\n\n//Laboratory Test, Performed\ndefine fluent function isLaboratoryTestPerformed(Obs List&lt;LaboratoryResultObservation&gt;):\n  Obs O\n    where O.status in { 'final', 'amended', 'corrected' }\n\n//Medication, Active\ndefine fluent function isMedicationActive(MedicationRequest List&lt;MedicationRequest&gt;):\n  MedicationRequest M\n    where M.status = 'active'\n      and M.intent in {'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'}\n\n//Medication, Dispensed\ndefine fluent function isMedicationDispensed(Med List&lt;MedicationDispense&gt;):\n  Med M\n    where M.status in { 'completed', 'in-progress', 'on-hold' }\n\n//Medication, Order\ndefine fluent function isMedicationOrder(MedicationRequest List&lt;MedicationRequest&gt;):\n  MedicationRequest M\n    where M.status in { 'active', 'completed' }\n    and M.intent in {'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'}\n\n//Physical Exam, Performed\ndefine fluent function isPhysicalExamPerformed(Obs List&lt;ObservationClinicalResult&gt;):\n  Obs O\n    where O.status in { 'final', 'amended', 'corrected' }\n      and exists ( O.category ObservationCategory\n          where ( ObservationCategory ) ~ &quot;exam&quot;\n      )\n\n//Observation Vital Signs\ndefine fluent function isObservationBP(Obs List&lt;USCoreBloodPressureProfile&gt;):\n  Obs O\n    where O.status in { 'final', 'amended', 'corrected' }\n      \ndefine fluent function isObservationBodyHeight(Obs List&lt;USCoreBodyHeightProfile&gt;):\n  Obs O\n    where O.status in { 'final', 'amended', 'corrected' }\n      \ndefine fluent function isObservationBodyWeight(Obs List&lt;USCoreBodyWeightProfile&gt;):\n  Obs O\n    where O.status in { 'final', 'amended', 'corrected' }\n      \ndefine fluent function isObservationBMI(Obs List&lt;USCoreBMIProfile&gt;):\n  Obs O\n    where O.status in { 'final', 'amended', 'corrected' }\n \n//Observation Pediatric BMI\ndefine fluent function isObservationPediatricBMI(Obs List&lt;USCorePediatricBMIforAgeObservationProfile&gt;):\n  Obs O\n    where O.status in { 'final', 'amended', 'corrected' } \n   \n//Observation Smoking Status\ndefine fluent function isObservationSmokingStatus(Obs List&lt;USCoreSmokingStatusProfile&gt;):\n  Obs O\n    where O.status = 'final' \n\n//Symptom\ndefine fluent function isSymptom(Obs List&lt;SimpleObservation&gt;):\n  Obs O\n    where O.status in { 'preliminary', 'final', 'amended', 'corrected' }</code></pre>\n      </td>\n    </tr>\n    \n    \n    \n  \n\n<tr>\n  <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.4.9 of the sample-content-ig Liquid templates</th>\n</tr>\n\n    </tbody>\n  </table>\n</div>"
      },
      "extension": [ {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/observation-category",
          "code": "exam",
          "display": "exam"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/observation-category",
          "code": "imaging",
          "display": "imaging"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
          "code": "confirmed",
          "display": "confirmed"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
          "code": "unconfirmed",
          "display": "unconfirmed"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
          "code": "provisional",
          "display": "provisional"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
          "code": "differential",
          "display": "differential"
        }
      } ],
      "url": "https://madie.cms.gov/Library/Status",
      "identifier": [ {
        "use": "official",
        "system": "https://madie.cms.gov/login",
        "value": "684c4d910d70b65363c69edf"
      } ],
      "version": "1.15.000",
      "name": "Status",
      "title": "Status",
      "status": "active",
      "experimental": false,
      "type": {
        "coding": [ {
          "system": "http://terminology.hl7.org/CodeSystem/library-type",
          "code": "logic-library"
        } ]
      },
      "date": "2025-11-24T17:18:54+00:00",
      "publisher": "National Committee for Quality Assurance",
      "description": "This library contains functions used to constrain FHIR resource elements for measures authored by NCQA, based on QICore 6.0.0 resources including IG and authoring patterns. The functions may appear similar to some QICoreCommon functions but differ in that they have constraints that are relevant for measures authored by NCQA.",
      "relatedArtifact": [ {
        "type": "depends-on",
        "display": "QICore model information",
        "resource": "http://hl7.org/fhir/Library/QICore-ModelInfo"
      }, {
        "type": "depends-on",
        "display": "Library FHIRHelpers",
        "resource": "https://madie.cms.gov/Library/FHIRHelpers|4.4.000"
      }, {
        "type": "depends-on",
        "display": "Code system ObservationCategoryCodes",
        "resource": "http://terminology.hl7.org/CodeSystem/observation-category"
      }, {
        "type": "depends-on",
        "display": "Code system ConditionVerificationStatusCodes",
        "resource": "http://terminology.hl7.org/CodeSystem/condition-ver-status"
      } ],
      "content": [ {
        "contentType": "text/cql",
        "data": "[encoded data, 8456 characters]"
      }, {
        "contentType": "application/elm+xml",
        "data": "[encoded data, 208832 characters]"
      }, {
        "contentType": "application/elm+json",
        "data": "[encoded data, 391068 characters]"
      } ]
    },
    "request": {
      "method": "POST",
      "url": "Library/Status"
    }
  }, {
    "fullUrl": "https://madie.cms.gov/Library/QICoreCommon",
    "resource": {
      "resourceType": "Library",
      "id": "QICoreCommon",
      "meta": {
        "profile": [ "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-computablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-executablelibrary", "http://hl7.org/fhir/uv/cql/StructureDefinition/cql-library", "http://hl7.org/fhir/uv/cql/StructureDefinition/elm-json-library", "http://hl7.org/fhir/uv/cql/StructureDefinition/elm-xml-library" ]
      },
      "language": "en",
      "text": {
        "status": "extensions",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"col-12\">\n  <table class=\"narrative-table\">\n    <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Metadata</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Title</th>\n\n\n<td class=\"content-container\">QICoreCommon</td>\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n<td class=\"content-container\">4.0.000</td>\n</tr>\n\n\n\n\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Identifier</th>\n\n\n<td class=\"content-container\">67cb33c19e9ab93ec36dad45</td>\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Steward (Publisher)</th>\n\n\n<td class=\"content-container\">ICF</td>\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Description</th>\n\n\n<td class=\"content-container\">Common terminologies and functions used in QI-Core-based CQL artifacts</td>\n</tr>\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/library-type#logic-library]</td>\n</tr>\n\n\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Resource\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/StructureDefinition/Resource\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: id, id.value\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>: Patient\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: birthDate, birthDate.value\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>: DeviceRequest\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-devicerequest\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: modifierExtension\n    <br/>\n   \n   \n  </td>\n</tr>\n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Library Content</th>\n\n\n</tr>\n  \n    \n    <tr>\n      <th scope=\"row\" class=\"row-header\">CQL Content</th>\n      <td>\n        <a name=\"cql-content\"> </a>\n        <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">library QICoreCommon version '4.0.000'\n\nusing QICore version '6.0.0'\n\ninclude FHIRHelpers version '4.4.000' called FHIRHelpers\n\ncodesystem &quot;LOINC&quot;: 'http://loinc.org'\ncodesystem &quot;SNOMEDCT&quot;: 'http://snomed.info/sct'\ncodesystem &quot;ActCode&quot;: 'http://terminology.hl7.org/CodeSystem/v3-ActCode'\ncodesystem &quot;RoleCode&quot;: 'http://terminology.hl7.org/CodeSystem/v3-RoleCode'\ncodesystem &quot;Diagnosis Role&quot;: 'http://terminology.hl7.org/CodeSystem/diagnosis-role'\ncodesystem &quot;RequestIntent&quot;: 'http://hl7.org/fhir/request-intent'\ncodesystem &quot;MedicationRequestCategory&quot;: 'http://terminology.hl7.org/CodeSystem/medicationrequest-category'\ncodesystem &quot;ConditionClinicalStatusCodes&quot;: 'http://terminology.hl7.org/CodeSystem/condition-clinical'\ncodesystem &quot;ConditionVerificationStatusCodes&quot;: 'http://terminology.hl7.org/CodeSystem/condition-ver-status'\ncodesystem &quot;AllergyIntoleranceClinicalStatusCodes&quot;: 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical'\ncodesystem &quot;AllergyIntoleranceVerificationStatusCodes&quot;: 'http://terminology.hl7.org/CodeSystem/allergyintolerance-verification'\ncodesystem &quot;ObservationCategoryCodes&quot;: 'http://terminology.hl7.org/CodeSystem/observation-category'\ncodesystem &quot;USCoreObservationCategoryExtensionCodes&quot;: 'http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category'  \ncodesystem &quot;ConditionCategory&quot;: 'http://terminology.hl7.org/CodeSystem/condition-category'\ncodesystem &quot;USCoreConditionCategoryExtensionCodes&quot;: 'http://hl7.org/fhir/us/core/CodeSystem/condition-category'\ncodesystem &quot;TaskCodeSystem&quot;: 'http://hl7.org/fhir/CodeSystem/task-code' \n\n\n\ncode &quot;Birthdate&quot;: '21112-8' from &quot;LOINC&quot; display 'Birth date'\ncode &quot;Dead&quot;: '419099009' from &quot;SNOMEDCT&quot; display 'Dead'\ncode &quot;ER&quot;: 'ER' from &quot;RoleCode&quot; display 'Emergency room'\ncode &quot;ICU&quot;: 'ICU' from &quot;RoleCode&quot; display 'Intensive care unit'\ncode &quot;Billing&quot;: 'billing' from &quot;Diagnosis Role&quot; display 'Billing'\n\n//Task codes\ncode &quot;Fulfill&quot;: 'fulfill' from &quot;TaskCodeSystem&quot; display 'Fulfill'\n\n// Encounter Class Codes\ncode &quot;ambulatory&quot;: 'AMB' from ActCode display 'ambulatory'\ncode &quot;emergency&quot;: 'EMER' from ActCode display 'emergency'\ncode &quot;field&quot;: 'FLD' from ActCode display 'field'\ncode &quot;home health&quot;: 'HH' from ActCode display 'home health'\ncode &quot;inpatient encounter&quot;: 'IMP' from ActCode display 'inpatient encounter'\ncode &quot;inpatient acute&quot;: 'ACUTE' from ActCode display 'inpatient acute'\ncode &quot;inpatient non-acute&quot;: 'NONAC' from ActCode display 'inpatient non-acute'\ncode &quot;observation encounter&quot;: 'OBSENC' from ActCode display 'observation encounter'\ncode &quot;pre-admission&quot;: 'PRENC' from ActCode display 'pre-admission'\ncode &quot;short stay&quot;: 'SS' from ActCode display 'short stay'\ncode &quot;virtual&quot;: 'VR' from ActCode display 'Virtual'\n\n// Condition Category Codes\ncode &quot;problem-list-item&quot;: 'problem-list-item' from &quot;ConditionCategory&quot; display 'Problem List Item'\ncode &quot;encounter-diagnosis&quot;: 'encounter-diagnosis' from &quot;ConditionCategory&quot; display 'Encounter Diagnosis'\ncode &quot;health-concern&quot;: 'health-concern' from &quot;USCoreConditionCategoryExtensionCodes&quot; display 'Health Concern'\n\n// Condition Clinical Status Codes - Consider value sets for these\ncode &quot;active&quot;: 'active' from &quot;ConditionClinicalStatusCodes&quot; display 'Active'\ncode &quot;recurrence&quot;: 'recurrence' from &quot;ConditionClinicalStatusCodes&quot; display 'Recurrence'\ncode &quot;relapse&quot;: 'relapse' from &quot;ConditionClinicalStatusCodes&quot; display 'Relapse'\ncode &quot;inactive&quot;: 'inactive' from &quot;ConditionClinicalStatusCodes&quot; display 'Inactive'\ncode &quot;remission&quot;: 'remission' from &quot;ConditionClinicalStatusCodes&quot; display 'Remission'\ncode &quot;resolved&quot;: 'resolved' from &quot;ConditionClinicalStatusCodes&quot; display 'Resolved'\n\n// Condition Verification Status Codes - Consider value sets for these\ncode &quot;unconfirmed&quot;: 'unconfirmed' from ConditionVerificationStatusCodes display 'Unconfirmed'\ncode &quot;provisional&quot;: 'provisional' from ConditionVerificationStatusCodes display 'Provisional'\ncode &quot;differential&quot;: 'differential' from ConditionVerificationStatusCodes display 'Differential'\ncode &quot;confirmed&quot;: 'confirmed' from ConditionVerificationStatusCodes display 'Confirmed'\ncode &quot;refuted&quot;: 'refuted' from ConditionVerificationStatusCodes display 'Refuted'\ncode &quot;entered-in-error&quot;: 'entered-in-error' from ConditionVerificationStatusCodes display 'Entered in Error'\n\ncode &quot;allergy-active&quot;: 'active' from &quot;AllergyIntoleranceClinicalStatusCodes&quot; display 'Active'\ncode &quot;allergy-inactive&quot;: 'inactive' from &quot;AllergyIntoleranceClinicalStatusCodes&quot; display 'Inactive'\ncode &quot;allergy-resolved&quot;: 'resolved' from &quot;AllergyIntoleranceClinicalStatusCodes&quot; display 'Resolved'\n\n// Allergy/Intolerance Verification Status Codes - Consider value sets for these\ncode &quot;allergy-unconfirmed&quot;: 'unconfirmed' from AllergyIntoleranceVerificationStatusCodes display 'Unconfirmed'\ncode &quot;allergy-confirmed&quot;: 'confirmed' from AllergyIntoleranceVerificationStatusCodes display 'Confirmed'\ncode &quot;allergy-refuted&quot;: 'refuted' from AllergyIntoleranceVerificationStatusCodes display 'Refuted'\n\n// MedicationRequest Category Codes\ncode &quot;Inpatient&quot;: 'inpatient' from &quot;MedicationRequestCategory&quot; display 'Inpatient'\ncode &quot;Outpatient&quot;: 'outpatient' from &quot;MedicationRequestCategory&quot; display 'Outpatient'\ncode &quot;Community&quot;: 'community' from &quot;MedicationRequestCategory&quot; display 'Community'\ncode &quot;Discharge&quot;: 'discharge' from &quot;MedicationRequestCategory&quot; display 'Discharge'\n\n// Diagnosis Role Codes\ncode &quot;AD&quot;: 'AD' from &quot;Diagnosis Role&quot; display 'Admission diagnosis'\ncode &quot;DD&quot;: 'DD' from &quot;Diagnosis Role&quot; display 'Discharge diagnosis'\ncode &quot;CC&quot;: 'CC' from &quot;Diagnosis Role&quot; display 'Chief complaint'\ncode &quot;CM&quot;: 'CM' from &quot;Diagnosis Role&quot; display 'Comorbidity diagnosis'\ncode &quot;pre-op&quot;: 'pre-op' from &quot;Diagnosis Role&quot; display 'pre-op diagnosis'\ncode &quot;post-op&quot;: 'post-op' from &quot;Diagnosis Role&quot; display 'post-op diagnosis'\ncode &quot;billing&quot;: 'billing' from &quot;Diagnosis Role&quot; display 'Billing'\n\n// Observation Category Codes\ncode &quot;social-history&quot;: 'social-history' from &quot;ObservationCategoryCodes&quot; display 'Social History'\ncode &quot;vital-signs&quot;: 'vital-signs' from &quot;ObservationCategoryCodes&quot; display 'Vital Signs'\ncode &quot;imaging&quot;: 'imaging' from &quot;ObservationCategoryCodes&quot; display 'Imaging'\ncode &quot;laboratory&quot;: 'laboratory' from &quot;ObservationCategoryCodes&quot; display 'Laboratory'\ncode &quot;procedure&quot;: 'procedure' from &quot;ObservationCategoryCodes&quot; display 'Procedure'\ncode &quot;survey&quot;: 'survey' from &quot;ObservationCategoryCodes&quot; display 'Survey'\ncode &quot;exam&quot;: 'exam' from &quot;ObservationCategoryCodes&quot; display 'Exam'\ncode &quot;therapy&quot;: 'therapy' from &quot;ObservationCategoryCodes&quot; display 'Therapy'\ncode &quot;activity&quot;: 'activity' from &quot;ObservationCategoryCodes&quot; display 'Activity'\n\ncontext Patient\n\n/* Candidates for FHIRCommon */\n\n/*\n@description: Returns true if the given condition has a clinical status of active, recurrence, or relapse\n*/\ndefine fluent function isActive(condition Choice&lt;&quot;ConditionEncounterDiagnosis&quot;, &quot;ConditionProblemsHealthConcerns&quot;&gt;):\n  condition.clinicalStatus ~ &quot;active&quot;\n    or condition.clinicalStatus ~ &quot;recurrence&quot;\n    or condition.clinicalStatus ~ &quot;relapse&quot;\n\n/*\n@description: Returns true if the given condition has the given category\n*/\ndefine fluent function hasCategory(condition Choice&lt;&quot;ConditionEncounterDiagnosis&quot;, &quot;ConditionProblemsHealthConcerns&quot;&gt;, category Code):\n  exists (condition.category C\n    where C ~ category\n  )\n\n/*\n@description: Returns true if the given condition is a problem list item.\n*/\ndefine fluent function isProblemListItem(condition Choice&lt;&quot;ConditionEncounterDiagnosis&quot;, &quot;ConditionProblemsHealthConcerns&quot;&gt;):\n  exists (condition.category C\n    where C ~ &quot;problem-list-item&quot;\n  )\n\n/*\n@description: Returns true if the given condition is an encounter diagnosis\n*/\ndefine fluent function isEncounterDiagnosis(condition Choice&lt;&quot;ConditionEncounterDiagnosis&quot;, &quot;ConditionProblemsHealthConcerns&quot;&gt;):\n  exists (condition.category C\n    where C ~ &quot;encounter-diagnosis&quot;\n  )\n\n/*\n@description: Returns true if the given condition is a health concern\n*/\ndefine fluent function isHealthConcern(condition Choice&lt;&quot;ConditionEncounterDiagnosis&quot;, &quot;ConditionProblemsHealthConcerns&quot;&gt;):\n  exists (condition.category C\n    where C ~ &quot;health-concern&quot;\n  )\n\n/*\n@description: Returns true if the given observation has the given category\n*/\ndefine fluent function hasCategory(observation Choice&lt;&quot;SimpleObservation&quot;, \n&quot;ObservationCancelled&quot;,\n&quot;NonPatientObservation&quot;,\n&quot;LaboratoryResultObservation&quot;,\n&quot;ObservationClinicalResult&quot;,\n&quot;ObservationScreeningAssessment&quot;&gt;, \ncategory Code):\n  exists (observation.category C\n    where C ~ category\n  )\n\n/*\n@description: Returns true if the given observation is a social history observation\n*/\ndefine fluent function isSocialHistory(observation Choice&lt;&quot;SimpleObservation&quot;, \n&quot;ObservationCancelled&quot;,\n&quot;NonPatientObservation&quot;,\n&quot;LaboratoryResultObservation&quot;,\n&quot;ObservationClinicalResult&quot;,\n&quot;ObservationScreeningAssessment&quot;&gt;):\n  exists (observation.category C\n    where C ~ &quot;social-history&quot;\n  )\n\n/*\n@description: Returns true if the given observation is a vital sign\n*/\ndefine fluent function isVitalSign(observation Choice&lt;&quot;SimpleObservation&quot;, \n&quot;ObservationCancelled&quot;,\n&quot;NonPatientObservation&quot;,\n&quot;LaboratoryResultObservation&quot;,\n&quot;ObservationClinicalResult&quot;,\n&quot;ObservationScreeningAssessment&quot;&gt;):\n  exists (observation.category C\n    where C ~ &quot;vital-signs&quot;\n  )\n\n/*\n@description: Returns true if the given observation is an imaging observation\n*/\ndefine fluent function isImaging(observation Choice&lt;&quot;SimpleObservation&quot;, \n&quot;ObservationCancelled&quot;,\n&quot;NonPatientObservation&quot;,\n&quot;LaboratoryResultObservation&quot;,\n&quot;ObservationClinicalResult&quot;,\n&quot;ObservationScreeningAssessment&quot;&gt;):\n  exists (observation.category C\n    where C ~ &quot;imaging&quot;\n  )\n\n/*\n@description: Returns true if the given observation is a laboratory observation\n*/\ndefine fluent function isLaboratory(observation Choice&lt;&quot;SimpleObservation&quot;, \n&quot;ObservationCancelled&quot;,\n&quot;NonPatientObservation&quot;,\n&quot;LaboratoryResultObservation&quot;,\n&quot;ObservationClinicalResult&quot;,\n&quot;ObservationScreeningAssessment&quot;&gt;):\n  exists (observation.category C\n    where C ~ &quot;laboratory&quot;\n  )\n\n/*\n@description: Returns true if the given observation is a procedure observation\n*/\ndefine fluent function isProcedure(observation Choice&lt;&quot;SimpleObservation&quot;, \n&quot;ObservationCancelled&quot;,\n&quot;NonPatientObservation&quot;,\n&quot;LaboratoryResultObservation&quot;,\n&quot;ObservationClinicalResult&quot;,\n&quot;ObservationScreeningAssessment&quot;&gt;):\n  exists (observation.category C\n    where C ~ &quot;procedure&quot;\n  )\n\n/*\n@description: Returns true if the given observation is a survey observation\n*/\ndefine fluent function isSurvey(observation Choice&lt;&quot;SimpleObservation&quot;, \n&quot;ObservationCancelled&quot;,\n&quot;NonPatientObservation&quot;,\n&quot;LaboratoryResultObservation&quot;,\n&quot;ObservationClinicalResult&quot;,\n&quot;ObservationScreeningAssessment&quot;&gt;):\n  exists (observation.category C\n    where C ~ &quot;survey&quot;\n  )\n\n/*\n@description: Returns true if the given observation is an exam observation\n*/\ndefine fluent function isExam(observation Choice&lt;&quot;SimpleObservation&quot;, \n&quot;ObservationCancelled&quot;,\n&quot;NonPatientObservation&quot;,\n&quot;LaboratoryResultObservation&quot;,\n&quot;ObservationClinicalResult&quot;,\n&quot;ObservationScreeningAssessment&quot;&gt;):\n  exists (observation.category C\n    where C ~ &quot;exam&quot;\n  )\n\n/*\n@description: Returns true if the given observation is a therapy observation\n*/\ndefine fluent function isTherapy(observation Choice&lt;&quot;SimpleObservation&quot;, \n&quot;ObservationCancelled&quot;,\n&quot;NonPatientObservation&quot;,\n&quot;LaboratoryResultObservation&quot;,\n&quot;ObservationClinicalResult&quot;,\n&quot;ObservationScreeningAssessment&quot;&gt;):\n  exists (observation.category C\n    where C ~ &quot;therapy&quot;\n  )\n\n/*\n@description: Returns true if the given observation is an activity observation\n*/\ndefine fluent function isActivity(observation Choice&lt;&quot;SimpleObservation&quot;, \n&quot;ObservationCancelled&quot;,\n&quot;NonPatientObservation&quot;,\n&quot;LaboratoryResultObservation&quot;,\n&quot;ObservationClinicalResult&quot;,\n&quot;ObservationScreeningAssessment&quot;&gt;):\n  exists (observation.category C\n    where C ~ &quot;activity&quot;\n  )\n\n/*\n@description: Returns true if the given MedicationRequest has a category of Community\n*/\ndefine fluent function isCommunity(medicationRequest Choice&lt;MedicationRequest, MedicationNotRequested&gt;):\n  exists (medicationRequest.category C\n    where C ~ Community\n  )\n\n/*\n@description: Returns true if the given MedicationRequest has a category of Discharge\n*/\ndefine fluent function isDischarge(medicationRequest Choice&lt;MedicationRequest, MedicationNotRequested&gt;):\n  exists (medicationRequest.category C\n    where C ~ Discharge\n  )\n\n/*\n@description: Returns true if the given DeviceRequest is a negation (i.e. do not perform this order)\n@deprecated: This function is no longer required in QICore 6.0.0 and above\n*/\ndefine fluent function doNotPerform(deviceRequest DeviceRequest):\n  // KNOWN ISSUE: The translator reports this as an error but the execution still works, this is under investigation\n  deviceRequest.doNotPerform\n\n/*\n@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval\n@comment: Normalizes a choice type of DateTime, Quanitty, Interval&lt;DateTime&gt;, or Interval&lt;Quantity&gt; types\nto an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible\nrepresentations for timing-valued elements in QICore, allowing this function to be used across any resource.\nThe input can be provided as a DateTime, Quantity, Interval&lt;DateTime&gt; or Interval&lt;Quantity&gt;.\nThe intent of this function is to provide a clear and concise mechanism to treat single\nelements that have multiple possible representations as intervals so that logic doesn't have to account\nfor the variability. More complex calculations (such as medication request period or dispense period\ncalculation) need specific guidance and consideration. That guidance may make use of this function, but\nthe focus of this function is on single element calculations where the semantics are unambiguous.\nIf the input is a DateTime, the result a DateTime Interval beginning and ending on that DateTime.\nIf the input is a Quantity, the quantity is expected to be a calendar-duration interpreted as an Age,\nand the result is a DateTime Interval beginning on the Date the patient turned that age and ending immediately before one year later.\nIf the input is a DateTime Interval, the result is the input.\nIf the input is a Quantity Interval, the quantities are expected to be calendar-durations interpreted as an Age, and the result\nis a DateTime Interval beginning on the date the patient turned the age given as the start of the quantity interval, and ending\nimmediately before one year later than the date the patient turned the age given as the end of the quantity interval.\nIf the input is a Timing, an error will be thrown indicating that Timing calculations are not implemented. Any other input will reslt in a null DateTime Interval\n@deprecated: This function is deprecated. Use the fluent function `toInterval()` instead\n*/\ndefine function ToInterval(choice Choice&lt;DateTime, Quantity, Interval&lt;DateTime&gt;, Interval&lt;Quantity&gt;, Timing&gt;):\n  case\n\t  when choice is DateTime then\n    \tInterval[choice as DateTime, choice as DateTime]\n\t\twhen choice is Interval&lt;DateTime&gt; then\n  \t\tchoice as Interval&lt;DateTime&gt;\n\t\twhen choice is Quantity then\n\t\t  Interval[Patient.birthDate + (choice as Quantity),\n\t\t\t  Patient.birthDate + (choice as Quantity) + 1 year)\n\t\twhen choice is Interval&lt;Quantity&gt; then\n\t\t  Interval[Patient.birthDate + (choice.low as Quantity),\n\t\t\t  Patient.birthDate + (choice.high as Quantity) + 1 year)\n\t\twhen choice is Timing then\n      Message(null, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported') as Interval&lt;DateTime&gt;\n\t\telse\n\t\t\tnull as Interval&lt;DateTime&gt;\n\tend\n\n/*\n@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval\n@comment: Normalizes a choice type of DateTime, Quanitty, Interval&lt;DateTime&gt;, or Interval&lt;Quantity&gt; types\nto an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible\nrepresentations for timing-valued elements in QICore, allowing this function to be used across any resource.\nThe input can be provided as a DateTime, Quantity, Interval&lt;DateTime&gt; or Interval&lt;Quantity&gt;.\nThe intent of this function is to provide a clear and concise mechanism to treat single\nelements that have multiple possible representations as intervals so that logic doesn't have to account\nfor the variability. More complex calculations (such as medication request period or dispense period\ncalculation) need specific guidance and consideration. That guidance may make use of this function, but\nthe focus of this function is on single element calculations where the semantics are unambiguous.\nIf the input is a DateTime, the result a DateTime Interval beginning and ending on that DateTime.\nIf the input is a Quantity, the quantity is expected to be a calendar-duration interpreted as an Age,\nand the result is a DateTime Interval beginning on the Date the patient turned that age and ending immediately before one year later.\nIf the input is a DateTime Interval, the result is the input.\nIf the input is a Quantity Interval, the quantities are expected to be calendar-durations interpreted as an Age, and the result\nis a DateTime Interval beginning on the date the patient turned the age given as the start of the quantity interval, and ending\nimmediately before one year later than the date the patient turned the age given as the end of the quantity interval.\nIf the input is a Timing, an error will be thrown indicating that Timing calculations are not implemented. Any other input will reslt in a null DateTime Interval\n*/\ndefine fluent function toInterval(choice Choice&lt;DateTime, Quantity, Interval&lt;DateTime&gt;, Interval&lt;Quantity&gt;, Timing&gt;):\n  case\n\t  when choice is DateTime then\n    \tInterval[choice as DateTime, choice as DateTime]\n\t\twhen choice is Interval&lt;DateTime&gt; then\n  \t\tchoice as Interval&lt;DateTime&gt;\n\t\twhen choice is Quantity then\n\t\t  Interval[Patient.birthDate + (choice as Quantity),\n\t\t\t  Patient.birthDate + (choice as Quantity) + 1 year)\n\t\twhen choice is Interval&lt;Quantity&gt; then\n\t\t  Interval[Patient.birthDate + (choice.low as Quantity),\n\t\t\t  Patient.birthDate + (choice.high as Quantity) + 1 year)\n\t\twhen choice is Timing then\n      Message(null, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported') as Interval&lt;DateTime&gt;\n\t\telse\n\t\t\tnull as Interval&lt;DateTime&gt;\n\tend\n\n/*\n@description: Returns an interval representing the normalized abatement of a given Condition.\n@comment: If the abatement element of the Condition is represented as a DateTime, the result\nis an interval beginning and ending on that DateTime.\nIf the abatement is represented as a Quantity, the quantity is expected to be a calendar-duration and is interpreted as the age of the patient. The\nresult is an interval from the date the patient turned that age to immediately before one year later.\nIf the abatement is represented as a Quantity Interval, the quantities are expected to be calendar-durations and are interpreted as an age range during\nwhich the abatement occurred. The result is an interval from the date the patient turned the starting age of the quantity interval, and ending immediately\nbefore one year later than the date the patient turned the ending age of the quantity interval.\n@deprecated: This function is deprecated. Use the fluent function `abatementInterval()` instead.\n*/\ndefine function ToAbatementInterval(condition Choice&lt;&quot;ConditionEncounterDiagnosis&quot;, &quot;ConditionProblemsHealthConcerns&quot;&gt;):\n\tif condition.abatement is DateTime then\n\t  Interval[condition.abatement as DateTime, condition.abatement as DateTime]\n\telse if condition.abatement is Quantity then\n\t\tInterval[Patient.birthDate + (condition.abatement as Quantity),\n\t\t\tPatient.birthDate + (condition.abatement as Quantity) + 1 year)\n\telse if condition.abatement is Interval&lt;Quantity&gt; then\n\t  Interval[Patient.birthDate + (condition.abatement.low as Quantity),\n\t\t  Patient.birthDate + (condition.abatement.high as Quantity) + 1 year)\n\telse if condition.abatement is Interval&lt;DateTime&gt; then\n\t  Interval[condition.abatement.low, condition.abatement.high)\n\telse null as Interval&lt;DateTime&gt;\n\n/*\n@description: Returns an interval representing the normalized abatement of a given Condition.\n@comment: If the abatement element of the Condition is represented as a DateTime, the result\nis an interval beginning and ending on that DateTime.\nIf the abatement is represented as a Quantity, the quantity is expected to be a calendar-duration and is interpreted as the age of the patient. The\nresult is an interval from the date the patient turned that age to immediately before one year later.\nIf the abatement is represented as a Quantity Interval, the quantities are expected to be calendar-durations and are interpreted as an age range during\nwhich the abatement occurred. The result is an interval from the date the patient turned the starting age of the quantity interval, and ending immediately\nbefore one year later than the date the patient turned the ending age of the quantity interval.\n*/\ndefine fluent function abatementInterval(condition Choice&lt;&quot;ConditionEncounterDiagnosis&quot;, &quot;ConditionProblemsHealthConcerns&quot;&gt;):\n\tif condition.abatement is DateTime then\n\t  Interval[condition.abatement as DateTime, condition.abatement as DateTime]\n\telse if condition.abatement is Quantity then\n\t\tInterval[Patient.birthDate + (condition.abatement as Quantity),\n\t\t\tPatient.birthDate + (condition.abatement as Quantity) + 1 year)\n\telse if condition.abatement is Interval&lt;Quantity&gt; then\n\t  Interval[Patient.birthDate + (condition.abatement.low as Quantity),\n\t\t  Patient.birthDate + (condition.abatement.high as Quantity) + 1 year)\n\telse if condition.abatement is Interval&lt;DateTime&gt; then\n\t  Interval[condition.abatement.low, condition.abatement.high)\n\telse null as Interval&lt;DateTime&gt;\n\n/*\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 Choice&lt;&quot;ConditionEncounterDiagnosis&quot;, &quot;ConditionProblemsHealthConcerns&quot;&gt;):\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]\n\n/*\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*/\ndefine fluent function prevalenceInterval(condition Choice&lt;&quot;ConditionEncounterDiagnosis&quot;, &quot;ConditionProblemsHealthConcerns&quot;&gt;):\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 condition.onset.toInterval(), end of condition.abatementInterval()]\nelse\n    (end of condition.abatementInterval()) abatementDate\n    return if abatementDate is null then\n      Interval[start of condition.onset.toInterval(), abatementDate)\n    else\n      Interval[start of condition.onset.toInterval(), abatementDate]\n\n/*\n@description: Returns the tail of the given uri (i.e. everything after the last slash in the URI).\n@comment: This function can be used to determine the logical id of a given resource. It can be used in\na single-server environment to trace references. However, this function does not attempt to resolve\nor distinguish the base of the given url, and so cannot be used safely in multi-server environments.\n@deprecated: This function is deprecated. Use the fluent function `getId()` instead\n*/\ndefine function GetId(uri String):\n  Last(Split(uri, '/'))\n\n/*\n@description: Returns the tail of the given uri (i.e. everything after the last slash in the URI).\n@comment: This function can be used to determine the logical id of a given resource. It can be used in\na single-server environment to trace references. However, this function does not attempt to resolve\nor distinguish the base of the given url, and so cannot be used safely in multi-server environments.\n*/\ndefine fluent function getId(uri String):\n  Last(Split(uri, '/'))\n\n/*\n@description: Returns true if the given reference is to the given resource\n@comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.\nNOTE: This function assumes resources from the same source server.\n*/\ndefine fluent function references(reference Reference, resource Resource):\n  resource.id = Last(Split(reference.reference, '/'))  \n\n/*\n@description: Returns true if the given reference is to the given resourceId\n@comment: Returns true if the `resourceId` parameter exactly equals the tail of the given reference.\nNOTE: This function assumes resources from the same source server.\n*/\ndefine fluent function references(reference Reference, resourceId String):\n  resourceId = Last(Split(reference.reference, '/'))\n\n/*\n@description: Returns true if any of the given references are to the given resource\n@comment: Returns true if the `id` element of the given resource exactly equals the tail of any of the given references.\nNOTE: This function assumes resources from the same source server.\n*/\ndefine fluent function references(references List&lt;Reference&gt;, resource Resource):\n  exists (references R where R.references(resource))\n  \n/*\n@description: Returns true if any of the given references are to the given resourceId\n@comment: Returns true if the `resourceId` parameter exactly equals the tail of any of the given references.\nNOTE: This function assumes resources from the same source server.\n*/\ndefine fluent function references(references List&lt;Reference&gt;, resourceId String):\n  exists (references R where R.references(resourceId))\n\n/*\n@description: Returns true if the given code is in the given codeList\n@comment: Returns true if the `code` is equivalent to any of the codes in the given `codeList`, false otherwise.\n*/\ndefine fluent function includesCode(codeList List&lt;Concept&gt;, code Code):\n  exists (codeList C where C ~ code)\n\n/*\n@description: Given an interval, return true if the interval has a starting boundary specified\n(i.e. the start of the interval is not null and not the minimum DateTime value)\n@deprecated: This function is deprecated. Uee the fluent function `hasStart()` instead\n*/\ndefine function &quot;HasStart&quot;(period Interval&lt;DateTime&gt; ):\n  not ( start of period is null\n      or start of period = minimum DateTime\n  )\n\n/*\n@description: Given an interval, return true if the interval has a starting boundary specified\n(i.e. the start of the interval is not null and not the minimum DateTime value)\n*/\ndefine fluent function hasStart(period Interval&lt;DateTime&gt; ):\n  not ( start of period is null\n      or start of period = minimum DateTime\n  )\n\n/*\n@description: Given an interval, returns true if the interval has an ending boundary specified\n(i.e. the end of the interval is not null and not the maximum DateTime value)\n@deprecated: This function is deprecated. Use the fluent function `hasEnd()` instead\n*/\ndefine function &quot;HasEnd&quot;(period Interval&lt;DateTime&gt; ):\n  not (\n    end of period is null\n      or end of period = maximum DateTime\n  )\n\n/*\n@description: Given an interval, returns true if the interval has an ending boundary specified\n(i.e. the end of the interval is not null and not the maximum DateTime value)\n*/\ndefine fluent function hasEnd(period Interval&lt;DateTime&gt; ):\n  not (\n    end of period is null\n      or end of period = maximum DateTime\n  )\n\n/*\n@description: Given an interval, returns the ending point if the interval has an ending boundary specified,\notherwise, returns the starting point\n@deprecated: This function is deprecated. Use the fluent function `latest()` instead\n*/\ndefine function &quot;Latest&quot;(choice Choice&lt;DateTime, Quantity, Interval&lt;DateTime&gt;, Interval&lt;Quantity&gt;&gt; ):\n  (choice.toInterval()) period\n    return\n      if (HasEnd(period)) then end of period\n      else start of period\n\n/*\n@description: Given an interval, returns the ending point if the interval has an ending boundary specified,\notherwise, returns the starting point\n*/\ndefine fluent function latest(choice Choice&lt;DateTime, Quantity, Interval&lt;DateTime&gt;, Interval&lt;Quantity&gt;&gt; ):\n  (choice.toInterval()) period\n    return\n      if (period.&quot;hasEnd&quot;()) then end of period\n      else start of period\n\n/*\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\n\n/*\n@description: Given an interval, return the starting point if the interval has a starting boundary specified,\notherwise, return the ending point\n*/\ndefine fluent function earliest(choice Choice&lt;DateTime, Quantity, Interval&lt;DateTime&gt;, Interval&lt;Quantity&gt;&gt; ):\n  (choice.toInterval()) period\n    return\n      if (period.&quot;hasStart&quot;()) then start of period\n      else end of period\n\n/*\n@description: Creates a list of integers from 1 to how many days are in the interval. Note, this wont create an index for\nthe final day if it is less than 24 hours. This also includes the first 24 hour period.\n@deprecated: This function is deprecated. Use the fluent function `toDayNumbers()` instead\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]} ) DayNumber\n    return end of DayNumber\n\n/*\n@description: Creates a list of integers from 1 to how many days are in the interval. Note, this wont create an index for\nthe final day if it is less than 24 hours. This also includes the first 24 hour period.\n*/\ndefine fluent function toDayNumbers(Period Interval&lt;DateTime&gt;):\n  ( expand { Interval[1, duration in days between start of Period and end of Period]} ) DayNumber\n    return end of DayNumber\n\n/*\n@description: Creates a list of 24 hour long intervals in an interval paired with the index (1 indexed) to which 24 hour interval it is.\nNote that the result will include intervals that are closed at the beginning and open at the end\n@deprecated: This function is deprecated. Use the fluent function `daysInPeriod()` instead\n*/\ndefine function &quot;Days In Period&quot;(Period Interval&lt;DateTime&gt;):\n  ( &quot;Interval To Day Numbers&quot;(Period)) DayIndex\n    let startPeriod: start of Period + (24 hours * (DayIndex - 1)),\n    endPeriod: if (hours between startPeriod and end of Period &lt; 24) then startPeriod\n      else start of Period + (24 hours * DayIndex)\n    return Tuple {\n      dayIndex: DayIndex,\n      dayPeriod: Interval[startPeriod, endPeriod)\n    }\n\n/*\n@description: Creates a list of 24 hour long intervals in an interval paired with the index (1 indexed) to which 24 hour interval it is.\nNote that the result will include intervals that are closed at the beginning and open at the end\n*/\ndefine fluent function daysInPeriod(Period Interval&lt;DateTime&gt;):\n  ( &quot;Interval To Day Numbers&quot;(Period)) DayIndex\n    let startPeriod: start of Period + (24 hours * (DayIndex - 1)),\n    endPeriod: if (hours between startPeriod and end of Period &lt; 24) then startPeriod\n      else start of Period + (24 hours * DayIndex)\n    return Tuple {\n      dayIndex: DayIndex,\n      dayPeriod: Interval[startPeriod, endPeriod)\n    }</code></pre>\n      </td>\n    </tr>\n    \n    \n    \n  \n\n<tr>\n  <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.4.9 of the sample-content-ig Liquid templates</th>\n</tr>\n\n    </tbody>\n  </table>\n</div>"
      },
      "extension": [ {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://loinc.org",
          "code": "21112-8",
          "display": "Birthdate"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://snomed.info/sct",
          "code": "419099009",
          "display": "Dead"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode",
          "code": "ER",
          "display": "ER"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode",
          "code": "ICU",
          "display": "ICU"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/diagnosis-role",
          "code": "billing",
          "display": "Billing"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://hl7.org/fhir/CodeSystem/task-code",
          "code": "fulfill",
          "display": "Fulfill"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
          "code": "AMB",
          "display": "ambulatory"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
          "code": "EMER",
          "display": "emergency"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
          "code": "FLD",
          "display": "field"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
          "code": "HH",
          "display": "home health"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
          "code": "IMP",
          "display": "inpatient encounter"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
          "code": "ACUTE",
          "display": "inpatient acute"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
          "code": "NONAC",
          "display": "inpatient non-acute"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
          "code": "OBSENC",
          "display": "observation encounter"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
          "code": "PRENC",
          "display": "pre-admission"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
          "code": "SS",
          "display": "short stay"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
          "code": "VR",
          "display": "virtual"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-category",
          "code": "problem-list-item",
          "display": "problem-list-item"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-category",
          "code": "encounter-diagnosis",
          "display": "encounter-diagnosis"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://hl7.org/fhir/us/core/CodeSystem/condition-category",
          "code": "health-concern",
          "display": "health-concern"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
          "code": "active",
          "display": "active"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
          "code": "recurrence",
          "display": "recurrence"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
          "code": "relapse",
          "display": "relapse"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
          "code": "inactive",
          "display": "inactive"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
          "code": "remission",
          "display": "remission"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
          "code": "resolved",
          "display": "resolved"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
          "code": "unconfirmed",
          "display": "unconfirmed"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
          "code": "provisional",
          "display": "provisional"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
          "code": "differential",
          "display": "differential"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
          "code": "confirmed",
          "display": "confirmed"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
          "code": "refuted",
          "display": "refuted"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
          "code": "entered-in-error",
          "display": "entered-in-error"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
          "code": "active",
          "display": "allergy-active"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
          "code": "inactive",
          "display": "allergy-inactive"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
          "code": "resolved",
          "display": "allergy-resolved"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification",
          "code": "unconfirmed",
          "display": "allergy-unconfirmed"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification",
          "code": "confirmed",
          "display": "allergy-confirmed"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification",
          "code": "refuted",
          "display": "allergy-refuted"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-category",
          "code": "inpatient",
          "display": "Inpatient"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-category",
          "code": "outpatient",
          "display": "Outpatient"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-category",
          "code": "community",
          "display": "Community"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-category",
          "code": "discharge",
          "display": "Discharge"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/diagnosis-role",
          "code": "AD",
          "display": "AD"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/diagnosis-role",
          "code": "DD",
          "display": "DD"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/diagnosis-role",
          "code": "CC",
          "display": "CC"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/diagnosis-role",
          "code": "CM",
          "display": "CM"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/diagnosis-role",
          "code": "pre-op",
          "display": "pre-op"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/diagnosis-role",
          "code": "post-op",
          "display": "post-op"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/diagnosis-role",
          "code": "billing",
          "display": "billing"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/observation-category",
          "code": "social-history",
          "display": "social-history"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/observation-category",
          "code": "vital-signs",
          "display": "vital-signs"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/observation-category",
          "code": "imaging",
          "display": "imaging"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/observation-category",
          "code": "laboratory",
          "display": "laboratory"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/observation-category",
          "code": "procedure",
          "display": "procedure"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/observation-category",
          "code": "survey",
          "display": "survey"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/observation-category",
          "code": "exam",
          "display": "exam"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/observation-category",
          "code": "therapy",
          "display": "therapy"
        }
      }, {
        "url": "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
        "valueCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/observation-category",
          "code": "activity",
          "display": "activity"
        }
      } ],
      "url": "https://madie.cms.gov/Library/QICoreCommon",
      "identifier": [ {
        "use": "official",
        "system": "https://madie.cms.gov/login",
        "value": "67cb33c19e9ab93ec36dad45"
      } ],
      "version": "4.0.000",
      "name": "QICoreCommon",
      "title": "QICoreCommon",
      "status": "active",
      "experimental": false,
      "type": {
        "coding": [ {
          "system": "http://terminology.hl7.org/CodeSystem/library-type",
          "code": "logic-library"
        } ]
      },
      "date": "2025-11-24T17:18:52+00:00",
      "publisher": "ICF",
      "description": "Common terminologies and functions used in QI-Core-based CQL artifacts",
      "relatedArtifact": [ {
        "type": "depends-on",
        "display": "QICore model information",
        "resource": "http://hl7.org/fhir/Library/QICore-ModelInfo"
      }, {
        "type": "depends-on",
        "display": "Library FHIRHelpers",
        "resource": "https://madie.cms.gov/Library/FHIRHelpers|4.4.000"
      }, {
        "type": "depends-on",
        "display": "Code system USCoreConditionCategoryExtensionCodes",
        "resource": "http://hl7.org/fhir/us/core/CodeSystem/condition-category"
      }, {
        "type": "depends-on",
        "display": "Code system ObservationCategoryCodes",
        "resource": "http://terminology.hl7.org/CodeSystem/observation-category"
      }, {
        "type": "depends-on",
        "display": "Code system ConditionClinicalStatusCodes",
        "resource": "http://terminology.hl7.org/CodeSystem/condition-clinical"
      }, {
        "type": "depends-on",
        "display": "Code system MedicationRequestCategory",
        "resource": "http://terminology.hl7.org/CodeSystem/medicationrequest-category"
      }, {
        "type": "depends-on",
        "display": "Code system ConditionCategory",
        "resource": "http://terminology.hl7.org/CodeSystem/condition-category"
      } ],
      "dataRequirement": [ {
        "type": "Resource",
        "profile": [ "http://hl7.org/fhir/StructureDefinition/Resource" ],
        "mustSupport": [ "id", "id.value" ]
      }, {
        "type": "Patient",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient" ],
        "mustSupport": [ "birthDate", "birthDate.value" ]
      }, {
        "type": "DeviceRequest",
        "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-devicerequest" ],
        "mustSupport": [ "modifierExtension" ]
      } ],
      "content": [ {
        "contentType": "text/cql",
        "data": "[encoded data, 43100 characters]"
      }, {
        "contentType": "application/elm+xml",
        "data": "[encoded data, 1733416 characters]"
      }, {
        "contentType": "application/elm+json",
        "data": "[encoded data, 2930368 characters]"
      } ]
    },
    "request": {
      "method": "POST",
      "url": "Library/QICoreCommon"
    }
  }, {
    "fullUrl": "https://madie.cms.gov/Library/FHIRHelpers",
    "resource": {
      "resourceType": "Library",
      "id": "FHIRHelpers",
      "meta": {
        "profile": [ "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-computablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablelibrary", "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-executablelibrary", "http://hl7.org/fhir/uv/cql/StructureDefinition/cql-library", "http://hl7.org/fhir/uv/cql/StructureDefinition/elm-json-library", "http://hl7.org/fhir/uv/cql/StructureDefinition/elm-xml-library" ]
      },
      "language": "en",
      "text": {
        "status": "extensions",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"col-12\">\n  <table class=\"narrative-table\">\n    <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Metadata</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Title</th>\n\n\n<td class=\"content-container\">FHIRHelpers</td>\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n<td class=\"content-container\">4.4.000</td>\n</tr>\n\n\n\n\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Identifier</th>\n\n\n<td class=\"content-container\">660d90bc01598d085de46056</td>\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Steward (Publisher)</th>\n\n\n<td class=\"content-container\">ICF</td>\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Description</th>\n\n\n<td class=\"content-container\">This library defines functions to convert between FHIR\n data types and CQL system-defined types, as well as functions to support\n FHIRPath implementation. For more information, the FHIRHelpers wiki page:\n https://github.com/cqframework/clinical_quality_language/wiki/FHIRHelpers</td>\n</tr>\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n<td class=\"content-container\">[http://terminology.hl7.org/CodeSystem/library-type#logic-library]</td>\n</tr>\n\n\n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Library Content</th>\n\n\n</tr>\n  \n    \n    <tr>\n      <th scope=\"row\" class=\"row-header\">CQL Content</th>\n      <td>\n        <a name=\"cql-content\"> </a>\n        <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">library FHIRHelpers version '4.4.000'\n\r\nusing FHIR version '4.0.1'\r\n\r\n/*\r\n@description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)\r\nvalue to a CQL DateTime Interval\r\n@comment: If the start value of the given period is unspecified, the starting\r\nboundary of the resulting interval will be open (meaning the start of the interval\r\nis unknown, as opposed to interpreted as the beginning of time).\r\n*/\r\ndefine function ToInterval(period FHIR.Period):\r\n    if period is null then\r\n        null\r\n    else\r\n        if period.&quot;start&quot; is null then\r\n            Interval(period.&quot;start&quot;.value, period.&quot;end&quot;.value]\r\n        else\r\n            Interval[period.&quot;start&quot;.value, period.&quot;end&quot;.value]\r\n\r\n/*\r\n@description: Converts a UCUM definite duration unit to a CQL calendar duration\r\nunit using conversions specified in the [quantities](https://cql.hl7.org/02-authorsguide.html#quantities) \r\ntopic of the CQL specification.\r\n@comment: Note that for durations above days (or weeks), the conversion is understood to be approximate\r\n*/\r\ndefine function ToCalendarUnit(unit System.String):\r\n    case unit\r\n        when 'ms' then 'millisecond'\r\n        when 's' then 'second'\r\n        when 'min' then 'minute'\r\n        when 'h' then 'hour'\r\n        when 'd' then 'day'\r\n        when 'wk' then 'week'\r\n        when 'mo' then 'month'\r\n        when 'a' then 'year'\r\n        else unit\r\n    end\r\n\r\n/*\r\n@description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity) \r\nvalue to a CQL Quantity\r\n@comment: If the given quantity has a comparator specified, a runtime error is raised. If the given quantity\r\nhas a system other than UCUM (i.e. `http://unitsofmeasure.org`) or CQL calendar units (i.e. `http://hl7.org/fhirpath/CodeSystem/calendar-units`)\r\nan error is raised. For UCUM to calendar units, the `ToCalendarUnit` function is used.\r\n@seealso: ToCalendarUnit\r\n*/\r\ndefine function ToQuantity(quantity FHIR.Quantity):\r\n    case\r\n        when quantity is null then null\r\n        when quantity.value is null then null\r\n        when quantity.comparator is not null then\r\n            Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')\r\n        when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'\r\n              or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then\r\n            System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }\r\n        else\r\n            Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' &amp; quantity.unit.value &amp; ' (' &amp; quantity.system.value &amp; '|' &amp; quantity.code.value &amp; ')')\r\n    end\r\n\r\n/*\r\n@description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity) value to a CQL Quantity, ignoring\r\nthe comparator element. This function should only be used when an application is justified in ignoring the comparator value (i.e. the\r\ncontext is looking for boundary).\r\n@comment: If the given quantity has a system other than UCUM (i.e. `http://unitsofmeasure.org`) or CQL calendar units \r\n(i.e. `http://hl7.org/fhirpath/CodeSystem/calendar-units`) an error is raised. For UCUM to calendar units, the `ToCalendarUnit` function \r\nis used.\r\n@seealso: ToCalendarUnit\r\n*/\r\ndefine function ToQuantityIgnoringComparator(quantity FHIR.Quantity):\r\n    case\r\n        when quantity is null then null\r\n        when quantity.value is null then null\r\n        when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'\r\n              or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then\r\n            System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }\r\n        else\r\n            Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' &amp; quantity.unit.value &amp; ' (' &amp; quantity.system.value &amp; '|' &amp; quantity.code.value &amp; ')')\r\n    end\r\n\r\n/*\r\n@description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity) value to a CQL Interval of Quantity.\r\n@comment: If the given quantity has a comparator, it is used to construct an interval based on the value of the comparator. If the comparator\r\nis less than, the resulting interval will start with a null closed boundary and end with an open boundary on the quantity. If the comparator\r\nis less than or equal, the resulting interval will start with a null closed boundary and end with a closed boundary on the quantity. If the \r\ncomparator is greater or equal, the resulting interval will start with a closed boundary on the quantity and end with a closed null boundary.\r\nIf the comparator is greatter than, the resulting interval will start with an open boundary on the quantity and end with a closed null boundary.\r\nIf no comparator is specified, the resulting interval will start and end with a closed boundary on the quantity.\r\n*/\r\ndefine function ToInterval(quantity FHIR.Quantity):\r\n    if quantity is null then null else\r\n        case quantity.comparator.value\r\n            when '&lt;' then\r\n                Interval[\r\n                    null,\r\n                    ToQuantityIgnoringComparator(quantity)\r\n                )\r\n            when '&lt;=' then\r\n                Interval[\r\n                    null,\r\n                    ToQuantityIgnoringComparator(quantity)\r\n                ]\r\n            when '&gt;=' then\r\n                Interval[\r\n                    ToQuantityIgnoringComparator(quantity),\r\n                    null\r\n                ]\r\n            when '&gt;' then\r\n                Interval(\r\n                    ToQuantityIgnoringComparator(quantity),\r\n                    null\r\n                ]\r\n            else\r\n                Interval[ToQuantity(quantity), ToQuantity(quantity)]\r\n        end\r\n\r\n/*\r\n@description: Converts the given FHIR [Ratio](https://hl7.org/fhir/datatypes.html#Ratio) value to a CQL Ratio.\r\n*/\r\ndefine function ToRatio(ratio FHIR.Ratio):\r\n    if ratio is null then\r\n        null\r\n    else\r\n        System.Ratio { numerator: ToQuantity(ratio.numerator), denominator: ToQuantity(ratio.denominator) }\r\n\r\n/*\r\n@description: Converts the given FHIR [Range](https://hl7.org/fhir/datatypes.html#Range) value to a CQL Interval of Quantity\r\n*/\r\ndefine function ToInterval(range FHIR.Range):\r\n    if range is null then\r\n        null\r\n    else\r\n        Interval[ToQuantity(range.low), ToQuantity(range.high)]\r\n\r\n/*\r\n@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.\r\n*/\r\ndefine function ToCode(coding FHIR.Coding):\r\n    if coding is null then\r\n        null\r\n    else\r\n        System.Code {\r\n          code: coding.code.value,\r\n          system: coding.system.value,\r\n          version: coding.version.value,\r\n          display: coding.display.value\r\n        }\r\n\r\n/*\r\n@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.\r\n*/\r\ndefine function ToConcept(concept FHIR.CodeableConcept):\r\n    if concept is null then\r\n        null\r\n    else\r\n        System.Concept {\r\n            codes: concept.coding C return ToCode(C),\r\n            display: concept.text.value\r\n        }\r\n\r\n/*\r\n@description: Converts the given value (assumed to be a URI) to a CQL [ValueSet](https://cql.hl7.org/09-b-cqlreference.html#valueset)\r\n*/\r\ndefine function ToValueSet(uri String):\r\n    if uri is null then\r\n        null\r\n    else\r\n        System.ValueSet {\r\n            id: uri\r\n        }\r\n\r\n/*\r\n@description: Constructs a FHIR [Reference](https://hl7.org/fhir/datatypes.html#Reference) from the given reference (assumed to be a FHIR resource URL)\r\n*/\r\ndefine function reference(reference String):\r\n    if reference is null then\r\n        null\r\n    else\r\n        Reference { reference: string { value: reference } }\r\n\r\n/*\r\n@description: Converts the given value to a CQL value using the appropriate accessor or conversion function.\r\n@comment: TODO: document conversion\r\n*/\r\ndefine function ToValue(value Choice&lt;base64Binary,\r\n        boolean,\r\n        canonical,\r\n        code,\r\n        date,\r\n        dateTime,\r\n        decimal,\r\n        id,\r\n        instant,\r\n        integer,\r\n        markdown,\r\n        oid,\r\n        positiveInt,\r\n        string,\r\n        time,\r\n        unsignedInt,\r\n        uri,\r\n        url,\r\n        uuid,\r\n        Address,\r\n        Age,\r\n        Annotation,\r\n        Attachment,\r\n        CodeableConcept,\r\n        Coding,\r\n        ContactPoint,\r\n        Count,\r\n        Distance,\r\n        Duration,\r\n        HumanName,\r\n        Identifier,\r\n        Money,\r\n        Period,\r\n        Quantity,\r\n        Range,\r\n        Ratio,\r\n        Reference,\r\n        SampledData,\r\n        Signature,\r\n        Timing,\r\n        ContactDetail,\r\n        Contributor,\r\n        DataRequirement,\r\n        Expression,\r\n        ParameterDefinition,\r\n        RelatedArtifact,\r\n        TriggerDefinition,\r\n        UsageContext,\r\n        Dosage,\r\n        Meta&gt;):\r\n    case\r\n      when value is base64Binary then (value as base64Binary).value\r\n      when value is boolean then (value as boolean).value\r\n      when value is canonical then (value as canonical).value\r\n      when value is code then (value as code).value\r\n      when value is date then (value as date).value\r\n      when value is dateTime then (value as dateTime).value\r\n      when value is decimal then (value as decimal).value\r\n      when value is id then (value as id).value\r\n      when value is instant then (value as instant).value\r\n      when value is integer then (value as integer).value\r\n      when value is markdown then (value as markdown).value\r\n      when value is oid then (value as oid).value\r\n      when value is positiveInt then (value as positiveInt).value\r\n      when value is string then (value as string).value\r\n      when value is time then (value as time).value\r\n      when value is unsignedInt then (value as unsignedInt).value\r\n      when value is uri then (value as uri).value\r\n      when value is url then (value as url).value\r\n      when value is uuid then (value as uuid).value\r\n      when value is Age then ToQuantity(value as Age)\r\n      when value is CodeableConcept then ToConcept(value as CodeableConcept)\r\n      when value is Coding then ToCode(value as Coding)\r\n      when value is Count then ToQuantity(value as Count)\r\n      when value is Distance then ToQuantity(value as Distance)\r\n      when value is Duration then ToQuantity(value as Duration)\r\n      when value is Quantity then ToQuantity(value as Quantity)\r\n      when value is Range then ToInterval(value as Range)\r\n      when value is Period then ToInterval(value as Period)\r\n      when value is Ratio then ToRatio(value as Ratio)\r\n      else value as Choice&lt;Address,\r\n        Annotation,\r\n        Attachment,\r\n        ContactPoint,\r\n        HumanName,\r\n        Identifier,\r\n        Money,\r\n        Reference,\r\n        SampledData,\r\n        Signature,\r\n        Timing,\r\n        ContactDetail,\r\n        Contributor,\r\n        DataRequirement,\r\n        Expression,\r\n        ParameterDefinition,\r\n        RelatedArtifact,\r\n        TriggerDefinition,\r\n        UsageContext,\r\n        Dosage,\r\n        Meta&gt;\r\n    end\r\n\r\n/*\r\n@description: Resolve the given reference as a url to a resource. If the item resolves, the Resource is returned, otherwise the result is null.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function resolve(reference String) returns Resource: external\r\n/*\r\n@description: Resolve the reference element of the given Reference. If the item resolves, the Resource is returned, otherwise the result is null.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function resolve(reference Reference) returns Resource: external\r\n/*\r\n@description: Constructs a Reference to the given Resource. The resulting reference will typically be relative, but implementations may provide a base URL if one can be unambiguously determined.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function reference(resource Resource) returns Reference: external\r\n/*\r\n@description: Returns any extensions with the given url defined on the given element.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function extension(element Element, url String) returns List&lt;Extension&gt;: external\r\n/*\r\n@description: Returns any extensions with the given url defined on the given resource.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function extension(resource DomainResource, url String) returns List&lt;Extension&gt;: external\r\n/*\r\n@description: Returns any modifier extensions with the given url defined on the given element.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function modifierExtension(element BackboneElement, url String) returns List&lt;Extension&gt;: external\r\n/*\r\n@description: Returns any modifier extensions with the given url defined on the given resource.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function modifierExtension(resource DomainResource, url String) returns List&lt;Extension&gt;: external\r\n/*\r\n@description: Returns true if the element is a FHIR primitive type with a value element (as opposed to having only extensions); false otherwise\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function hasValue(element Element) returns Boolean: external\r\n/*\r\n@description: Returns the value of the FHIR primitive; null otherwise\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function getValue(element Element) returns Any: external\r\n/*\r\n@description: Returns a list containing only those elements in the input that are of the given type, specified as a string.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function ofType(identifier String) returns List&lt;Any&gt;: external\r\n/*\r\n@description: Returns true if the input is of the given type; false otherwise\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function is(identifier String) returns Boolean: external\r\n/*\r\n@description: If the input is of the given type; returns the value as that type; null otherwise.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function as(identifier String) returns Any: external\r\n/*\r\n@description: Returns the FHIR element definition for the given element\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function elementDefinition(element Element) returns ElementDefinition: external\r\n/*\r\n@description: Returns the given slice as defined in the given structure definition. The structure argument is a uri that resolves to the structure definition, and the name must be the name of a slice within that structure definition. If the structure cannot be resolved, or the name of the slice within the resolved structure is not present, an error is thrown.\r\n@comment: For every element in the input collection, if the resolved slice is present on the element, it will be returned. If the slice does not match any element in the input collection, or if the input collection is empty, the result is an empty collection ({ }).\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function slice(element Element, url String, name String) returns List&lt;Element&gt;: external\r\n/*\r\n@description: For each element in the input collection, verifies that there are no modifying extensions defined other than the ones given by the modifier argument. If the check passes, the input collection is returned. Otherwise, an error is thrown.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function checkModifiers(resource Resource) returns Resource: external\r\n/*\r\n@description: For each element in the input collection, verifies that there are no modifying extensions defined other than the ones given by the modifier argument. If the check passes, the input collection is returned. Otherwise, an error is thrown.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function checkModifiers(resource Resource, modifier String) returns Resource: external\r\n/*\r\n@description: For each element in the input collection, verifies that there are no modifying extensions defined other than the ones given by the modifier argument. If the check passes, the input collection is returned. Otherwise, an error is thrown.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function checkModifiers(element Element) returns Element: external\r\n/*\r\n@description: For each element in the input collection, verifies that there are no modifying extensions defined other than the ones given by the modifier argument. If the check passes, the input collection is returned. Otherwise, an error is thrown.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function checkModifiers(element Element, modifier String) returns Element: external\r\n/*\r\n@description: Returns true if the single input element conforms to the profile specified by the structure argument, and false otherwise. If the structure cannot be resolved to a valid profile, an error is thrown. If the input contains more than one element, an error is thrown. If the input is empty, the result is empty.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function conformsTo(resource Resource, structure String) returns Boolean: external\r\n/*\r\n@description: Returns true if the given code is equal to a code in the valueset, so long as the valueset only contains one codesystem. If the valueset contains more than one codesystem, an error is thrown.\r\n@comment: If the valueset cannot be resolved as a uri to a value set, an error is thrown.\r\nNote that implementations are encouraged to make use of a terminology service to provide this functionality.\r\nFor example:\r\n```fhirpath\r\nObservation.component.where(code.memberOf('http://hl7.org/fhir/ValueSet/observation-vitalsignresult'))\r\n```\r\nThis expression returns components that have a code that is a member of the observation-vitalsignresult valueset.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function memberOf(code code, valueSet String) returns Boolean: external\r\n/*\r\n@description: Returns true if the code is a member of the given valueset.\r\n@comment: If the valueset cannot be resolved as a uri to a value set, an error is thrown.\r\nNote that implementations are encouraged to make use of a terminology service to provide this functionality.\r\nFor example:\r\n```fhirpath\r\nObservation.component.where(code.memberOf('http://hl7.org/fhir/ValueSet/observation-vitalsignresult'))\r\n```\r\nThis expression returns components that have a code that is a member of the observation-vitalsignresult valueset.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function memberOf(coding Coding, valueSet String) returns Boolean: external\r\n/*\r\n@description: Returns true if any code in the concept is a member of the given valueset.\r\n@comment: If the valueset cannot be resolved as a uri to a value set, an error is thrown.\r\nNote that implementations are encouraged to make use of a terminology service to provide this functionality.\r\nFor example:\r\n```fhirpath\r\nObservation.component.where(code.memberOf('http://hl7.org/fhir/ValueSet/observation-vitalsignresult'))\r\n```\r\nThis expression returns components that have a code that is a member of the observation-vitalsignresult valueset.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function memberOf(concept CodeableConcept, valueSet String) returns Boolean: external\r\n/*\r\n@description: Returns true if the source code is equivalent to the given code, or if the source code subsumes the given code (i.e. the source code is an ancestor of the given code in a subsumption hierarchy), and false otherwise.\r\n@comment: If the Codings are from different code systems, the relationships between the code systems must be well-defined or a run-time error is thrown.\r\nNote that implementations are encouraged to make use of a terminology service to provide this functionality.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function subsumes(coding Coding, subsumedCoding Coding) returns Boolean: external\r\n/*\r\n@description: Returns true if any Coding in the source or given elements is equivalent to or subsumes the given code.\r\n@comment: If the Codings are from different code systems, the relationships between the code systems must be well-defined or a run-time error is thrown.\r\nNote that implementations are encouraged to make use of a terminology service to provide this functionality.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function subsumes(concept CodeableConcept, subsumedConcept CodeableConcept) returns Boolean: external\r\n/*\r\n@description: Returns true if the source code is equivalent to the given code, or if the source code is subsumed by the given code (i.e. the source code is a descendant of the given code in a subsumption hierarchy), and false otherwise.\r\n@comment: If the Codings are from different code systems, the relationships between the code systems must be well-defined or a run-time error is thrown.\r\nNote that implementations are encouraged to make use of a terminology service to provide this functionality.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function subsumedBy(coding Coding, subsumingCoding Coding) returns Boolean: external\r\n/*\r\n@description: Returns true if any Coding in the source or given elements is equivalent to or subsumed by the given code.\r\n@comment: If the Codings are from different code systems, the relationships between the code systems must be well-defined or a run-time error is thrown.\r\nNote that implementations are encouraged to make use of a terminology service to provide this functionality.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function subsumedBy(concept CodeableConcept, subsumingConcept CodeableConcept) returns Boolean: external\r\n/*\r\n@description: When invoked on an xhtml element, returns true if the rules around HTML usage are met, and false if they are not. The return value is undefined (null) on any other kind of element.\r\n@seealso: https://hl7.org/fhir/fhirpath.html#functions\r\n*/\r\ndefine function htmlChecks(element Element) returns Boolean: external\r\n\r\ndefine function ToString(value AccountStatus): value.value\r\ndefine function ToString(value ActionCardinalityBehavior): value.value\r\ndefine function ToString(value ActionConditionKind): value.value\r\ndefine function ToString(value ActionGroupingBehavior): value.value\r\ndefine function ToString(value ActionParticipantType): value.value\r\ndefine function ToString(value ActionPrecheckBehavior): value.value\r\ndefine function ToString(value ActionRelationshipType): value.value\r\ndefine function ToString(value ActionRequiredBehavior): value.value\r\ndefine function ToString(value ActionSelectionBehavior): value.value\r\ndefine function ToString(value ActivityDefinitionKind): value.value\r\ndefine function ToString(value ActivityParticipantType): value.value\r\ndefine function ToString(value AddressType): value.value\r\ndefine function ToString(value AddressUse): value.value\r\ndefine function ToString(value AdministrativeGender): value.value\r\ndefine function ToString(value AdverseEventActuality): value.value\r\ndefine function ToString(value AggregationMode): value.value\r\ndefine function ToString(value AllergyIntoleranceCategory): value.value\r\ndefine function ToString(value AllergyIntoleranceCriticality): value.value\r\ndefine function ToString(value AllergyIntoleranceSeverity): value.value\r\ndefine function ToString(value AllergyIntoleranceType): value.value\r\ndefine function ToString(value AppointmentStatus): value.value\r\ndefine function ToString(value AssertionDirectionType): value.value\r\ndefine function ToString(value AssertionOperatorType): value.value\r\ndefine function ToString(value AssertionResponseTypes): value.value\r\ndefine function ToString(value AuditEventAction): value.value\r\ndefine function ToString(value AuditEventAgentNetworkType): value.value\r\ndefine function ToString(value AuditEventOutcome): value.value\r\ndefine function ToString(value BindingStrength): value.value\r\ndefine function ToString(value BiologicallyDerivedProductCategory): value.value\r\ndefine function ToString(value BiologicallyDerivedProductStatus): value.value\r\ndefine function ToString(value BiologicallyDerivedProductStorageScale): value.value\r\ndefine function ToString(value BundleType): value.value\r\ndefine function ToString(value CapabilityStatementKind): value.value\r\ndefine function ToString(value CarePlanActivityKind): value.value\r\ndefine function ToString(value CarePlanActivityStatus): value.value\r\ndefine function ToString(value CarePlanIntent): value.value\r\ndefine function ToString(value CarePlanStatus): value.value\r\ndefine function ToString(value CareTeamStatus): value.value\r\ndefine function ToString(value CatalogEntryRelationType): value.value\r\ndefine function ToString(value ChargeItemDefinitionPriceComponentType): value.value\r\ndefine function ToString(value ChargeItemStatus): value.value\r\ndefine function ToString(value ClaimResponseStatus): value.value\r\ndefine function ToString(value ClaimStatus): value.value\r\ndefine function ToString(value ClinicalImpressionStatus): value.value\r\ndefine function ToString(value CodeSearchSupport): value.value\r\ndefine function ToString(value CodeSystemContentMode): value.value\r\ndefine function ToString(value CodeSystemHierarchyMeaning): value.value\r\ndefine function ToString(value CommunicationPriority): value.value\r\ndefine function ToString(value CommunicationRequestStatus): value.value\r\ndefine function ToString(value CommunicationStatus): value.value\r\ndefine function ToString(value CompartmentCode): value.value\r\ndefine function ToString(value CompartmentType): value.value\r\ndefine function ToString(value CompositionAttestationMode): value.value\r\ndefine function ToString(value CompositionStatus): value.value\r\ndefine function ToString(value ConceptMapEquivalence): value.value\r\ndefine function ToString(value ConceptMapGroupUnmappedMode): value.value\r\ndefine function ToString(value ConditionalDeleteStatus): value.value\r\ndefine function ToString(value ConditionalReadStatus): value.value\r\ndefine function ToString(value ConsentDataMeaning): value.value\r\ndefine function ToString(value ConsentProvisionType): value.value\r\ndefine function ToString(value ConsentState): value.value\r\ndefine function ToString(value ConstraintSeverity): value.value\r\ndefine function ToString(value ContactPointSystem): value.value\r\ndefine function ToString(value ContactPointUse): value.value\r\ndefine function ToString(value ContractPublicationStatus): value.value\r\ndefine function ToString(value ContractStatus): value.value\r\ndefine function ToString(value ContributorType): value.value\r\ndefine function ToString(value CoverageStatus): value.value\r\ndefine function ToString(value CurrencyCode): value.value\r\ndefine function ToString(value DayOfWeek): value.value\r\ndefine function ToString(value DaysOfWeek): value.value\r\ndefine function ToString(value DetectedIssueSeverity): value.value\r\ndefine function ToString(value DetectedIssueStatus): value.value\r\ndefine function ToString(value DeviceMetricCalibrationState): value.value\r\ndefine function ToString(value DeviceMetricCalibrationType): value.value\r\ndefine function ToString(value DeviceMetricCategory): value.value\r\ndefine function ToString(value DeviceMetricColor): value.value\r\ndefine function ToString(value DeviceMetricOperationalStatus): value.value\r\ndefine function ToString(value DeviceNameType): value.value\r\ndefine function ToString(value DeviceRequestStatus): value.value\r\ndefine function ToString(value DeviceUseStatementStatus): value.value\r\ndefine function ToString(value DiagnosticReportStatus): value.value\r\ndefine function ToString(value DiscriminatorType): value.value\r\ndefine function ToString(value DocumentConfidentiality): value.value\r\ndefine function ToString(value DocumentMode): value.value\r\ndefine function ToString(value DocumentReferenceStatus): value.value\r\ndefine function ToString(value DocumentRelationshipType): value.value\r\ndefine function ToString(value EligibilityRequestPurpose): value.value\r\ndefine function ToString(value EligibilityRequestStatus): value.value\r\ndefine function ToString(value EligibilityResponsePurpose): value.value\r\ndefine function ToString(value EligibilityResponseStatus): value.value\r\ndefine function ToString(value EnableWhenBehavior): value.value\r\ndefine function ToString(value EncounterLocationStatus): value.value\r\ndefine function ToString(value EncounterStatus): value.value\r\ndefine function ToString(value EndpointStatus): value.value\r\ndefine function ToString(value EnrollmentRequestStatus): value.value\r\ndefine function ToString(value EnrollmentResponseStatus): value.value\r\ndefine function ToString(value EpisodeOfCareStatus): value.value\r\ndefine function ToString(value EventCapabilityMode): value.value\r\ndefine function ToString(value EventTiming): value.value\r\ndefine function ToString(value EvidenceVariableType): value.value\r\ndefine function ToString(value ExampleScenarioActorType): value.value\r\ndefine function ToString(value ExplanationOfBenefitStatus): value.value\r\ndefine function ToString(value ExposureState): value.value\r\ndefine function ToString(value ExtensionContextType): value.value\r\ndefine function ToString(value FHIRAllTypes): value.value\r\ndefine function ToString(value FHIRDefinedType): value.value\r\ndefine function ToString(value FHIRDeviceStatus): value.value\r\ndefine function ToString(value FHIRResourceType): value.value\r\ndefine function ToString(value FHIRSubstanceStatus): value.value\r\ndefine function ToString(value FHIRVersion): value.value\r\ndefine function ToString(value FamilyHistoryStatus): value.value\r\ndefine function ToString(value FilterOperator): value.value\r\ndefine function ToString(value FlagStatus): value.value\r\ndefine function ToString(value GoalLifecycleStatus): value.value\r\ndefine function ToString(value GraphCompartmentRule): value.value\r\ndefine function ToString(value GraphCompartmentUse): value.value\r\ndefine function ToString(value GroupMeasure): value.value\r\ndefine function ToString(value GroupType): value.value\r\ndefine function ToString(value GuidanceResponseStatus): value.value\r\ndefine function ToString(value GuidePageGeneration): value.value\r\ndefine function ToString(value GuideParameterCode): value.value\r\ndefine function ToString(value HTTPVerb): value.value\r\ndefine function ToString(value IdentifierUse): value.value\r\ndefine function ToString(value IdentityAssuranceLevel): value.value\r\ndefine function ToString(value ImagingStudyStatus): value.value\r\ndefine function ToString(value ImmunizationEvaluationStatus): value.value\r\ndefine function ToString(value ImmunizationStatus): value.value\r\ndefine function ToString(value InvoicePriceComponentType): value.value\r\ndefine function ToString(value InvoiceStatus): value.value\r\ndefine function ToString(value IssueSeverity): value.value\r\ndefine function ToString(value IssueType): value.value\r\ndefine function ToString(value LinkType): value.value\r\ndefine function ToString(value LinkageType): value.value\r\ndefine function ToString(value ListMode): value.value\r\ndefine function ToString(value ListStatus): value.value\r\ndefine function ToString(value LocationMode): value.value\r\ndefine function ToString(value LocationStatus): value.value\r\ndefine function ToString(value MeasureReportStatus): value.value\r\ndefine function ToString(value MeasureReportType): value.value\r\ndefine function ToString(value MediaStatus): value.value\r\ndefine function ToString(value MedicationAdministrationStatus): value.value\r\ndefine function ToString(value MedicationDispenseStatus): value.value\r\ndefine function ToString(value MedicationKnowledgeStatus): value.value\r\ndefine function ToString(value MedicationRequestIntent): value.value\r\ndefine function ToString(value MedicationRequestPriority): value.value\r\ndefine function ToString(value MedicationRequestStatus): value.value\r\ndefine function ToString(value MedicationStatementStatus): value.value\r\ndefine function ToString(value MedicationStatus): value.value\r\ndefine function ToString(value MessageSignificanceCategory): value.value\r\ndefine function ToString(value Messageheader_Response_Request): value.value\r\ndefine function ToString(value MimeType): value.value\r\ndefine function ToString(value NameUse): value.value\r\ndefine function ToString(value NamingSystemIdentifierType): value.value\r\ndefine function ToString(value NamingSystemType): value.value\r\ndefine function ToString(value NarrativeStatus): value.value\r\ndefine function ToString(value NoteType): value.value\r\ndefine function ToString(value NutritiionOrderIntent): value.value\r\ndefine function ToString(value NutritionOrderStatus): value.value\r\ndefine function ToString(value ObservationDataType): value.value\r\ndefine function ToString(value ObservationRangeCategory): value.value\r\ndefine function ToString(value ObservationStatus): value.value\r\ndefine function ToString(value OperationKind): value.value\r\ndefine function ToString(value OperationParameterUse): value.value\r\ndefine function ToString(value OrientationType): value.value\r\ndefine function ToString(value ParameterUse): value.value\r\ndefine function ToString(value ParticipantRequired): value.value\r\ndefine function ToString(value ParticipantStatus): value.value\r\ndefine function ToString(value ParticipationStatus): value.value\r\ndefine function ToString(value PaymentNoticeStatus): value.value\r\ndefine function ToString(value PaymentReconciliationStatus): value.value\r\ndefine function ToString(value ProcedureStatus): value.value\r\ndefine function ToString(value PropertyRepresentation): value.value\r\ndefine function ToString(value PropertyType): value.value\r\ndefine function ToString(value ProvenanceEntityRole): value.value\r\ndefine function ToString(value PublicationStatus): value.value\r\ndefine function ToString(value QualityType): value.value\r\ndefine function ToString(value QuantityComparator): value.value\r\ndefine function ToString(value QuestionnaireItemOperator): value.value\r\ndefine function ToString(value QuestionnaireItemType): value.value\r\ndefine function ToString(value QuestionnaireResponseStatus): value.value\r\ndefine function ToString(value ReferenceHandlingPolicy): value.value\r\ndefine function ToString(value ReferenceVersionRules): value.value\r\ndefine function ToString(value ReferredDocumentStatus): value.value\r\ndefine function ToString(value RelatedArtifactType): value.value\r\ndefine function ToString(value RemittanceOutcome): value.value\r\ndefine function ToString(value RepositoryType): value.value\r\ndefine function ToString(value RequestIntent): value.value\r\ndefine function ToString(value RequestPriority): value.value\r\ndefine function ToString(value RequestStatus): value.value\r\ndefine function ToString(value ResearchElementType): value.value\r\ndefine function ToString(value ResearchStudyStatus): value.value\r\ndefine function ToString(value ResearchSubjectStatus): value.value\r\ndefine function ToString(value ResourceType): value.value\r\ndefine function ToString(value ResourceVersionPolicy): value.value\r\ndefine function ToString(value ResponseType): value.value\r\ndefine function ToString(value RestfulCapabilityMode): value.value\r\ndefine function ToString(value RiskAssessmentStatus): value.value\r\ndefine function ToString(value SPDXLicense): value.value\r\ndefine function ToString(value SearchComparator): value.value\r\ndefine function ToString(value SearchEntryMode): value.value\r\ndefine function ToString(value SearchModifierCode): value.value\r\ndefine function ToString(value SearchParamType): value.value\r\ndefine function ToString(value SectionMode): value.value\r\ndefine function ToString(value SequenceType): value.value\r\ndefine function ToString(value ServiceRequestIntent): value.value\r\ndefine function ToString(value ServiceRequestPriority): value.value\r\ndefine function ToString(value ServiceRequestStatus): value.value\r\ndefine function ToString(value SlicingRules): value.value\r\ndefine function ToString(value SlotStatus): value.value\r\ndefine function ToString(value SortDirection): value.value\r\ndefine function ToString(value SpecimenContainedPreference): value.value\r\ndefine function ToString(value SpecimenStatus): value.value\r\ndefine function ToString(value Status): value.value\r\ndefine function ToString(value StrandType): value.value\r\ndefine function ToString(value StructureDefinitionKind): value.value\r\ndefine function ToString(value StructureMapContextType): value.value\r\ndefine function ToString(value StructureMapGroupTypeMode): value.value\r\ndefine function ToString(value StructureMapInputMode): value.value\r\ndefine function ToString(value StructureMapModelMode): value.value\r\ndefine function ToString(value StructureMapSourceListMode): value.value\r\ndefine function ToString(value StructureMapTargetListMode): value.value\r\ndefine function ToString(value StructureMapTransform): value.value\r\ndefine function ToString(value SubscriptionChannelType): value.value\r\ndefine function ToString(value SubscriptionStatus): value.value\r\ndefine function ToString(value SupplyDeliveryStatus): value.value\r\ndefine function ToString(value SupplyRequestStatus): value.value\r\ndefine function ToString(value SystemRestfulInteraction): value.value\r\ndefine function ToString(value TaskIntent): value.value\r\ndefine function ToString(value TaskPriority): value.value\r\ndefine function ToString(value TaskStatus): value.value\r\ndefine function ToString(value TestReportActionResult): value.value\r\ndefine function ToString(value TestReportParticipantType): value.value\r\ndefine function ToString(value TestReportResult): value.value\r\ndefine function ToString(value TestReportStatus): value.value\r\ndefine function ToString(value TestScriptRequestMethodCode): value.value\r\ndefine function ToString(value TriggerType): value.value\r\ndefine function ToString(value TypeDerivationRule): value.value\r\ndefine function ToString(value TypeRestfulInteraction): value.value\r\ndefine function ToString(value UDIEntryType): value.value\r\ndefine function ToString(value UnitsOfTime): value.value\r\ndefine function ToString(value Use): value.value\r\ndefine function ToString(value VariableType): value.value\r\ndefine function ToString(value VisionBase): value.value\r\ndefine function ToString(value VisionEyes): value.value\r\ndefine function ToString(value VisionStatus): value.value\r\ndefine function ToString(value XPathUsageType): value.value\r\ndefine function ToString(value base64Binary): value.value\r\ndefine function ToBoolean(value boolean): value.value\r\ndefine function ToDate(value date): value.value\r\ndefine function ToDateTime(value dateTime): value.value\r\ndefine function ToDecimal(value decimal): value.value\r\ndefine function ToDateTime(value instant): value.value\r\ndefine function ToInteger(value integer): value.value\r\ndefine function ToString(value string): value.value\r\ndefine function ToTime(value time): value.value\r\ndefine function ToString(value uri): value.value\r\ndefine function ToString(value xhtml): value.value</code></pre>\n      </td>\n    </tr>\n    \n    \n    \n  \n\n<tr>\n  <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.4.9 of the sample-content-ig Liquid templates</th>\n</tr>\n\n    </tbody>\n  </table>\n</div>"
      },
      "url": "https://madie.cms.gov/Library/FHIRHelpers",
      "identifier": [ {
        "use": "official",
        "system": "https://madie.cms.gov/login",
        "value": "660d90bc01598d085de46056"
      } ],
      "version": "4.4.000",
      "name": "FHIRHelpers",
      "title": "FHIRHelpers",
      "status": "active",
      "experimental": false,
      "type": {
        "coding": [ {
          "system": "http://terminology.hl7.org/CodeSystem/library-type",
          "code": "logic-library"
        } ]
      },
      "date": "2025-11-24T17:18:51+00:00",
      "publisher": "ICF",
      "description": "This library defines functions to convert between FHIR\n data types and CQL system-defined types, as well as functions to support\n FHIRPath implementation. For more information, the FHIRHelpers wiki page:\n https://github.com/cqframework/clinical_quality_language/wiki/FHIRHelpers",
      "relatedArtifact": [ {
        "type": "depends-on",
        "display": "FHIR model information",
        "resource": "http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1"
      } ],
      "content": [ {
        "contentType": "text/cql",
        "data": "[encoded data, 52440 characters]"
      }, {
        "contentType": "application/elm+xml",
        "data": "[encoded data, 1342916 characters]"
      }, {
        "contentType": "application/elm+json",
        "data": "[encoded data, 2177516 characters]"
      } ]
    },
    "request": {
      "method": "POST",
      "url": "Library/FHIRHelpers"
    }
  } ]
}