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: Intensive Care Unit Venous Thromboembolism ProphylaxisFHIR

Official URL: https://madie.cms.gov/Measure/IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Version: 0.2.000
Draft as of 2024-07-09 Responsible: The Joint Commission Computable Name: IntensiveCareUnitVenousThromboembolismProphylaxisFHIR
Other Identifiers: Short Name (use: usual, ), UUID:693f0836-228e-43cc-ac71-53388e5dc010 (use: official, ), UUID:6eaf8571-3c4a-4605-88ea-8c66f3294e7c (use: official, ), Publisher (use: official, )

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.

This measure assesses the number of patients who received Venous Thromboembolism (VTE) prophylaxis or have documentation why no VTE prophylaxis was given the day of or the day after the initial admission (or transfer) to the Intensive Care Unit (ICU) or surgery end date for surgeries that start the day of or the day after ICU admission (or transfer)

UNKNOWN

Title: Intensive Care Unit Venous Thromboembolism ProphylaxisFHIR
Id: IntensiveCareUnitVenousThromboembolismProphylaxisFHIR
Version: 0.2.000
Url: Intensive Care Unit Venous Thromboembolism ProphylaxisFHIR
short-name identifier:

CMS190FHIR

version-independent identifier:

urn:uuid:693f0836-228e-43cc-ac71-53388e5dc010

version-specific identifier:

urn:uuid:6eaf8571-3c4a-4605-88ea-8c66f3294e7c

publisher (CMS) identifier:

190FHIR

Effective Period: 2025-01-01..2025-12-31
Status: draft
Publisher: The Joint Commission
Author: The Joint Commission
Description:

This measure assesses the number of patients who received Venous Thromboembolism (VTE) prophylaxis or have documentation why no VTE prophylaxis was given the day of or the day after the initial admission (or transfer) to the Intensive Care Unit (ICU) or surgery end date for surgeries that start the day of or the day after ICU admission (or transfer)

Purpose:

UNKNOWN

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.

Disclaimer:

These performance measures are not clinical guidelines and do not establish a standard of medical care, and have not been tested for all potential applications. The measures and specifications are provided without warranty.

Rationale:

Venous Thromboembolism (VTE) is a known complication of hospitalization, frequently extending the length of stay and increasing hospital mortality (Maynard, 2016). Approximately 20% of VTE are associated with a surgical procedure (Henke et al., 2020). Almost all hospitalized patients have at least one risk factor for VTE, and approximately 40% have three or more risk factors. Without thromboprophylaxis, the incidence of objectively confirmed, hospital-acquired deep-vein thrombosis (DVT) is approximately 10% to 40% among medical or general surgical patients and 40% to 60% following major orthopedic surgery (Geerts et al., 2008). Commonly, criteria for admission to the Intensive Care Unit (ICU) itself puts patients at an increased risk for developing VTE and subsequent increased risk of morbidity from pulmonary embolism (PE). Some risk factors are related to the acute illness present that allowed for the admission to the ICU unit, and some risk factors may be acquired during the ICU admission due to subsequent medical treatments, for example limitations of mobility, presence of central venous lines or mechanical ventilation and subsequent pharmacological paralysis. Reports of DVT in the population of ICU patients vary in relation to the acuity of the illness in this population. DVT in ICU patients diagnosed with routine venography or Doppler ultrasound found ranges between 10% to 100%. Five studies prospectively screened patients who were not receiving thromboprophylaxis during their ICU stays. The rates of DVT using Fibrinogen Uptake Test, Doppler Ultrasound or venography ranged from 13 to 31% (Geerts et al., 2008). It is essential for all ICUs to assess each patient upon admission to the ICU unit, a change in level of status, for the need for VTE prophylaxis due to the above increased development of risk factors (Geerts et al., 2004). American Society of Hematology (ASH) 2018 VTE prophylaxis guidelines strongly recommend pharmacological prophylaxis using unfractionated heparin (UFH), low molecular weight heparin (LMWH) or fondaparinux for acutely and critically ill hospitalized medical patients, unless contraindicated. The use of mechanical prophylaxis is an acceptable alternative for patients with increased risk of bleeding and preferred over no prophylaxis. ASH 2019 guidelines for surgical patients similarly recommend pharmacological or mechanical prophylaxis over no VTE prophylaxis. Some select surgeries have previously been monitored in the Surgical Care Improvement Project; since performance on these surgeries has achieved very high levels, they are not included in this measure.

Clinical recommendation statement:

Failure to recognize and protect patients at risk for venous thromboembolism (VTE) increases the chances for critically ill hospitalized patients for developing a deep vein thrombosis or dying from a pulmonary embolism. Screening all patients is the only evidence based practice in reducing incidence of disease. All intensive care unit (ICU) patients should be evaluated for primary VTE prophylaxis, and given appropriate prophylaxis when indicated.

Guidance (Usage): The definition of an ICU for the purpose of the measures noted above is that used by the CDC in the NHSN Patient Safety Project (CDC, 2022). An intensive care unit can be defined as a nursing care area that provides intensive observation, diagnosis, and therapeutic procedures for adults and/or children who are critically ill. An ICU excludes nursing areas that provide step-down, intermediate care or telemetry only and specialty care areas. Reasons for no pharmacological and no mechanical VTE prophylaxis must be explicitly documented by the MD/APN/PA or pharmacist and linked with VTE prophylaxis. Ambulation alone is not a sufficient reason for not administering VTE prophylaxis. In order for ambulation/patient ambulating to be considered as an acceptable reason, there needs to be explicit documentation, e.g., "patient out of bed and ambulating in halls - no VTE prophylaxis needed." 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: CMS190v13. 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:
64f8bc34da013638e7b3d801
Initial Population: Inpatient hospitalizations for patients age 18 and older, discharged from hospital inpatient acute care without a diagnosis of venous thromboembolism (VTE) or obstetrics that ends during the measurement period
Denominator: Inpatient hospitalizations for patients directly admitted or transferred to ICU during the hospitalization
Denominator Exclusion: - Inpatient hospitalizations for patients who have a hospital length of stay (LOS) less than 2 days - Inpatient hospitalizations for patients with a principal procedure of surgical care improvement Project (SCIP) VTE selected surgeries that end the day of or the day after ICU admission or transfer - Inpatient hospitalizations for patients with comfort measures documented anytime between the day of arrival and the day after ICU admission or transfer - Inpatient hospitalizations for patients with comfort measures documented by the day after surgery end date for surgeries that end the day of or the day after ICU admission or transfer
Numerator: Inpatient hospitalizations for patients who received VTE prophylaxis: - the day of or the day after ICU admission (or transfer) - the day of or the day after surgery end date (for surgeries that end the day of or the day after ICU admission or transfer) Inpatient hospitalizations for patients who have documentation of a reason why no VTE prophylaxis was given: - between the day of arrival and the day after ICU admission (for patients directly admitted as inpatients to the ICU) - the day of or the day after surgery end date (for surgeries that end the day of or the day after ICU admission or transfer)
Denominator Exception: Inpatient hospitalizations for patients with ICU LOS less than one day
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; 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.
Libraries:
IntensiveCareUnitVenousThromboembolismProphylaxisFHIR
Terminology and Other Dependencies:
  • Library/SupplementalDataElements|3.5.000
  • Library/VTE|8.8.000
  • Library/CQMCommon|2.2.000
  • Library/FHIRHelpers|4.4.000
  • Library/QICoreCommon|2.1.000
  • Library/TJCOverall|8.14.000
  • AdministrativeGender
  • Condition Clinical Status Codes
  • ConditionVerificationStatus
  • Logical Observation Identifiers, Names and Codes (LOINC)
  • Encounter Inpatient
  • Obstetrics
  • Venous Thromboembolism
  • Obstetrics VTE
  • Intensive Care Unit
  • Low Dose Unfractionated Heparin for VTE Prophylaxis
  • Subcutaneous route
  • Low Molecular Weight Heparin for VTE Prophylaxis
  • Injectable Factor Xa Inhibitor for VTE Prophylaxis
  • Warfarin
  • Rivaroxaban and Betrixaban for VTE Prophylaxis
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.65
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.64
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.66
  • General or Neuraxial Anesthesia
  • Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment
  • Atrial Fibrillation/Flutter
  • Hip Replacement Surgery
  • Knee Replacement Surgery
  • Low Risk
  • INR
  • Unfractionated Heparin
  • Intravenous route
  • Direct Thrombin Inhibitor
  • Glycoprotein IIb/IIIa Inhibitors
  • Observation Services
  • Emergency Department Visit
  • Medical Reason
  • Venous foot pumps (VFP)
  • Intermittent pneumatic compression devices (IPC)
  • Graduated compression stockings (GCS)
  • Patient Refusal
  • Payer
  • General Surgery
  • Gynecological Surgery
  • Hip Fracture Surgery
  • Intracranial Neurosurgery
  • Urological Surgery
  • Comfort Measures
  • Parameters:
    name use min max type
    Measurement Period In 0 1 Period
    SDE Sex Out 0 1 Coding
    Numerator Out 0 * Resource
    Denominator Out 0 * Resource
    SDE Payer Out 0 * Resource
    Initial Population Out 0 * Resource
    SDE Ethnicity Out 0 1 Resource
    Denominator Exclusions Out 0 * Resource
    SDE Race Out 0 1 Resource
    Denominator Exceptions Out 0 * Resource
    DataRequirements:
    Resource Type Resource Elements Valueset Name Valueset
    Patient(QICorePatient) ethnicity race
    Encounter(QICoreEncounter) type status status.value period condition condition.reference condition.reference.value location location.type extension Encounter Inpatient Encounter Inpatient
    Encounter(QICoreEncounter) type status status.value period condition condition.reference condition.reference.value location location.type extension Observation Services Observation Services
    Encounter(QICoreEncounter) type status status.value period condition condition.reference condition.reference.value location location.type extension Emergency Department Visit Emergency Department Visit
    Condition(QICoreCondition) id id.value code
    Condition(QICoreCondition) code verificationStatus onset Atrial Fibrillation or Flutter Atrial Fibrillation/Flutter
    Condition(QICoreCondition) code clinicalStatus verificationStatus onset Venous Thromboembolism Venous Thromboembolism
    Location(QICoreLocation) id id.value
    MedicationAdministration(QICoreMedicationAdministration) medication status status.value dosage dosage.route effective id id.value Low Dose Unfractionated Heparin for VTE Prophylaxis Low Dose Unfractionated Heparin for VTE Prophylaxis
    MedicationAdministration(QICoreMedicationAdministration) medication status status.value dosage dosage.route effective id id.value Low Molecular Weight Heparin for VTE Prophylaxis Low Molecular Weight Heparin for VTE Prophylaxis
    MedicationAdministration(QICoreMedicationAdministration) medication status status.value dosage dosage.route effective id id.value Injectable Factor Xa Inhibitor for VTE Prophylaxis Injectable Factor Xa Inhibitor for VTE Prophylaxis
    MedicationAdministration(QICoreMedicationAdministration) medication status status.value dosage dosage.route effective id id.value Warfarin Warfarin
    MedicationAdministration(QICoreMedicationAdministration) medication status status.value dosage dosage.route effective id id.value Rivaroxaban for VTE Prophylaxis Rivaroxaban and Betrixaban for VTE Prophylaxis
    MedicationAdministration(QICoreMedicationAdministration) medication status status.value dosage dosage.route effective id id.value Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment
    MedicationAdministration(QICoreMedicationAdministration) medication status status.value dosage dosage.route effective id id.value Unfractionated Heparin Unfractionated Heparin
    MedicationAdministration(QICoreMedicationAdministration) medication status status.value dosage dosage.route effective id id.value Direct Thrombin Inhibitor Direct Thrombin Inhibitor
    MedicationAdministration(QICoreMedicationAdministration) medication status status.value dosage dosage.route effective id id.value Glycoprotein IIb/IIIa Inhibitors Glycoprotein IIb/IIIa Inhibitors
    Procedure(QICoreProcedure) code status status.value performed id id.value Application of Intermittent Pneumatic Compression Devices http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.65
    Procedure(QICoreProcedure) code status status.value performed id id.value Application of Venous Foot Pumps http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.64
    Procedure(QICoreProcedure) code status status.value performed id id.value Application of Graduated Compression Stockings http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.66
    Procedure(QICoreProcedure) code status status.value performed id id.value General Surgery General Surgery
    Procedure(QICoreProcedure) code status status.value performed id id.value Gynecological Surgery Gynecological Surgery
    Procedure(QICoreProcedure) code status status.value performed id id.value Hip Fracture Surgery Hip Fracture Surgery
    Procedure(QICoreProcedure) code status status.value performed id id.value Hip Replacement Surgery Hip Replacement Surgery
    Procedure(QICoreProcedure) code status status.value performed id id.value Intracranial Neurosurgery Intracranial Neurosurgery
    Procedure(QICoreProcedure) code status status.value performed id id.value Knee Replacement Surgery Knee Replacement Surgery
    Procedure(QICoreProcedure) code status status.value performed id id.value Urological Surgery Urological Surgery
    Procedure(QICoreProcedure) code status status.value performed id id.value Comfort Measures Comfort Measures
    Procedure(QICoreProcedure) code status status.value performed performed.low performed.lowClosed performed.high performed.highClosed id id.value General or Neuraxial Anesthesia General or Neuraxial Anesthesia
    Observation(QICoreObservation) code value status status.value id id.value effective
    Observation(US Core Laboratory Result Observation Profile) code value status status.value id id.value issued issued.value INR INR
    MedicationAdministration(QICoreMedicationAdministrationNotDone) medication id id.value statusReason extension Low Dose Unfractionated Heparin for VTE Prophylaxis Low Dose Unfractionated Heparin for VTE Prophylaxis
    MedicationAdministration(QICoreMedicationAdministrationNotDone) medication id id.value statusReason extension Low Dose Unfractionated Heparin for VTE Prophylaxis Low Dose Unfractionated Heparin for VTE Prophylaxis
    MedicationAdministration(QICoreMedicationAdministrationNotDone) medication id id.value statusReason extension Low Molecular Weight Heparin for VTE Prophylaxis Low Molecular Weight Heparin for VTE Prophylaxis
    MedicationAdministration(QICoreMedicationAdministrationNotDone) medication id id.value statusReason extension Low Molecular Weight Heparin for VTE Prophylaxis Low Molecular Weight Heparin for VTE Prophylaxis
    MedicationAdministration(QICoreMedicationAdministrationNotDone) medication id id.value statusReason extension Injectable Factor Xa Inhibitor for VTE Prophylaxis Injectable Factor Xa Inhibitor for VTE Prophylaxis
    MedicationAdministration(QICoreMedicationAdministrationNotDone) medication id id.value statusReason extension Injectable Factor Xa Inhibitor for VTE Prophylaxis Injectable Factor Xa Inhibitor for VTE Prophylaxis
    MedicationAdministration(QICoreMedicationAdministrationNotDone) medication id id.value statusReason extension Warfarin Warfarin
    MedicationAdministration(QICoreMedicationAdministrationNotDone) medication id id.value statusReason extension Warfarin Warfarin
    MedicationAdministration(QICoreMedicationAdministrationNotDone) medication id id.value statusReason extension Rivaroxaban for VTE Prophylaxis Rivaroxaban and Betrixaban for VTE Prophylaxis
    MedicationAdministration(QICoreMedicationAdministrationNotDone) medication id id.value statusReason extension Rivaroxaban for VTE Prophylaxis Rivaroxaban and Betrixaban for VTE Prophylaxis
    MedicationRequest(QICoreMedicationNotRequested) medication intent intent.value id id.value reasonCode authoredOn authoredOn.value Low Dose Unfractionated Heparin for VTE Prophylaxis Low Dose Unfractionated Heparin for VTE Prophylaxis
    MedicationRequest(QICoreMedicationNotRequested) medication intent intent.value id id.value reasonCode authoredOn authoredOn.value Low Dose Unfractionated Heparin for VTE Prophylaxis Low Dose Unfractionated Heparin for VTE Prophylaxis
    MedicationRequest(QICoreMedicationNotRequested) medication intent intent.value id id.value reasonCode authoredOn authoredOn.value Low Molecular Weight Heparin for VTE Prophylaxis Low Molecular Weight Heparin for VTE Prophylaxis
    MedicationRequest(QICoreMedicationNotRequested) medication intent intent.value id id.value reasonCode authoredOn authoredOn.value Low Molecular Weight Heparin for VTE Prophylaxis Low Molecular Weight Heparin for VTE Prophylaxis
    MedicationRequest(QICoreMedicationNotRequested) medication intent intent.value id id.value reasonCode authoredOn authoredOn.value Injectable Factor Xa Inhibitor for VTE Prophylaxis Injectable Factor Xa Inhibitor for VTE Prophylaxis
    MedicationRequest(QICoreMedicationNotRequested) medication intent intent.value id id.value reasonCode authoredOn authoredOn.value Injectable Factor Xa Inhibitor for VTE Prophylaxis Injectable Factor Xa Inhibitor for VTE Prophylaxis
    MedicationRequest(QICoreMedicationNotRequested) medication intent intent.value id id.value reasonCode authoredOn authoredOn.value Warfarin Warfarin
    MedicationRequest(QICoreMedicationNotRequested) medication intent intent.value id id.value reasonCode authoredOn authoredOn.value Warfarin Warfarin
    MedicationRequest(QICoreMedicationNotRequested) medication intent intent.value id id.value reasonCode authoredOn authoredOn.value Rivaroxaban for VTE Prophylaxis Rivaroxaban and Betrixaban for VTE Prophylaxis
    MedicationRequest(QICoreMedicationNotRequested) medication intent intent.value id id.value reasonCode authoredOn authoredOn.value Rivaroxaban for VTE Prophylaxis Rivaroxaban and Betrixaban for VTE Prophylaxis
    ServiceRequest(QICoreServiceNotRequested) code intent intent.value id id.value extension authoredOn authoredOn.value Venous foot pumps Venous foot pumps (VFP)
    ServiceRequest(QICoreServiceNotRequested) code intent intent.value id id.value extension authoredOn authoredOn.value Venous foot pumps Venous foot pumps (VFP)
    ServiceRequest(QICoreServiceNotRequested) code intent intent.value id id.value extension authoredOn authoredOn.value Intermittent pneumatic compression devices Intermittent pneumatic compression devices (IPC)
    ServiceRequest(QICoreServiceNotRequested) code intent intent.value id id.value extension authoredOn authoredOn.value Intermittent pneumatic compression devices Intermittent pneumatic compression devices (IPC)
    ServiceRequest(QICoreServiceNotRequested) code intent intent.value id id.value extension authoredOn authoredOn.value Graduated compression stockings Graduated compression stockings (GCS)
    ServiceRequest(QICoreServiceNotRequested) code intent intent.value id id.value extension authoredOn authoredOn.value Graduated compression stockings Graduated compression stockings (GCS)
    Procedure(QICoreProcedureNotDone) code extension id id.value statusReason Application of Intermittent Pneumatic Compression Devices http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.65
    Procedure(QICoreProcedureNotDone) code extension id id.value statusReason Application of Intermittent Pneumatic Compression Devices http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.65
    Procedure(QICoreProcedureNotDone) code extension id id.value statusReason Application of Venous Foot Pumps http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.64
    Procedure(QICoreProcedureNotDone) code extension id id.value statusReason Application of Venous Foot Pumps http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.64
    Procedure(QICoreProcedureNotDone) code extension id id.value statusReason Application of Graduated Compression Stockings http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.66
    Procedure(QICoreProcedureNotDone) code extension id id.value statusReason Application of Graduated Compression Stockings http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.66
    Coverage(QICoreCoverage) type period Payer Type Payer
    ServiceRequest(QICoreServiceRequest) code intent intent.value status status.value doNotPerform doNotPerform.value Comfort Measures Comfort Measures
    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
    Inactive inactive http://terminology.hl7.org/CodeSystem/condition-clinical
    Remission remission http://terminology.hl7.org/CodeSystem/condition-clinical
    Resolved resolved http://terminology.hl7.org/CodeSystem/condition-clinical
    Risk for venous thromboembolism 72136-5 http://loinc.org
    Logic Definitions:
    Group Scoring Population Criteria Expression
    64f8bc34da013638e7b3d801 Group scoring: proportion
    Type:

    Process

    Rate Aggregation: None
    Improvement Notation:

    increase

    Initial Population
    define "Initial Population":
      VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions"
    Denominator
    define "Denominator":
      "Encounter with ICU Location"
    Denominator Exclusion
    define "Denominator Exclusions":
      "Encounter with ICU Location And Encounter Less Than 2 Days"
        union "Encounter with First ICU Stay with Principal Procedure of SCIP VTE Selected Surgery"
        union "Encounter with Intervention Comfort Measures From Day Of Start of Hospitalization To Day After First ICU Stay"
        union "Encounter with Intervention Comfort Measures on Day of or Day After Procedure"
    Numerator
    define "Numerator":
      "Encounter with VTE Prophylaxis Received on Day of or Day After First ICU Stay or Procedure"
        union ( "Encounter with Medication Oral Factor Xa Inhibitor Administered on Day of or Day After First ICU Stay or Procedure"
            intersect ( "Encounter with Prior or Present Diagnosis of Atrial Fibrillation or Prior Diagnosis of VTE"
                union "Encounter with Prior or Present Procedure of Hip or Knee Replacement Surgery"
            )
        )
        union "Encounter with Low Risk for VTE or Anticoagulant Administered"
        union "Encounter with No VTE Prophylaxis Due to Medical Reason"
        union "Encounter with No VTE Prophylaxis Due to Patient Refusal"
    Denominator Exception
    define "Denominator Exceptions":
      "Encounter with First ICU Location Stay Less Than 1 day"
    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
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR SDE Sex
    define "SDE Sex":
      SDE."SDE Sex"
    Library Name Name
    CQMCommon Inpatient Encounter
    define "Inpatient Encounter":
      [Encounter: "Encounter Inpatient"] EncounterInpatient
    		where EncounterInpatient.status = 'finished'
    		and EncounterInpatient.period ends during day of "Measurement Period"
    Library Name Name
    VTE Admission without VTE or Obstetrical Conditions
    define "Admission without VTE or Obstetrical Conditions":
      CQMCommon."Inpatient Encounter" InpatientEncounter
       where not (exists (InpatientEncounter.encounterDiagnosis()) EncDx
                     where (EncDx.code in "Obstetrical or Pregnancy Related Conditions" 
                          or EncDx.code in "Venous Thromboembolism"
              				or EncDx.code in "Obstetrics VTE"
              			         )
                         )
    Library Name Name
    VTE Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions
    define "Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions":
     ( CQMCommon."Inpatient Encounter" InpatientEncounter
         where AgeInYearsAt(date from start of InpatientEncounter.period) >= 18 )
        intersect "Admission without VTE or Obstetrical Conditions"
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Encounter with ICU Location
    define "Encounter with ICU Location":
      VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
        where exists ( QualifyingEncounter.location Location
            where Location.location.getLocation ( ).type in "Intensive Care Unit"
              and Location.period during QualifyingEncounter.period
        )
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Pharmacological or Mechanical VTE Prophylaxis Received
    define "Pharmacological or Mechanical VTE Prophylaxis Received":
      ( ["MedicationAdministration": "Low Dose Unfractionated Heparin for VTE Prophylaxis"] VTEMedication
          where VTEMedication.status = 'completed'
            and VTEMedication.dosage.route in "Subcutaneous route"
      )
        union ( ["MedicationAdministration": "Low Molecular Weight Heparin for VTE Prophylaxis"] LMWH
            where LMWH.status = 'completed'
        )
        union ( ["MedicationAdministration": "Injectable Factor Xa Inhibitor for VTE Prophylaxis"] FactorXa
            where FactorXa.status = 'completed'
        )
        union ( ["MedicationAdministration": "Warfarin"] Warfarin
            where Warfarin.status = 'completed'
        )
        union ( ["MedicationAdministration": "Rivaroxaban for VTE Prophylaxis"] Rivaroxaban
            where Rivaroxaban.status = 'completed'
        )
        union ( ( ["Procedure": "Application of Intermittent Pneumatic Compression Devices"]
            union ["Procedure": "Application of Venous Foot Pumps"]
            union ["Procedure": "Application of Graduated Compression Stockings"] ) DeviceApplied
            where DeviceApplied.status = 'completed'
        )
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Encounter with VTE Prophylaxis Received on Day of or Day After First ICU Stay or Procedure
    define "Encounter with VTE Prophylaxis Received on Day of or Day After First ICU Stay or Procedure":
      ( "Encounter with ICU Location" QualifyingEncounterICU
          with "Pharmacological or Mechanical VTE Prophylaxis Received" VTEProphylaxis
            such that start of Coalesce(VTEProphylaxis.effective.toInterval(), VTEProphylaxis.performed.toInterval()) during day of QualifyingEncounterICU.StartOfFirstICU ( ).CalendarDayOfOrDayAfter ( )
      )
        union ( from
            "Encounter with ICU Location" QualifyingEncounterICU,
            ["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
            "Pharmacological or Mechanical VTE Prophylaxis Received" VTEProphylaxis
            where AnesthesiaProcedure.status = 'completed'
              and AnesthesiaProcedure.performed.toInterval ( ) ends 1 day after day of QualifyingEncounterICU.StartOfFirstICU ( )
              and start of Coalesce(VTEProphylaxis.effective.toInterval(), VTEProphylaxis.performed.toInterval()) during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).CalendarDayOfOrDayAfter ( )
            return QualifyingEncounterICU
        )
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Encounter with Medication Oral Factor Xa Inhibitor Administered on Day of or Day After First ICU Stay or Procedure
    define "Encounter with Medication Oral Factor Xa Inhibitor Administered on Day of or Day After First ICU Stay or Procedure":
      ( "Encounter with ICU Location" QualifyingEncounterICU
          with ["MedicationAdministration": "Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment"] FactorXaMedication
            such that FactorXaMedication.status = 'completed'
              and FactorXaMedication.effective.toInterval ( ) starts during day of QualifyingEncounterICU.StartOfFirstICU ( ).CalendarDayOfOrDayAfter ( )
      )
        union ( from
            "Encounter with ICU Location" QualifyingEncounterICU,
            ["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
            ["MedicationAdministration": "Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment"] FactorXaMedication
            where FactorXaMedication.status = 'completed'
              and AnesthesiaProcedure.status = 'completed'
              and AnesthesiaProcedure.performed.toInterval ( ) ends 1 day after day of QualifyingEncounterICU.StartOfFirstICU ( )
              and FactorXaMedication.effective.toInterval ( ) starts during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).CalendarDayOfOrDayAfter ( )
            return QualifyingEncounterICU
        )
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Encounter with Prior or Present Diagnosis of Atrial Fibrillation or Prior Diagnosis of VTE
    define "Encounter with Prior or Present Diagnosis of Atrial Fibrillation or Prior Diagnosis of VTE":
      ( "Encounter with ICU Location" QualifyingEncounterICU
          with ["Condition": "Atrial Fibrillation or Flutter"] AtrialFibrillation
            such that AtrialFibrillation.isActive ( )
              and AtrialFibrillation.verificationStatus is not null
              and AtrialFibrillation.verificationStatus ~ QICoreCommon."confirmed"
              and AtrialFibrillation.onset.toInterval ( ) starts on or before end of QualifyingEncounterICU.period
      )
        union ( "Encounter with ICU Location" QualifyingEncounterICU
            where QualifyingEncounterICU.encounterDiagnosis ( ).code in "Atrial Fibrillation or Flutter"
        )
        union ( "Encounter with ICU Location" QualifyingEncounterICU
            with ["Condition": "Venous Thromboembolism"] VTEDiagnosis
              such that ( VTEDiagnosis.clinicalStatus ~ QICoreCommon."inactive"
                  or VTEDiagnosis.clinicalStatus ~ QICoreCommon."remission"
                  or VTEDiagnosis.clinicalStatus ~ QICoreCommon."resolved"
              )
                and VTEDiagnosis.verificationStatus is not null
                and VTEDiagnosis.verificationStatus ~ QICoreCommon."confirmed"
                and VTEDiagnosis.onset.toInterval ( ) before start of QualifyingEncounterICU.period
        )
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Encounter with Prior or Present Procedure of Hip or Knee Replacement Surgery
    define "Encounter with Prior or Present Procedure of Hip or Knee Replacement Surgery":
      "Encounter with ICU Location" QualifyingEncounterICU
        with ( ["Procedure": "Hip Replacement Surgery"]
          union ["Procedure": "Knee Replacement Surgery"] ) HipKneeProcedure
          such that HipKneeProcedure.status = 'completed'
            and HipKneeProcedure.performed.toInterval ( ) starts on or before end of QualifyingEncounterICU.period
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Low Risk Indicator For VTE
    define "Low Risk Indicator For VTE":
      ( ["Observation": "Risk for venous thromboembolism"] VTERiskAssessment
          where VTERiskAssessment.value as Concept in "Low Risk"
            and VTERiskAssessment.status in { 'final', 'amended', 'corrected' }
          return {
            id: VTERiskAssessment.id,
            LowRiskDatetime: VTERiskAssessment.effective.earliest ( )
          }
      )
        union ( ["US Core Laboratory Result Observation Profile": "INR"] INRLabTest
            where INRLabTest.value as Quantity > 3.0
              and INRLabTest.status in { 'final', 'amended', 'corrected' }
            return {
              id: INRLabTest.id,
              LowRiskDatetime: INRLabTest.issued
            }
        )
        union ( ( ( ["MedicationAdministration": "Unfractionated Heparin"] UnfractionatedHeparin
              where UnfractionatedHeparin.dosage.route in "Intravenous route"
          )
            union ["MedicationAdministration": "Direct Thrombin Inhibitor"]
            union ["MedicationAdministration": "Glycoprotein IIb/IIIa Inhibitors"] ) AnticoagulantMedication
            where AnticoagulantMedication.status = 'completed'
            return {
              id: AnticoagulantMedication.id,
              LowRiskDatetime: start of AnticoagulantMedication.effective.toInterval ( )
            }
        )
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Low Risk for VTE or Anticoagulant Administered From Day of Start of Hospitalization To Day After First ICU Stay
    define "Low Risk for VTE or Anticoagulant Administered From Day of Start of Hospitalization To Day After First ICU Stay":
      "Encounter with ICU Location" QualifyingEncounterICU
        with "Low Risk Indicator For VTE" LowRiskForVTE
          such that LowRiskForVTE.LowRiskDatetime during day of QualifyingEncounterICU.FromDayOfStartOfHospitalizationToDayAfterFirstICU ( )
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Low Risk for VTE or Anticoagulant Administered on Day of or Day After Procedure
    define "Low Risk for VTE or Anticoagulant Administered on Day of or Day After Procedure":
      from
        "Encounter with ICU Location" QualifyingEncounterICU,
        ["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
        "Low Risk Indicator For VTE" LowRiskForVTE
        where AnesthesiaProcedure.status = 'completed'
          and AnesthesiaProcedure.performed.toInterval ( ) ends 1 day after day of QualifyingEncounterICU.StartOfFirstICU ( )
          and LowRiskForVTE.LowRiskDatetime during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).CalendarDayOfOrDayAfter ( )
        return QualifyingEncounterICU
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Encounter with Low Risk for VTE or Anticoagulant Administered
    define "Encounter with Low Risk for VTE or Anticoagulant Administered":
      "Low Risk for VTE or Anticoagulant Administered From Day of Start of Hospitalization To Day After First ICU Stay"
        union "Low Risk for VTE or Anticoagulant Administered on Day of or Day After Procedure"
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR No VTE Prophylaxis Medication Administered or Ordered
    define "No VTE Prophylaxis Medication Administered or Ordered":
      ( ( [MedicationAdministrationNotDone: "Low Dose Unfractionated Heparin for VTE Prophylaxis"]
          union [MedicationAdministrationNotDone: "Low Molecular Weight Heparin for VTE Prophylaxis"]
          union [MedicationAdministrationNotDone: "Injectable Factor Xa Inhibitor for VTE Prophylaxis"]
          union [MedicationAdministrationNotDone: "Warfarin"]
          union [MedicationAdministrationNotDone: "Rivaroxaban for VTE Prophylaxis"] ) NoMedicationAdm
          return {
            id: NoMedicationAdm.id,
            MedicationStatusReason: NoMedicationAdm.statusReason,
            authoredOn: NoMedicationAdm.recorded
          }
      )
        union ( ( ["MedicationNotRequested": "Low Dose Unfractionated Heparin for VTE Prophylaxis"]
            union ["MedicationNotRequested": "Low Molecular Weight Heparin for VTE Prophylaxis"]
            union ["MedicationNotRequested": "Injectable Factor Xa Inhibitor for VTE Prophylaxis"]
            union ["MedicationNotRequested": "Warfarin"]
            union ["MedicationNotRequested": "Rivaroxaban for VTE Prophylaxis"] ) NoMedicationOrder
            where NoMedicationOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
            return {
              id: NoMedicationOrder.id,
              MedicationStatusReason: NoMedicationOrder.reasonCode,
              authoredOn: NoMedicationOrder.authoredOn
            }
        )
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR No VTE Prophylaxis Medication Due to Medical Reason From Day Of Start of Hospitalization To Day After First ICU Stay
    define "No VTE Prophylaxis Medication Due to Medical Reason From Day Of Start of Hospitalization To Day After First ICU Stay":
      "Encounter with ICU Location" QualifyingEncounterICU
        with "No VTE Prophylaxis Medication Administered or Ordered" NoVTEMedication
          such that NoVTEMedication.MedicationStatusReason in "Medical Reason For Not Providing Treatment"
            and NoVTEMedication.authoredOn during day of QualifyingEncounterICU.FromDayOfStartOfHospitalizationToDayAfterFirstICU ( )
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR No Mechanical VTE Prophylaxis Performed or Ordered
    define "No Mechanical VTE Prophylaxis Performed or Ordered":
      ( ( [ServiceNotRequested: "Venous foot pumps"]
          union [ServiceNotRequested: "Intermittent pneumatic compression devices"]
          union [ServiceNotRequested: "Graduated compression stockings"] ) DeviceNotOrder
          where DeviceNotOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
          return {
            id: DeviceNotOrder.id,
            requestStatusReason: DeviceNotOrder.reasonRefused,
            authoredOn: DeviceNotOrder.authoredOn
          }
      )
        union ( ( [ProcedureNotDone: "Application of Intermittent Pneumatic Compression Devices"]
            union [ProcedureNotDone: "Application of Venous Foot Pumps"]
            union [ProcedureNotDone: "Application of Graduated Compression Stockings"] ) DeviceNotApplied
            let DeviceNotDoneTiming: DeviceNotApplied.recorded
            return {
              id: DeviceNotApplied.id,
              requestStatusReason: DeviceNotApplied.statusReason,
              authoredOn: DeviceNotDoneTiming
            }
        )
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR No Mechanical VTE Prophylaxis Due to Medical Reason From Day of Start of Hospitalization To Day After First ICU Stay
    define "No Mechanical VTE Prophylaxis Due to Medical Reason From Day of Start of Hospitalization To Day After First ICU Stay":
      "Encounter with ICU Location" QualifyingEncounterICU
        with "No Mechanical VTE Prophylaxis Performed or Ordered" NoVTEDevice
          such that NoVTEDevice.requestStatusReason in "Medical Reason For Not Providing Treatment"
            and NoVTEDevice.authoredOn during day of QualifyingEncounterICU."FromDayOfStartOfHospitalizationToDayAfterFirstICU" ( )
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR No VTE Prophylaxis Medication Due to Medical Reason on Day of or Day After Procedure
    define "No VTE Prophylaxis Medication Due to Medical Reason on Day of or Day After Procedure":
      from
        "Encounter with ICU Location" QualifyingEncounterICU,
        ["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
        "No VTE Prophylaxis Medication Administered or Ordered" NoVTEMedication
        where NoVTEMedication.MedicationStatusReason in "Medical Reason For Not Providing Treatment"
          and AnesthesiaProcedure.status = 'completed'
          and AnesthesiaProcedure.performed.toInterval ( ) ends 1 day after day of QualifyingEncounterICU.StartOfFirstICU ( )
          and NoVTEMedication.authoredOn during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).CalendarDayOfOrDayAfter ( )
        return QualifyingEncounterICU
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR No Mechanical VTE Prophylaxis Due to Medical Reason on Day of or Day After Procedure
    define "No Mechanical VTE Prophylaxis Due to Medical Reason on Day of or Day After Procedure":
      from
        "Encounter with ICU Location" QualifyingEncounterICU,
        ["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
        "No Mechanical VTE Prophylaxis Performed or Ordered" NoVTEDevice
        where NoVTEDevice.requestStatusReason in "Medical Reason For Not Providing Treatment"
          and AnesthesiaProcedure.status = 'completed'
          and AnesthesiaProcedure.performed.toInterval ( ) ends 1 day after day of QualifyingEncounterICU.StartOfFirstICU ( )
          and NoVTEDevice.authoredOn during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).CalendarDayOfOrDayAfter ( )
        return QualifyingEncounterICU
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Encounter with No VTE Prophylaxis Due to Medical Reason
    define "Encounter with No VTE Prophylaxis Due to Medical Reason":
      ( "No VTE Prophylaxis Medication Due to Medical Reason From Day Of Start of Hospitalization To Day After First ICU Stay"
          intersect "No Mechanical VTE Prophylaxis Due to Medical Reason From Day of Start of Hospitalization To Day After First ICU Stay"
      )
        union ( "No VTE Prophylaxis Medication Due to Medical Reason on Day of or Day After Procedure"
            intersect "No Mechanical VTE Prophylaxis Due to Medical Reason on Day of or Day After Procedure"
        )
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR No Mechanical or Pharmacological VTE Prophylaxis Due to Patient Refusal
    define "No Mechanical or Pharmacological VTE Prophylaxis Due to Patient Refusal":
      ( "No VTE Prophylaxis Medication Administered or Ordered" NoVTEMedication
          where NoVTEMedication.MedicationStatusReason in "Patient Refusal"
      )
        union ( "No Mechanical VTE Prophylaxis Performed or Ordered" NoVTEDevice
            where NoVTEDevice.requestStatusReason in "Patient Refusal"
        )
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR No VTE Prophylaxis Due to Patient Refusal From Day of Start of Hospitalization To Day After First ICU Stay
    define "No VTE Prophylaxis Due to Patient Refusal From Day of Start of Hospitalization To Day After First ICU Stay":
      "Encounter with ICU Location" QualifyingEncounterICU
        with "No Mechanical or Pharmacological VTE Prophylaxis Due to Patient Refusal" PatientRefusal
          such that PatientRefusal.authoredOn during day of QualifyingEncounterICU.FromDayOfStartOfHospitalizationToDayAfterFirstICU ( )
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR No VTE Prophylaxis Due to Patient Refusal on Day of or Day After Procedure
    define "No VTE Prophylaxis Due to Patient Refusal on Day of or Day After Procedure":
      from
        "Encounter with ICU Location" QualifyingEncounterICU,
        ["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
        "No Mechanical or Pharmacological VTE Prophylaxis Due to Patient Refusal" PatientRefusal
        where AnesthesiaProcedure.status = 'completed'
          and AnesthesiaProcedure.performed.toInterval ( ) ends 1 day after day of QualifyingEncounterICU.StartOfFirstICU ( )
          and PatientRefusal.authoredOn during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).CalendarDayOfOrDayAfter ( )
        return QualifyingEncounterICU
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Encounter with No VTE Prophylaxis Due to Patient Refusal
    define "Encounter with No VTE Prophylaxis Due to Patient Refusal":
      "No VTE Prophylaxis Due to Patient Refusal From Day of Start of Hospitalization To Day After First ICU Stay"
        union "No VTE Prophylaxis Due to Patient Refusal on Day of or Day After Procedure"
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Numerator
    define "Numerator":
      "Encounter with VTE Prophylaxis Received on Day of or Day After First ICU Stay or Procedure"
        union ( "Encounter with Medication Oral Factor Xa Inhibitor Administered on Day of or Day After First ICU Stay or Procedure"
            intersect ( "Encounter with Prior or Present Diagnosis of Atrial Fibrillation or Prior Diagnosis of VTE"
                union "Encounter with Prior or Present Procedure of Hip or Knee Replacement Surgery"
            )
        )
        union "Encounter with Low Risk for VTE or Anticoagulant Administered"
        union "Encounter with No VTE Prophylaxis Due to Medical Reason"
        union "Encounter with No VTE Prophylaxis Due to Patient Refusal"
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Denominator
    define "Denominator":
      "Encounter with ICU Location"
    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
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR SDE Payer
    define "SDE Payer":
      SDE."SDE Payer"
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Initial Population
    define "Initial Population":
      VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions"
    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
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR SDE Ethnicity
    define "SDE Ethnicity":
      SDE."SDE Ethnicity"
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Encounter with ICU Location And Encounter Less Than 2 Days
    define "Encounter with ICU Location And Encounter Less Than 2 Days":
      "Encounter with ICU Location" QualifyingEncounterICU
        where QualifyingEncounterICU.period.lengthInDays ( ) < 2
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR SCIP VTE Selected Surgery
    define "SCIP VTE Selected Surgery":
      ( ["Procedure": "General Surgery"]
        union ["Procedure": "Gynecological Surgery"]
        union ["Procedure": "Hip Fracture Surgery"]
        union ["Procedure": "Hip Replacement Surgery"]
        union ["Procedure": "Intracranial Neurosurgery"]
        union ["Procedure": "Knee Replacement Surgery"]
        union ["Procedure": "Urological Surgery"] ) Procedure
        where Procedure.status = 'completed'
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Encounter with First ICU Stay with Principal Procedure of SCIP VTE Selected Surgery
    define "Encounter with First ICU Stay with Principal Procedure of SCIP VTE Selected Surgery":
      from
        "Encounter with ICU Location" QualifyingEncounterICU,
        "SCIP VTE Selected Surgery" SelectedProcedure
        let EncounterProcedure: singleton from ( QualifyingEncounterICU.procedure P
            where P.rank = 1
        )
        where EncounterProcedure.procedure.reference.getId ( ) = SelectedProcedure.id
          and end of SelectedProcedure.performed.toInterval ( ) during day of QualifyingEncounterICU.StartOfFirstICU ( ).CalendarDayOfOrDayAfter ( )
        return QualifyingEncounterICU
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Intervention Comfort Measures
    define "Intervention Comfort Measures":
      ( ["ServiceRequest": "Comfort Measures"] InterventionRequest
          where InterventionRequest.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
            and InterventionRequest.status in { 'active', 'on-hold', 'completed' }
            and InterventionRequest.doNotPerform is not true
      )
        union ( ["Procedure": "Comfort Measures"] InterventionPerformed
            where InterventionPerformed.status in { 'completed', 'in-progress' }
        )
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Encounter with Intervention Comfort Measures From Day Of Start of Hospitalization To Day After First ICU Stay
    define "Encounter with Intervention Comfort Measures From Day Of Start of Hospitalization To Day After First ICU Stay":
      "Encounter with ICU Location" QualifyingEncounterICU
        with "Intervention Comfort Measures" ComfortMeasure
          such that Coalesce(start of ComfortMeasure.performed.toInterval(), ComfortMeasure.authoredOn) during day of QualifyingEncounterICU.FromDayOfStartOfHospitalizationToDayAfterFirstICU ( )
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Encounter with Intervention Comfort Measures on Day of or Day After Procedure
    define "Encounter with Intervention Comfort Measures on Day of or Day After Procedure":
      from
        "Encounter with ICU Location" QualifyingEncounterICU,
        ["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
        "Intervention Comfort Measures" ComfortMeasure
        where AnesthesiaProcedure.status = 'completed'
          and AnesthesiaProcedure.performed.toInterval ( ) ends 1 day after day of QualifyingEncounterICU.StartOfFirstICU ( )
          and Coalesce(start of ComfortMeasure.performed.toInterval(), ComfortMeasure.authoredOn) during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).CalendarDayOfOrDayAfter ( )
        return QualifyingEncounterICU
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Denominator Exclusions
    define "Denominator Exclusions":
      "Encounter with ICU Location And Encounter Less Than 2 Days"
        union "Encounter with First ICU Stay with Principal Procedure of SCIP VTE Selected Surgery"
        union "Encounter with Intervention Comfort Measures From Day Of Start of Hospitalization To Day After First ICU Stay"
        union "Encounter with Intervention Comfort Measures on Day of or Day After Procedure"
    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
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR SDE Race
    define "SDE Race":
      SDE."SDE Race"
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Encounter with First ICU Location Stay Less Than 1 day
    define "Encounter with First ICU Location Stay Less Than 1 day":
      "Encounter with ICU Location" QualifyingEncounterICU
        where QualifyingEncounterICU.firstInpatientIntensiveCareUnit ( ).period.lengthInDays ( ) < 1
    Library Name Name
    IntensiveCareUnitVenousThromboembolismProphylaxisFHIR Denominator Exceptions
    define "Denominator Exceptions":
      "Encounter with First ICU Location Stay Less Than 1 day"
    Library Name Name
    CQMCommon encounterDiagnosis
    /*
    @description: Returns the Condition resources referenced by the diagnosis element of the Encounter
    */
    define fluent function encounterDiagnosis(Encounter Encounter ):
      Encounter.diagnosis D
        return singleton from ([Condition] C where C.id = D.condition.reference.getId())
    Library Name Name
    QICoreCommon getId
    /*
    @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, '/'))
    Library Name Name
    CQMCommon getLocation
    /*
    @description: Returns the Location resource specified by the given reference.
    */
    define fluent function getLocation(reference Reference ):
      singleton from (
        [Location] L where L.id = reference.reference.getId()
      )
    Library Name Name
    FHIRHelpers ToConcept
    /*
    @description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.
    */
    define function ToConcept(concept FHIR.CodeableConcept):
        if concept is null then
            null
        else
            System.Concept {
                codes: concept.coding C return ToCode(C),
                display: concept.text.value
            }
    Library Name Name
    TJCOverall CalendarDayOfOrDayAfter
    define fluent function CalendarDayOfOrDayAfter(StartValue DateTime):
      Interval [date from (StartValue), date from (StartValue) + 1 day]
    Library Name Name
    VTE StartOfFirstICU
    define fluent function "StartOfFirstICU"(Encounter Encounter ):
    	start of Encounter.firstInpatientIntensiveCareUnit().period
    Library Name Name
    CQMCommon firstInpatientIntensiveCareUnit
    /*
    @description: First Inpatient Intensive Care Unit returns the first intensive care unit for the given encounter, without considering any immediately prior emergency department visit.
    */
    define fluent function firstInpatientIntensiveCareUnit(Encounter Encounter ):
      First((Encounter.location)HospitalLocation
      			where GetLocation(HospitalLocation.location).type in "Intensive Care Unit"
      				and HospitalLocation.period during Encounter.period
      			sort by start of period
      	)
    Library Name Name
    CQMCommon GetLocation
    /*
    @description: Returns the Location resource specified by the given reference
    @deprecated: This function is deprecated. Use the fluent function `getLocation()` instead.
    */
    define function "GetLocation"(reference Reference ):
      singleton from (
        [Location] L where L.id = reference.reference.getId()
      )
    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 earliest
    /*
    @description: Given an interval, return the starting point if the interval has a starting boundary specified,
    otherwise, return the ending point
    */
    define fluent function earliest(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>> ):
      (choice.toInterval()) period
        return
          if (period."hasStart"()) then start of period
          else end of period
    Library Name Name
    VTE FromDayOfStartOfHospitalizationToDayAfterFirstICU
    define fluent function "FromDayOfStartOfHospitalizationToDayAfterFirstICU"(Encounter Encounter ):
    	Interval[date from (start of Encounter.hospitalizationWithObservation()), date from (Encounter.StartOfFirstICU()) + 1 day]
    Library Name Name
    CQMCommon hospitalizationWithObservation
    /*
    @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]
    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
    CQMCommon lengthInDays
    /*
    @description: Calculates the difference in calendar days between the start and end of the given interval.
    */
    define fluent function lengthInDays(Value Interval<DateTime> ):
      difference in days between start of Value and end of Value