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: Coronary Artery Disease (CAD): Beta-Blocker Therapy-Prior Myocardial Infarction (MI) or Left Ventricular Systolic Dysfunction (LVEF less than or equal to 40%)FHIR

Official URL: https://madie.cms.gov/Measure/CADBetaBlockerTherapyPriorMIorLVSDFHIR Version: 0.2.000
Draft as of 2024-07-09 Responsible: American Heart Association Computable Name: CADBetaBlockerTherapyPriorMIorLVSDFHIR
Other Identifiers: Short Name (use: usual, ), UUID:466e5d36-1e01-478b-9dcb-edac33594dd5 (use: official, ), UUID:b4533eba-331a-4cb7-88b3-6f2d07e225e9 (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 coronary artery disease seen within a 12-month period who also have a prior MI or a current or prior left ventricular ejection fraction (LVEF) <=40% who were prescribed beta-blocker therapy

UNKNOWN

Title: Coronary Artery Disease (CAD): Beta-Blocker Therapy-Prior Myocardial Infarction (MI) or Left Ventricular Systolic Dysfunction (LVEF less than or equal to 40%)FHIR
Id: CADBetaBlockerTherapyPriorMIorLVSDFHIR
Version: 0.2.000
Url: Coronary Artery Disease (CAD): Beta-Blocker Therapy-Prior Myocardial Infarction (MI) or Left Ventricular Systolic Dysfunction (LVEF less than or equal to 40%)FHIR
short-name identifier:

CMS145FHIR

version-independent identifier:

urn:uuid:466e5d36-1e01-478b-9dcb-edac33594dd5

version-specific identifier:

urn:uuid:b4533eba-331a-4cb7-88b3-6f2d07e225e9

endorser (CMS Consensus Based Entity) identifier:

0070e

publisher (CMS) identifier:

145FHIR

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 coronary artery disease seen within a 12-month period who also have a prior MI or a current or prior left ventricular ejection fraction (LVEF) <=40% who were prescribed beta-blocker therapy

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].

Scoring:

Proportion

Rationale:

For patients with coronary artery disease (CAD), beta-blockers are recommended for 3 years after myocardial infarction or acute coronary syndrome. Beta-blockers, particularly carvedilol, metoprolol succinate, or bisoprolol which have been shown to reduce risk of death, are recommended indefinitely for patients with CAD and LV systolic dysfunction. These agents have proven efficacy in reducing angina onset and improving the ischemic threshold during exercise. In patients who have suffered an MI, beta-blockers significantly reduce deaths and recurrent MIs (Fihn et al., 2012).

Nonadherence to cardioprotective medications is prevalent among outpatients with CAD and can be associated with a broad range of adverse outcomes, including all-cause and cardiovascular mortality, cardiovascular hospitalizations, and the need for revascularization procedures (Gibbons et al., 2002).

This measure is intended to promote beta-blocker usage in select patients with CAD.

Clinical recommendation statement:

Beta-blocker therapy should be started and continued for 3 years in all patients with normal LV function after MI or acute coronary syndrome (ACS) (Class I, Level of Evidence: B) (Fihn et al., 2012).

Beta-blocker therapy should be used in all patients with LV systolic dysfunction (EF <= 40%) with heart failure or prior MI, unless contraindicated. (Use should be limited to carvedilol, metoprolol succinate, or bisoprolol, which have been shown to reduce risk of death.) (Class I, Level of Evidence: A) (Fihn et al., 2012).

In patients with chronic coronary disease (CCD) and LVEF ≤40% with or without previous MI, the use of beta-blocker therapy is recommended to reduce the risk of future Major Adverse Cardiac Events (MACE), including cardiovascular death. (Class 1, Level of Evidence: A) (Virani et al., 2023)

Guidance (Usage): Beta-blocker therapy: - For patients with prior MI, beta-blocker therapy includes any agent within the beta-blocker drug class. As of 2015, no recommendations or evidence are cited in current stable ischemic heart disease guidelines for preferential use of specific agents. - For patients with prior LVEF <=40%, beta-blocker therapy includes the following: bisoprolol, carvedilol, or sustained release metoprolol succinate. The requirement of two or more visits is to establish that the 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." If a patient has had a myocardial infarction (MI) within the past 3 years and a current or prior LVEF <=40% (or moderate or severe LVSD), the patient should only be counted in Population Criteria 1. This eCQM is a patient-based measure. This FHIR-based measure has been derived from the QDM-based measure: CMS145v13. 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:
6643a4bda7a1805d3b73744c
Initial Population: All patients aged 18 years and older with two qualifying encounters during the measurement period and a diagnosis of coronary artery disease
Denominator: Equals Initial Population who also have prior (within the past 3 years) MI or a current or prior LVEF <=40%
Numerator: Patients who were prescribed beta-blocker therapy
Denominator Exception: Documentation of medical reason(s) for not prescribing beta-blocker therapy (e.g., arrhythmia, asthma, bradycardia, hypotension, patients with atrioventricular block without cardiac pacer, observation of consecutive heart rates <50, allergy, intolerance, other medical reasons). Documentation of patient reason(s) for not prescribing beta-blocker therapy (e.g., patient declined, other patient reasons).
6643a4bda7a1805d3b73744d
Initial Population: All patients aged 18 years and older with two qualifying encounters during the measurement period and a diagnosis of coronary artery disease
Denominator: Equals Initial Population who also have prior (within the past 3 years) MI or a current or prior LVEF <=40%
Numerator: Patients who were prescribed beta-blocker therapy
Denominator Exception: Documentation of medical reason(s) for not prescribing beta-blocker therapy (e.g., arrhythmia, asthma, bradycardia, hypotension, patients with atrioventricular block without cardiac pacer, observation of consecutive heart rates <50, allergy, intolerance, other medical reasons). Documentation of patient reason(s) for not prescribing beta-blocker therapy (e.g., patient declined, other patient reasons).
Supplemental Data Elements:

SDE Sex

SDE Race

SDE Payer

SDE Ethnicity

Supplemental Data Guidance : For every patient evaluated by this measure also identify payer, race, ethnicity and sex
Libraries:
CADBetaBlockerTherapyPriorMIorLVSDFHIR
Terminology and Other Dependencies:
  • Library/SupplementalDataElements|3.5.000
  • Library/FHIRHelpers|4.4.000
  • Library/AHAOverall|2.8.000
  • Library/QICoreCommon|2.1.000
  • AdministrativeGender
  • Condition Clinical Status Codes
  • ConditionVerificationStatus
  • SNOMED CT (all versions)
  • AllergyIntolerance Clinical Status Codes
  • Office Visit
  • Outpatient Consultation
  • Nursing Facility Visit
  • Care Services in Long-Term Residential Facility
  • Home Healthcare Services
  • Patient Provider Interaction
  • Coronary Artery Disease No MI
  • Cardiac Surgery
  • Myocardial Infarction
  • Ejection Fraction
  • Moderate or Severe LVSD
  • Moderate or Severe
  • Arrhythmia
  • Asthma
  • Bradycardia
  • Hypotension
  • Beta Blocker Therapy Ingredient
  • Allergy to Beta Blocker Therapy
  • Intolerance to Beta Blocker Therapy
  • Atrioventricular Block
  • Cardiac Pacer in Situ
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1178.53
  • Beta Blocker Therapy for LVSD
  • Payer
  • Beta Blocker Therapy
  • Parameters:
    name use min max type
    Measurement Period In 0 1 Period
    SDE Sex Out 0 1 Coding
    Denominator 2 Out 0 1 boolean
    Denominator Exceptions 1 Out 0 1 boolean
    Numerator 1 Out 0 1 boolean
    SDE Payer Out 0 * Resource
    Numerator 2 Out 0 1 boolean
    Initial Population Out 0 1 boolean
    SDE Ethnicity Out 0 1 Resource
    Denominator Exceptions 2 Out 0 1 boolean
    SDE Race Out 0 1 Resource
    Denominator 1 Out 0 1 boolean
    DataRequirements:
    Resource Type Resource Elements Valueset Name Valueset
    Patient(QICorePatient) ethnicity race
    Encounter(QICoreEncounter) type period status status.value id id.value Patient Provider Interaction Patient Provider Interaction
    Encounter(QICoreEncounter) type period status status.value id id.value Office Visit Office Visit
    Encounter(QICoreEncounter) type period status status.value id id.value Outpatient Consultation Outpatient Consultation
    Encounter(QICoreEncounter) type period status status.value id id.value Care Services in Long Term Residential Facility Care Services in Long-Term Residential Facility
    Encounter(QICoreEncounter) type period status status.value id id.value Home Healthcare Services Home Healthcare Services
    Encounter(QICoreEncounter) type period status status.value id id.value Nursing Facility Visit Nursing Facility Visit
    Condition(QICoreCondition) code Coronary Artery Disease No MI Coronary Artery Disease No MI
    Condition(QICoreCondition) code severity
    Condition(QICoreCondition) code Moderate or Severe LVSD Moderate or Severe LVSD
    Condition(QICoreCondition) code Myocardial Infarction Myocardial Infarction
    Condition(QICoreCondition) code Arrhythmia Arrhythmia
    Condition(QICoreCondition) code Asthma Asthma
    Condition(QICoreCondition) code Bradycardia Bradycardia
    Condition(QICoreCondition) code Hypotension Hypotension
    Condition(QICoreCondition) code Allergy to Beta Blocker Therapy Allergy to Beta Blocker Therapy
    Condition(QICoreCondition) code Intolerance to Beta Blocker Therapy Intolerance to Beta Blocker Therapy
    Condition(QICoreCondition) code Atrioventricular Block Atrioventricular Block
    Condition(QICoreCondition) code Cardiac Pacer in Situ Cardiac Pacer in Situ
    Procedure(QICoreProcedure) code performed status status.value Cardiac Surgery Cardiac Surgery
    Procedure(QICoreProcedure) code performed Cardiac Pacer http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1178.53
    Observation(QICoreObservation) code value status status.value Ejection Fraction Ejection Fraction
    Observation(Observation Heart Rate Profile) effective value status status.value
    AllergyIntolerance(QICoreAllergyIntolerance) code Beta Blocker Therapy Ingredient Beta Blocker Therapy Ingredient
    AllergyIntolerance(QICoreAllergyIntolerance) code
    MedicationRequest(QICoreMedicationRequest) medication dosageInstruction status status.value intent intent.value Beta Blocker Therapy for LVSD Beta Blocker Therapy for LVSD
    MedicationRequest(QICoreMedicationRequest) medication dosageInstruction status status.value intent intent.value Beta Blocker Therapy Beta Blocker Therapy
    Coverage(QICoreCoverage) type period Payer Type Payer
    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 beta adrenergic receptor antagonist mechanism of action (substance) 373254001 http://snomed.info/sct
    Active active http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical
    Logic Definitions:
    Group Scoring Population Criteria Expression
    6643a4bda7a1805d3b73744c Group scoring: proportion Measure scoring:

    Proportion

    Type:

    Process

    Rate Aggregation: This measure is intended to have one reporting rate, which aggregates the following populations into a single performance rate for reporting purposes: - Population 1: Patients with left ventricular systolic dysfunction (LVEF <=40%) - Population 2: Patients with a prior (within the past 3 years) myocardial infarction For the purposes of this measure, a single performance rate can be calculated as follows: Performance Rate = (Numerator 1 + Numerator 2)/ [(Denominator 1 - Denominator Exceptions 1) + (Denominator 2 - Denominator Exceptions 2)]
    Improvement Notation:

    Increased score indicates improvement

    Initial Population
    define "Initial Population":
      AgeInYearsAt(date from start of "Measurement Period") >= 18
        and exists ( "Qualifying Encounter During Measurement Period" Encounter1
            with "Qualifying Encounter During Measurement Period" Encounter2
              such that Encounter2.id !~ Encounter1.id
        )
        and exists "Qualifying CAD Encounter"
    Denominator
    define "Denominator 1":
      "Initial Population"
        and exists "Qualifying CAD Encounter and History of Moderate or Severe LVSD"
    Numerator
    define "Numerator 1":
      "Has Beta Blocker Therapy for LVSD Ordered"
        or "Is Currently Taking Beta Blocker Therapy for LVSD"
    Denominator Exception
    /*
    @commentedOut: "Has Medical or Patient Reason for Not Ordering Beta Blocker for LVSD"
    @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 1":
      "Has Arrhythmia with Qualifying CAD Encounter and History of Moderate or Severe LVSD"
        or "Has Asthma with Qualifying CAD Encounter and History of Moderate or Severe LVSD"
        or "Has Bradycardia with Qualifying CAD Encounter and History of Moderate or Severe LVSD"
        or "Has Hypotension with Qualifying CAD Encounter and History of Moderate or Severe LVSD"
        or "Has Consecutive Heart Rates Less than 50 with Qualifying CAD Encounter and History of Moderate or Severe LVSD"
        or "Has Allergy or Intolerance to Beta Blocker Therapy Ingredient with Qualifying CAD Encounter and History of Moderate or Severe LVSD"
        or "Has Diagnosis of Allergy or Intolerance to Beta Blocker Therapy with Qualifying CAD Encounter and History of Moderate or Severe LVSD"
          //or "Has Medical or Patient Reason for Not Ordering Beta Blocker for LVSD"
        
        or "Has Atrioventricular Block with Qualifying CAD Encounter and History of Moderate or Severe LVSD without Cardiac Pacer"
    6643a4bda7a1805d3b73744d Group scoring: proportion Measure scoring:

    Proportion

    Type:

    Process

    Rate Aggregation: This measure is intended to have one reporting rate, which aggregates the following populations into a single performance rate for reporting purposes: - Population 1: Patients with left ventricular systolic dysfunction (LVEF <=40%) - Population 2: Patients with a prior (within the past 3 years) myocardial infarction For the purposes of this measure, a single performance rate can be calculated as follows: Performance Rate = (Numerator 1 + Numerator 2)/ [(Denominator 1 - Denominator Exceptions 1) + (Denominator 2 - Denominator Exceptions 2)]
    Improvement Notation:

    Increased score indicates improvement

    Initial Population
    define "Initial Population":
      AgeInYearsAt(date from start of "Measurement Period") >= 18
        and exists ( "Qualifying Encounter During Measurement Period" Encounter1
            with "Qualifying Encounter During Measurement Period" Encounter2
              such that Encounter2.id !~ Encounter1.id
        )
        and exists "Qualifying CAD Encounter"
    Denominator
    define "Denominator 2":
      "Initial Population"
        and exists "Qualifying CAD Encounter and Prior MI"
    Numerator
    define "Numerator 2":
      "Has Beta Blocker Therapy Ordered"
        or "Is Currently Taking Beta Blocker Therapy"
    Denominator Exception
    /*
    @commentedOut: "Has Medical or Patient Reason for Not Ordering Beta Blocker Therapy" 
    @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 2":
      "Has Arrhythmia with Qualifying CAD Encounter and Prior MI"
        or "Has Asthma with Qualifying CAD Encounter and Prior MI"
        or "Has Bradycardia with Qualifying CAD Encounter and Prior MI"
        or "Has Hypotension with Qualifying CAD Encounter and Prior MI"
        or "Has Consecutive Heart Rates Less than 50 with Qualifying CAD Encounter and Prior MI"
        or "Has Allergy or Intolerance to Beta Blocker Therapy Ingredient with Qualifying CAD Encounter and Prior MI"
        or "Has Diagnosis of Allergy or Intolerance to Beta Blocker Therapy with Qualifying CAD Encounter and Prior MI"
          //or "Has Medical or Patient Reason for Not Ordering Beta Blocker Therapy"
        
        or "Has Atrioventricular Block with Qualifying CAD Encounter and Prior MI without Cardiac Pacer"
    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
    CADBetaBlockerTherapyPriorMIorLVSDFHIR SDE Sex
    define "SDE Sex":
      SDE."SDE Sex"
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Qualifying Encounter During Measurement Period
    define "Qualifying 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.status = 'finished'
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Outpatient Encounter During Measurement Period
    define "Outpatient Encounter During Measurement Period":
      ( [Encounter: "Office Visit"]
        union [Encounter: "Outpatient Consultation"]
        union [Encounter: "Care Services in Long Term Residential Facility"]
        union [Encounter: "Home Healthcare Services"]
        union [Encounter: "Nursing Facility Visit"] ) QualifyingEncounter
        where QualifyingEncounter.period during day of "Measurement Period"
          and QualifyingEncounter.status = 'finished'
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Coronary Artery Disease Encounter
    define "Coronary Artery Disease Encounter":
      "Outpatient Encounter During Measurement Period" ValidQualifyingEncounter
        with [Condition: "Coronary Artery Disease No MI"] CoronaryArteryDisease
          such that CoronaryArteryDisease.overlapsDayOfEncounter ( ValidQualifyingEncounter )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR History of Cardiac Surgery Prior to Encounter
    define "History of Cardiac Surgery Prior to Encounter":
      "Outpatient Encounter During Measurement Period" ValidQualifyingEncounter
        with [Procedure: "Cardiac Surgery"] CardiacSurgery
          such that CardiacSurgery.performed.toInterval ( ) starts before end of ValidQualifyingEncounter.period
            and CardiacSurgery.status = 'completed'
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Qualifying CAD Encounter
    define "Qualifying CAD Encounter":
      "Coronary Artery Disease Encounter"
        union "History of Cardiac Surgery Prior to Encounter"
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Initial Population
    define "Initial Population":
      AgeInYearsAt(date from start of "Measurement Period") >= 18
        and exists ( "Qualifying Encounter During Measurement Period" Encounter1
            with "Qualifying Encounter During Measurement Period" Encounter2
              such that Encounter2.id !~ Encounter1.id
        )
        and exists "Qualifying CAD Encounter"
    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
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Qualifying CAD Encounter and Prior MI
    define "Qualifying CAD Encounter and Prior MI":
      "Qualifying CAD Encounter" EncounterWithCADProxy
        with [Condition: "Myocardial Infarction"] MyocardialInfarction
          such that MyocardialInfarction.prevalenceInterval ( ) starts 3 years or less before day of start of EncounterWithCADProxy.period
            and not exists AHA."Moderate or Severe LVSD Findings"
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Denominator 2
    define "Denominator 2":
      "Initial Population"
        and exists "Qualifying CAD Encounter and Prior MI"
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Qualifying CAD Encounter and History of Moderate or Severe LVSD
    define "Qualifying CAD Encounter and History of Moderate or Severe LVSD":
      "Qualifying CAD Encounter" EncounterWithCADProxy
        with AHA."Moderate or Severe LVSD Findings" LVSDFindings
          such that Coalesce(LVSDFindings.prevalenceInterval(), LVSDFindings.effective.toInterval()) starts before end of EncounterWithCADProxy.period
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Arrhythmia with Qualifying CAD Encounter and History of Moderate or Severe LVSD
    define "Has Arrhythmia with Qualifying CAD Encounter and History of Moderate or Severe LVSD":
      exists ( [Condition: "Arrhythmia"] ArrhythmiaDiagnosis
          where ArrhythmiaDiagnosis.overlapsDayOfEncounter ( "Qualifying CAD Encounter and History of Moderate or Severe LVSD" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Asthma with Qualifying CAD Encounter and History of Moderate or Severe LVSD
    define "Has Asthma with Qualifying CAD Encounter and History of Moderate or Severe LVSD":
      exists ( [Condition: "Asthma"] AsthmaDiagnosis
          where AsthmaDiagnosis.overlapsDayOfEncounter ( "Qualifying CAD Encounter and History of Moderate or Severe LVSD" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Bradycardia with Qualifying CAD Encounter and History of Moderate or Severe LVSD
    define "Has Bradycardia with Qualifying CAD Encounter and History of Moderate or Severe LVSD":
      exists ( [Condition: "Bradycardia"] BradycardiaDiagnosis
          where BradycardiaDiagnosis.overlapsDayOfEncounter ( "Qualifying CAD Encounter and History of Moderate or Severe LVSD" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Hypotension with Qualifying CAD Encounter and History of Moderate or Severe LVSD
    define "Has Hypotension with Qualifying CAD Encounter and History of Moderate or Severe LVSD":
      exists ( [Condition: "Hypotension"] HypotensionDiagnosis
          where HypotensionDiagnosis.overlapsDayOfEncounter ( "Qualifying CAD Encounter and History of Moderate or Severe LVSD" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Consecutive Heart Rates Less than 50 with Qualifying CAD Encounter and History of Moderate or Severe LVSD
    /*
    * @code: Heart rate - 8867-4
    * @profile: http://hl7.org/fhir/StructureDefinition/heartrate 
    */
    
    
    define "Has Consecutive Heart Rates Less than 50 with Qualifying CAD Encounter and History of Moderate or Severe LVSD":
      exists ( from
          ["observation-heartrate"] HeartRate,
          "Qualifying CAD Encounter and History of Moderate or Severe LVSD" CADEncounterModerateOrSevereLVSD
          let PriorHeartRate: Last(["observation-heartrate"] MostRecentPriorHeartRate
              where MostRecentPriorHeartRate.effective.toInterval() during CADEncounterModerateOrSevereLVSD.period
                and MostRecentPriorHeartRate.effective.toInterval() before HeartRate.effective.toInterval()
              sort by start of effective.toInterval()
          )
          where HeartRate.effective.toInterval ( ) during CADEncounterModerateOrSevereLVSD.period
            and HeartRate.value < 50 '/min'
            and PriorHeartRate.value < 50 '/min'
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Allergy or Intolerance to Beta Blocker Therapy Ingredient with Qualifying CAD Encounter and History of Moderate or Severe LVSD
    define "Has Allergy or Intolerance to Beta Blocker Therapy Ingredient with Qualifying CAD Encounter and History of Moderate or Severe LVSD":
      exists ( ( [AllergyIntolerance: "Beta Blocker Therapy Ingredient"]
          union [AllergyIntolerance: "Substance with beta adrenergic receptor antagonist mechanism of action (substance)"] ) BetaBlockerAllergyIntolerance
          where BetaBlockerAllergyIntolerance.overlapsAfterDayOfEncounter ( "Qualifying CAD Encounter and History of Moderate or Severe LVSD" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Diagnosis of Allergy or Intolerance to Beta Blocker Therapy with Qualifying CAD Encounter and History of Moderate or Severe LVSD
    define "Has Diagnosis of Allergy or Intolerance to Beta Blocker Therapy with Qualifying CAD Encounter and History of Moderate or Severe LVSD":
      exists ( ( [Condition: "Allergy to Beta Blocker Therapy"]
          union [Condition: "Intolerance to Beta Blocker Therapy"] ) BetaBlockerAllergyOrIntoleranceDiagnosis
          where BetaBlockerAllergyOrIntoleranceDiagnosis.overlapsAfterDayOfEncounter ( "Qualifying CAD Encounter and History of Moderate or Severe LVSD" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Atrioventricular Block with Qualifying CAD Encounter and History of Moderate or Severe LVSD
    define "Has Atrioventricular Block with Qualifying CAD Encounter and History of Moderate or Severe LVSD":
      exists ( [Condition: "Atrioventricular Block"] AtrioventricularBlock
          where AtrioventricularBlock.overlapsDayOfEncounter ( "Qualifying CAD Encounter and History of Moderate or Severe LVSD" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Diagnosis of Cardiac Pacer in Situ with Qualifying CAD Encounter and History of Moderate or Severe LVSD
    define "Has Diagnosis of Cardiac Pacer in Situ with Qualifying CAD Encounter and History of Moderate or Severe LVSD":
      exists ( [Condition: "Cardiac Pacer in Situ"] CardiacPacerDiagnosis
          where CardiacPacerDiagnosis.overlapsDayOfEncounter ( "Qualifying CAD Encounter and History of Moderate or Severe LVSD" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Cardiac Pacer Device Implanted with Qualifying CAD Encounter and History of Moderate or Severe LVSD
    define "Has Cardiac Pacer Device Implanted with Qualifying CAD Encounter and History of Moderate or Severe LVSD":
      exists ( [Procedure: "Cardiac Pacer"] ImplantedCardiacPacer
          with "Qualifying CAD Encounter and History of Moderate or Severe LVSD" CADEncounterModerateOrSevereLVSD
            such that ImplantedCardiacPacer.performed.toInterval ( ) starts before end of CADEncounterModerateOrSevereLVSD.period
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Atrioventricular Block with Qualifying CAD Encounter and History of Moderate or Severe LVSD without Cardiac Pacer
    define "Has Atrioventricular Block with Qualifying CAD Encounter and History of Moderate or Severe LVSD without Cardiac Pacer":
      "Has Atrioventricular Block with Qualifying CAD Encounter and History of Moderate or Severe LVSD"
        and not "Has Diagnosis of Cardiac Pacer in Situ with Qualifying CAD Encounter and History of Moderate or Severe LVSD"
        and not "Has Cardiac Pacer Device Implanted with Qualifying CAD Encounter and History of Moderate or Severe LVSD"
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Denominator Exceptions 1
    /*
    @commentedOut: "Has Medical or Patient Reason for Not Ordering Beta Blocker for LVSD"
    @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 1":
      "Has Arrhythmia with Qualifying CAD Encounter and History of Moderate or Severe LVSD"
        or "Has Asthma with Qualifying CAD Encounter and History of Moderate or Severe LVSD"
        or "Has Bradycardia with Qualifying CAD Encounter and History of Moderate or Severe LVSD"
        or "Has Hypotension with Qualifying CAD Encounter and History of Moderate or Severe LVSD"
        or "Has Consecutive Heart Rates Less than 50 with Qualifying CAD Encounter and History of Moderate or Severe LVSD"
        or "Has Allergy or Intolerance to Beta Blocker Therapy Ingredient with Qualifying CAD Encounter and History of Moderate or Severe LVSD"
        or "Has Diagnosis of Allergy or Intolerance to Beta Blocker Therapy with Qualifying CAD Encounter and History of Moderate or Severe LVSD"
          //or "Has Medical or Patient Reason for Not Ordering Beta Blocker for LVSD"
        
        or "Has Atrioventricular Block with Qualifying CAD Encounter and History of Moderate or Severe LVSD without Cardiac Pacer"
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Beta Blocker Therapy for LVSD Ordered
    define "Has Beta Blocker Therapy for LVSD Ordered":
      exists ( [MedicationRequest: medication in "Beta Blocker Therapy for LVSD"] BetaBlockerForLVSDOrdered
          where BetaBlockerForLVSDOrdered.authoredDuringDayOfEncounter ( "Qualifying CAD Encounter and History of Moderate or Severe LVSD" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Is Currently Taking Beta Blocker Therapy for LVSD
    define "Is Currently Taking Beta Blocker Therapy for LVSD":
      exists ( [MedicationRequest: medication in "Beta Blocker Therapy for LVSD"] ActiveBetaBlockerForLVSD
          with "Qualifying CAD Encounter and History of Moderate or Severe LVSD" CADEncounterModerateOrSevereLVSD
            such that First((collapse(ActiveBetaBlockerForLVSD.dosageInstruction.timing.repeat.bounds DoseTime
                  return DoseTime.toInterval()
              )) DrugPeriod
                sort by start of $this
            ) overlaps after day of CADEncounterModerateOrSevereLVSD.period
          where ActiveBetaBlockerForLVSD.status in { 'active', 'completed' }
            and ActiveBetaBlockerForLVSD.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Numerator 1
    define "Numerator 1":
      "Has Beta Blocker Therapy for LVSD Ordered"
        or "Is Currently Taking Beta Blocker Therapy for 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
    CADBetaBlockerTherapyPriorMIorLVSDFHIR SDE Payer
    define "SDE Payer":
      SDE."SDE Payer"
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Beta Blocker Therapy Ordered
    define "Has Beta Blocker Therapy Ordered":
      exists ( [MedicationRequest: medication in "Beta Blocker Therapy"] BetaBlockerOrdered
          where BetaBlockerOrdered.authoredDuringDayOfEncounter ( "Qualifying CAD Encounter and Prior MI" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Is Currently Taking Beta Blocker Therapy
    define "Is Currently Taking Beta Blocker Therapy":
      exists ( [MedicationRequest: medication in "Beta Blocker Therapy"] ActiveBetaBlocker
          with "Qualifying CAD Encounter and Prior MI" CADEncounterMI
            such that First((collapse(ActiveBetaBlocker.dosageInstruction.timing.repeat.bounds DoseTime
                  return DoseTime.toInterval()
              )) DrugPeriod
                sort by start of $this
            ) overlaps after day of CADEncounterMI.period
          where ActiveBetaBlocker.status in { 'active', 'completed' }
            and ActiveBetaBlocker.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Numerator 2
    define "Numerator 2":
      "Has Beta Blocker Therapy Ordered"
        or "Is Currently Taking Beta Blocker Therapy"
    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
    CADBetaBlockerTherapyPriorMIorLVSDFHIR SDE Ethnicity
    define "SDE Ethnicity":
      SDE."SDE Ethnicity"
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Arrhythmia with Qualifying CAD Encounter and Prior MI
    define "Has Arrhythmia with Qualifying CAD Encounter and Prior MI":
      exists ( [Condition: "Arrhythmia"] ArrhythmiaDiagnosis
          where ArrhythmiaDiagnosis.overlapsDayOfEncounter ( "Qualifying CAD Encounter and Prior MI" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Asthma with Qualifying CAD Encounter and Prior MI
    define "Has Asthma with Qualifying CAD Encounter and Prior MI":
      exists ( [Condition: "Asthma"] AsthmaDiagnosis
          where AsthmaDiagnosis.overlapsDayOfEncounter ( "Qualifying CAD Encounter and Prior MI" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Bradycardia with Qualifying CAD Encounter and Prior MI
    define "Has Bradycardia with Qualifying CAD Encounter and Prior MI":
      exists ( [Condition: "Bradycardia"] BradycardiaDiagnosis
          where BradycardiaDiagnosis.overlapsDayOfEncounter ( "Qualifying CAD Encounter and Prior MI" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Hypotension with Qualifying CAD Encounter and Prior MI
    define "Has Hypotension with Qualifying CAD Encounter and Prior MI":
      exists ( [Condition: "Hypotension"] HypotensionDiagnosis
          where HypotensionDiagnosis.overlapsDayOfEncounter ( "Qualifying CAD Encounter and Prior MI" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Consecutive Heart Rates Less than 50 with Qualifying CAD Encounter and Prior MI
    /*
    * @code: Heart rate - 8867-4
    * @profile: http://hl7.org/fhir/StructureDefinition/heartrate 
    */
    
    
    define "Has Consecutive Heart Rates Less than 50 with Qualifying CAD Encounter and Prior MI":
      exists ( from
          ["observation-heartrate"] HeartRate,
          "Qualifying CAD Encounter and Prior MI" CADEncounterMI
          let PriorHeartRate: Last(["observation-heartrate"] MostRecentPriorHeartRate
              where MostRecentPriorHeartRate.effective.toInterval() during CADEncounterMI.period
                and MostRecentPriorHeartRate.status in { 'final', 'amended', 'corrected' }
                and MostRecentPriorHeartRate.effective.toInterval() before HeartRate.effective.toInterval()
              sort by start of effective.toInterval()
          )
          where HeartRate.effective.toInterval ( ) during CADEncounterMI.period
            and HeartRate.status in { 'final', 'amended', 'corrected' }
            and HeartRate.value < 50 '/min'
            and PriorHeartRate.value < 50 '/min'
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Allergy or Intolerance to Beta Blocker Therapy Ingredient with Qualifying CAD Encounter and Prior MI
    define "Has Allergy or Intolerance to Beta Blocker Therapy Ingredient with Qualifying CAD Encounter and Prior MI":
      exists ( ( [AllergyIntolerance: "Beta Blocker Therapy Ingredient"]
          union [AllergyIntolerance: "Substance with beta adrenergic receptor antagonist mechanism of action (substance)"] ) BetaBlockerAllergyIntolerance
          where BetaBlockerAllergyIntolerance.overlapsAfterDayOfEncounter ( "Qualifying CAD Encounter and Prior MI" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Diagnosis of Allergy or Intolerance to Beta Blocker Therapy with Qualifying CAD Encounter and Prior MI
    define "Has Diagnosis of Allergy or Intolerance to Beta Blocker Therapy with Qualifying CAD Encounter and Prior MI":
      exists ( ( [Condition: "Allergy to Beta Blocker Therapy"]
          union [Condition: "Intolerance to Beta Blocker Therapy"] ) BetaBlockerAllergyOrIntoleranceDiagnosis
          where BetaBlockerAllergyOrIntoleranceDiagnosis.overlapsAfterDayOfEncounter ( "Qualifying CAD Encounter and Prior MI" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Atrioventricular Block with Qualifying CAD Encounter and Prior MI
    define "Has Atrioventricular Block with Qualifying CAD Encounter and Prior MI":
      exists ( [Condition: "Atrioventricular Block"] AtrioventricularBlock
          where AtrioventricularBlock.overlapsDayOfEncounter ( "Qualifying CAD Encounter and Prior MI" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Diagnosis of Cardiac Pacer in Situ with Qualifying CAD Encounter and Prior MI
    define "Has Diagnosis of Cardiac Pacer in Situ with Qualifying CAD Encounter and Prior MI":
      exists ( [Condition: "Cardiac Pacer in Situ"] CardiacPacerDiagnosis
          where CardiacPacerDiagnosis.overlapsDayOfEncounter ( "Qualifying CAD Encounter and Prior MI" )
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Cardiac Pacer Device Implanted with Qualifying CAD Encounter and Prior MI
    define "Has Cardiac Pacer Device Implanted with Qualifying CAD Encounter and Prior MI":
      exists ( [Procedure: "Cardiac Pacer"] ImplantedCardiacPacer
          with "Qualifying CAD Encounter and Prior MI" CADEncounterMI
            such that ImplantedCardiacPacer.performed.toInterval ( ) starts before end of CADEncounterMI.period
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Has Atrioventricular Block with Qualifying CAD Encounter and Prior MI without Cardiac Pacer
    define "Has Atrioventricular Block with Qualifying CAD Encounter and Prior MI without Cardiac Pacer":
      "Has Atrioventricular Block with Qualifying CAD Encounter and Prior MI"
        and not "Has Diagnosis of Cardiac Pacer in Situ with Qualifying CAD Encounter and Prior MI"
        and not "Has Cardiac Pacer Device Implanted with Qualifying CAD Encounter and Prior MI"
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Denominator Exceptions 2
    /*
    @commentedOut: "Has Medical or Patient Reason for Not Ordering Beta Blocker Therapy" 
    @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 2":
      "Has Arrhythmia with Qualifying CAD Encounter and Prior MI"
        or "Has Asthma with Qualifying CAD Encounter and Prior MI"
        or "Has Bradycardia with Qualifying CAD Encounter and Prior MI"
        or "Has Hypotension with Qualifying CAD Encounter and Prior MI"
        or "Has Consecutive Heart Rates Less than 50 with Qualifying CAD Encounter and Prior MI"
        or "Has Allergy or Intolerance to Beta Blocker Therapy Ingredient with Qualifying CAD Encounter and Prior MI"
        or "Has Diagnosis of Allergy or Intolerance to Beta Blocker Therapy with Qualifying CAD Encounter and Prior MI"
          //or "Has Medical or Patient Reason for Not Ordering Beta Blocker Therapy"
        
        or "Has Atrioventricular Block with Qualifying CAD Encounter and Prior MI without Cardiac Pacer"
    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
    CADBetaBlockerTherapyPriorMIorLVSDFHIR SDE Race
    define "SDE Race":
      SDE."SDE Race"
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR Denominator 1
    define "Denominator 1":
      "Initial Population"
        and exists "Qualifying CAD Encounter and History of Moderate or Severe LVSD"
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR overlapsDayOfEncounter
    define fluent function overlapsDayOfEncounter(Diagnosis Condition, TheEncounter Encounter):
      TheEncounter Visit
        where Diagnosis.isConfirmedActiveDiagnosis ( )
        return Diagnosis.prevalenceInterval ( ) overlaps day of Visit.period
    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
    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
    CADBetaBlockerTherapyPriorMIorLVSDFHIR overlapsAfterDayOfEncounter
    define fluent function overlapsAfterDayOfEncounter(Event Choice<AllergyIntolerance, Condition>, EncounterList List<Encounter>):
      AnyTrue(EncounterList Visit
          return case
            when Event is AllergyIntolerance then Interval[start of Event.onset.toInterval(), Event.lastOccurrence]overlaps after day of Visit.period
              and(Event.clinicalStatus is null
                  or Event.clinicalStatus ~ QICoreCommon."allergy-active"
              )
            when Event is Condition then Event.isConfirmedActiveDiagnosis()
              and Event.prevalenceInterval() overlaps after day of Visit.period
              and Event.verificationStatus ~ QICoreCommon."confirmed" 
            else false 
          end
      )
    Library Name Name
    CADBetaBlockerTherapyPriorMIorLVSDFHIR authoredDuringDayOfEncounter
    define fluent function authoredDuringDayOfEncounter(Order Choice<MedicationRequest, MedicationNotRequested>, EncounterList List<Encounter>):
      AnyTrue(EncounterList Visit
          return case
            when Order is MedicationRequest then Order.authoredOn during day of Visit.period
              and Order.status in { 'active', 'completed' }
              and Order.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
              and Order.doNotPerform is not true
            when Order is MedicationNotRequested then Order.authoredOn during day of Visit.period
              and Order.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' } 
            else false 
          end
      )
    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
            }