eCQM QICore Content Implementation Guide
2024.0.0 - CI Build

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

Measure: Kidney Health EvaluationFHIR

Official URL: https://madie.cms.gov/Measure/KidneyHealthEvaluationFHIR Version: 0.1.000
Draft as of 2024-07-09 Responsible: National Kidney Foundation Computable Name: KidneyHealthEvaluationFHIR
Other Identifiers: Short Name (use: usual, ), UUID:e66e345d-d892-4fe2-84a7-748433b6e0a6 (use: official, ), UUID:3efe7ea6-862e-4268-a188-d4e837a5c300 (use: official, ), Publisher (use: official, )

Copyright/Legal: Copyright 2024 National Kidney Foundation. All Rights Reserved.

Percentage of patients aged 18-85 years with a diagnosis of diabetes who received a kidney health evaluation defined by an Estimated Glomerular Filtration Rate (eGFR) AND Urine Albumin-Creatinine Ratio (uACR) within the measurement period

UNKNOWN

Title: Kidney Health EvaluationFHIR
Id: KidneyHealthEvaluationFHIR
Version: 0.1.000
Url: Kidney Health EvaluationFHIR
short-name identifier:

CMS951FHIR

version-independent identifier:

urn:uuid:e66e345d-d892-4fe2-84a7-748433b6e0a6

version-specific identifier:

urn:uuid:3efe7ea6-862e-4268-a188-d4e837a5c300

publisher (CMS) identifier:

951FHIR

Effective Period: 2025-01-01..2025-12-31
Status: draft
Publisher: National Kidney Foundation
Author: American Medical Association-convened Physician Consortium for Performance Improvement(R) (AMA-PCPI), National Kidney Foundation
Description:

Percentage of patients aged 18-85 years with a diagnosis of diabetes who received a kidney health evaluation defined by an Estimated Glomerular Filtration Rate (eGFR) AND Urine Albumin-Creatinine Ratio (uACR) within the measurement period

Purpose:

UNKNOWN

Copyright:

Copyright 2024 National Kidney Foundation. All Rights Reserved.

Disclaimer:

Physician Performance Measures (Measures) and related data specifications developed by the National Kidney Foundation (NKF) are intended to facilitate quality improvement activities by health care professionals. These Measures are intended to assist health care professionals in enhancing quality of care. These Measures are not clinical guidelines and do not establish a standard of medical care and have not been tested for all potential applications. NKF encourages testing and evaluation of its Measures. Measures are subject to review and may be revised or rescinded at any time by NKF. The measures may not be altered without prior written approval from NKF. The measures, while copyrighted, can be reproduced and distributed, without modification, for noncommercial purposes. Commercial use is defined as the sale, license, or distribution of the measures for commercial gain, or incorporation of the measures into a product or service that is sold, licensed, or distributed for commercial gain. Commercial uses of the measures require a license agreement between the user and NKF. Neither NKF nor its members shall be responsible for any use of the measures. THESE MEASURES AND SPECIFICATIONS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. 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. CPT(R) contained in the Measure specifications is copyright 2004-2023 American Medical Association. LOINC(R) is copyright 2004-2023 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2023 International Health Terminology Standards Development Organisation. ICD-10 is copyright 2023 World Health Organization. All Rights Reserved. The PCPI’s and AMA’s significant past efforts and contributions to the development and updating of the measure are acknowledged. Due to technical limitations, registered trademarks are indicated by (R) or [R].

Rationale:

Chronic Kidney Disease (CKD) is a major driver of morbidity, mortality and high healthcare costs in the United States. Currently, 37 million American adults have CKD and millions of others are at increased risk (National Kidney Foundation [NKF], 2022), with an estimated population prevalence growing to nearly 17% among Americans aged 30 years and older by the year 2030 (Saran et al., 2019; Hoerger et al., 2015). Total Medicare spending in 2016 on both CKD and End Stage Renal Disease (ESRD) was over $114 billion, comprising 23% of total Medicare fee-for-service spending overall with costs increasing exponentially with advancing CKD (Saran et al., 2019; Nichols et al., 2020). In the US from 2002-2016, the burden of CKD, defined as years of life lost, years living with disability, disability-adjusted life years, and deaths, outpaced changes in the burden of disease for other conditions (Bowe et al., 2018). Patients with CKD are readmitted to the hospital more frequently than those without diagnosed CKD (Saran et al., 2019). CKD is the 9th leading cause of death in the US and is the fastest growing non-communicable disease in terms of in burden largely due to death (Hoerger et al., 2015; Bowe et al., 2018). This public health issue is driven largely by the impact of diabetes—the most common comorbid risk factor for CKD (Saran et al., 2019; Bowe et al., 2018). The intent of this process measure is to improve rates of guideline-concordant kidney health evaluation in patients with diabetes to more consistently identify and potentially treat or delay progression of CKD in this high-risk population. Annual kidney health evaluation in patients with diabetes to determine risk of CKD using eGFR and uACR is recommended by clinical practice guidelines (American Disability Association, 2022; de Boer, 2022; NKF, 2007; NKF, 2012) and has been a focus of various local and national health care quality improvement initiatives, including Healthy People 2030 (Healthy People 2030, 2023). However, performance of these tests in patients with diabetes remains low, with rates that vary across Medicare (41.8%) and private insurers (49.0%) (Saran et al., 2019; Alfego et al., 2021; Stempneiwicz et al., 2021). Low rates of detection of CKD in a population of patients with diabetes have been demonstrated to be associated with low patient awareness of their own kidney health status (Szczech et al., 2014). Indeed, 90% of individuals with CKD are unaware of their condition due to under-recognition and under-diagnosis (Saran et al., 2019; Centers for Disease Control and Prevention, 2023). Currently, an individual’s lifetime probability of developing CKD is relatively high, reaching 54% for someone currently aged 30-49 years (Hoerger et al., 2015). Regular kidney health evaluations, utilizing both eGFR and uACR, provide an opportunity to improve identification and potential reversal of worsening kidney function, particularly in high risk populations, such as those with diabetes.

Clinical recommendation statement:

The following evidence statements are quoted verbatim from the referenced clinical guidelines and other sources, where applicable: At annually, urinary albumin (e.g., spot urinary albumin-to-creatinine ratio) and estimated glomerular filtration rate should be assessed in people with type 1 diabetes with duration of >= 5 years and in all people with type 2 diabetes regardless of treatment. B (American Diabetes Association Professional Practice Committee, 2023) Patients with diabetes should be screened annually for Diabetic Kidney Disease (DKD). Initial screening should commence: - 5 years after the diagnosis of type 1 diabetes; (A) or - From diagnosis of type 2 diabetes. (B) Screening should include: - Measurements of urinary albumin-creatinine ratio (ACR) in a spot urine sample; (B) - Measurement of serum creatinine and estimation of GFR. (B) (National Kidney Foundation [NKF], 2007; NKF, 2012)

Guidance (Usage): This measure assesses performance of a comprehensive kidney evaluation in adults aged 18-85. This measure does not preclude or discourage the use of regular laboratory testing for CKD in patients outside of the age range (patients under 18 years and those over 85 years of age). This eCQM is a patient-based measure. This FHIR-based measure has been derived from the QDM-based measure: CMS951v3. Please refer to the HL7 QI-Core Implementation Guide (http://hl7.org/fhir/us/qicore/STU4.1.1/) for more information on QI-Core and mapping recommendations from QDM to QI-Core 4.1.1 (http://hl7.org/fhir/us/qicore/STU4.1.1/qdm-to-qicore.html).
Population Criteria:
64f0dfe956d636294b157faf
Initial Population: All patients aged 18-85 years with a diagnosis of diabetes at the start of the measurement period with a visit during the measurement period
Denominator: Equals Initial Population
Denominator Exclusion: Patients with a diagnosis of ESRD active during the measurement period; Patients with a diagnosis of (CKD) Stage 5 active during the measurement period; Patients who have an order for or are receiving hospice or palliative care
Numerator: Patients who received a kidney health evaluation defined by an eGFR AND uACR within the measurement period
Supplemental Data Elements:

SDE Ethnicity

SDE Payer

SDE Race

SDE Sex

Supplemental Data Guidance : For every patient evaluated by this measure also identify payer, race, ethnicity and sex
Libraries:
KidneyHealthEvaluationFHIR
Terminology and Other Dependencies:
  • Library/SupplementalDataElements|3.5.000
  • Library/QICoreCommon|2.1.000
  • Library/FHIRHelpers|4.4.000
  • Library/Hospice|6.12.000
  • Library/Status|1.8.000
  • Library/PalliativeCare|1.11.000
  • AdministrativeGender
  • Condition Clinical Status Codes
  • SNOMED CT (all versions)
  • Observation Category Codes
  • Logical Observation Identifiers, Names and Codes (LOINC)
  • Estimated Glomerular Filtration Rate
  • Urine Albumin Creatinine Ratio
  • Diabetes
  • Annual Wellness Visit
  • Home Healthcare Services
  • Office Visit
  • Outpatient Consultation
  • Preventive Care Services - Established Office Visit, 18 and Up
  • Preventive Care Services-Initial Office Visit, 18 and Up
  • Telephone Visits
  • Payer
  • Chronic Kidney Disease, Stage 5
  • End Stage Renal Disease
  • Encounter Inpatient
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1003
  • Hospice Care Ambulatory
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1165
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1167
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1090
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1135
  • Parameters:
    name use min max type
    Measurement Period In 0 1 Period
    SDE Sex Out 0 1 Coding
    Numerator Out 0 1 boolean
    Denominator Out 0 1 boolean
    SDE Payer Out 0 * Resource
    Initial Population Out 0 1 boolean
    SDE Ethnicity Out 0 1 Resource
    Denominator Exclusions Out 0 1 boolean
    SDE Race Out 0 1 Resource
    DataRequirements:
    Resource Type Resource Elements Valueset Name Valueset
    Patient(QICorePatient) ethnicity race
    Observation(QICoreObservation) code effective value status status.value category Estimated Glomerular Filtration Rate Estimated Glomerular Filtration Rate
    Observation(QICoreObservation) code effective value status status.value category Urine Albumin Creatinine Ratio Urine Albumin Creatinine Ratio
    Observation(QICoreObservation) code value effective status status.value category
    Observation(QICoreObservation) code effective status status.value category
    Condition(QICoreCondition) code clinicalStatus Diabetes Diabetes
    Condition(QICoreCondition) code clinicalStatus Chronic Kidney Disease, Stage 5 Chronic Kidney Disease, Stage 5
    Condition(QICoreCondition) code clinicalStatus End Stage Renal Disease End Stage Renal Disease
    Condition(QICoreCondition) code clinicalStatus Hospice Diagnosis http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1165
    Condition(QICoreCondition) code clinicalStatus Palliative Care Diagnosis http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1167
    Encounter(QICoreEncounter) type period status status.value Annual Wellness Visit Annual Wellness Visit
    Encounter(QICoreEncounter) type period status status.value Home Healthcare Services Home Healthcare Services
    Encounter(QICoreEncounter) type period status status.value Office Visit Office Visit
    Encounter(QICoreEncounter) type period status status.value Outpatient Consultation Outpatient Consultation
    Encounter(QICoreEncounter) type period status status.value Preventive Care Services Established Office Visit, 18 and Up Preventive Care Services - Established Office Visit, 18 and Up
    Encounter(QICoreEncounter) type period status status.value Preventive Care Services Initial Office Visit, 18 and Up Preventive Care Services-Initial Office Visit, 18 and Up
    Encounter(QICoreEncounter) type period status status.value Telephone Visits Telephone Visits
    Encounter(QICoreEncounter) type hospitalization hospitalization.dischargeDisposition period status status.value Encounter Inpatient Encounter Inpatient
    Encounter(QICoreEncounter) type period status status.value Hospice Encounter http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1003
    Encounter(QICoreEncounter) type period status status.value Palliative Care Encounter http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1090
    Coverage(QICoreCoverage) type period Payer Type Payer
    ServiceRequest(QICoreServiceRequest) code authoredOn authoredOn.value status status.value intent intent.value Hospice Care Ambulatory Hospice Care Ambulatory
    Procedure(QICoreProcedure) code performed status status.value Hospice Care Ambulatory Hospice Care Ambulatory
    Procedure(QICoreProcedure) code performed status status.value Palliative Care Intervention http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1135
    Direct Reference Codes:
    display code system
    Male M http://hl7.org/fhir/administrative-gender
    Female F http://hl7.org/fhir/administrative-gender
    active http://terminology.hl7.org/CodeSystem/condition-clinical
    Discharge to home for hospice care (procedure) 428361000124107 http://snomed.info/sct
    Discharge to healthcare facility for hospice care (procedure) 428371000124100 http://snomed.info/sct
    survey survey http://terminology.hl7.org/CodeSystem/observation-category
    Yes (qualifier value) 373066001 http://snomed.info/sct
    Hospice care [Minimum Data Set] 45755-6 http://loinc.org
    Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal) 71007-9 http://loinc.org
    Logic Definitions:
    Group Scoring Population Criteria Expression
    64f0dfe956d636294b157faf Group scoring: proportion
    Type:

    Process

    Rate Aggregation: None
    Improvement Notation:

    increase

    Initial Population
    define "Initial Population":
      AgeInYearsAt(date from start of "Measurement Period") in Interval[18, 85]
        and "Has Active Diabetes Overlaps Measurement Period"
        and "Has Outpatient Visit During Measurement Period"
    Denominator
    define "Denominator":
      "Initial Population"
    Denominator Exclusion
    define "Denominator Exclusions":
      exists "Has CKD Stage 5 or ESRD Diagnosis Overlaps Measurement Period"
        or Hospice."Has Hospice Services"
        or PalliativeCare."Has Palliative Care in the Measurement Period"
    Numerator
    define "Numerator":
      "Has Kidney Panel Performed During Measurement Period"
    Library Name Name
    SupplementalDataElements SDE Sex
    define "SDE Sex":
      case
        when Patient.gender = 'male' then "M"
        when Patient.gender = 'female' then "F"
        else null
      end
    Library Name Name
    KidneyHealthEvaluationFHIR SDE Sex
    define "SDE Sex":
      SDE."SDE Sex"
    Library Name Name
    KidneyHealthEvaluationFHIR Has Kidney Panel Performed During Measurement Period
    define "Has Kidney Panel Performed During Measurement Period":
      exists ( ["Observation": "Estimated Glomerular Filtration Rate"] eGFRTest
          where eGFRTest.effective.toInterval ( ) during day of "Measurement Period"
            and eGFRTest.value is not null
            and eGFRTest.status in { 'final', 'amended', 'corrected' }
      )
        and exists ( ["Observation": "Urine Albumin Creatinine Ratio"] uACRTest
            where uACRTest.effective.toInterval ( ) during day of "Measurement Period"
              and uACRTest.value is not null
              and uACRTest.status in { 'final', 'amended', 'corrected' }
        )
    Library Name Name
    KidneyHealthEvaluationFHIR Numerator
    define "Numerator":
      "Has Kidney Panel Performed During Measurement Period"
    Library Name Name
    KidneyHealthEvaluationFHIR Has Active Diabetes Overlaps Measurement Period
    define "Has Active Diabetes Overlaps Measurement Period":
      exists ( ["Condition": "Diabetes"] Diabetes
          where Diabetes.prevalenceInterval ( ) overlaps day of "Measurement Period"
            and Diabetes.clinicalStatus ~ "active"
      )
    Library Name Name
    KidneyHealthEvaluationFHIR Has Outpatient Visit During Measurement Period
    define "Has Outpatient Visit During Measurement Period":
      exists ( ( ["Encounter": "Annual Wellness Visit"]
          union ["Encounter": "Home Healthcare Services"]
          union ["Encounter": "Office Visit"]
          union ["Encounter": "Outpatient Consultation"]
          union ["Encounter": "Preventive Care Services Established Office Visit, 18 and Up"]
          union ["Encounter": "Preventive Care Services Initial Office Visit, 18 and Up"]
          union ["Encounter": "Telephone Visits"] ) ValidEncounter
          where ValidEncounter.period during "Measurement Period"
            and ValidEncounter.status = 'finished'
      )
    Library Name Name
    KidneyHealthEvaluationFHIR Initial Population
    define "Initial Population":
      AgeInYearsAt(date from start of "Measurement Period") in Interval[18, 85]
        and "Has Active Diabetes Overlaps Measurement Period"
        and "Has Outpatient Visit During Measurement Period"
    Library Name Name
    KidneyHealthEvaluationFHIR Denominator
    define "Denominator":
      "Initial Population"
    Library Name Name
    SupplementalDataElements SDE Payer
    define "SDE Payer":
      [Coverage: type in "Payer Type"] Payer
        return {
          code: Payer.type,
          period: Payer.period
        }
    Library Name Name
    KidneyHealthEvaluationFHIR SDE Payer
    define "SDE Payer":
      SDE."SDE Payer"
    Library Name Name
    SupplementalDataElements SDE Ethnicity
    define "SDE Ethnicity":
      Patient.ethnicity E
        return Tuple {
          codes: { E.ombCategory } union E.detailed,
          display: E.text
        }
    Library Name Name
    KidneyHealthEvaluationFHIR SDE Ethnicity
    define "SDE Ethnicity":
      SDE."SDE Ethnicity"
    Library Name Name
    KidneyHealthEvaluationFHIR Has CKD Stage 5 or ESRD Diagnosis Overlaps Measurement Period
    define "Has CKD Stage 5 or ESRD Diagnosis Overlaps Measurement Period":
      ( ["Condition": "Chronic Kidney Disease, Stage 5"]
        union ["Condition": "End Stage Renal Disease"] ) CKDOrESRD
        where CKDOrESRD.prevalenceInterval ( ) overlaps day of "Measurement Period"
          and CKDOrESRD.clinicalStatus ~ "active"
    Library Name Name
    Hospice Has Hospice Services
    define "Has Hospice Services":
      exists ((([Encounter: "Encounter Inpatient"]).isEncounterPerformed()) InpatientEncounter
          where (InpatientEncounter.hospitalization.dischargeDisposition ~ "Discharge to home for hospice care (procedure)"
              or InpatientEncounter.hospitalization.dischargeDisposition ~ "Discharge to healthcare facility for hospice care (procedure)"
          )
            and InpatientEncounter.period.toInterval() ends during day of "Measurement Period"
      )
        or exists ((([Encounter: "Hospice Encounter"]).isEncounterPerformed()) HospiceEncounter
            where HospiceEncounter.period.toInterval() overlaps day of "Measurement Period"
        )
        or exists ((([Observation: "Hospice care [Minimum Data Set]"]).isAssessmentPerformed()) HospiceAssessment
            where HospiceAssessment.value ~ "Yes (qualifier value)"
              and HospiceAssessment.effective.toInterval() overlaps day of "Measurement Period"
        )
        or exists ((([ServiceRequest: "Hospice Care Ambulatory"]).isInterventionOrder()) HospiceOrder
            where HospiceOrder.authoredOn.toInterval() during day of "Measurement Period"
            // and HospiceOrder.doNotPerform is not true
            // https://oncprojectracking.healthit.gov/support/browse/CQLIT-447
        )
        or exists ((([Procedure: "Hospice Care Ambulatory"]).isInterventionPerformed()) HospicePerformed
            where HospicePerformed.performed.toInterval() overlaps day of "Measurement Period"
        )
        or exists (([Condition: "Hospice Diagnosis"]) HospiceCareDiagnosis
            where HospiceCareDiagnosis.prevalenceInterval() overlaps day of "Measurement Period"
        )
    Library Name Name
    PalliativeCare Has Palliative Care in the Measurement Period
    define "Has Palliative Care in the Measurement Period":
      exists ((([Observation: "Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)"]).isAssessmentPerformed()) PalliativeAssessment
          where PalliativeAssessment.effective.toInterval() overlaps day of "Measurement Period"
      )
        or exists ([Condition: "Palliative Care Diagnosis"] PalliativeDiagnosis
            where PalliativeDiagnosis.prevalenceInterval() overlaps day of "Measurement Period"
        )
        or exists ((([Encounter: "Palliative Care Encounter"]).isEncounterPerformed()) PalliativeEncounter
            where PalliativeEncounter.period.toInterval() overlaps day of "Measurement Period"
        )
        or exists ((([Procedure: "Palliative Care Intervention"]).isInterventionPerformed()) PalliativeIntervention
            where PalliativeIntervention.performed.toInterval() overlaps day of "Measurement Period"
        )
    Library Name Name
    KidneyHealthEvaluationFHIR Denominator Exclusions
    define "Denominator Exclusions":
      exists "Has CKD Stage 5 or ESRD Diagnosis Overlaps Measurement Period"
        or Hospice."Has Hospice Services"
        or PalliativeCare."Has Palliative Care in the Measurement Period"
    Library Name Name
    SupplementalDataElements SDE Race
    define "SDE Race":
      Patient.race R
        return Tuple {
          codes: R.ombCategory union R.detailed,
          display: R.text
        }
    Library Name Name
    KidneyHealthEvaluationFHIR SDE Race
    define "SDE Race":
      SDE."SDE Race"
    Library Name Name
    QICoreCommon prevalenceInterval
    /*
    @description: Returns an interval representing the normalized prevalence period of a given Condition.
    @comment: Uses the ToInterval and ToAbatementInterval functions to determine the widest potential interval from
    onset to abatement as specified in the given Condition. If the condition is active, or has an abatement date the resulting 
    interval will have a closed ending boundary. Otherwise, the resulting interval will have an open ending boundary.
    */
    define fluent function prevalenceInterval(condition Condition):
    if condition.clinicalStatus ~ "active"
      or condition.clinicalStatus ~ "recurrence"
      or condition.clinicalStatus ~ "relapse" then
      Interval[start of condition.onset.toInterval(), end of condition.abatementInterval()]
    else
        (end of condition.abatementInterval()) abatementDate
        return if abatementDate is null then
          Interval[start of condition.onset.toInterval(), abatementDate)
        else
          Interval[start of condition.onset.toInterval(), abatementDate]
    Library Name Name
    FHIRHelpers ToString
    define function ToString(value uri): value.value
    Library Name Name
    FHIRHelpers ToCode
    /*
    @description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.
    */
    define function ToCode(coding FHIR.Coding):
        if coding is null then
            null
        else
            System.Code {
              code: coding.code.value,
              system: coding.system.value,
              version: coding.version.value,
              display: coding.display.value
            }
    Library Name Name
    Status isEncounterPerformed
    //Encounter, Performed
    //General usage unless required otherwise by measure intent (e.g., follow-up encounters)
    define fluent function isEncounterPerformed(Enc List<Encounter>):
      Enc E
        where E.status in {'finished', 'arrived', 'triaged', 'in-progress', 'onleave'}
    Library Name Name
    QICoreCommon toInterval
    /*
    @description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
    @comment: Normalizes a choice type of DateTime, Quanitty, Interval<DateTime>, or Interval<Quantity> types
    to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible
    representations for timing-valued elements in QICore, allowing this function to be used across any resource.
    The input can be provided as a DateTime, Quantity, Interval<DateTime> or Interval<Quantity>.
    The intent of this function is to provide a clear and concise mechanism to treat single
    elements that have multiple possible representations as intervals so that logic doesn't have to account
    for the variability. More complex calculations (such as medication request period or dispense period
    calculation) need specific guidance and consideration. That guidance may make use of this function, but
    the focus of this function is on single element calculations where the semantics are unambiguous.
    If the input is a DateTime, the result a DateTime Interval beginning and ending on that DateTime.
    If the input is a Quantity, the quantity is expected to be a calendar-duration interpreted as an Age,
    and the result is a DateTime Interval beginning on the Date the patient turned that age and ending immediately before one year later.
    If the input is a DateTime Interval, the result is the input.
    If the input is a Quantity Interval, the quantities are expected to be calendar-durations interpreted as an Age, and the result
    is a DateTime Interval beginning on the date the patient turned the age given as the start of the quantity interval, and ending
    immediately before one year later than the date the patient turned the age given as the end of the quantity interval.
    If the input is a Timing, an error will be thrown indicating that Timing calculations are not implemented. Any other input will reslt in a null DateTime Interval
    */
    define fluent function toInterval(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>, Timing>):
      case
    	  when choice is DateTime then
        	Interval[choice as DateTime, choice as DateTime]
    		when choice is Interval<DateTime> then
      		choice as Interval<DateTime>
    		when choice is Quantity then
    		  Interval[Patient.birthDate + (choice as Quantity),
    			  Patient.birthDate + (choice as Quantity) + 1 year)
    		when choice is Interval<Quantity> then
    		  Interval[Patient.birthDate + (choice.low as Quantity),
    			  Patient.birthDate + (choice.high as Quantity) + 1 year)
    		when choice is Timing then
          Message(null, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported') as Interval<DateTime>
    		else
    			null as Interval<DateTime>
    	end
    Library Name Name
    Status isAssessmentPerformed
    //This library contains functions that are based on QDM 5.6 to QICore 4.1.1 March 2023 (https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns---QICore-v4.1.1). The functions may appear similar to some QICoreCommon functions but different in that they have constraints that are relevant for measures authored by NCQA.
    
    //Assessment, Performed
    define fluent function isAssessmentPerformed(Obs List<Observation>):
      Obs O
        where O.status in { 'final', 'amended', 'corrected' }
              and exists ( O.category ObservationCategory
              where ( ObservationCategory ) ~ "survey"
          )
    Library Name Name
    FHIRHelpers ToConcept
    /*
    @description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.
    */
    define function ToConcept(concept FHIR.CodeableConcept):
        if concept is null then
            null
        else
            System.Concept {
                codes: concept.coding C return ToCode(C),
                display: concept.text.value
            }
    Library Name Name
    Status isInterventionOrder
    //Intervention, Order: active and completed only    
    define fluent function isInterventionOrder(ServiceRequest List<ServiceRequest>):
      ServiceRequest S
        where S.status in { 'active', 'completed' }
          and S.intent = 'order'
    Library Name Name
    Status isInterventionPerformed
    //Intervention, Performed
    define fluent function isInterventionPerformed(Proc List<Procedure>):
      Proc P
        where P.status ~ 'completed'