eCQM QICore Content Subset Implementation Guide
2024.0.0 - CI Build

eCQM QICore Content Subset 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-subset/ and changes regularly. See the Directory of published versions

Measure: Discharged on Antithrombotic TherapyFHIR (Experimental)

Official URL: https://madie.cms.gov/Measure/DischargedonAntithromboticTherapyFHIR Version: 0.9.000
Active as of 2024-09-09 Responsible: The Joint Commission Computable Name: DischargedonAntithromboticTherapyFHIR
Other Identifiers: Short Name: CMS104FHIR (use: usual, ), UUID:4f57e4a2-097b-45f8-9c85-91b35ea92dc1 (use: official, ), UUID:9b96b5de-f0b8-412a-8523-ed2918efeb19 (use: official, ), Publisher: 104FHIR (use: official, )

Usage:Venue: EH

Copyright/Legal: Measure specifications are in the Public Domain LOINC(R) 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 copyright 2023 World Health Organization. All Rights Reserved.

Ischemic stroke patients prescribed or continuing to take antithrombotic therapy at hospital discharge

UNKNOWN

Knowledge Artifact Metadata
Name (machine-readable) DischargedonAntithromboticTherapyFHIR
Title (human-readable) Discharged on Antithrombotic TherapyFHIR
Status Active
Experimental true
Description

Ischemic stroke patients prescribed or continuing to take antithrombotic therapy at hospital discharge

Purpose

UNKNOWN

Clinical Usage The "Nonelective Inpatient Encounter" value set intends to capture all non-scheduled hospitalizations. This value set is a subset of the "Inpatient encounter" value set, excluding concepts that specifically refer to elective hospital admissions. Non-elective admissions include emergency, urgent and unplanned admissions. The "Medication, Discharge" datatype refers to the discharge medication list and is intended to express medications ordered for post-discharge use. The denominator population includes patients with inpatient hospitalizations and patients from Acute Hospital Care at Home programs, who are treated and billed as inpatients but receive care in their home. This eCQM is an episode-based measure. An episode is defined as each inpatient hospitalization or encounter that ends during the measurement period. This FHIR-based measure has been derived from the QDM-based measure: CMS104v13. 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).
Effective Period 2025-01-01..2025-12-31
Use Context Venue = EH
Measure Developer The Joint Commission: https://www.jointcommission.org/
Measure Steward The Joint Commission
Steward Contact Details https://www.jointcommission.org/
Copyright

Measure specifications are in the Public Domain LOINC(R) 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 copyright 2023 World Health Organization. All Rights Reserved.

Measure Metadata
Short Name Identifier CMS104FHIR
Version Independent Identifier urn:uuid:4f57e4a2-097b-45f8-9c85-91b35ea92dc1
Version Specific Identifier urn:uuid:9b96b5de-f0b8-412a-8523-ed2918efeb19
Publisher (CMS) Identifier 104FHIR
Version Number 0.9.000
Measure Scoring Proportion
Rationale

The effectiveness of antithrombotic agents in reducing stroke mortality, stroke-related morbidity and recurrence rates has been studied in several large clinical trials. While the use of these agents for patients with acute ischemic stroke and transient ischemic attacks continues to be the subject of study, substantial evidence is available from completed studies. Data at this time suggest that antithrombotic therapy should be prescribed at discharge following acute ischemic stroke to reduce stroke mortality and morbidity if no contraindications exist. For patients with a stroke due to a cardioembolic source (e.g., atrial fibrillation, mechanical heart valve), warfarin is recommended unless contraindicated. In recent years, novel oral anticoagulant agents (NOACs) have been developed and approved by the U.S. Food and Drug Administration (FDA) for stroke prevention and may be considered as an alternative to warfarin for select patients. Anticoagulation therapy is not generally recommended for secondary stroke prevention in patients presumed to have a non-cardioembolic stroke Anticoagulants at doses to prevent venous thromboembolism are insufficient antithrombotic therapy to prevent recurrent ischemic stroke or transient ischemic attack (TIA).

Clinical Recommendation Statement

Clinical trial results suggest that antithrombotic therapy should be prescribed at discharge following acute ischemic stroke to reduce stroke mortality and morbidity if no contraindications exist

Guidance

The "Nonelective Inpatient Encounter" value set intends to capture all non-scheduled hospitalizations. This value set is a subset of the "Inpatient encounter" value set, excluding concepts that specifically refer to elective hospital admissions. Non-elective admissions include emergency, urgent and unplanned admissions. The "Medication, Discharge" datatype refers to the discharge medication list and is intended to express medications ordered for post-discharge use. The denominator population includes patients with inpatient hospitalizations and patients from Acute Hospital Care at Home programs, who are treated and billed as inpatients but receive care in their home. This eCQM is an episode-based measure. An episode is defined as each inpatient hospitalization or encounter that ends during the measurement period. This FHIR-based measure has been derived from the QDM-based measure: CMS104v13. 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).

Supplemental Data Guidance For every patient evaluated by this measure also identify payer, race, ethnicity and sex; SDE Ethnicity-Patient's Ethnicity: Hispanic or Latino Not Hispanic or Latino SDE Payer-Patient's Payer: Categories of types of health care payer entities as defined by the US Public Health Data Consortium SOP code system SDE Race-Patient's Race: Native Hawaiian or Other Pacific Islander Asian American Indian or Alaska Native Other Race White Black or African American SDE Sex-Patient's Sex: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.
Measure Population Criteria (ID: 64f0daaf56d636294b157ea1)
Summary Ischemic stroke patients prescribed or continuing to take antithrombotic therapy at hospital discharge
Initial Population ID: 937BAF2A-D36A-4EE5-B2B2-762A0FE04502
Description:

Inpatient hospitalizations (non-elective admissions) for patients age 18 and older, discharged from inpatient care with a principal diagnosis of ischemic stroke, and ends during the measurement period

Logic Definition: Initial Population
Denominator ID: 302C1DCC-7FE6-41EF-A94E-FDAE24B7BB1B
Description:

Equals Initial Population

Logic Definition: Denominator
Denominator Exclusion ID: 4B649804-9C55-4949-8CE0-01B462CAA74C
Description:

- Inpatient hospitalizations for patients admitted for elective carotid intervention. This exclusion is implicitly modeled by only including non-elective hospitalizations. - Inpatient hospitalizations for patients discharged to another hospital - Inpatient hospitalizations for patients who left against medical advice - Inpatient hospitalizations for patients who expired - Inpatient hospitalizations for patients discharged to home for hospice care - Inpatient hospitalizations for patients discharged to a health care facility for hospice care - Inpatient hospitalizations for patients with comfort measures documented

Logic Definition: Denominator Exclusions
Numerator ID: 99961E3A-EFC4-4858-A3EE-F7F1D5B222FB
Description:

Inpatient hospitalizations for patients prescribed or continuing to take antithrombotic therapy at hospital discharge

Logic Definition: Numerator
Denominator Exception ID: 516A3DD0-69B0-49EF-BBD3-12809CDC843E
Description:

- Inpatient hospitalizations for patients with a documented reason for not prescribing antithrombotic therapy at discharge. - Inpatient hospitalizations for patients who receive Prasugrel as an antithrombotic therapy at discharge.

Logic Definition: Denominator Exceptions
Population Basis Encounter
Scoring Proportion
Type Process
Rate Aggregation None
Improvement Notation increase
Supplemental Data Elements
Supplemental Data Element ID: sde-ethnicity
Usage Code: Supplemental Data
Description: SDE Ethnicity
Logic Definition: SDE Ethnicity
Supplemental Data Element ID: sde-payer
Usage Code: Supplemental Data
Description: SDE Payer
Logic Definition: SDE Payer
Supplemental Data Element ID: sde-race
Usage Code: Supplemental Data
Description: SDE Race
Logic Definition: SDE Race
Supplemental Data Element ID: sde-sex
Usage Code: Supplemental Data
Description: SDE Sex
Logic Definition: SDE Sex
Measure Logic
Primary Library DischargedonAntithromboticTherapyFHIR
Dependency Description: Library SDE
Resource: Library/SupplementalDataElements|3.5.000
Canonical URL: Library/SupplementalDataElements|3.5.000
Dependency Description: Library TJC
Resource: Library/TJCOverall|8.14.000
Canonical URL: Library/TJCOverall|8.14.000
Dependency Description: Library FHIRHelpers
Resource: Library/FHIRHelpers|4.4.000
Canonical URL: Library/FHIRHelpers|4.4.000
Dependency Description: Library CQMCommon
Resource: Library/CQMCommon|2.2.000
Canonical URL: Library/CQMCommon|2.2.000
Dependency Description: Library QICoreCommon
Resource: Library/QICoreCommon|2.1.000
Canonical URL: Library/QICoreCommon|2.1.000
Dependency Description: Code system AdministrativeGender
Resource: AdministrativeGender
Canonical URL: http://hl7.org/fhir/administrative-gender
Dependency Description: Code system DiagnosisRole
Resource: Diagnosis Role
Canonical URL: http://terminology.hl7.org/CodeSystem/diagnosis-role
Dependency Description: Code system MedicationRequestCategory
Resource: MedicationRequest Category Codes
Canonical URL: http://terminology.hl7.org/CodeSystem/medicationrequest-category
Dependency Description: Value set Nonelective Inpatient Encounter
Resource: Non-Elective Inpatient Encounter
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.424
Dependency Description: Value set Ischemic Stroke
Resource: Ischemic Stroke
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.247
Dependency Description: Value set Antithrombotic Therapy for Ischemic Stroke
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.62
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.62
Dependency Description: Value set Payer Type
Resource: Payer
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591
Dependency Description: Value set Discharge To Acute Care Facility
Resource: Discharge To Acute Care Facility
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.87
Dependency Description: Value set Left Against Medical Advice
Resource: Left Against Medical Advice
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.308
Dependency Description: Value set Patient Expired
Resource: Patient Expired
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.309
Dependency Description: Value set Discharged to Home for Hospice Care
Resource: Discharged to Home for Hospice Care
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.209
Dependency Description: Value set Discharged to Health Care Facility for Hospice Care
Resource: Discharged to Health Care Facility for Hospice Care
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.207
Dependency Description: Value set Comfort Measures
Resource: Comfort Measures
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/1.3.6.1.4.1.33895.1.3.0.45
Dependency Description: Value set Observation Services
Resource: Observation Services
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143
Dependency Description: Value set Emergency Department Visit
Resource: Emergency Department Visit
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292
Dependency Description: Value set Medical Reason For Not Providing Treatment
Resource: Medical Reason
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.473
Dependency Description: Value set Patient Refusal
Resource: Patient Refusal
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.93
Dependency Description: Value set Pharmacological Contraindications For Antithrombotic Therapy
Resource: Pharmacological Contraindications For Antithrombotic Therapy
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.52
Direct Reference Code Display: Male
Code: M
System: http://hl7.org/fhir/administrative-gender
Direct Reference Code Display: Female
Code: F
System: http://hl7.org/fhir/administrative-gender
Direct Reference Code Display: Billing
Code: billing
System: http://terminology.hl7.org/CodeSystem/diagnosis-role
Direct Reference Code Display: Community
Code: community
System: http://terminology.hl7.org/CodeSystem/medicationrequest-category
Direct Reference Code Display: Discharge
Code: discharge
System: http://terminology.hl7.org/CodeSystem/medicationrequest-category
Parameter Name: Measurement Period
Use: In
Min Cardinality: 0
Max Cardinality: 1
Type: Period
Parameter Name: SDE Sex
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: Coding
Parameter Name: Numerator
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Denominator
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: SDE Payer
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Initial Population
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: SDE Ethnicity
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: Resource
Parameter Name: Denominator Exclusions
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: SDE Race
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: Resource
Parameter Name: Denominator Exceptions
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Measure Logic Data Requirements
Data Requirement Type: Patient
Profile(s): QICorePatient
Must Support Elements: ethnicity, race
Data Requirement Type: Encounter
Profile(s): QICoreEncounter
Must Support Elements: type, status, status.value, period, rank, rank.value, use, condition, condition.reference, condition.reference.value
Code Filter(s):
Path: type
ValueSet: Observation Services
Path: status.value
Code:
Data Requirement Type: Encounter
Profile(s): QICoreEncounter
Must Support Elements: type, status, status.value, period, rank, rank.value, use, condition, condition.reference, condition.reference.value
Code Filter(s):
Path: type
ValueSet: Emergency Department Visit
Path: status.value
Code:
Data Requirement Type: Encounter
Profile(s): QICoreEncounter
Must Support Elements: type, period, rank, rank.value, use, condition, condition.reference, condition.reference.value
Code Filter(s):
Path: type
ValueSet: Non-Elective Inpatient Encounter
Data Requirement Type: Encounter
Profile(s): QICoreEncounter
Must Support Elements: type, period, rank, rank.value, use, condition, condition.reference, condition.reference.value, hospitalization, hospitalization.dischargeDisposition
Code Filter(s):
Path: type
ValueSet: Non-Elective Inpatient Encounter
Data Requirement Type: Condition
Profile(s): QICoreCondition
Must Support Elements: id, id.value
Data Requirement Type: MedicationRequest
Profile(s): QICoreMedicationRequest
Must Support Elements: medication, authoredOn, authoredOn.value
Code Filter(s):
Path: medication
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.62
Data Requirement Type: MedicationRequest
Profile(s): QICoreMedicationRequest
Must Support Elements: medication, status, status.value, intent, intent.value
Code Filter(s):
Path: medication
ValueSet: Pharmacological Contraindications For Antithrombotic Therapy
Data Requirement Type: MedicationRequest
Profile(s): QICoreMedicationRequest
Must Support Elements: medication, status, status.value, intent, intent.value, authoredOn, authoredOn.value
Code Filter(s):
Path: medication
ValueSet: Pharmacological Contraindications For Antithrombotic Therapy
Data Requirement Type: Coverage
Profile(s): QICoreCoverage
Must Support Elements: type, period
Code Filter(s):
Path: type
ValueSet: Payer
Data Requirement Type: ServiceRequest
Profile(s): QICoreServiceRequest
Must Support Elements: code, status, status.value, intent, intent.value, doNotPerform, doNotPerform.value
Code Filter(s):
Path: code
ValueSet: Comfort Measures
Data Requirement Type: Procedure
Profile(s): QICoreProcedure
Must Support Elements: code, status, status.value
Code Filter(s):
Path: code
ValueSet: Comfort Measures
Data Requirement Type: MedicationRequest
Profile(s): QICoreMedicationNotRequested
Must Support Elements: medication, reasonCode, authoredOn, authoredOn.value
Code Filter(s):
Path: medication
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.62
Measure Logic Definitions
Logic Definition Library Name: SupplementalDataElements
define "SDE Sex":
  case
    when Patient.gender = 'male' then "M"
    when Patient.gender = 'female' then "F"
    else null
  end
Logic Definition Library Name: DischargedonAntithromboticTherapyFHIR
define "SDE Sex":
  SDE."SDE Sex"
Logic Definition Library Name: TJCOverall
define "Non Elective Inpatient Encounter with Age":
  ["Encounter": "Nonelective Inpatient Encounter"] NonElectiveEncounter
        where AgeInYearsAt(date from start of NonElectiveEncounter.period ) >= 18
         and NonElectiveEncounter.period ends during day of "Measurement Period"
Logic Definition Library Name: TJCOverall
define "Ischemic Stroke Encounter":
  "Non Elective Inpatient Encounter with Age" NonElectiveEncounterWithAge
    where NonElectiveEncounterWithAge.principalDiagnosis().code in "Ischemic Stroke"
Logic Definition Library Name: DischargedonAntithromboticTherapyFHIR
define "Numerator":
  TJC."Ischemic Stroke Encounter" IschemicStrokeEncounter
    with ["MedicationRequest": medication in "Antithrombotic Therapy for Ischemic Stroke"] DischargeAntithrombotic
      such that DischargeAntithrombotic.authoredOn during IschemicStrokeEncounter.period
Logic Definition Library Name: DischargedonAntithromboticTherapyFHIR
define "Initial Population":
  TJC."Ischemic Stroke Encounter"
Logic Definition Library Name: DischargedonAntithromboticTherapyFHIR
define "Denominator":
  "Initial Population"
Logic Definition Library Name: SupplementalDataElements
define "SDE Payer":
  [Coverage: type in "Payer Type"] Payer
    return {
      code: Payer.type,
      period: Payer.period
    }
Logic Definition Library Name: DischargedonAntithromboticTherapyFHIR
define "SDE Payer":
  SDE."SDE Payer"
Logic Definition Library Name: SupplementalDataElements
define "SDE Ethnicity":
  Patient.ethnicity E
    return Tuple {
      codes: { E.ombCategory } union E.detailed,
      display: E.text
    }
Logic Definition Library Name: DischargedonAntithromboticTherapyFHIR
define "SDE Ethnicity":
  SDE."SDE Ethnicity"
Logic Definition Library Name: TJCOverall
define "Ischemic Stroke Encounters with Discharge Disposition":
  "Ischemic Stroke Encounter" IschemicStrokeEncounter
  let DischDisp: IschemicStrokeEncounter.hospitalization.dischargeDisposition
  	where  DischDisp in "Discharge To Acute Care Facility"
		or DischDisp in "Left Against Medical Advice"
		or DischDisp in "Patient Expired"
		or DischDisp in "Discharged to Home for Hospice Care"
		or DischDisp in "Discharged to Health Care Facility for Hospice Care"
Logic Definition Library Name: TJCOverall
define "Intervention Comfort Measures":
  ( ["ServiceRequest": code in "Comfort Measures"] SR
    where SR.status in { 'active', 'completed', 'on-hold' }
      and SR.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
      and SR.doNotPerform is not true
  )  
  union ( ["Procedure": "Comfort Measures"] InterventionPerformed
        where InterventionPerformed.status in { 'completed', 'in-progress' }
  )
Logic Definition Library Name: DischargedonAntithromboticTherapyFHIR
define "Encounter with Comfort Measures during Hospitalization for Patients with Documented Ischemic Stroke":
  "Denominator" Encounter
    with TJC."Intervention Comfort Measures" ComfortMeasure
      such that Coalesce(start of ComfortMeasure.performed.toInterval(), ComfortMeasure.authoredOn) during Encounter.hospitalizationWithObservation ( )
Logic Definition Library Name: DischargedonAntithromboticTherapyFHIR
define "Denominator Exclusions":
  TJC."Ischemic Stroke Encounters with Discharge Disposition"
    union "Encounter with Comfort Measures during Hospitalization for Patients with Documented Ischemic Stroke"
Logic Definition Library Name: SupplementalDataElements
define "SDE Race":
  Patient.race R
    return Tuple {
      codes: R.ombCategory union R.detailed,
      display: R.text
    }
Logic Definition Library Name: DischargedonAntithromboticTherapyFHIR
define "SDE Race":
  SDE."SDE Race"
Logic Definition Library Name: DischargedonAntithromboticTherapyFHIR
define "Reason for Not Giving Antithrombotic at Discharge":
  ["MedicationNotRequested": "Antithrombotic Therapy for Ischemic Stroke"] NoAntithromboticDischarge
    where ( NoAntithromboticDischarge.reasonCode in "Medical Reason For Not Providing Treatment"
        or NoAntithromboticDischarge.reasonCode in "Patient Refusal"
    )
      and ( NoAntithromboticDischarge.isCommunity ( )
          or NoAntithromboticDischarge.isDischarge ( )
      )
Logic Definition Library Name: DischargedonAntithromboticTherapyFHIR
define "Encounter with Documented Reason for No Antithrombotic At Discharge":
  TJC."Ischemic Stroke Encounter" IschemicStrokeEncounter
    with "Reason for Not Giving Antithrombotic at Discharge" NoDischargeAntithrombotic
      such that NoDischargeAntithrombotic.authoredOn during IschemicStrokeEncounter.period
Logic Definition Library Name: DischargedonAntithromboticTherapyFHIR
define "Pharmacological Contraindications for Antithrombotic Therapy at Discharge":
  ["MedicationRequest": medication in "Pharmacological Contraindications For Antithrombotic Therapy"] Pharmacological
    where ( Pharmacological.isCommunity ( )
        or Pharmacological.isDischarge ( )
    )
      and Pharmacological.status in { 'active', 'completed' }
      and Pharmacological.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
Logic Definition Library Name: DischargedonAntithromboticTherapyFHIR
//BONNIEMAT-1617-Since there is an anticipated resolution for STU 5 for Medication.Discharge which leaves one blockers on coverage, will leave the assertion logic as is and update the test cases for coverage.


define "Encounter with Pharmacological Contraindications for Antithrombotic Therapy at Discharge":
  TJC."Ischemic Stroke Encounter" IschemicStrokeEncounter
    with "Pharmacological Contraindications for Antithrombotic Therapy at Discharge" DischargePharmacological
      such that DischargePharmacological.authoredOn during IschemicStrokeEncounter.period
Logic Definition Library Name: DischargedonAntithromboticTherapyFHIR
define "Denominator Exceptions":
  "Encounter with Documented Reason for No Antithrombotic At Discharge"
    union "Encounter with Pharmacological Contraindications for Antithrombotic Therapy at Discharge"
Logic Definition Library Name: CQMCommon
/*
@description: Returns the condition that is specified as the principal diagnosis for the encounter
*/
define fluent function principalDiagnosis(Encounter Encounter ):
	singleton from ((Encounter.diagnosis D where D.rank = 1 and D.use ~ "Billing") PD
      return singleton from ([Condition] C where C.id = PD.condition.reference.getId())
	)
Logic Definition Library Name: QICoreCommon
/*
@description: Returns the tail of the given uri (i.e. everything after the last slash in the URI).
@comment: This function can be used to determine the logical id of a given resource. It can be used in
a single-server environment to trace references. However, this function does not attempt to resolve
or distinguish the base of the given url, and so cannot be used safely in multi-server environments.
*/
define fluent function getId(uri String):
  Last(Split(uri, '/'))
Logic Definition Library Name: FHIRHelpers
define function ToString(value uri): value.value
Logic Definition Library Name: FHIRHelpers
/*
@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
        }
Logic Definition Library Name: CQMCommon
/*
@description: Hospitalization with Observation returns the total interval from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter
*/
define fluent function hospitalizationWithObservation(TheEncounter Encounter ):
  TheEncounter Visit
  		let ObsVisit: Last([Encounter: "Observation Services"] LastObs
  				where LastObs.status = 'finished'
            and LastObs.period ends 1 hour or less on or before start of Visit.period
  				sort by end of period
  			),
  			VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),
  			EDVisit: Last([Encounter: "Emergency Department Visit"] LastED
  				where LastED.status = 'finished'
            and LastED.period ends 1 hour or less on or before VisitStart
  				sort by end of period
  			)
  		return Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]
Logic Definition Library Name: FHIRHelpers
/*
@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
        }
Logic Definition Library Name: QICoreCommon
/*
@description: Returns true if the given MedicationRequest has a category of Community
*/
define fluent function isCommunity(medicationRequest MedicationNotRequested):
  exists (medicationRequest.category C
    where C ~ Community
  )
Logic Definition Library Name: QICoreCommon
/*
@description: Returns true if the given MedicationRequest has a category of Discharge
*/
define fluent function isDischarge(medicationRequest MedicationNotRequested):
  exists (medicationRequest.category C
    where C ~ Discharge
  )
Generated using version 0.4.6 of the sample-content-ig Liquid templates