Draft dQM CMS Content Implementation Guide
2025.1.0 - CI Build

Draft dQM CMS Content Implementation Guide, published by cqframework. This guide is not an authorized publication; it is the continuous build for version 2025.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/dqm-content-cms-2025/ and changes regularly. See the Directory of published versions

## Measure: Venous Thromboembolism ProphylaxisFHIR

Official URL: https://madie.cms.gov/Measure/CMS108FHIRVTEProphylaxis | Version: 1.1.000
Active as of 2026-01-16 | Responsible: The Joint Commission | Computable Name: CMS108FHIRVTEProphylaxis
Other Identifiers: Short Name: CMS108FHIR (use: usual, ), UUID:fa570e9c-c75f-4972-a77e-9488816d14af (use: official, ), UUID:b05a3fa8-ec68-4b88-a613-10274fada82e (use: official, ), Publisher: 108FHIR (use: official, )
Copyright/Legal: Measure specifications are in the Public Domain. LOINC(R) copyright 2004-2024 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2024 International Health Terminology Standards Development Organisation. ICD-10 copyright 2024 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 between the day of arrival to the day after hospital admission or surgery end date for surgeries that end the day after hospital admission

Metadata
Title | Venous Thromboembolism ProphylaxisFHIR
Version | 1.1.000
Short Name | CMS108FHIR
GUID (Version Independent) | urn:uuid:fa570e9c-c75f-4972-a77e-9488816d14af
GUID (Version Specific) | urn:uuid:b05a3fa8-ec68-4b88-a613-10274fada82e
CMS Identifier | 108FHIR
Effective Period | 2026-01-01 through 2026-12-31
Steward (Publisher) | The Joint Commission
Developer | 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 between the day of arrival to the day after hospital admission or surgery end date for surgeries that end the day after hospital admission
Copyright | Measure specifications are in the Public Domain. LOINC(R) copyright 2004-2024 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2024 International Health Terminology Standards Development Organisation. ICD-10 copyright 2024 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 | The estimated annual incidence of deep-vein thrombosis (DVT) and pulmonary embolism (PE), known collectively as venous thromboembolism (VTE), ranges from 350,000 to 600,000 (Maynard, 2016). According to the Centers for Disease Control and Prevention (CDC) 2020 statistics, 1-2 per 1,000 adults in the United States are clinically diagnosed with VTE each year (CDC, 2020). Increased incidence is reported in the elderly (1 per 100) compared to young adults (1 per 10,000) (Henke et al., 2020). 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). Hospitalized patients at high-risk for VTE may develop an asymptomatic DVT, and die from PE even before the diagnosis is suspected. The majority of fatal events occur as sudden or abrupt death, underscoring the importance of prevention as the most critical action step for reducing death from PE (Geerts et al., 2008). 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. (NOTE: 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.) Despite its proven effectiveness, VTE prophylaxis remains underused or inappropriately used in both medical and surgical patients (Kahn et al., 2018). The ENDORSE study evaluated prophylaxis rates in 17,084 major surgery patients and found that more than one third of patients at risk for VTE (38%) did not receive prophylaxis with various rates reported for different types of surgery (Cohen et al., 2008). More recently, a systemic review of multiple randomized controlled trials found that system-wide interventions, such as computer alerts to physicians and other healthcare professionals, increased the use of appropriate VTE prophylaxis while reducing the number of symptomatic VTE at three months (Kahn et al., 2018).
Clinical Recommendation Statement | Failure to recognize and protect patients at risk for venous thromboembolism (VTE) increases the chances for acutely ill hospitalized patients at high risk 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 hospitalized patients should be evaluated for primary VTE prophylaxis, and given appropriate prophylaxis when indicated.
Citation | Anderson, D. R., Morgano, G. P., Bennett, C., Dentali, F., Francis, C. W., Garcia, D. A., . . . Dahm, P. (2019). American Society of Hematology 2019 guidelines for management of venous thromboembolism: Prevention of venous thromboembolism in surgical hospitalized patients. Blood Advances, 3(23), 3898-3944. doi: 10.1182/bloodadvances.2019000975.
Citation | Cohen, A. T., Tapson, V. F., Bergmann, J. F., et al. (2008). Venous thromboembolism risk and prophylaxis in the acute hospital care setting (ENDORSE study): A multinational cross-sectional study. Lancet, 371, 387-394.
Citation | Geerts, W. H., Bergqvist, D., Pineo, G. F., et al. (2008). Prevention of venous thromboembolism: The Eighth ACCP Conference on Antithrombotic and Thrombolytic Therapy. Chest, 133, 381S-453S.
Citation | Guyatt, G. H., Akl, E. A., Crowther, M., et al. (2012). Antithrombotic therapy and prevention of thrombosis, 9th edition: American College of Chest Physicians evidence-based clinical practice guidelines. Chest, 141(2 Suppl.), 7S-47S.
Citation | Kearon, C., Akl, E. A., Comerota, A. J., et al. (2012, February). Antithrombotic therapy for VTE disease: Antithrombotic therapy and prevention of thrombosis, 9th edition: American College of Chest Physicians evidence-based clinical practice guidelines. Chest, 141(2 Suppl.), e419S-e494S.
Citation | National Quality Forum. (2006). National voluntary consensus standards for prevention and care of venous thromboembolism: Policy, preferred practices, and initial performance measures-A consensus report. Washington, DC: National Quality Forum.
Citation | Shojania, K. G., Duncan, B. W., McDonald, D. M., et al. (eds.). (2001). Making health care safer: A critical analysis of patient safety practices. Evidence Report/Technology Assessment No. 43. Rockville, MD: Agency for Healthcare Research and Quality.
Guidance (Usage) | When low dose unfractionated heparin is administered for VTE prophylaxis, the intended administration route for low dose unfractionated heparin is subcutaneous. Reasons for no pharmacological and no mechanical VTE prophylaxis must be explicitly documented by the medical doctor, advanced practice registered nurse, physician assistant, or pharmacist and linked with VTE prophylaxis. The only exception is patient refusal may be documented by a nurse. 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." This measure does not require the use of a specific risk assessment model or tool (e.g., Caprini, Padua, and IMPROVE) to determine VTE risk. 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. Inpatient hospitalizations for patients with a principal procedure of selected surgeries are excluded from the measure's denominator. Selected surgeries include general surgery, gynecological surgery, hip fracture surgery, hip/knee replacement surgery, intracranial neurosurgery, and urological surgery. Inpatient hospitalizations for patients administered apixaban or edoxaban, medications included in the "Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment" value set, would be counted in the numerator population only when the patients also have either a prior or present diagnosis of atrial fibrillation, a prior diagnosis of VTE, or a prior or present procedure of hip/knee replacement surgery. This dQM 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: CMS108v14. Please refer to the HL7 QI-Core Implementation Guide (https://hl7.org/fhir/us/qicore/STU6/) for more information on QI-Core and mapping recommendations from QDM to QI-Core STU 6. (https://hl7.org/fhir/us/qicore/STU6/qdm-to-qicore.html)
Measure Group (Rate) (ID: Group_1)
Basis | Encounter
Scoring | Proportion
Improvement Notation | Increased score indicates improvement
Type | Process
Rate Aggregation | None
Initial Population | ID: InitialPopulation_1 Description: 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 Criteria: Initial Population
Denominator | ID: Denominator_1 Description: Equals Initial Population Criteria: Denominator
Denominator Exclusion | ID: DenominatorExclusion_1 Description: * Inpatient hospitalizations for patients who have a length of stay less than 2 days * Inpatient hospitalizations for patients who are direct admits to intensive care unit (ICU), or transferred to ICU the day of or the day after hospital admission with ICU length of stay greater than or equal to one day * Inpatient hospitalizations for patients with a principal diagnosis of mental disorders or stroke * Inpatient hospitalizations for patients with a principal procedure of selected surgeries * Inpatient hospitalizations for patients with comfort measures documented anytime between the day of arrival and the day after hospital admission * Inpatient hospitalizations for patients with comfort measures documented by the day after surgery end date for surgeries that end the day after hospital admission Criteria: Denominator Exclusions
Numerator | ID: Numerator_1 Description: Inpatient hospitalizations for patients who received VTE prophylaxis: * between the day of arrival and the day after hospital admission * the day of or the day after surgery end date (for surgeries that end the day after hospital admission) 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 hospital admission * the day of or the day after surgery end date (for surgeries that end the day after hospital admission) Criteria: Numerator
Supplemental Data Guidance Guidance | <p>For every patient evaluated by this measure also identify payer, race, ethnicity and sex</p>
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-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
Supplemental Data Element | ID: sde-payer Usage Code: Supplemental Data Description: SDE Payer Logic Definition: SDE Payer
Measure Logic
Primary Library | CMS108FHIRVTEProphylaxis
Contents | Population Criteria Logic Definitions Terminology Dependencies Data Requirements Parameters
Population Criteria
Measure Group (Rate) (ID: Group_1)
Initial Population
    define "Initial Population":
      VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions"
Definition
Denominator
    define "Denominator":
      "Initial Population"
Definition
Denominator Exclusion
    define "Denominator Exclusions":
      "Encounter Less Than 2 Days"
        union "Encounter With ICU Location Stay 1 Day Or More"
        union "Encounter With Principal Diagnosis Of Mental Disorder Or Stroke"
        union "Encounter With Principal Procedure Of Selected Surgery"
        union "Encounter With Intervention Comfort Measures From Day Of Start Of Hospitalization To Day After Admission"
        union "Encounter With Intervention Comfort Measures On Day Of Or Day After Procedure"
Definition
Numerator
    define "Numerator":
      "Encounter With VTE Prophylaxis Received From Day Of Start Of Hospitalization To Day After Admission Or Procedure"
        union ( "Encounter With Medication Oral Factor Xa Inhibitor Administered On Day Of Or Day After Admission 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"
Definition
Logic Definitions
Logic Definition | Library Name: SupplementalDataElements
    define "SDE Sex":
      case
        when Patient.sex() = '248153007' then "Male (finding)"
        when Patient.sex() = '248152002' then "Female (finding)"
        else null
      end
Logic Definition | Library Name: SupplementalDataElements
    define "SDE Payer":
      [USQualityCore.Coverage: type in "Payer Type"] Payer
        return {
          code: Payer.type,
          period: Payer.period
        }
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: SupplementalDataElements
    define "SDE Race":
      (Patient.race()) R
        return Tuple {
          codes: R.ombCategory union R.detailed,
          display: R.text
        }
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "SDE Sex":
      SDE."SDE Sex"
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    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"] WarfarinAdm
            where WarfarinAdm.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'
        )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "Encounter With VTE Prophylaxis Received From Day Of Start Of Hospitalization To Day After Admission Or Procedure":
      ( from
          VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter,
          "Pharmacological or Mechanical VTE Prophylaxis Received" VTEProphylaxis
          where Coalesce(VTEProphylaxis.effective.toInterval(), VTEProphylaxis.performed.toInterval()) starts during day of QualifyingEncounter.fromDayOfStartOfHospitalizationToDayAfterAdmission ( )
          return QualifyingEncounter
      )
        union ( from
            VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter,
            ["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 start of QualifyingEncounter.period
              and Coalesce(VTEProphylaxis.effective.toInterval(), VTEProphylaxis.performed.toInterval()) starts during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).calendarDayOfOrDayAfter ( )
            return QualifyingEncounter
        )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "Encounter With Medication Oral Factor Xa Inhibitor Administered On Day Of Or Day After Admission Or Procedure":
      ( from
          VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter,
          ["MedicationAdministration": "Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment"] FactorXaMedication
          where FactorXaMedication.status = 'completed'
            and FactorXaMedication.effective.toInterval ( ) starts during day of ( start of QualifyingEncounter.period ).calendarDayOfOrDayAfter ( )
          return QualifyingEncounter
      )
        union ( from
            VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter,
            ["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 start of QualifyingEncounter.period
              and FactorXaMedication.effective.toInterval ( ) starts during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).calendarDayOfOrDayAfter ( )
            return QualifyingEncounter
        )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "Encounter With Prior Or Present Diagnosis Of Atrial Fibrillation Or Prior Diagnosis Of VTE":
      ( VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter
          with ["ConditionProblemsHealthConcerns": "Atrial Fibrillation or Flutter"] AtrialFibrillation
            such that AtrialFibrillation.verificationStatus is not null implies ( AtrialFibrillation.verificationStatus !~ FHIRCommon."refuted"
                and AtrialFibrillation.verificationStatus !~ FHIRCommon."entered-in-error"
            )
              and AtrialFibrillation.onset.toInterval ( ) starts on or before end of QualifyingEncounter.period
      )
        union ( VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter
            where QualifyingEncounter.hasEncDiagnosisOf ( "Atrial Fibrillation or Flutter" )
        )
        union ( VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter
            with ["ConditionProblemsHealthConcerns": "Venous Thromboembolism"] VTEDiagnosis
              such that ( VTEDiagnosis.clinicalStatus ~ FHIRCommon."inactive"
                  or VTEDiagnosis.clinicalStatus ~ FHIRCommon."remission"
                  or VTEDiagnosis.clinicalStatus ~ FHIRCommon."resolved"
              )
                and VTEDiagnosis.verificationStatus is not null implies ( VTEDiagnosis.verificationStatus !~ FHIRCommon."refuted"
                  and VTEDiagnosis.verificationStatus !~ FHIRCommon."entered-in-error"
              )
                and VTEDiagnosis.onset.toInterval ( ) before start of QualifyingEncounter.period
        )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "Encounter With Prior Or Present Procedure Of Hip Or Knee Replacement Surgery":
      VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter
        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 QualifyingEncounter.period
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "Low Risk Indicator For VTE":
      ( ["SimpleObservation": "Risk for venous thromboembolism"] VTERiskAssessment
          where VTERiskAssessment.value as FHIR.CodeableConcept in "Low Risk"
            and VTERiskAssessment.status in { 'final', 'amended', 'corrected' }
          return {
            id: VTERiskAssessment.id,
            LowRiskDatetime: VTERiskAssessment.effective.earliest ( )
          }
      )
        union ( ["LaboratoryResultObservation": "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 ( )
            }
        )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "Low Risk For VTE Or Anticoagulant Administered From Day Of Start Of Hospitalization To Day After Admission":
      VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter
        with "Low Risk Indicator For VTE" LowRiskForVTE
          such that LowRiskForVTE.LowRiskDatetime during day of QualifyingEncounter.fromDayOfStartOfHospitalizationToDayAfterAdmission ( )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "Low Risk For VTE Or Anticoagulant Administered On Day Of Or Day After Procedure":
      from
        VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter,
        ["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 start of QualifyingEncounter.period
          and LowRiskForVTE.LowRiskDatetime during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).calendarDayOfOrDayAfter ( )
        return QualifyingEncounter
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    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 Admission"
        union "Low Risk For VTE Or Anticoagulant Administered On Day Of Or Day After Procedure"
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    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' }
              and NoMedicationOrder.status in { 'active', 'completed' }
            return {
              id: NoMedicationOrder.id,
              medicationStatusReason: NoMedicationOrder.reasonCode,
              authoredOn: NoMedicationOrder.authoredOn
            }
        )
        union ( from
            ( ["MedicationRequest": "Low Dose Unfractionated Heparin for VTE Prophylaxis"]
              union ["MedicationRequest": "Low Molecular Weight Heparin for VTE Prophylaxis"]
              union ["MedicationRequest": "Injectable Factor Xa Inhibitor for VTE Prophylaxis"]
              union ["MedicationRequest": "Warfarin"]
              union ["MedicationRequest": "Rivaroxaban for VTE Prophylaxis"] ) MedicationOrderReject,
            [TaskRejected] T
            where T.focus.references ( MedicationOrderReject )
              and T.code ~ USQualityCoreCommon."Fulfill"
              and MedicationOrderReject.status = 'active'
            return {
              id: MedicationOrderReject.id,
              medicationStatusReason: { T.statusReason },
              authoredOn: MedicationOrderReject.authoredOn
            }
        )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "No VTE Prophylaxis Medication Due To Medical Reason From Day Of Start Of Hospitalization To Day After Admission":
      VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter
        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 QualifyingEncounter.fromDayOfStartOfHospitalizationToDayAfterAdmission ( )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    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 ( from
            ( [ServiceRequest: "Venous foot pumps"]
              union [ServiceRequest: "Intermittent pneumatic compression devices"]
              union [ServiceRequest: "Graduated compression stockings"] ) DeviceOrderReject,
            [TaskRejected] T
            where DeviceOrderReject.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
              and DeviceOrderReject.status = 'active'
              and T.focus.references ( DeviceOrderReject )
              and T.code ~ USQualityCoreCommon."Fulfill"
            return {
              id: DeviceOrderReject.id,
              requestStatusReason: T.statusReason,
              authoredOn: DeviceOrderReject.authoredOn
            }
        )
        union ( ( [ProcedureNotDone: "Application of Intermittent Pneumatic Compression Devices"]
            union [ProcedureNotDone: "Application of Venous Foot Pumps"]
            union [ProcedureNotDone: "Application of Graduated Compression Stockings"] ) DeviceNotApplied
            return {
              id: DeviceNotApplied.id,
              requestStatusReason: DeviceNotApplied.statusReason,
              authoredOn: DeviceNotApplied.recorded()
            }
        )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "No Mechanical VTE Prophylaxis Due To Medical Reason From Day Of Start Of Hospitalization To Day After Admission":
      VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter
        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 QualifyingEncounter.fromDayOfStartOfHospitalizationToDayAfterAdmission ( )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "No VTE Prophylaxis Medication Due To Medical Reason On Day Of Or Day After Procedure":
      from
        VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter,
        ["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 start of QualifyingEncounter.period
          and NoVTEMedication.authoredOn during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).calendarDayOfOrDayAfter ( )
        return QualifyingEncounter
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "No Mechanical VTE Prophylaxis Due To Medical Reason On Day Of Or Day After Procedure":
      from
        VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter,
        ["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 start of QualifyingEncounter.period
          and NoVTEDevice.authoredOn during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).calendarDayOfOrDayAfter ( )
        return QualifyingEncounter
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    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 Admission"
          intersect "No Mechanical VTE Prophylaxis Due To Medical Reason From Day Of Start Of Hospitalization To Day After Admission"
      )
        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"
        )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "No Mechanical Or Pharmacological VTE Prophylaxis Due To Patient Refusal":
      ( "No VTE Prophylaxis Medication Administered Or Ordered" NoVTEMedication
          where exists ( NoVTEMedication.medicationStatusReason MedRsn
              where MedRsn in "Patient Refusal"
          )
      )
        union ( "No Mechanical VTE Prophylaxis Performed Or Ordered" NoVTEDevice
            where NoVTEDevice.requestStatusReason in "Patient Refusal"
        )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "No VTE Prophylaxis Due To Patient Refusal From Day Of Start Of Hospitalization To Day After Admission":
      VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter
        with "No Mechanical Or Pharmacological VTE Prophylaxis Due To Patient Refusal" PatientRefusal
          such that PatientRefusal.authoredOn during day of QualifyingEncounter.fromDayOfStartOfHospitalizationToDayAfterAdmission ( )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "No VTE Prophylaxis Due To Patient Refusal On Day Of Or Day After Procedure":
      from
        VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter,
        ["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 start of QualifyingEncounter.period
          and PatientRefusal.authoredOn during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).calendarDayOfOrDayAfter ( )
        return QualifyingEncounter
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    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 Admission"
        union "No VTE Prophylaxis Due To Patient Refusal On Day Of Or Day After Procedure"
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "Numerator":
      "Encounter With VTE Prophylaxis Received From Day Of Start Of Hospitalization To Day After Admission Or Procedure"
        union ( "Encounter With Medication Oral Factor Xa Inhibitor Administered On Day Of Or Day After Admission 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"
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "Initial Population":
      VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions"
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "Denominator":
      "Initial Population"
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "SDE Payer":
      SDE."SDE Payer"
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "SDE Ethnicity":
      SDE."SDE Ethnicity"
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "Encounter Less Than 2 Days":
      VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter
        where QualifyingEncounter.period.lengthInDays ( ) < 2
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "Encounter With ICU Location Stay 1 Day Or More":
      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.lengthInDays ( ) >= 1
              and Location.period starts on or after start of QualifyingEncounter.period
              and date from ( start of Location.period ) during ( start of QualifyingEncounter.period ).calendarDayOfOrDayAfter ( )
        )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "Encounter With Principal Diagnosis Of Mental Disorder Or Stroke":
      VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter
        where QualifyingEncounter.hasPrincipalDiagnosisOf ( "Mental Health Diagnoses" )
          or QualifyingEncounter.hasPrincipalDiagnosisOf ( "Hemorrhagic Stroke" )
          or QualifyingEncounter.hasPrincipalDiagnosisOf ( "Ischemic Stroke" )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "Encounter With Principal Procedure Of Selected Surgery":
      VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter
        where QualifyingEncounter.hasPrincipalProcedureOf ( "General Surgery" )
          or QualifyingEncounter.hasPrincipalProcedureOf ( "Gynecological Surgery" )
          or QualifyingEncounter.hasPrincipalProcedureOf ( "Hip Fracture Surgery" )
          or QualifyingEncounter.hasPrincipalProcedureOf ( "Hip Replacement Surgery" )
          or QualifyingEncounter.hasPrincipalProcedureOf ( "Intracranial Neurosurgery" )
          or QualifyingEncounter.hasPrincipalProcedureOf ( "Knee Replacement Surgery" )
          or QualifyingEncounter.hasPrincipalProcedureOf ( "Urological Surgery" )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    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', 'completed' }
      )
        union ( ["Procedure": "Comfort Measures"] InterventionPerformed
            where InterventionPerformed.status in { 'completed', 'in-progress' }
        )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "Encounter With Intervention Comfort Measures From Day Of Start Of Hospitalization To Day After Admission":
      VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter
        with "Intervention Comfort Measures" ComfortMeasure
          such that Coalesce(start of ComfortMeasure.performed.toInterval(), ComfortMeasure.authoredOn) during day of QualifyingEncounter.fromDayOfStartOfHospitalizationToDayAfterAdmission ( )
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "Encounter With Intervention Comfort Measures On Day Of Or Day After Procedure":
      from
        VTE."Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions" QualifyingEncounter,
        ["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
        "Intervention Comfort Measures" ComfortMeasure
        where AnesthesiaProcedure.status = 'completed'
          and AnesthesiaProcedure.performed.toInterval ( ) ends 1 day after day of start of QualifyingEncounter.period
          and Coalesce(start of ComfortMeasure.performed.toInterval(), ComfortMeasure.authoredOn) during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).calendarDayOfOrDayAfter ( )
        return QualifyingEncounter
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "Denominator Exclusions":
      "Encounter Less Than 2 Days"
        union "Encounter With ICU Location Stay 1 Day Or More"
        union "Encounter With Principal Diagnosis Of Mental Disorder Or Stroke"
        union "Encounter With Principal Procedure Of Selected Surgery"
        union "Encounter With Intervention Comfort Measures From Day Of Start Of Hospitalization To Day After Admission"
        union "Encounter With Intervention Comfort Measures On Day Of Or Day After Procedure"
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define "SDE Race":
      SDE."SDE Race"
Logic Definition | Library Name: CMS108FHIRVTEProphylaxis
    define fluent function "fromDayOfStartOfHospitalizationToDayAfterAdmission"(Encounter Encounter):
      Interval[date from ( start of Encounter.hospitalizationWithObservation ( ) ), date from ( start of Encounter.period ) + 1 days]
Logic Definition | Library Name: TJCOverall
    define fluent function calendarDayOfOrDayAfter(StartValue DateTime):
      Interval [date from (StartValue), date from (StartValue) + 1 day]
Logic Definition | Library Name: USQualityCoreCommon
    /*
    @description: Returns the value of the recorded extension for a Medication Administration Not Done
    */
    define fluent function recorded(medicationAdministrationNotDone MedicationAdministrationNotDone):
      medicationAdministrationNotDone.ext('http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-recorded').value as FHIR.dateTime
Logic Definition | Library Name: USQualityCoreCommon
    /*
    @description: Returns the value of the recorded extension for a Medication Administration Not Done
    */
    define fluent function reasonRefused(serviceNotRequested ServiceNotRequested):
      serviceNotRequested.ext('http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-doNotPerformReason').value as FHIR.CodeableConcept
Logic Definition | Library Name: USQualityCoreCommon
    /*
    @description: Returns the value of the recorded extension for a Medication Administration Not Done
    */
    define fluent function recorded(procedureNotDone ProcedureNotDone):
      procedureNotDone.ext('http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-recorded').value as FHIR.dateTime
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value string): value.value
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value uri): value.value
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value EncounterStatus): value.value
Logic Definition | Library Name: FHIRHelpers
    /*
    @description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)
    value to a CQL DateTime Interval
    @comment: If the start value of the given period is unspecified, the starting
    boundary of the resulting interval will be open (meaning the start of the interval
    is unknown, as opposed to interpreted as the beginning of time).
    */
    define function ToInterval(period FHIR.Period):
        if period is null then
            null
        else
            if period."start" is null then
                Interval(period."start".value, period."end".value]
            else
                Interval[period."start".value, period."end".value]
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: 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: FHIRHelpers
    define function ToDate(value date): value.value
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value MedicationAdministrationStatus): value.value
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value ProcedureStatus): value.value
Logic Definition | Library Name: FHIRHelpers
    define function ToDateTime(value dateTime): value.value
Logic Definition | Library Name: FHIRHelpers
    define function ToDateTime(value instant): value.value
Logic Definition | Library Name: FHIRHelpers
    /*
    @description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity)
    value to a CQL Quantity
    @comment: If the given quantity has a comparator specified, a runtime error is raised. If the given quantity
    has a system other than UCUM (i.e. `http://unitsofmeasure.org`) or CQL calendar units (i.e. `http://hl7.org/fhirpath/CodeSystem/calendar-units`)
    an error is raised. For UCUM to calendar units, the `ToCalendarUnit` function is used.
    @seealso: ToCalendarUnit
    */
    define function ToQuantity(quantity FHIR.Quantity):
        case
            when quantity is null then null
            when quantity.value is null then null
            when quantity.comparator is not null then
                Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')
            when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'
                  or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then
                System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }
            else
                Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' & quantity.unit.value & ' (' & quantity.system.value & '|' & quantity.code.value & ')')
        end
Logic Definition | Library Name: FHIRHelpers
    /*
    @description: Converts a UCUM definite duration unit to a CQL calendar duration
    unit using conversions specified in the [quantities](https://cql.hl7.org/02-authorsguide.html#quantities)
    topic of the CQL specification.
    @comment: Note that for durations above days (or weeks), the conversion is understood to be approximate
    */
    define function ToCalendarUnit(unit System.String):
        case unit
            when 'ms' then 'millisecond'
            when 's' then 'second'
            when 'min' then 'minute'
            when 'h' then 'hour'
            when 'd' then 'day'
            when 'wk' then 'week'
            when 'mo' then 'month'
            when 'a' then 'year'
            else unit
        end
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value ObservationStatus): value.value
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value MedicationRequestIntent): value.value
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value MedicationRequestStatus): value.value
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value ServiceRequestIntent): value.value
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value ServiceRequestStatus): value.value
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value ClaimStatus): value.value
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value Use): value.value
Logic Definition | Library Name: FHIRCommon
    /*
    @description: Returns the single extension (if present) on the given resource with the specified url.
    @comment: This function uses singleton from to ensure that a run-time exception is thrown if there
    is more than one extension on the given resource with the specified url.
    */
    define fluent function ext(domainResource DomainResource, url String):
      singleton from domainResource.exts(url)
Logic Definition | Library Name: FHIRCommon
    /*
    @description: Returns any extensions defined on the given resource with the specified url
    */
    define fluent function exts(domainResource DomainResource, url String):
      domainResource.extension E
        where E.url = url
        return E
Logic Definition | Library Name: FHIRCommon
    /*
    @description: Returns true if the given reference is to the given resourceId
    @comment: Returns true if the `resourceId` parameter exactly equals the tail of the given reference.
    NOTE: This function assumes resources from the same source server.
    */
    define fluent function references(reference FHIR.Reference, resourceId String):
      resourceId = Last(Split(reference.reference, '/'))
Logic Definition | Library Name: FHIRCommon
    /*
    @description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
    @comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range types
    to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible
    representations for timing-valued elements in FHIR, allowing this function to be used across any resource.

    The input can be provided as a dateTime, Period, Timing, instant, string, Age, or Range.
    The intent of this function is to provide a clear and concise mechanism to treat single
    elements that have multiple possible representations as intervals so that logic doesn't have to account
    for the variability. More complex calculations (such as medication request period or dispense period
    calculation) need specific guidance and consideration. That guidance may make use of this function, but
    the focus of this function is on single element calculations where the semantics are unambiguous.
    If the input is a dateTime, the result a DateTime Interval beginning and ending on that dateTime.
    If the input is a Period, the result is a DateTime Interval.
    If the input is a Timing, an error is raised indicating a single interval cannot be computed from a Timing.
    If the input is an instant, the result is a DateTime Interval beginning and ending on that instant.
    If the input is a string, an error is raised indicating a single interval cannot be computed from a string.
    If the input is an Age, the result is a DateTime Interval beginning when the patient was the given Age,
    and ending immediately prior to when the patient was the given Age plus one year.
    If the input is a Range, the result is a DateTime Interval beginning when the patient was the Age given
    by the low end of the Range, and ending immediately prior to when the patient was the Age given by the
    high end of the Range plus one year.

    NOTE: Due to the
    complexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used
    with a Timing or String.
    */
    define fluent function toInterval(choice Choice<FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range>):
      case
        when choice is FHIR.dateTime then
          Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]
        when choice is FHIR.Period then
          FHIRHelpers.ToInterval(choice as FHIR.Period)
        when choice is FHIR.instant then
          Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]
        when choice is FHIR.Age then
          Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),
            FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)
        when choice is FHIR.Range then
          Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),
            FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)
        when choice is FHIR.Timing then
          Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported')
        when choice is FHIR.string then
          Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')
        else
          null as Interval<DateTime>
      end
Logic Definition | Library Name: FHIRCommon
    /*
    @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<FHIR.dateTime, FHIR.Period, FHIR.Age, FHIR.Range>):
      (choice.toInterval()) period
        return
          if (period.hasStart()) then start of period
          else end of period
Logic Definition | Library Name: FHIRCommon
    /*
    @description: Given an interval, return true if the interval has a starting boundary specified
    (i.e. the start of the interval is not null and not the minimum DateTime value)
    */
    define fluent function hasStart(period Interval<DateTime>):
      not ( start of period is null
          or start of period = minimum DateTime
      )
Logic Definition | Library Name: FHIRCommon
    /*
    @description: Returns true if the given reference is to the given resource
    @comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.
    NOTE: This function assumes resources from the same source server.
    */
    define fluent function references(reference FHIR.Reference, resource FHIR.Resource):
      resource.id = Last(Split(reference.reference, '/'))
Logic Definition | Library Name: FHIRCommon
    /*
    @description: Returns the single extension (if present) on the given element with the specified url.
    @comment: This function uses singleton from to ensure that a run-time exception is thrown if there
    is more than one extension on the given element with the specified url.
    */
    define fluent function ext(element Element, url String):
      singleton from element.exts(url)
Logic Definition | Library Name: FHIRCommon
    /*
    @description: Returns any extensions defined on the given element with the specified url.
    */
    define fluent function exts(element Element, url String):
      element.extension E
        where E.url = url
        return E
Logic Definition | Library Name: FHIRCommon
    /*
    @description: Returns true if any of the given references are to the given resource
    @comment: Returns true if the `id` element of the given resource exactly equals the tail of any of the given references.
    NOTE: This function assumes resources from the same source server.
    */
    define fluent function references(references List<FHIR.Reference>, resource FHIR.Resource):
      exists (references R where R.references(resource))
Logic Definition | Library Name: FHIRCommon
    /*
    @description: Returns true if the given code is in the given codeList
    @comment: Returns true if the `code` is equivalent to any of the codes in the given `codeList`, false otherwise.
    */
    define fluent function includesCode(codeList List<CodeableConcept>, code Concept):
      exists (codeList C where C ~ code)
Logic Definition | Library Name: VTE
    define "Admission Without VTE Or Obstetrical Conditions":
      CQMCommon."Inpatient Encounter" InpatientEncounter
      where not (InpatientEncounter.hasEncDiagnosisOf("Obstetrical or Pregnancy Related Conditions")
                 or InpatientEncounter.hasEncDiagnosisOf("Venous Thromboembolism")
                 or InpatientEncounter.hasEncDiagnosisOf("Obstetrics VTE")
                )
Logic Definition | Library Name: VTE
    define "Encounter With Age Range And Without VTE Diagnosis Or Obstetrical Conditions":
     "Admission Without VTE Or Obstetrical Conditions" EncounterWithoutConditions
         where AgeInYearsAt(date from start of EncounterWithoutConditions.period) >= 18
Logic Definition | Library Name: VTE
    define fluent function hasEncDiagnosisOf(TheEncounter Encounter, DiagnosisValueSet System.ValueSet):
       TheEncounter E
         return (E.encounterDiagnosis()).code in DiagnosisValueSet
           or E.reasonCode in DiagnosisValueSet
Logic Definition | Library Name: VTE
    define fluent function hasPrincipalProcedureOf(TheEncounter Encounter, DiagnosisValueSet System.ValueSet):
       TheEncounter E
       let
            PPx: E.principalProcedure(),
            CPx: singleton from ([Procedure] P where PPx.procedure.references(P.id))
         return PPx.procedure in DiagnosisValueSet
           or CPx.code in DiagnosisValueSet
Logic Definition | Library Name: CQMCommon
    define "Inpatient Encounter":
      [Encounter: "Encounter Inpatient"] EncounterInpatient
        where EncounterInpatient.status = 'finished'
          and EncounterInpatient.period ends during day of "Measurement Period"
Logic Definition | Library Name: CQMCommon
    /*
    @description: Returns the Condition resources referenced by the diagnosis element of the Encounter
    */
    define fluent function encounterDiagnosis(Encounter Encounter ):
      Encounter.reasonReference D
        return singleton from (([ConditionEncounterDiagnosis] union [ConditionProblemsHealthConcerns]) C where D.references(C.id))
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: CQMCommon
    /*
    @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
Logic Definition | Library Name: CQMCommon
    /*
    @description: Returns the Location resource specified by the given reference.
    */
    define fluent function getLocation(reference Reference):
      singleton from (
        [Location] L where reference.references(L)
      )
Logic Definition | Library Name: CQMCommon
    /*
     @description: Returns the condition that is specified as the principal diagnosis for the encounter and has a code in the given valueSet.
     @comment: See the QICore 6 Authoring Patterns discussion on [Principal Diagnosis and Present on Admission](https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns-QICore-v6.0.0#conditions-present-on-admission-and-principal-diagnoses) for more information
     */
     define fluent function hasPrincipalDiagnosisOf(encounter Encounter, valueSet System.ValueSet):
       (encounter.principalDiagnosis()) PD
         return PD.diagnosis in valueSet
           or PD.diagnosis.getCondition().code in valueSet
Logic Definition | Library Name: CQMCommon
    /*
    @description: Returns the claim diagnosis element that is specified as the principal diagnosis for the encounter
     @comment: See the QICore 6 Authoring Patterns discussion on [Principal Diagnosis and Present on Admission](https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns-QICore-v6.0.0#conditions-present-on-admission-and-principal-diagnoses) for more information
    */
    define fluent function principalDiagnosis(encounter Encounter):
    singleton from (
         (encounter.claimDiagnosis()) CD
           where CD.type.includesCode("Principal Diagnosis")
       )
Logic Definition | Library Name: CQMCommon
    /*
    @description: Returns the claim diagnosis elements for the given encounter
    @comment: See the QICore 6 Authoring Patterns discussion on [Principal Diagnosis and Present on Admission](https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns-QICore-v6.0.0#conditions-present-on-admission-and-principal-diagnoses) for more information
    */
    define fluent function claimDiagnosis(encounter Encounter):
      encounter E
        let
          claim: ([Claim] C where C.status = 'active' and C.use = 'claim' and exists (C.item I where I.encounter.references(E))),
          claimItem: (claim.item I where I.encounter.references(E))
        return claim.diagnosis D where D.sequence in claimItem.diagnosisSequence
Logic Definition | Library Name: CQMCommon
    /*
    @description: Returns the Condition resource for the given reference
    */
    define fluent function getCondition(reference Reference):
      singleton from (([ConditionEncounterDiagnosis] union [ConditionProblemsHealthConcerns]) C where reference.references(C.id))
Logic Definition | Library Name: CQMCommon
    /*
    @description: Returns the claim procedure elements for the given encounter
    */
    define fluent function principalProcedure(encounter Encounter):
      	 encounter E
      	 let
            claim: [Claim] C where C.status = 'active' and C.use = 'claim' and exists (C.item I where I.encounter.references(E)),
            claimItem: claim.item I where I.encounter.references(E),
            princProcedure: singleton from (claim.procedure P where P.sequence in claimItem.procedureSequence and P.type.includesCode("Primary procedure"))
        return princProcedure
Logic Definition | Library Name: USCoreCommon
    /*
    @description: Returns the sex element as defined for the USCore patient profile
    */
    define fluent function sex(patient Patient):
      patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-sex').value as FHIR.code
Logic Definition | Library Name: USCoreCommon
    define fluent function ethnicity(patient Patient):
      (patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity')) E
        return {
          ombCategory: E.ext('ombCategory').value as FHIR.Coding,
          detailed: (E.exts('detailed')) d return d.value as FHIR.Coding,
          text: E.ext('text').value as FHIR.string
        }
Logic Definition | Library Name: USCoreCommon
    define fluent function race(patient Patient):
      (patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-race')) E
        return {
          ombCategory: (E.exts('ombCategory')) o return o.value as FHIR.Coding,
          detailed: (E.exts('detailed')) d return d.value as FHIR.Coding,
          text: E.ext('text').value as FHIR.string
        }
Terminology
Code System | Description: Code system SNOMEDCT Resource: SNOMED CT (all versions) Canonical URL: `http://snomed.info/sct`
Code System | Description: Code system ConditionVerificationStatusCodes Resource: ConditionVerificationStatus Canonical URL: `http://terminology.hl7.org/CodeSystem/condition-ver-status`
Code System | Description: Code system ConditionClinicalStatusCodes Resource: Condition Clinical Status Codes Canonical URL: `http://terminology.hl7.org/CodeSystem/condition-clinical`
Code System | Description: Code system LOINC Resource: Logical Observation Identifiers, Names and Codes (LOINC) Canonical URL: `http://loinc.org`
Code System | Description: Code system TaskCodeSystem Resource: Task Codes Canonical URL: `http://hl7.org/fhir/CodeSystem/task-code`
Code System | Description: Code system Diagnosis Type Resource: Example Diagnosis Type Codes Canonical URL: `http://terminology.hl7.org/CodeSystem/ex-diagnosistype`
Code System | Description: Code system Procedure Type Resource: Example Procedure Type Codes Canonical URL: `http://terminology.hl7.org/CodeSystem/ex-procedure-type`
Value Set | Description: Value set Encounter Inpatient Resource: Encounter Inpatient Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307`
Value Set | Description: Value set Obstetrical or Pregnancy Related Conditions Resource: Obstetrical or Pregnancy Related Conditions Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.263`
Value Set | Description: Value set Venous Thromboembolism Resource: Venous Thromboembolism Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.279`
Value Set | Description: Value set Obstetrics VTE Resource: Obstetrics VTE Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.264`
Value Set | Description: Value set Low Dose Unfractionated Heparin for VTE Prophylaxis Resource: Low Dose Unfractionated Heparin for VTE Prophylaxis Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.39`
Value Set | Description: Value set Subcutaneous route Resource: Subcutaneous route Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.223`
Value Set | Description: Value set Low Molecular Weight Heparin for VTE Prophylaxis Resource: Low Molecular Weight Heparin for VTE Prophylaxis Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.219`
Value Set | Description: Value set Injectable Factor Xa Inhibitor for VTE Prophylaxis Resource: Injectable Factor Xa Inhibitor for VTE Prophylaxis Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.211`
Value Set | Description: Value set Warfarin Resource: Warfarin Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.232`
Value Set | Description: Value set Rivaroxaban for VTE Prophylaxis Resource: Rivaroxaban for VTE Prophylaxis Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.50`
Value Set | Description: Value set Application of Intermittent Pneumatic Compression Devices Resource: Application of Intermittent Pneumatic Compression Devices Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.65`
Value Set | Description: Value set Application of Venous Foot Pumps Resource: Application of Venous Foot Pumps Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.64`
Value Set | Description: Value set Application of Graduated Compression Stockings Resource: Application of Graduated Compression Stockings Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.66`
Value Set | 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`
Value Set | 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`
Value Set | Description: Value set General or Neuraxial Anesthesia Resource: General or Neuraxial Anesthesia Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.1743`
Value Set | Description: Value set Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment Resource: Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.134`
Value Set | Description: Value set Atrial Fibrillation or Flutter Resource: Atrial Fibrillation or Flutter Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.202`
Value Set | Description: Value set Hip Replacement Surgery Resource: Hip Replacement Surgery Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.259`
Value Set | Description: Value set Knee Replacement Surgery Resource: Knee Replacement Surgery Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.261`
Value Set | Description: Value set Low Risk Resource: Low Risk Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.400`
Value Set | Description: Value set INR Resource: INR Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.213`
Value Set | Description: Value set Unfractionated Heparin Resource: Unfractionated Heparin Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.218`
Value Set | Description: Value set Intravenous route Resource: Intravenous route Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.222`
Value Set | Description: Value set Direct Thrombin Inhibitor Resource: Direct Thrombin Inhibitor Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.205`
Value Set | Description: Value set Glycoprotein IIb IIIa Inhibitors Resource: Glycoprotein IIb IIIa Inhibitors Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.41`
Value Set | Description: Value set Medical Reason For Not Providing Treatment Resource: Medical Reason For Not Providing Treatment Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.473`
Value Set | Description: Value set Venous foot pumps Resource: Venous foot pumps Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.230`
Value Set | Description: Value set Intermittent pneumatic compression devices Resource: Intermittent pneumatic compression devices Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.214`
Value Set | Description: Value set Graduated compression stockings Resource: Graduated compression stockings Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.256`
Value Set | 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`
Value Set | Description: Value set Payer Type Resource: Payer Type Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591`
Value Set | Description: Value set Intensive Care Unit Resource: Intensive Care Unit Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.206`
Value Set | Description: Value set Mental Health Diagnoses Resource: Mental Health Diagnoses Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.105.12.1004`
Value Set | Description: Value set Hemorrhagic Stroke Resource: Hemorrhagic Stroke Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.212`
Value Set | 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`
Value Set | Description: Value set General Surgery Resource: General Surgery Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.255`
Value Set | Description: Value set Gynecological Surgery Resource: Gynecological Surgery Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.257`
Value Set | Description: Value set Hip Fracture Surgery Resource: Hip Fracture Surgery Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.258`
Value Set | Description: Value set Intracranial Neurosurgery Resource: Intracranial Neurosurgery Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.260`
Value Set | Description: Value set Urological Surgery Resource: Urological Surgery Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.272`
Value Set | 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`
Direct Reference Code | Display: Male (finding) Code: 248153007 System: `http://snomed.info/sct`
Direct Reference Code | Display: Female (finding) Code: 248152002 System: `http://snomed.info/sct`
Direct Reference Code | Code: refuted System: `http://terminology.hl7.org/CodeSystem/condition-ver-status`
Direct Reference Code | Code: entered-in-error System: `http://terminology.hl7.org/CodeSystem/condition-ver-status`
Direct Reference Code | Code: inactive System: `http://terminology.hl7.org/CodeSystem/condition-clinical`
Direct Reference Code | Code: remission System: `http://terminology.hl7.org/CodeSystem/condition-clinical`
Direct Reference Code | Code: resolved System: `http://terminology.hl7.org/CodeSystem/condition-clinical`
Direct Reference Code | Display: Risk for venous thromboembolism Code: 72136-5 System: `http://loinc.org`
Direct Reference Code | Display: Fulfill Code: fulfill System: `http://hl7.org/fhir/CodeSystem/task-code`
Direct Reference Code | Display: Principal Diagnosis Code: principal System: `http://terminology.hl7.org/CodeSystem/ex-diagnosistype`
Direct Reference Code | Display: Primary procedure Code: primary System: `http://terminology.hl7.org/CodeSystem/ex-procedure-type`
Dependencies
Dependency | Description: USQualityCore model information Resource: `https://madie.cms.gov/Library/USQualityCore-ModelInfo|0.1.0-cibuild` Canonical URL: `https://madie.cms.gov/Library/USQualityCore-ModelInfo|0.1.0-cibuild`
Dependency | Description: USCore model information Resource: http://hl7.org/fhir/us/cql/Library/USCore-ModelInfo|6.1.0-derived Canonical URL: `http://hl7.org/fhir/us/cql/Library/USCore-ModelInfo|6.1.0-derived`
Dependency | Description: FHIR model information Resource: http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1 Canonical URL: `http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1`
Dependency | Description: Library SDE Resource: SupplementalDataElementsversion: null6.1.000) Canonical URL: `https://madie.cms.gov/Library/SupplementalDataElements|6.1.000`
Dependency | Description: Library FHIRHelpers Resource: http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1 Canonical URL: `http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1`
Dependency | Description: Library USCommon Resource: http://hl7.org/fhir/us/cql/Library/USCoreCommon|2.0.0-ballot Canonical URL: `http://hl7.org/fhir/us/cql/Library/USCoreCommon|2.0.0-ballot`
Dependency | Description: Library FHIRCommon Resource: http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0 Canonical URL: `http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0`
Dependency | Description: Library VTE Resource: VTEversion: null9.1.000) Canonical URL: `https://madie.cms.gov/Library/VTE|9.1.000`
Dependency | Description: Library CQMCommon Resource: CQMCommonversion: null5.1.000) Canonical URL: `https://madie.cms.gov/Library/CQMCommon|5.1.000`
Dependency | Description: Library TJC Resource: TJCOverallversion: null9.1.000) Canonical URL: `https://madie.cms.gov/Library/TJCOverall|9.1.000`
Dependency | Description: Library USQualityCoreCommon Resource: US Quality Core Commonversion: null0.1.0-cibuild) Canonical URL: `https://madie.cms.gov/Library/USQualityCoreCommon|0.1.0-cibuild`
Data Requirements
Data Requirement | Type: Patient Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-patient` Must Support Elements: ombCategory, detailed, text
Data Requirement | Type: Encounter Profile(s): Encounter Must Support Elements: type, status, period, reasonCode, diagnosis, diagnosis.code Code Filter(s): Path: type ValueSet: Observation Services Path: status Code(s): [not stated]: finished (finished)
Data Requirement | Type: Encounter Profile(s): Encounter Must Support Elements: type, status, period, reasonCode, diagnosis, diagnosis.code Code Filter(s): Path: type ValueSet: Emergency Department Visit Path: status Code(s): [not stated]: finished (finished)
Data Requirement | Type: Encounter Profile(s): Encounter Must Support Elements: period, reasonCode, type, diagnosis, diagnosis.code
Data Requirement | Type: Encounter Profile(s): Encounter Must Support Elements: type, status, period, reasonCode, diagnosis, diagnosis.code, period.low, period.lowClosed, period.high, period.highClosed, location Code Filter(s): Path: type ValueSet: Encounter Inpatient Path: status Code(s): [not stated]: finished (finished)
Data Requirement | Type: Condition Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-condition-encounter-diagnosis`
Data Requirement | Type: Condition Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-condition-problems-health-concerns`
Data Requirement | Type: Medication Profile(s): Medication Must Support Elements: id, code Code Filter(s): Path: code ValueSet: Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment
Data Requirement | Type: Medication Profile(s): Medication Must Support Elements: id, code Code Filter(s): Path: code ValueSet: Unfractionated Heparin
Data Requirement | Type: Medication Profile(s): Medication Must Support Elements: id, code Code Filter(s): Path: code ValueSet: Direct Thrombin Inhibitor
Data Requirement | Type: Medication Profile(s): Medication Must Support Elements: id, code Code Filter(s): Path: code ValueSet: Glycoprotein IIb IIIa Inhibitors
Data Requirement | Type: Medication Profile(s): Medication Must Support Elements: id, code Code Filter(s): Path: code ValueSet: Low Dose Unfractionated Heparin for VTE Prophylaxis
Data Requirement | Type: Medication Profile(s): Medication Must Support Elements: id, code Code Filter(s): Path: code ValueSet: Low Molecular Weight Heparin for VTE Prophylaxis
Data Requirement | Type: Medication Profile(s): Medication Must Support Elements: id, code Code Filter(s): Path: code ValueSet: Injectable Factor Xa Inhibitor for VTE Prophylaxis
Data Requirement | Type: Medication Profile(s): Medication Must Support Elements: id, code Code Filter(s): Path: code ValueSet: Warfarin
Data Requirement | Type: Medication Profile(s): Medication Must Support Elements: id, code Code Filter(s): Path: code ValueSet: Rivaroxaban for VTE Prophylaxis
Data Requirement | Type: MedicationAdministration Profile(s): MedicationAdministration Must Support Elements: medication, status, dosage, dosage.route, effective, id Code Filter(s): Path: medication ValueSet: Low Dose Unfractionated Heparin for VTE Prophylaxis
Data Requirement | Type: MedicationAdministration Profile(s): MedicationAdministration Must Support Elements: medication, status, dosage, dosage.route, effective, id Code Filter(s): Path: medication ValueSet: Low Molecular Weight Heparin for VTE Prophylaxis
Data Requirement | Type: MedicationAdministration Profile(s): MedicationAdministration Must Support Elements: medication, status, dosage, dosage.route, effective, id Code Filter(s): Path: medication ValueSet: Injectable Factor Xa Inhibitor for VTE Prophylaxis
Data Requirement | Type: MedicationAdministration Profile(s): MedicationAdministration Must Support Elements: medication, status, dosage, dosage.route, effective, id Code Filter(s): Path: medication ValueSet: Warfarin
Data Requirement | Type: MedicationAdministration Profile(s): MedicationAdministration Must Support Elements: medication, status, dosage, dosage.route, effective, id Code Filter(s): Path: medication ValueSet: Rivaroxaban for VTE Prophylaxis
Data Requirement | Type: MedicationAdministration Profile(s): MedicationAdministration Must Support Elements: medication, status, dosage, dosage.route, effective, id Code Filter(s): Path: medication ValueSet: Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment
Data Requirement | Type: MedicationAdministration Profile(s): MedicationAdministration Must Support Elements: medication, status, dosage, dosage.route, effective, id Code Filter(s): Path: medication ValueSet: Unfractionated Heparin
Data Requirement | Type: MedicationAdministration Profile(s): MedicationAdministration Must Support Elements: medication.reference, status, dosage, dosage.route, effective, id
Data Requirement | Type: MedicationAdministration Profile(s): MedicationAdministration Must Support Elements: medication, status, dosage, dosage.route, effective, id Code Filter(s): Path: medication ValueSet: Direct Thrombin Inhibitor
Data Requirement | Type: MedicationAdministration Profile(s): MedicationAdministration Must Support Elements: medication, status, dosage, dosage.route, effective, id Code Filter(s): Path: medication ValueSet: Glycoprotein IIb IIIa Inhibitors
Data Requirement | Type: Procedure Profile(s): Procedure Must Support Elements: code, status, performed Code Filter(s): Path: code ValueSet: Application of Intermittent Pneumatic Compression Devices
Data Requirement | Type: Procedure Profile(s): Procedure Must Support Elements: code, status, performed Code Filter(s): Path: code ValueSet: Application of Venous Foot Pumps
Data Requirement | Type: Procedure Profile(s): Procedure Must Support Elements: code, status, performed Code Filter(s): Path: code ValueSet: Application of Graduated Compression Stockings
Data Requirement | Type: Procedure Profile(s): Procedure Must Support Elements: code, status, performed Code Filter(s): Path: code ValueSet: Hip Replacement Surgery
Data Requirement | Type: Procedure Profile(s): Procedure Must Support Elements: code, status, performed Code Filter(s): Path: code ValueSet: Knee Replacement Surgery
Data Requirement | Type: Procedure Profile(s): Procedure Must Support Elements: id, status, performed, code
Data Requirement | Type: Procedure Profile(s): Procedure Must Support Elements: code, status, performed Code Filter(s): Path: code ValueSet: Comfort Measures
Data Requirement | Type: Procedure Profile(s): Procedure Must Support Elements: code, status, performed, performed.low, performed.lowClosed, performed.high, performed.highClosed Code Filter(s): Path: code ValueSet: General or Neuraxial Anesthesia Path: status Code(s): [not stated]: completed (completed)
Data Requirement | Type: Patient Profile(s): Patient Must Support Elements: birthDate
Data Requirement | Type: Observation Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-simple-observation` Must Support Elements: code, value, status, id, effective Code Filter(s): Path: code Code(s): LOINC: 72136-5 (Risk for venous thromboembolism) Path: value ValueSet: Low Risk
Data Requirement | Type: Observation Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-observation-lab` Must Support Elements: code, value, status, id, issued Code Filter(s): Path: code ValueSet: INR
Data Requirement | Type: Resource Profile(s): Resource Must Support Elements: id
Data Requirement | Type: MedicationAdministration Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-medicationadministrationnotdone` Must Support Elements: medication, id, statusReason Code Filter(s): Path: medication ValueSet: Low Dose Unfractionated Heparin for VTE Prophylaxis
Data Requirement | Type: MedicationAdministration Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-medicationadministrationnotdone` Must Support Elements: medication, id, statusReason Code Filter(s): Path: medication ValueSet: Low Molecular Weight Heparin for VTE Prophylaxis
Data Requirement | Type: MedicationAdministration Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-medicationadministrationnotdone` Must Support Elements: medication, id, statusReason Code Filter(s): Path: medication ValueSet: Injectable Factor Xa Inhibitor for VTE Prophylaxis
Data Requirement | Type: MedicationAdministration Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-medicationadministrationnotdone` Must Support Elements: medication, id, statusReason Code Filter(s): Path: medication ValueSet: Warfarin
Data Requirement | Type: MedicationAdministration Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-medicationadministrationnotdone` Must Support Elements: medication, id, statusReason Code Filter(s): Path: medication ValueSet: Rivaroxaban for VTE Prophylaxis
Data Requirement | Type: MedicationRequest Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-medicationnotrequested` Must Support Elements: medication, intent, status, id, reasonCode, authoredOn Code Filter(s): Path: medication ValueSet: Low Dose Unfractionated Heparin for VTE Prophylaxis
Data Requirement | Type: MedicationRequest Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-medicationnotrequested` Must Support Elements: medication, intent, status, id, reasonCode, authoredOn Code Filter(s): Path: medication ValueSet: Low Molecular Weight Heparin for VTE Prophylaxis
Data Requirement | Type: MedicationRequest Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-medicationnotrequested` Must Support Elements: medication, intent, status, id, reasonCode, authoredOn Code Filter(s): Path: medication ValueSet: Injectable Factor Xa Inhibitor for VTE Prophylaxis
Data Requirement | Type: MedicationRequest Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-medicationnotrequested` Must Support Elements: medication, intent, status, id, reasonCode, authoredOn Code Filter(s): Path: medication ValueSet: Warfarin
Data Requirement | Type: MedicationRequest Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-medicationnotrequested` Must Support Elements: medication, intent, status, id, reasonCode, authoredOn Code Filter(s): Path: medication ValueSet: Rivaroxaban for VTE Prophylaxis
Data Requirement | Type: MedicationRequest Profile(s): MedicationRequest Must Support Elements: medication.reference, status, id, authoredOn
Data Requirement | Type: MedicationRequest Profile(s): MedicationRequest Must Support Elements: medication, status, id, authoredOn Code Filter(s): Path: medication ValueSet: Low Dose Unfractionated Heparin for VTE Prophylaxis
Data Requirement | Type: MedicationRequest Profile(s): MedicationRequest Must Support Elements: medication, status, id, authoredOn Code Filter(s): Path: medication ValueSet: Low Molecular Weight Heparin for VTE Prophylaxis
Data Requirement | Type: MedicationRequest Profile(s): MedicationRequest Must Support Elements: medication, status, id, authoredOn Code Filter(s): Path: medication ValueSet: Injectable Factor Xa Inhibitor for VTE Prophylaxis
Data Requirement | Type: MedicationRequest Profile(s): MedicationRequest Must Support Elements: medication, status, id, authoredOn Code Filter(s): Path: medication ValueSet: Warfarin
Data Requirement | Type: MedicationRequest Profile(s): MedicationRequest Must Support Elements: medication, status, id, authoredOn Code Filter(s): Path: medication ValueSet: Rivaroxaban for VTE Prophylaxis
Data Requirement | Type: Task Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-taskrejected` Must Support Elements: focus, code, statusReason Code Filter(s): Path: code
Data Requirement | Type: ServiceRequest Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-servicenotrequested` Must Support Elements: code, intent, id, authoredOn Code Filter(s): Path: code ValueSet: Venous foot pumps
Data Requirement | Type: ServiceRequest Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-servicenotrequested` Must Support Elements: code, intent, id, authoredOn Code Filter(s): Path: code ValueSet: Intermittent pneumatic compression devices
Data Requirement | Type: ServiceRequest Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-servicenotrequested` Must Support Elements: code, intent, id, authoredOn Code Filter(s): Path: code ValueSet: Graduated compression stockings
Data Requirement | Type: ServiceRequest Profile(s): ServiceRequest Must Support Elements: code, intent, status, id, authoredOn Code Filter(s): Path: code ValueSet: Venous foot pumps
Data Requirement | Type: ServiceRequest Profile(s): ServiceRequest Must Support Elements: code, intent, status, id, authoredOn Code Filter(s): Path: code ValueSet: Intermittent pneumatic compression devices
Data Requirement | Type: ServiceRequest Profile(s): ServiceRequest Must Support Elements: code, intent, status, id, authoredOn Code Filter(s): Path: code ValueSet: Graduated compression stockings
Data Requirement | Type: ServiceRequest Profile(s): ServiceRequest Must Support Elements: code, intent, status, id, authoredOn Code Filter(s): Path: code ValueSet: Comfort Measures
Data Requirement | Type: Procedure Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-procedurenotdone` Must Support Elements: code, id, statusReason Code Filter(s): Path: code ValueSet: Application of Intermittent Pneumatic Compression Devices
Data Requirement | Type: Procedure Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-procedurenotdone` Must Support Elements: code, id, statusReason Code Filter(s): Path: code ValueSet: Application of Venous Foot Pumps
Data Requirement | Type: Procedure Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-procedurenotdone` Must Support Elements: code, id, statusReason Code Filter(s): Path: code ValueSet: Application of Graduated Compression Stockings
Data Requirement | Type: Coverage Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-coverage` Must Support Elements: type, period Code Filter(s): Path: type ValueSet: Payer Type
Data Requirement | Type: Location Profile(s): Location
Data Requirement | Type: Claim Profile(s): Claim Must Support Elements: status, use, item Code Filter(s): Path: status Code(s): [not stated]: active (active) Path: use Code(s): [not stated]: claim (claim)
Parameters
Name | Use | Card. | Type | Documentation
Measurement Period | In | 0..1 | Period |
SDE Sex | Out | 0..1 | Coding |
Numerator | Out | 0..* | Encounter |
Denominator | Out | 0..* | Encounter |
SDE Payer | Out | 0..* | Resource |
Initial Population | Out | 0..* | Encounter |
SDE Ethnicity | Out | 0..1 | Resource |
Denominator Exclusions | Out | 0..* | Encounter |
SDE Race | Out | 0..1 | Resource |
Generated using version 0.5.4 of the sample-content-ig Liquid templates