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: Functional Status Assessments for Heart FailureFHIR

Official URL: https://madie.cms.gov/Measure/FunctionalStatusAssessmentsforHeartFailureFHIR Version: 0.1.000
Draft as of 2024-07-09 Responsible: Centers for Medicare & Medicaid Services (CMS) Computable Name: FunctionalStatusAssessmentsforHeartFailureFHIR
Other Identifiers: Short Name (use: usual, ), UUID:54792d38-7ad9-459c-b209-91b8915ab7ac (use: official, ), UUID:e1455c1f-ab8a-4337-86ad-903576c55d4e (use: official, ), Publisher (use: official, )

Copyright/Legal: Copyright This Physician Performance Measure (Measure) and related data specifications are owned and stewarded by the Centers for Medicare & Medicaid Services (CMS). CMS contracted (Contract HHSP23320095627WC; HHSP23337008T) with the National Committee for Quality Assurance (NCQA) to develop this electronic measure. NCQA is not responsible for any use of the Measure. NCQA makes no representations, warranties, or endorsement about the quality of any organization or physician that uses or reports performance measures and NCQA has no liability to anyone who relies on such measures or specifications.

Limited proprietary coding is contained in the Measure specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets. NCQA disclaims all liability for use or accuracy of any third-party codes contained in the specifications.

CPT(R) codes, descriptions and other data are copyright 2024. American Medical Association. All rights reserved. CPT is a trademark of the American Medical Association. Fee schedules, relative value units, conversion factors and/or related components are not assigned by the AMA, are not part of CPT, and the AMA is not recommending their use. The AMA does not directly or indirectly practice medicine or dispense medical services. The AMA assumes no liability for data contained or not contained herein. Applicable FARS/DFARS restrictions apply to government use.

The American Dental Association (“ADA”) holds a copyright to the Current Dental Terminology (“CDT”) codes contained in certain measure specifications. The CDT codes in the measure specifications are included with the permission of the ADA. All uses of the CDT codes require a license from the ADA. No alteration, amendments, or modifications of the CDT or any portion thereof is allowed. Resale, transmission, or distribution of copies of the CDT or other portions of the CDT is also not allowed. To inquire about licensing, contact CDT-SNODENT@ada.org.

The measure specifications contain coding from LOINC(R) (http://loinc.org). The LOINC table, LOINC codes, LOINC panels and form file, LOINC linguistic variants file, LOINC/RSNA Radiology Playbook, and LOINC/IEEE Medical Device Code Mapping Table are copyright 2004-2024 Regenstrief Institute, Inc. and the Logical Observation Identifiers Names and Codes (LOINC) Committee, and are available at no cost under the license at http://loinc.org/terms-of-use.

This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2023 International Health Terminology Standards Development Organisation.

ICD-10 copyright 2024 World Health Organization. All Rights Reserved.

“HL7” is the registered trademark of Health Level Seven International.

Percentage of patients 18 years of age and older with heart failure who completed initial and follow-up patient-reported functional status assessments

UNKNOWN

Title: Functional Status Assessments for Heart FailureFHIR
Id: FunctionalStatusAssessmentsforHeartFailureFHIR
Version: 0.1.000
Url: Functional Status Assessments for Heart FailureFHIR
short-name identifier:

CMS90FHIR

version-independent identifier:

urn:uuid:54792d38-7ad9-459c-b209-91b8915ab7ac

version-specific identifier:

urn:uuid:e1455c1f-ab8a-4337-86ad-903576c55d4e

publisher (CMS) identifier:

90FHIR

Effective Period: 2025-01-01..2025-12-31
Status: draft
Publisher: Centers for Medicare & Medicaid Services (CMS)
Author: National Committee for Quality Assurance
Description:

Percentage of patients 18 years of age and older with heart failure who completed initial and follow-up patient-reported functional status assessments

Purpose:

UNKNOWN

Copyright:

Copyright This Physician Performance Measure (Measure) and related data specifications are owned and stewarded by the Centers for Medicare & Medicaid Services (CMS). CMS contracted (Contract HHSP23320095627WC; HHSP23337008T) with the National Committee for Quality Assurance (NCQA) to develop this electronic measure. NCQA is not responsible for any use of the Measure. NCQA makes no representations, warranties, or endorsement about the quality of any organization or physician that uses or reports performance measures and NCQA has no liability to anyone who relies on such measures or specifications.

Limited proprietary coding is contained in the Measure specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets. NCQA disclaims all liability for use or accuracy of any third-party codes contained in the specifications.

CPT(R) codes, descriptions and other data are copyright 2024. American Medical Association. All rights reserved. CPT is a trademark of the American Medical Association. Fee schedules, relative value units, conversion factors and/or related components are not assigned by the AMA, are not part of CPT, and the AMA is not recommending their use. The AMA does not directly or indirectly practice medicine or dispense medical services. The AMA assumes no liability for data contained or not contained herein. Applicable FARS/DFARS restrictions apply to government use.

The American Dental Association (“ADA”) holds a copyright to the Current Dental Terminology (“CDT”) codes contained in certain measure specifications. The CDT codes in the measure specifications are included with the permission of the ADA. All uses of the CDT codes require a license from the ADA. No alteration, amendments, or modifications of the CDT or any portion thereof is allowed. Resale, transmission, or distribution of copies of the CDT or other portions of the CDT is also not allowed. To inquire about licensing, contact CDT-SNODENT@ada.org.

The measure specifications contain coding from LOINC(R) (http://loinc.org). The LOINC table, LOINC codes, LOINC panels and form file, LOINC linguistic variants file, LOINC/RSNA Radiology Playbook, and LOINC/IEEE Medical Device Code Mapping Table are copyright 2004-2024 Regenstrief Institute, Inc. and the Logical Observation Identifiers Names and Codes (LOINC) Committee, and are available at no cost under the license at http://loinc.org/terms-of-use.

This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2023 International Health Terminology Standards Development Organisation.

ICD-10 copyright 2024 World Health Organization. All Rights Reserved.

“HL7” is the registered trademark of Health Level Seven International.

Disclaimer:

The performance Measure is not a clinical guideline and does not establish a standard of medical care, and has not been tested for all potential applications. THE MEASURE AND SPECIFICATIONS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.

Due to technical limitations, registered trademarks are indicated by (R) or [R] and unregistered trademarks are indicated by (TM) or [TM].

Scoring:

Proportion

Rationale:

Patients living with heart failure often have poor functional status and health-related quality of life, which declines as the disease progresses (Allen et al., 2012). In addition, their care is often complicated by multiple comorbidities. To assist in managing these complex patients, the American College of Cardiology Foundation and American Heart Association recommend collecting initial and repeat assessments of a patient's function and ability to complete desired activities of daily living (Hunt et al., 2009). The American Heart Association also released scientific statements emphasizing the collection of patient-reported health status (for example, functional limitations, symptom burden, quality of life) from heart failure patients as an important means of establishing a dynamic conversation between patient and provider regarding care goals and the patient's priorities (Allen et al., 2012; Rumsfeld et al., 2013).

The most recent update to clinical guidelines by the American Heart Association, the American College of Cardiology, and the Heart Failure Society of America further emphasizes that better understanding of symptom burden and prognosis may improve the quality of treatment decisions. The guideline also indicates that routine assessment can facilitate population health management by identifying high-risk patients needing closer monitoring or referral to specialized centers and that patient-reported health status assessment increases the patient’s role in care, which can motivate initiation and uptake of medical therapy (Heidenreich et al., 2022).

Clinical recommendation statement:

The American Heart Association, the American College of Cardiology, and the Heart Failure Society of America (2022): This guideline provides patient-centric recommendations for clinicians to prevent, diagnose, and manage patients with heart failure and specifically recommends assessing patient-reported health status using a validated questionnaire to provide incremental information for patient functional status, symptom burden, and prognosis. Tools specifically recommended in the guideline are as follows:

  • The Kansas City Cardiomyopathy Questionnaire or,
  • The Minnesota Living with Heart Failure Questionnaire
  • PROMIS-Plus-HF [Patient Reported Outcomes Measurement Information System Plus-Heart Failure]
Guidance (Usage): Initial functional status assessment (FSA) and encounter: The initial FSA is an FSA that occurs within two weeks before or during an encounter, in the 180 days or more before the end of the measurement period. Follow-up FSA: The follow-up FSA must be completed at least 30 days but no more than 180 days after the initial FSA. The same FSA instrument must be used for the initial and follow-up assessment. This eCQM is a patient-based measure. This FHIR-based measure has been derived from the QDM-based measure: CMS90v14. 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:
654a6f0e78418140875e3610
Initial Population: Patients 18 years of age and older who had two outpatient encounters during the measurement period and a diagnosis of heart failure that starts any time before and continues into the measurement period
Denominator: Equals Initial Population
Denominator Exclusion: Exclude patients who are in hospice care for any part of the measurement period. Exclude patients with severe cognitive impairment in any part of the measurement period.
Numerator: Patients with patient-reported functional status assessment results (i.e., Veterans RAND 12-item health survey [VR-12]; VR-36; Kansas City Cardiomyopathy Questionnaire [KCCQ]; KCCQ-12; Minnesota Living with Heart Failure Questionnaire [MLHFQ]; Patient-Reported Outcomes Measurement Information System [PROMIS]-10 Global Health; PROMIS-29) present in the EHR within two weeks before or during the initial FSA encounter and results for the follow-up FSA at least 30 days but no more than 180 days after the initial FSA
Libraries:
FunctionalStatusAssessmentsforHeartFailureFHIR
Terminology and Other Dependencies:
  • Library/Status|1.8.000
  • Library/QICoreCommon|2.1.000
  • Library/FHIRHelpers|4.4.000
  • Library/Hospice|6.12.000
  • Observation Category Codes
  • Logical Observation Identifiers, Names and Codes (LOINC)
  • SNOMED CT (all versions)
  • Office Visit
  • Telephone Visits
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1089
  • Heart Failure
  • 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
  • Parameters:
    name use min max type
    Measurement Period In 0 1 Period
    Numerator Out 0 1 boolean
    Denominator Out 0 1 boolean
    Initial Population Out 0 1 boolean
    Denominator Exclusions Out 0 1 boolean
    DataRequirements:
    Resource Type Resource Elements Valueset Name Valueset
    Patient(QICorePatient)
    Encounter(QICoreEncounter) type status status.value period Office Visit Office Visit
    Encounter(QICoreEncounter) type status status.value period Telephone Visits Telephone Visits
    Encounter(QICoreEncounter) type status status.value period Virtual Encounter http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1089
    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
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code effective value status status.value category
    Observation(QICoreObservation) code value effective status status.value category
    Condition(QICoreCondition) code Heart Failure Heart Failure
    Condition(QICoreCondition) code Hospice Diagnosis http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1165
    Condition(QICoreCondition) code
    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
    Direct Reference Codes:
    display code system
    survey survey http://terminology.hl7.org/CodeSystem/observation-category
    PROMIS-10 Global Mental Health (GMH) score T-score 71969-0 http://loinc.org
    PROMIS-10 Global Physical Health (GPH) score T-score 71971-6 http://loinc.org
    PROMIS-29 Sleep disturbance score T-score 71955-9 http://loinc.org
    PROMIS-29 Satisfaction with participation in social roles score T-score 71957-5 http://loinc.org
    PROMIS-29 Physical function score T-score 71959-1 http://loinc.org
    PROMIS-29 Pain interference score T-score 71961-7 http://loinc.org
    PROMIS-29 Fatigue score T-score 71963-3 http://loinc.org
    PROMIS-29 Depression score T-score 71965-8 http://loinc.org
    PROMIS-29 Anxiety score T-score 71967-4 http://loinc.org
    VR-12 Mental component summary (MCS) score - oblique method T-score 72026-8 http://loinc.org
    VR-12 Physical component summary (PCS) score - oblique method T-score 72025-0 http://loinc.org
    VR-12 Mental component summary (MCS) score - orthogonal method T-score 72028-4 http://loinc.org
    VR-12 Physical component summary (PCS) score - orthogonal method T-score 72027-6 http://loinc.org
    VR-36 Mental component summary (MCS) score - oblique method T-score 71990-6 http://loinc.org
    VR-36 Physical component summary (PCS) score - oblique method T-score 71989-8 http://loinc.org
    VR-36 Mental component summary (MCS) score - orthogonal method T-score 72008-6 http://loinc.org
    VR-36 Physical component summary (PCS) score - orthogonal method T-score 72007-8 http://loinc.org
    Physical score [MLHFQ] 85618-7 http://loinc.org
    Emotional score [MLHFQ] 85609-6 http://loinc.org
    Kansas City Cardiomyopathy Questionnaire - 12 item [KCCQ-12] 86923-0 http://loinc.org
    Overall summary score [KCCQ-12] 86924-8 http://loinc.org
    Quality of life score [KCCQ] 72189-4 http://loinc.org
    Symptom stability score [KCCQ] 72194-4 http://loinc.org
    Self-efficacy score [KCCQ] 72190-2 http://loinc.org
    Total symptom score [KCCQ] 72191-0 http://loinc.org
    Physical limitation score [KCCQ] 72195-1 http://loinc.org
    Social limitation score [KCCQ] 72196-9 http://loinc.org
    Overall summary score [KCCQ] 71940-1 http://loinc.org
    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
    Yes (qualifier value) 373066001 http://snomed.info/sct
    Hospice care [Minimum Data Set] 45755-6 http://loinc.org
    Severe cognitive impairment (finding) 702956004 http://snomed.info/sct
    Logic Definitions:
    Group Scoring Population Criteria Expression
    654a6f0e78418140875e3610 Group scoring: proportion Measure scoring:

    Proportion

    Type:

    Process

    Rate Aggregation: None
    Improvement Notation:

    increase

    Initial Population
    define "Initial Population":
      AgeInYearsAt(date from start of "Measurement Period") >= 18
        and exists ( ( [Condition: "Heart Failure"] ) HeartFailure
            where HeartFailure.prevalenceInterval ( ) overlaps before "Measurement Period"
        )
        and exists ( "Two Outpatient Encounters during Measurement Period" )
    Denominator
    define "Denominator":
      "Initial Population"
    Denominator Exclusion
    define "Denominator Exclusions":
      Hospice."Has Hospice Services"
        or exists ( ( [Condition: "Severe cognitive impairment (finding)"] ) SevereCognitiveImpairment
            where SevereCognitiveImpairment.prevalenceInterval ( ) overlaps "Measurement Period"
        )
    Numerator
    define "Numerator":
      ( "Has Encounter with Initial and Follow Up PROMIS10 Assessments" )
        or ( "Has Encounter with Initial and Follow Up PROMIS29 Assessments" )
        or ( "Has Encounter with Initial and Follow Up VR12 Oblique Assessments" )
        or ( "Has Encounter with Initial and Follow Up VR12 Orthogonal Assessments" )
        or ( "Has Encounter with Initial and Follow Up VR36 Oblique Assessments" )
        or ( "Has Encounter with Initial and Follow Up VR36 Orthogonal Assessments" )
        or ( "Has Encounter with Initial and Follow Up MLHFQ Assessments" )
        or ( "Has Encounter with Initial and Follow Up KCCQ12 Assessments" )
        or ( "Has Encounter with Initial and Follow Up KCCQ Domain Score Assessments" )
        or ( "Has Encounter with Initial and Follow Up KCCQ Total Score Assessments" )
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Qualifying Encounters
    define "Qualifying Encounters":
      ( ( [Encounter: "Office Visit"]
          union [Encounter: "Telephone Visits"]
          union [Encounter: "Virtual Encounter"]
      ).isEncounterPerformed ( ) ) ValidEncounter
        where ValidEncounter.period.toInterval ( ) during day of "Measurement Period"
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Date PROMIS10 Total Assessment Completed
    define "Date PROMIS10 Total Assessment Completed":
      from
        ( ( [Observation: "PROMIS-10 Global Mental Health (GMH) score T-score"] ).isAssessmentPerformed ( ) ) PROMIS10MentalScore,
        ( ( [Observation: "PROMIS-10 Global Physical Health (GPH) score T-score"] ).isAssessmentPerformed ( ) ) PROMIS10PhysicalScore
        let PROMIS10MentalScoreDate: date from start of PROMIS10MentalScore.effective.toInterval ( ),
        PROMIS10PhysicalScoreDate: date from start of PROMIS10PhysicalScore.effective.toInterval ( )
        where PROMIS10MentalScoreDate same day as PROMIS10PhysicalScoreDate
          and PROMIS10MentalScore.value is not null
          and PROMIS10PhysicalScore.value is not null
        return PROMIS10MentalScoreDate
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Has Encounter with Initial and Follow Up PROMIS10 Assessments
    define "Has Encounter with Initial and Follow Up PROMIS10 Assessments":
      exists ( from
          "Qualifying Encounters" ValidEncounters,
          "Date PROMIS10 Total Assessment Completed" InitialPROMIS10Date,
          "Date PROMIS10 Total Assessment Completed" FollowupPROMIS10Date
          where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
            and InitialPROMIS10Date 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
            and date from FollowupPROMIS10Date during day of Interval[date from InitialPROMIS10Date + 30 days, date from InitialPROMIS10Date + 180 days]
          return ValidEncounters
      )
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Date PROMIS29 Total Assessment Completed
    define "Date PROMIS29 Total Assessment Completed":
      from
        ( ( [Observation: "PROMIS-29 Sleep disturbance score T-score"] ).isAssessmentPerformed ( ) ) Promis29Sleep,
        ( ( [Observation: "PROMIS-29 Satisfaction with participation in social roles score T-score"] ).isAssessmentPerformed ( ) ) Promis29SocialRoles,
        ( ( [Observation: "PROMIS-29 Physical function score T-score"] ).isAssessmentPerformed ( ) ) Promis29Physical,
        ( ( [Observation: "PROMIS-29 Pain interference score T-score"] ).isAssessmentPerformed ( ) ) Promis29Pain,
        ( ( [Observation: "PROMIS-29 Fatigue score T-score"] ).isAssessmentPerformed ( ) ) Promis29Fatigue,
        ( ( [Observation: "PROMIS-29 Depression score T-score"] ).isAssessmentPerformed ( ) ) Promis29Depression,
        ( ( [Observation: "PROMIS-29 Anxiety score T-score"] ).isAssessmentPerformed ( ) ) Promis29Anxiety
        let Promis29SleepDate: date from start of Promis29Sleep.effective.toInterval ( ),
        Promis29SocialRolesDate: date from start of Promis29SocialRoles.effective.toInterval ( ),
        Promis29PhysicalDate: date from start of Promis29Physical.effective.toInterval ( ),
        Promis29PainDate: date from start of Promis29Pain.effective.toInterval ( ),
        Promis29FatigueDate: date from start of Promis29Fatigue.effective.toInterval ( ),
        Promis29DepressionDate: date from start of Promis29Depression.effective.toInterval ( ),
        Promis29AnxietyDate: date from start of Promis29Anxiety.effective.toInterval ( )
        where Promis29SleepDate same day as Promis29SocialRolesDate
          and Promis29SocialRoles.value is not null
          and Promis29SleepDate same day as Promis29PhysicalDate
          and Promis29Physical.value is not null
          and Promis29SleepDate same day as Promis29PainDate
          and Promis29Pain.value is not null
          and Promis29SleepDate same day as Promis29FatigueDate
          and Promis29Fatigue.value is not null
          and Promis29SleepDate same day as Promis29DepressionDate
          and Promis29Depression.value is not null
          and Promis29SleepDate same day as Promis29AnxietyDate
          and Promis29Anxiety.value is not null
          and Promis29Sleep.value is not null
        return Promis29SleepDate
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Has Encounter with Initial and Follow Up PROMIS29 Assessments
    define "Has Encounter with Initial and Follow Up PROMIS29 Assessments":
      exists ( from
          "Qualifying Encounters" ValidEncounters,
          "Date PROMIS29 Total Assessment Completed" InitialPROMIS29Date,
          "Date PROMIS29 Total Assessment Completed" FollowupPROMIS29Date
          where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
            and InitialPROMIS29Date 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
            and date from FollowupPROMIS29Date during day of Interval[date from InitialPROMIS29Date + 30 days, date from InitialPROMIS29Date + 180 days]
          return ValidEncounters
      )
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Date VR12 Oblique Total Assessment Completed
    define "Date VR12 Oblique Total Assessment Completed":
      from
        ( ( [Observation: "VR-12 Mental component summary (MCS) score - oblique method T-score"] ).isAssessmentPerformed ( ) ) VR12MentalAssessment,
        ( ( [Observation: "VR-12 Physical component summary (PCS) score - oblique method T-score"] ).isAssessmentPerformed ( ) ) VR12PhysicalAssessment
        let VR12MentalAssessmentDate: date from start of VR12MentalAssessment.effective.toInterval ( ),
        VR12PhysicalAssessmentDate: date from start of VR12PhysicalAssessment.effective.toInterval ( )
        where VR12MentalAssessmentDate same day as VR12PhysicalAssessmentDate
          and VR12MentalAssessment.value is not null
          and VR12PhysicalAssessment.value is not null
        return VR12MentalAssessmentDate
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Has Encounter with Initial and Follow Up VR12 Oblique Assessments
    define "Has Encounter with Initial and Follow Up VR12 Oblique Assessments":
      exists ( from
          "Qualifying Encounters" ValidEncounters,
          "Date VR12 Oblique Total Assessment Completed" InitialVR12ObliqueDate,
          "Date VR12 Oblique Total Assessment Completed" FollowupVR12ObliqueDate
          where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
            and InitialVR12ObliqueDate 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
            and date from FollowupVR12ObliqueDate during day of Interval[date from InitialVR12ObliqueDate + 30 days, date from InitialVR12ObliqueDate + 180 days]
          return ValidEncounters
      )
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Date VR12 Orthogonal Total Assessment Completed
    define "Date VR12 Orthogonal Total Assessment Completed":
      from
        ( ( [Observation: "VR-12 Mental component summary (MCS) score - orthogonal method T-score"] ).isAssessmentPerformed ( ) ) VR12MentalAssessment,
        ( ( [Observation: "VR-12 Physical component summary (PCS) score - orthogonal method T-score"] ).isAssessmentPerformed ( ) ) VR12PhysicalAssessment
        let VR12MentalAssessmentDate: date from start of VR12MentalAssessment.effective.toInterval ( ),
        VR12PhysicalAssessmentDate: date from start of VR12PhysicalAssessment.effective.toInterval ( )
        where VR12MentalAssessmentDate same day as VR12PhysicalAssessmentDate
          and VR12MentalAssessment.value is not null
          and VR12PhysicalAssessment.value is not null
        return VR12MentalAssessmentDate
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Has Encounter with Initial and Follow Up VR12 Orthogonal Assessments
    define "Has Encounter with Initial and Follow Up VR12 Orthogonal Assessments":
      exists ( from
          "Qualifying Encounters" ValidEncounters,
          "Date VR12 Orthogonal Total Assessment Completed" InitialVR12OrthogonalDate,
          "Date VR12 Orthogonal Total Assessment Completed" FollowupVR12OrthogonalDate
          where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
            and InitialVR12OrthogonalDate 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
            and date from FollowupVR12OrthogonalDate during day of Interval[date from InitialVR12OrthogonalDate + 30 days, date from InitialVR12OrthogonalDate + 180 days]
          return ValidEncounters
      )
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Date VR36 Oblique Total Assessment Completed
    define "Date VR36 Oblique Total Assessment Completed":
      from
        ( ( [Observation: "VR-36 Mental component summary (MCS) score - oblique method T-score"] ).isAssessmentPerformed ( ) ) VR36MentalAssessment,
        ( ( [Observation: "VR-36 Physical component summary (PCS) score - oblique method T-score"] ).isAssessmentPerformed ( ) ) VR36PhysicalAssessment
        let VR36MentalAssessmentDate: date from start of VR36MentalAssessment.effective.toInterval ( ),
        VR36PhysicalAssessmentDate: date from start of VR36PhysicalAssessment.effective.toInterval ( )
        where VR36MentalAssessmentDate same day as VR36PhysicalAssessmentDate
          and VR36MentalAssessment.value is not null
          and VR36PhysicalAssessment.value is not null
        return VR36MentalAssessmentDate
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Has Encounter with Initial and Follow Up VR36 Oblique Assessments
    define "Has Encounter with Initial and Follow Up VR36 Oblique Assessments":
      exists ( from
          "Qualifying Encounters" ValidEncounters,
          "Date VR36 Oblique Total Assessment Completed" InitialVR36ObliqueDate,
          "Date VR36 Oblique Total Assessment Completed" FollowupVR36ObliqueDate
          where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
            and InitialVR36ObliqueDate 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
            and date from FollowupVR36ObliqueDate during day of Interval[date from InitialVR36ObliqueDate + 30 days, date from InitialVR36ObliqueDate + 180 days]
          return ValidEncounters
      )
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Date VR36 Orthogonal Total Assessment Completed
    define "Date VR36 Orthogonal Total Assessment Completed":
      from
        ( ( [Observation: "VR-36 Mental component summary (MCS) score - orthogonal method T-score"] ).isAssessmentPerformed ( ) ) VR36MentalAssessment,
        ( ( [Observation: "VR-36 Physical component summary (PCS) score - orthogonal method T-score"] ).isAssessmentPerformed ( ) ) VR36PhysicalAssessment
        let VR36MentalAssessmentDate: date from start of VR36MentalAssessment.effective.toInterval ( ),
        VR36PhysicalAssessmentDate: date from start of VR36PhysicalAssessment.effective.toInterval ( )
        where VR36MentalAssessmentDate same day as VR36PhysicalAssessmentDate
          and VR36MentalAssessment.value is not null
          and VR36PhysicalAssessment.value is not null
        return VR36MentalAssessmentDate
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Has Encounter with Initial and Follow Up VR36 Orthogonal Assessments
    define "Has Encounter with Initial and Follow Up VR36 Orthogonal Assessments":
      exists ( from
          "Qualifying Encounters" ValidEncounters,
          "Date VR36 Orthogonal Total Assessment Completed" InitialVR36OrthogonalDate,
          "Date VR36 Orthogonal Total Assessment Completed" FollowupVR36OrthogonalDate
          where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
            and InitialVR36OrthogonalDate 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
            and date from FollowupVR36OrthogonalDate during day of Interval[date from InitialVR36OrthogonalDate + 30 days, date from InitialVR36OrthogonalDate + 180 days]
          return ValidEncounters
      )
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Date MLHFQ Total Assessment Completed
    define "Date MLHFQ Total Assessment Completed":
      from
        ( ( [Observation: "Physical score [MLHFQ]"] ).isAssessmentPerformed ( ) ) MLHFQPhysical,
        ( ( [Observation: "Emotional score [MLHFQ]"] ).isAssessmentPerformed ( ) ) MLHFQEmotional
        let MLHFQPhysicalDate: date from start of MLHFQPhysical.effective.toInterval ( ),
        MLHFQEmotionalDate: date from start of MLHFQEmotional.effective.toInterval ( )
        where MLHFQPhysicalDate same day as MLHFQEmotionalDate
          and MLHFQPhysical.value is not null
          and MLHFQEmotional.value is not null
        return MLHFQPhysicalDate
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Has Encounter with Initial and Follow Up MLHFQ Assessments
    define "Has Encounter with Initial and Follow Up MLHFQ Assessments":
      exists ( from
          "Qualifying Encounters" ValidEncounters,
          "Date MLHFQ Total Assessment Completed" InitialMLHFQDate,
          "Date MLHFQ Total Assessment Completed" FollowupMLHFQDate
          where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
            and InitialMLHFQDate 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
            and date from FollowupMLHFQDate during day of Interval[date from InitialMLHFQDate + 30 days, date from InitialMLHFQDate + 180 days]
          return ValidEncounters
      )
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Date KCCQ12 Total Assessment Completed
    define "Date KCCQ12 Total Assessment Completed":
      from
        ( ( [Observation: "Kansas City Cardiomyopathy Questionnaire - 12 item [KCCQ-12]"] ).isAssessmentPerformed ( ) ) KCCQ12Item,
        ( ( [Observation: "Overall summary score [KCCQ-12]"] ).isAssessmentPerformed ( ) ) KCCQ12Summary
        let KCCQ12ItemDate: date from start of KCCQ12Item.effective.toInterval ( ),
        KCCQ12SummaryDate: date from start of KCCQ12Summary.effective.toInterval ( )
        where KCCQ12ItemDate same day as KCCQ12SummaryDate
          and KCCQ12Item.value is not null
          and KCCQ12Summary.value is not null
        return KCCQ12ItemDate
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Has Encounter with Initial and Follow Up KCCQ12 Assessments
    define "Has Encounter with Initial and Follow Up KCCQ12 Assessments":
      exists ( from
          "Qualifying Encounters" ValidEncounters,
          "Date KCCQ12 Total Assessment Completed" InitialKCCQ12Date,
          "Date KCCQ12 Total Assessment Completed" FollowupKCCQ12Date
          where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
            and InitialKCCQ12Date 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
            and date from FollowupKCCQ12Date during day of Interval[date from InitialKCCQ12Date + 30 days, date from InitialKCCQ12Date + 180 days]
          return ValidEncounters
      )
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Date KCCQ Domain Assessment Completed
    define "Date KCCQ Domain Assessment Completed":
      from
        ( ( [Observation: "Quality of life score [KCCQ]"] ).isAssessmentPerformed ( ) ) KCCQLifeQuality,
        ( ( [Observation: "Symptom stability score [KCCQ]"] ).isAssessmentPerformed ( ) ) KCCQSymptomStability,
        ( ( [Observation: "Self-efficacy score [KCCQ]"] ).isAssessmentPerformed ( ) ) KCCQSelfEfficacy,
        ( ( [Observation: "Total symptom score [KCCQ]"] ).isAssessmentPerformed ( ) ) KCCQSymptoms,
        ( ( [Observation: "Physical limitation score [KCCQ]"] ).isAssessmentPerformed ( ) ) KCCQPhysicalLimits,
        ( ( [Observation: "Social limitation score [KCCQ]"] ).isAssessmentPerformed ( ) ) KCCQSocialLimits
        let KCCQLifeQualityDate: date from start of KCCQLifeQuality.effective.toInterval ( ),
        KCCQSymptomStabilityDate: date from start of KCCQSymptomStability.effective.toInterval ( ),
        KCCQSelfEfficacyDate: date from start of KCCQSelfEfficacy.effective.toInterval ( ),
        KCCQSymptomsDate: date from start of KCCQSymptoms.effective.toInterval ( ),
        KCCQPhysicalLimitsDate: date from start of KCCQPhysicalLimits.effective.toInterval ( ),
        KCCQSocialLimitsDate: date from start of KCCQSocialLimits.effective.toInterval ( )
        where KCCQLifeQualityDate same day as KCCQSymptomStabilityDate
          and KCCQSymptomStability.value is not null
          and KCCQLifeQualityDate same day as KCCQSelfEfficacyDate
          and KCCQSelfEfficacy.value is not null
          and KCCQLifeQualityDate same day as KCCQSymptomsDate
          and KCCQSymptoms.value is not null
          and KCCQLifeQualityDate same day as KCCQPhysicalLimitsDate
          and KCCQPhysicalLimits.value is not null
          and KCCQLifeQualityDate same day as KCCQSocialLimitsDate
          and KCCQSocialLimits.value is not null
          and KCCQLifeQuality.value is not null
        return KCCQLifeQualityDate
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Has Encounter with Initial and Follow Up KCCQ Domain Score Assessments
    define "Has Encounter with Initial and Follow Up KCCQ Domain Score Assessments":
      exists ( from
          "Qualifying Encounters" ValidEncounters,
          "Date KCCQ Domain Assessment Completed" InitialKCCQAssessmentDate,
          "Date KCCQ Domain Assessment Completed" FollowupKCCQAssessmentDate
          where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
            and InitialKCCQAssessmentDate 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
            and date from FollowupKCCQAssessmentDate during day of Interval[date from InitialKCCQAssessmentDate + 30 days, date from InitialKCCQAssessmentDate + 180 days]
          return ValidEncounters
      )
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Date KCCQ Total Assessment Completed
    define "Date KCCQ Total Assessment Completed":
      ( ( [Observation: "Overall summary score [KCCQ]"] ).isAssessmentPerformed ( ) ) KCCQSummaryScore
        let KCCQSummaryScoreDate: date from start of KCCQSummaryScore.effective.toInterval ( )
        where KCCQSummaryScore.value is not null
        return KCCQSummaryScoreDate
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Has Encounter with Initial and Follow Up KCCQ Total Score Assessments
    define "Has Encounter with Initial and Follow Up KCCQ Total Score Assessments":
      exists ( from
          "Qualifying Encounters" ValidEncounters,
          "Date KCCQ Total Assessment Completed" InitialKCCQTotalScore,
          "Date KCCQ Total Assessment Completed" FollowupKCCQTotalScore
          where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
            and InitialKCCQTotalScore 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
            and date from FollowupKCCQTotalScore during day of Interval[date from InitialKCCQTotalScore + 30 days, date from InitialKCCQTotalScore + 180 days]
          return ValidEncounters
      )
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Numerator
    define "Numerator":
      ( "Has Encounter with Initial and Follow Up PROMIS10 Assessments" )
        or ( "Has Encounter with Initial and Follow Up PROMIS29 Assessments" )
        or ( "Has Encounter with Initial and Follow Up VR12 Oblique Assessments" )
        or ( "Has Encounter with Initial and Follow Up VR12 Orthogonal Assessments" )
        or ( "Has Encounter with Initial and Follow Up VR36 Oblique Assessments" )
        or ( "Has Encounter with Initial and Follow Up VR36 Orthogonal Assessments" )
        or ( "Has Encounter with Initial and Follow Up MLHFQ Assessments" )
        or ( "Has Encounter with Initial and Follow Up KCCQ12 Assessments" )
        or ( "Has Encounter with Initial and Follow Up KCCQ Domain Score Assessments" )
        or ( "Has Encounter with Initial and Follow Up KCCQ Total Score Assessments" )
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Two Outpatient Encounters during Measurement Period
    define "Two Outpatient Encounters during Measurement Period":
      from
        "Qualifying Encounters" OfficeVisit1,
        "Qualifying Encounters" OfficeVisit2
        where OfficeVisit2.period.toInterval ( ) starts 1 day or more after day of end of OfficeVisit1.period.toInterval ( )
        return OfficeVisit1
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Initial Population
    define "Initial Population":
      AgeInYearsAt(date from start of "Measurement Period") >= 18
        and exists ( ( [Condition: "Heart Failure"] ) HeartFailure
            where HeartFailure.prevalenceInterval ( ) overlaps before "Measurement Period"
        )
        and exists ( "Two Outpatient Encounters during Measurement Period" )
    Library Name Name
    FunctionalStatusAssessmentsforHeartFailureFHIR Denominator
    define "Denominator":
      "Initial Population"
    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
    FunctionalStatusAssessmentsforHeartFailureFHIR Denominator Exclusions
    define "Denominator Exclusions":
      Hospice."Has Hospice Services"
        or exists ( ( [Condition: "Severe cognitive impairment (finding)"] ) SevereCognitiveImpairment
            where SevereCognitiveImpairment.prevalenceInterval ( ) overlaps "Measurement Period"
        )
    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
    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
    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'