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: Heart Failure (HF): Angiotensin-Converting Enzyme (ACE) Inhibitor or Angiotensin Receptor Blocker (ARB) or Angiotensin Receptor-Neprilysin Inhibitor (ARNI) Therapy for Left Ventricular Systolic Dysfunction (LVSD)FHIR

Official URL: https://madie.cms.gov/Measure/HFACEIorARBorARNIforLVSDFHIR Version: 0.2.000
Draft as of 2024-07-09 Responsible: American Heart Association Computable Name: HFACEIorARBorARNIforLVSDFHIR
Other Identifiers: Short Name (use: usual, ), UUID:86136d6c-dbe1-4b7f-89f3-406cb90f08d5 (use: official, ), UUID:c8b2c180-b44c-4f06-b2e5-fe526afe8049 (use: official, ), Endorser (use: official, ), Publisher (use: official, )

Copyright/Legal: Copyright 2024 American College of Cardiology and American Heart Association. All Rights Reserved.

Percentage of patients aged 18 years and older with a diagnosis of heart failure (HF) with a current or prior left ventricular ejection fraction (LVEF) <=40% who were prescribed or already taking ACE inhibitor or ARB or ARNI therapy during the measurement period

UNKNOWN

Title: Heart Failure (HF): Angiotensin-Converting Enzyme (ACE) Inhibitor or Angiotensin Receptor Blocker (ARB) or Angiotensin Receptor-Neprilysin Inhibitor (ARNI) Therapy for Left Ventricular Systolic Dysfunction (LVSD)FHIR
Id: HFACEIorARBorARNIforLVSDFHIR
Version: 0.2.000
Url: Heart Failure (HF): Angiotensin-Converting Enzyme (ACE) Inhibitor or Angiotensin Receptor Blocker (ARB) or Angiotensin Receptor-Neprilysin Inhibitor (ARNI) Therapy for Left Ventricular Systolic Dysfunction (LVSD)FHIR
short-name identifier:

CMS135FHIR

version-independent identifier:

urn:uuid:86136d6c-dbe1-4b7f-89f3-406cb90f08d5

version-specific identifier:

urn:uuid:c8b2c180-b44c-4f06-b2e5-fe526afe8049

endorser (CMS Consensus Based Entity) identifier:

0081e

publisher (CMS) identifier:

135FHIR

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

Percentage of patients aged 18 years and older with a diagnosis of heart failure (HF) with a current or prior left ventricular ejection fraction (LVEF) <=40% who were prescribed or already taking ACE inhibitor or ARB or ARNI therapy during the measurement period

Purpose:

UNKNOWN

Copyright:

Copyright 2024 American College of Cardiology and American Heart Association. All Rights Reserved.

Disclaimer:

The 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, while copyrighted, can be reproduced and distributed, without modification, for noncommercial purposes, e.g., use by health care providers in connection with their practices. Commercial use is defined as the sale, license, or distribution of the Measure for commercial gain, or incorporation of the Measure into a product or service that is sold, licensed or distributed for commercial gain. Commercial uses of the Measure require a license agreement between the user and the American College of Cardiology (ACC) or the American Heart Association (AHA). Neither the ACC, nor AHA, nor their members shall be responsible for any use of the Measure. ACC and AHA encourage use of the Measure by other health care professionals, where appropriate. THE MEASURE 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. The ACC and AHA and their members disclaim all liability for use or accuracy of any Current Procedural Terminology (CPT[R]) or other coding contained in the specifications. 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 American Medical Association’s and the PCPI(R) Foundation’s significant past efforts and contributions to the performance measure are gratefully acknowledged. Due to technical limitations, registered trademarks are indicated by (R) or [R].

Rationale:

Use of ACE inhibitor, ARB, or ARNI therapy has been associated with improved outcomes in patients with reduced LVEF. Long-term therapy with ARBs have also been shown to reduce morbidity and mortality, especially in ACE inhibitor–intolerant patients. More recently, ARNI therapy has also been shown to more significantly improve outcomes, such that the newest guidelines recommend replacement of ACE inhibitors or ARBs with ARNI therapy in eligible patients. However, despite the benefits of these drugs, use of ACE inhibitor, ARB, or ARNI remains suboptimal.

Clinical recommendation statement:

In patients with Heart Failure with Reduced Ejection Fraction (HFrEF) and New York Heart Association (NYHA) class II to III symptoms, the use of ARNI is recommended to reduce morbidity and mortality (Class I, Level of Evidence A) (Heidenreich et al., 2022). In patients with previous or current symptoms of chronic HFrEF, the use of angiotension-converting enzyme inhibitors (ACEi) is beneficial to reduce morbidity and mortality when the use of ARNI is not feasible (Class I, Level of Evidence A) (Heidenreich et al., 2022). In patients with previous or current symptoms of chronic HFrEF who are intolerant to ACEi because of cough or angioedema and when the use of ARNI is not feasible, the use of ARB is recommended to reduce morbidity and mortality. (Class I, Level of Evidence A) (Heidenreich et al., 2022). In patients with chronic symptomatic HFrEF NYHA class II or III who tolerate an ACEi or ARB, replacement by an ARNI is recommended to further reduce morbidity and mortality (Class I, Level of Evidence B-R) (Heidenreich et al., 2022). ARNI should not be administered concomitantly with ACEi or within 36 hours of the last dose of an ACEi (Class II: Harm, Level of Evidence B-R) (Heidenreich et al., 2022). ARNI should not be administered to patients with any history of angioedema (Class III: Harm, Level of Evidence C-LD) (Heidenreich et al., 2022). ACEi should not be administered to patients with any history of angioedema (Class III: Harm, Level of Evidence C-LD) (Heidenreich et al., 2022). Drugs Commonly Used for Stage C HFrEF (abbreviated to align with focus of measure to include only ACE inhibitors, ARB and ARNI therapy) Drug Initial Daily Dose(s) Target Dose(s) Mean Doses Achieved in Clinical Trials ACEi Captopril 6.25 mg 3 times 50 mg 3 times 122.7 mg total daily Enalapril 2.5 mg twice 10 to 20 mg twice 16.6 mg total daily Fosinopril 5 to 10 mg once 40 mg once N/A Lisinopril 2.5 to 5 mg once 20 to 40 mg once 32.5 to 35.0 mg total daily Perindopril 2 mg once 8 to 16 mg once N/A Quinapril 5 mg twice 20 mg twice N/A Ramipril 1.25 to 2.5 mg once 10 mg once N/A Trandolapril 1 mg once 4 mg once N/A ARB Candesartan 4 to 8 mg once 32 mg once 24 mg total daily Losartan 25 to 50 mg once 50 to 150 mg once 129 mg total daily Valsartan 20 to 40 mg twice 160 mg twice 254 mg total daily ARNI Sacubitril- 49/51 mg twice 97/103 mg twice 182/193 mg valsartan (sacubitril/valsartan) (sacubitril/valsartan) (sacubitril/valsartan) total (therapy may be initiated daily at 24/26 mg twice)

Guidance (Usage): This eCQM is to be reported as patient-based. To satisfy this measure, it must be reported for all heart failure patients at least once during the measurement period. The requirement of two or more visits is used to establish that the eligible professional or eligible clinician has an existing relationship with the patient. A range value should satisfy the logic requirement for 'Ejection Fraction' as long as the ranged observation value clearly meets the less than or equal to 40% threshold noted in the denominator logic. A range that is greater than 40% would not meet the measure requirement. In order for the Ejection Fraction result pathway to be recognized as below 40%, the result must be reported as a number with unit of %. A text string of "below 40%" or "ejection fraction between 35 and 40%" will not be recognized through electronic data capture. Although, this criteria can also be met using the Diagnosis pathway if specified as "Moderate or Severe." Eligible clinicians who have given a prescription for or whose patient is already taking an Angiotensin-Converting Enzyme Inhibitor (ACEI) or Angiotensin Receptor Blocker (ARB) would meet performance for this measure. Other combination therapies that consist of an ACEI plus diuretic, ARB + neprilysin inhibitor (ARNI), ARB plus diuretic, ACEI plus calcium channel blocker, ARB plus calcium channel blocker, or ARB plus calcium channel blocker plus diuretic would also meet performance for this measure. This eCQM is a PATIENT-based measure. This FHIR-based measure has been derived from the QDM-based measure: CMS135v13. Please refer to the HL7 QI-Core Implementation Guide (https://hl7.org/fhir/us/qicore/STU4.1.1/) for more information on QI-Core and mapping recommendations from QDM to QI-Core 4.1.1 (https://hl7.org/fhir/us/qicore/STU4.1.1/qdm-to-qicore.html).
Population Criteria:
66439e60f4fc785d8711709d
Initial Population: All patients aged 18 years and older with two qualifying encounters during the measurement period and a diagnosis of heart failure on or before at least one qualifying encounter
Denominator: Equals Initial Population with a current or prior LVEF <= 40%
Denominator Exclusion: Patients with a history of heart transplant or with a Left Ventricular Assist Device (LVAD) prior to the end of the outpatient encounter with Moderate or Severe LVSD
Numerator: Patients who were prescribed or already taking ACE inhibitor or ARB or ARNI therapy during the measurement period
Denominator Exception: Documentation of medical reason(s) for not prescribing ACE inhibitor or ARB or ARNI therapy (e.g., pregnancy, renal failure due to ACEI, allergy, intolerance, other medical reasons). Documentation of patient reason(s) for not prescribing ACE inhibitor or ARB or ARNI therapy (e.g., patient declined, other patient reasons).
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:
HFACEIorARBorARNIforLVSDFHIR
Terminology and Other Dependencies:
  • Library/SupplementalDataElements|3.5.000
  • Library/AHAOverall|2.8.000
  • Library/QICoreCommon|2.1.000
  • Library/FHIRHelpers|4.4.000
  • AdministrativeGender
  • Condition Clinical Status Codes
  • ConditionVerificationStatus
  • SNOMED CT (all versions)
  • AllergyIntolerance Clinical Status Codes
  • AllergyIntolerance Verification Status
  • ACE Inhibitor or ARB or ARNI
  • Care Services in Long-Term Residential Facility
  • Home Healthcare Services
  • Nursing Facility Visit
  • Office Visit
  • Outpatient Consultation
  • Heart Failure
  • Ejection Fraction
  • Moderate or Severe LVSD
  • Moderate or Severe
  • Patient Provider Interaction
  • Payer
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1178.33
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1178.56
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1178.61
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1178.58
  • ACE Inhibitor or ARB Ingredient
  • Allergy to ACE Inhibitor or ARB
  • Intolerance to ACE Inhibitor or ARB
  • Pregnancy
  • 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
    Denominator Exceptions Out 0 1 boolean
    DataRequirements:
    Resource Type Resource Elements Valueset Name Valueset
    Patient(QICorePatient) ethnicity race
    Encounter(QICoreEncounter) type period id id.value Office Visit Office Visit
    Encounter(QICoreEncounter) type period id id.value Outpatient Consultation Outpatient Consultation
    Encounter(QICoreEncounter) type period id id.value Nursing Facility Visit Nursing Facility Visit
    Encounter(QICoreEncounter) type period id id.value Care Services in Long Term Residential Facility Care Services in Long-Term Residential Facility
    Encounter(QICoreEncounter) type period id id.value Home Healthcare Services Home Healthcare Services
    Encounter(QICoreEncounter) type period id id.value Patient Provider Interaction Patient Provider Interaction
    Condition(QICoreCondition) code Heart Failure Heart Failure
    Condition(QICoreCondition) code severity
    Condition(QICoreCondition) code Moderate or Severe LVSD Moderate or Severe LVSD
    Condition(QICoreCondition) code recordedDate recordedDate.value Heart Transplant Complications http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1178.56
    Condition(QICoreCondition) code recordedDate recordedDate.value Left Ventricular Assist Device Complications http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1178.58
    Condition(QICoreCondition) code Allergy to ACE Inhibitor or ARB Allergy to ACE Inhibitor or ARB
    Condition(QICoreCondition) code Intolerance to ACE Inhibitor or ARB Intolerance to ACE Inhibitor or ARB
    Condition(QICoreCondition) code Pregnancy Pregnancy
    Condition(QICoreCondition) code
    Observation(QICoreObservation) code value status status.value Ejection Fraction Ejection Fraction
    MedicationRequest(QICoreMedicationRequest) medication timing repeat bounds ACE Inhibitor or ARB or ARNI ACE Inhibitor or ARB or ARNI
    Coverage(QICoreCoverage) type period Payer Type Payer
    Procedure(QICoreProcedure) code performed status status.value Heart Transplant http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1178.33
    Procedure(QICoreProcedure) code performed status status.value Left Ventricular Assist Device Placement http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1178.61
    AllergyIntolerance(QICoreAllergyIntolerance) code ACE Inhibitor or ARB or ARNI Ingredient ACE Inhibitor or ARB Ingredient
    AllergyIntolerance(QICoreAllergyIntolerance) code
    AllergyIntolerance(QICoreAllergyIntolerance) code
    AllergyIntolerance(QICoreAllergyIntolerance) code
    Direct Reference Codes:
    display code system
    Male M http://hl7.org/fhir/administrative-gender
    Female F http://hl7.org/fhir/administrative-gender
    Active active http://terminology.hl7.org/CodeSystem/condition-clinical
    Recurrence recurrence http://terminology.hl7.org/CodeSystem/condition-clinical
    Relapse relapse http://terminology.hl7.org/CodeSystem/condition-clinical
    Confirmed confirmed http://terminology.hl7.org/CodeSystem/condition-ver-status
    Left ventricular systolic dysfunction (disorder) 134401001 http://snomed.info/sct
    Substance with angiotensin-converting enzyme inhibitor mechanism of action (substance) 372733002 http://snomed.info/sct
    Substance with angiotensin II receptor antagonist mechanism of action (substance) 372913009 http://snomed.info/sct
    Substance with neprilysin inhibitor mechanism of action (substance) 786886009 http://snomed.info/sct
    Active active http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical
    Confirmed confirmed http://terminology.hl7.org/CodeSystem/allergyintolerance-verification
    Acute renal failure caused by angiotensin-converting-enzyme inhibitor (disorder) 422593004 http://snomed.info/sct
    Logic Definitions:
    Group Scoring Population Criteria Expression
    66439e60f4fc785d8711709d Group scoring: proportion
    Type:

    Process

    Rate Aggregation: None
    Improvement Notation:

    Increased score indicates improvement

    Initial Population
    define "Initial Population":
      AHA."Is Adults With Two Qualifying Outpatient Encounters and One Heart Failure Outpatient Encounter During the Measurement Period"
    Denominator
    define "Denominator":
      "Initial Population"
        and exists AHA."Heart Failure Outpatient Encounter with History of Moderate or Severe LVSD"
    Denominator Exclusion
    define "Denominator Exclusions":
      AHA."Has Heart Transplant"
        or AHA."Has Heart Transplant Complications"
        or AHA."Has Left Ventricular Assist Device"
        or AHA."Has Left Ventricular Assist Device Complications"
    Numerator
    define "Numerator":
      "Has ACEI or ARB or ARNI Ordered"
        or "Is Currently Taking ACEI or ARB or ARNI"
    Denominator Exception
    /*
    @commentedOut: "Has Medical or Patient Reason for Not Ordering ACEI or ARB or ARNI"
    @commentedOutReason: Negation issue noted in https://github.com/cqframework/cql-execution/issues/296, which is tied to https://oncprojectracking.healthit.gov/support/browse/BONNIEMAT-1455
    */
    
    
    define "Denominator Exceptions":
        //"Has Medical or Patient Reason for Not Ordering ACEI or ARB or ARNI" or
      
      "Has Allergy or Intolerance to ACEI or ARB or ARNI Ingredient"
        or "Has Diagnosis of Allergy or Intolerance to ACEI or ARB"
        or "Has Diagnosis of Pregnancy"
        or "Has Diagnosis of Renal Failure Due to ACEI"
    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
    HFACEIorARBorARNIforLVSDFHIR SDE Sex
    define "SDE Sex":
      SDE."SDE Sex"
    Library Name Name
    AHAOverall Heart Failure Outpatient Encounter
    /*
    @description: Returns certain finished encounter types that overlap a Heart Failure condition and are during the measurement period: 
                    * care services in long term residential facility (http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1014)
                    * home healthcare services (http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016)
                    * nursing facility visits (http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1012)
                    * office visits (http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001)
                    * outpatient consolutations (http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1008)
    */   
    define "Heart Failure Outpatient Encounter":
      ( [Encounter: "Care Services in Long Term Residential Facility"]
          union [Encounter: "Home Healthcare Services"]
          union [Encounter: "Nursing Facility Visit"]
          union [Encounter: "Office Visit"] 
          union [Encounter: "Outpatient Consultation"]
         ) QualifyingEncounter
        with [Condition: "Heart Failure"] HeartFailure
          such that HeartFailure.prevalenceInterval() overlaps QualifyingEncounter.period  
            and HeartFailure.isConfirmedActiveDiagnosis()
        where QualifyingEncounter.period during day of "Measurement Period"
          and QualifyingEncounter.isFinished()
    Library Name Name
    AHAOverall Moderate or Severe LVSD Findings
    /*
    @description: Returns a union  of the following:
                    * Observations where the final, amended or correction ejection fraction result is <= 40
                    * Moderate or Severe LVSD conditions where the diagnosis has been confirmed as active
    */  
    define "Moderate or Severe LVSD Findings":
      ( [Observation: "Ejection Fraction"] EjectionFraction
          where EjectionFraction.value as Quantity <= 40 '%'
            and EjectionFraction.status in {'final', 'amended', 'corrected'} 
       )
       union ( 
               ( [Condition: "Moderate or Severe LVSD"]
                 union ( [Condition: "Left ventricular systolic dysfunction (disorder)"] LVSDDiagnosis
                           where LVSDDiagnosis.severity in "Moderate or Severe" )
                ) ModerateOrSevereLVSD   
                where ModerateOrSevereLVSD.isConfirmedActiveDiagnosis()
              )
    Library Name Name
    AHAOverall Heart Failure Outpatient Encounter with History of Moderate or Severe LVSD
    /*
    @description: Returns heart failure outpatient encounters that start before the end of a moderate or severe LVSD finding
    */ 
    define "Heart Failure Outpatient Encounter with History of Moderate or Severe LVSD":
        "Heart Failure Outpatient Encounter" HFOutpatientEncounter
            with "Moderate or Severe LVSD Findings" LVSDFindings
                such that Coalesce(LVSDFindings.prevalenceInterval(), LVSDFindings.effective.toInterval()) starts before end of HFOutpatientEncounter.period
    Library Name Name
    HFACEIorARBorARNIforLVSDFHIR Has ACEI or ARB or ARNI Ordered
    define "Has ACEI or ARB or ARNI Ordered":
      exists ( [MedicationRequest: medication in "ACE Inhibitor or ARB or ARNI"] ACEIOrARBOrARNIOrdered
          where ACEIOrARBOrARNIOrdered.isOrderedDuringHeartFailureOutpatientEncounter ( )
      )
    Library Name Name
    HFACEIorARBorARNIforLVSDFHIR Is Currently Taking ACEI or ARB or ARNI
    define "Is Currently Taking ACEI or ARB or ARNI":
      exists ( [MedicationRequest: medication in "ACE Inhibitor or ARB or ARNI"] ActiveACEIOrARBOrARNI
          where ActiveACEIOrARBOrARNI.overlapsAfterHeartFailureOutpatientEncounter ( )
      )
    Library Name Name
    HFACEIorARBorARNIforLVSDFHIR Numerator
    define "Numerator":
      "Has ACEI or ARB or ARNI Ordered"
        or "Is Currently Taking ACEI or ARB or ARNI"
    Library Name Name
    AHAOverall Qualifying Outpatient Encounter During Measurement Period
    /*
    @description: Returns certain finished encounter types that occurred during the measurement period: 
                    * office visits (http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001)
                    * outpatient consolutations (http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1008)
                    * nursing facility visits (http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1012)
                    * care services in long term residential facility (http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1014)
                    * home healthcare services (http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016)
                    * patient provider interactions (http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1012) 
    */          
    define "Qualifying Outpatient Encounter During Measurement Period":
        ( [Encounter: "Office Visit"]
            union [Encounter: "Outpatient Consultation"]
            union [Encounter: "Nursing Facility Visit"]
            union [Encounter: "Care Services in Long Term Residential Facility"]
            union [Encounter: "Home Healthcare Services"]
            union [Encounter: "Patient Provider Interaction"] ) ValidEncounter
          where ValidEncounter.period during day of "Measurement Period"
            and ValidEncounter.isFinished()
    Library Name Name
    AHAOverall Is Adults With Two Qualifying Outpatient Encounters and One Heart Failure Outpatient Encounter During the Measurement Period
    /*
    @description: Returns true if the patient meets the following criteria:
                    * 18 years of age or older, has two 
                    * Has two Qualifying Outpatient Encounters During Measurement Period
                    * Has a Heart Failure Outpatient Encounter
    */           
    define "Is Adults With Two Qualifying Outpatient Encounters and One Heart Failure Outpatient Encounter During the Measurement Period":
      AgeInYearsAt(date from start of "Measurement Period") >= 18
        and exists ( "Qualifying Outpatient Encounter During Measurement Period" Encounter1
            with "Qualifying Outpatient Encounter During Measurement Period" Encounter2
              such that Encounter2.id !~ Encounter1.id
        )
        and exists "Heart Failure Outpatient Encounter"
    Library Name Name
    HFACEIorARBorARNIforLVSDFHIR Initial Population
    define "Initial Population":
      AHA."Is Adults With Two Qualifying Outpatient Encounters and One Heart Failure Outpatient Encounter During the Measurement Period"
    Library Name Name
    HFACEIorARBorARNIforLVSDFHIR Denominator
    define "Denominator":
      "Initial Population"
        and exists AHA."Heart Failure Outpatient Encounter with History of Moderate or Severe LVSD"
    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
    HFACEIorARBorARNIforLVSDFHIR 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
    HFACEIorARBorARNIforLVSDFHIR SDE Ethnicity
    define "SDE Ethnicity":
      SDE."SDE Ethnicity"
    Library Name Name
    AHAOverall Has Heart Transplant
    /*
    @description: Returns completed heart tansplant procedures that start before the end of a heart failure outpatient encounter with history of moderate or severe LVSD
    */ 
    define "Has Heart Transplant":
      exists (
              [Procedure: "Heart Transplant"] HeartTransplant
                with "Heart Failure Outpatient Encounter with History of Moderate or Severe LVSD" ModerateOrSevereLVSDHFOutpatientEncounter
                  such that HeartTransplant.performed.toInterval() starts before end of ModerateOrSevereLVSDHFOutpatientEncounter.period
                where HeartTransplant.status = 'completed'
              )
    Library Name Name
    AHAOverall Has Heart Transplant Complications
    /*
    @description: Returns true if patient has confirmed heart transplant complications that start before the end of a heart failure outpatient encounter with history of moderate or severe LVSD
    */ 
    define "Has Heart Transplant Complications":
      exists ( 
              [Condition: "Heart Transplant Complications"] HeartTransplantComplications
                let diagnosisStart: Coalesce( HeartTransplantComplications.recordedDate, start of HeartTransplantComplications.prevalenceInterval() )  
                with "Heart Failure Outpatient Encounter with History of Moderate or Severe LVSD" ModerateOrSevereLVSDHFOutpatientEncounter
                  such that diagnosisStart before end of ModerateOrSevereLVSDHFOutpatientEncounter.period
                where HeartTransplantComplications.isConfirmedActiveDiagnosis()
              )
    Library Name Name
    AHAOverall Has Left Ventricular Assist Device
    /*
    @description: Returns true if patient has a completed LVAD placement that starts before the end of a heart failure outpatient encounter with history of moderate or severe LVSD
    */ 
    define "Has Left Ventricular Assist Device":
      exists (
                [Procedure: "Left Ventricular Assist Device Placement"] LVADOutpatient
                  with "Heart Failure Outpatient Encounter with History of Moderate or Severe LVSD" ModerateOrSevereLVSDHFOutpatientEncounter
                    such that LVADOutpatient.performed.toInterval() starts before end of ModerateOrSevereLVSDHFOutpatientEncounter.period
                  where LVADOutpatient.status = 'completed'
                )
    Library Name Name
    AHAOverall Has Left Ventricular Assist Device Complications
    /*
    @description: Returns true if patient has active LVAD complications that start before the end of a heart failure outpatient encounter with history of moderate or severe LVSD
    */ 
    define "Has Left Ventricular Assist Device Complications":
      exists (
                [Condition: "Left Ventricular Assist Device Complications"] LVADComplications
                  let diagnosisStart: Coalesce( LVADComplications.recordedDate, start of LVADComplications.prevalenceInterval() ) 
                  with "Heart Failure Outpatient Encounter with History of Moderate or Severe LVSD" ModerateOrSevereLVSDHFOutpatientEncounter
                    such that diagnosisStart before end of ModerateOrSevereLVSDHFOutpatientEncounter.period  
                  where LVADComplications.isConfirmedActiveDiagnosis()
              )
    Library Name Name
    HFACEIorARBorARNIforLVSDFHIR Denominator Exclusions
    define "Denominator Exclusions":
      AHA."Has Heart Transplant"
        or AHA."Has Heart Transplant Complications"
        or AHA."Has Left Ventricular Assist Device"
        or AHA."Has Left Ventricular Assist Device Complications"
    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
    HFACEIorARBorARNIforLVSDFHIR SDE Race
    define "SDE Race":
      SDE."SDE Race"
    Library Name Name
    HFACEIorARBorARNIforLVSDFHIR Has Allergy or Intolerance to ACEI or ARB or ARNI Ingredient
    define "Has Allergy or Intolerance to ACEI or ARB or ARNI Ingredient":
      exists ( ( [AllergyIntolerance: "ACE Inhibitor or ARB or ARNI Ingredient"]
          union [AllergyIntolerance: "Substance with angiotensin-converting enzyme inhibitor mechanism of action (substance)"]
          union [AllergyIntolerance: "Substance with angiotensin II receptor antagonist mechanism of action (substance)"]
          union [AllergyIntolerance: "Substance with neprilysin inhibitor mechanism of action (substance)"] ) ACEIOrARBOrARNIAllergyIntolerance
          where ACEIOrARBOrARNIAllergyIntolerance.overlapsAfterHeartFailureOutpatientEncounter ( )
      )
    Library Name Name
    HFACEIorARBorARNIforLVSDFHIR Has Diagnosis of Allergy or Intolerance to ACEI or ARB
    define "Has Diagnosis of Allergy or Intolerance to ACEI or ARB":
      exists ( ( ["Condition": "Allergy to ACE Inhibitor or ARB"]
          union ["Condition": "Intolerance to ACE Inhibitor or ARB"] ) ACEIOrARBAllergyOrIntoleranceDiagnosis
          where ACEIOrARBAllergyOrIntoleranceDiagnosis.overlapsAfterHeartFailureOutpatientEncounter ( )
      )
    Library Name Name
    HFACEIorARBorARNIforLVSDFHIR Has Diagnosis of Pregnancy
    define "Has Diagnosis of Pregnancy":
      exists ( [Condition: "Pregnancy"] PregnancyDiagnosis
          with AHA."Heart Failure Outpatient Encounter with History of Moderate or Severe LVSD" ModerateOrSevereLVSDHFOutpatientEncounter
            such that PregnancyDiagnosis.prevalenceInterval ( ) starts 9 months or less before or on start of ModerateOrSevereLVSDHFOutpatientEncounter.period
      )
    Library Name Name
    HFACEIorARBorARNIforLVSDFHIR Has Diagnosis of Renal Failure Due to ACEI
    define "Has Diagnosis of Renal Failure Due to ACEI":
      exists ( [Condition: "Acute renal failure caused by angiotensin-converting-enzyme inhibitor (disorder)"] RenalFailureDueToACEI
          where RenalFailureDueToACEI.overlapsHeartFailureOutpatientEncounter ( )
      )
    Library Name Name
    HFACEIorARBorARNIforLVSDFHIR Denominator Exceptions
    /*
    @commentedOut: "Has Medical or Patient Reason for Not Ordering ACEI or ARB or ARNI"
    @commentedOutReason: Negation issue noted in https://github.com/cqframework/cql-execution/issues/296, which is tied to https://oncprojectracking.healthit.gov/support/browse/BONNIEMAT-1455
    */
    
    
    define "Denominator Exceptions":
        //"Has Medical or Patient Reason for Not Ordering ACEI or ARB or ARNI" or
      
      "Has Allergy or Intolerance to ACEI or ARB or ARNI Ingredient"
        or "Has Diagnosis of Allergy or Intolerance to ACEI or ARB"
        or "Has Diagnosis of Pregnancy"
        or "Has Diagnosis of Renal Failure Due to ACEI"
    Library Name Name
    AHAOverall isOrderedDuringHeartFailureOutpatientEncounter
    /*
    @description: Returns true if the given MedicationRequest is ordered during the heart failure outpatient encounter with history of moderate or severe LVSD at any point
    */
    define fluent function isOrderedDuringHeartFailureOutpatientEncounter(MedicationRequest MedicationRequest): 
      exists ( "Heart Failure Outpatient Encounter with History of Moderate or Severe LVSD" ModerateOrSevereLVSDHFOutpatientEncounter
                where MedicationRequest.authoredOn during day of ModerateOrSevereLVSDHFOutpatientEncounter.period
                  and MedicationRequest.status in {'active', 'completed'}
                  and MedicationRequest.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
                  /*Issue: The logic commented out below was added to the logic due to an issue described in the authoring patterns for QI-Core: https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns---QICore-v4.1.1#medication-ordered. However, when this logic is present, it causes an issue in Coverage calculation for resources that must be QI-Core compliant, because the inverse cannot be tested for a QI-Core MedicationRequest profile instance. This logic was commented out to achieve 100% Coverage. This requirement is really to handle what would happen if a MedicationRequest instance that could be set to 'false' were provided, but this should not happen within a trusted environment where QI-Core profile instances must be provided.*/
                  // and MedicationRequest.doNotPerform is not true 
              )
    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
    AHAOverall isConfirmedActiveDiagnosis
    /*
    @description: Returns true if the given Condition is confirmed as active
    */
    define fluent function isConfirmedActiveDiagnosis(condition Condition):
        condition.isActive()
            and condition.verificationStatus ~ QICoreCommon."confirmed"
    Library Name Name
    QICoreCommon isActive
    /* Candidates for FHIRCommon */
    
    /*
    @description: Returns true if the given condition has a clinical status of active, recurrence, or relapse
    */
    define fluent function isActive(condition Condition):
      condition.clinicalStatus ~ "active"
        or condition.clinicalStatus ~ "recurrence"
        or condition.clinicalStatus ~ "relapse"
    Library Name Name
    AHAOverall isFinished
    /*
    @description: Returns true if the given Encounter is finished
    */
    define fluent function isFinished(Encounter Encounter):
        Encounter.status = 'finished'
    Library Name Name
    AHAOverall overlapsAfterHeartFailureOutpatientEncounter
    /*
    @overloaded
    @description: Returns true if the given MedicationRequest overlaps after the day of the heart failure outpatient encounter with history of moderate or severe LVSD
    */                    
    define fluent function overlapsAfterHeartFailureOutpatientEncounter(MedicationRequest MedicationRequest): 
      exists ( "Heart Failure Outpatient Encounter with History of Moderate or Severe LVSD" ModerateOrSevereLVSDHFOutpatientEncounter
                 where First( ( collapse (MedicationRequest.dosageInstruction.timing.repeat.bounds DoseTime
                                            return DoseTime.toInterval()) ) DrugPeriods
                               sort by start of $this ) overlaps after day of ModerateOrSevereLVSDHFOutpatientEncounter.period 
                   and MedicationRequest.status in { 'active', 'completed' } 
                   and MedicationRequest.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
                   /*Issue: The logic commented out below was added to the logic due to an issue described in the authoring patterns for QI-Core: https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns---QICore-v4.1.1#medication-ordered. However, when this logic is present, it causes an issue in Coverage calculation for resources that must be QI-Core compliant, because the inverse cannot be tested for a QI-Core MedicationRequest profile instance. This logic was commented out to achieve 100% Coverage. This requirement is really to handle what would happen if a MedicationRequest instance that could be set to 'false' were provided, but this should not happen within a trusted environment where QI-Core profile instances must be provided.*/
                   // and Event.doNotPerform is not true 
              )
    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
    AHAOverall overlapsHeartFailureOutpatientEncounter
    /*
    @description: Returns true if the given Condition overlaps the heart failure outpatient encounter with history of moderate or severe LVSD at any point
    */
    define fluent function overlapsHeartFailureOutpatientEncounter(Condition Condition): 
      exists ( "Heart Failure Outpatient Encounter with History of Moderate or Severe LVSD" ModerateOrSevereLVSDHFOutpatientEncounter
                where Condition.prevalenceInterval() overlaps day of ModerateOrSevereLVSDHFOutpatientEncounter.period
                  and Condition.isConfirmedActiveDiagnosis()
              )