Quality Measure Implementation Guide
2.0.0 - STU 2 International flag

Quality Measure Implementation Guide, published by HL7 International / Clinical Quality Information. This guide is not an authorized publication; it is the continuous build for version 2.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/fhir-cqm/ and changes regularly. See the Directory of published versions

Measure: EXM108 - Venous Thromboembolism Prophylaxis (Experimental)

Official URL: http://hl7.org/fhir/uv/cqm/Measure/EXM108-FHIR Version: 2.0.0
Standards status: Informative Computable Name: EXM108
Other Identifiers: http://example.org/fhir/cqi/ecqm/Measure/Identifier/cms#108 (use: official, ), OID:2.16.840.1.113883.4.642.40.61.29.3

Usage: Clinical Venue: EH

Copyright/Legal: Measure specifications are in the Public Domain.

LOINC(R) is a registered trademark of the Regenstrief Institute.

This material contains SNOMED Clinical Terms(R) (SNOMED CT(C)) copyright 2004-2017 International Health Terminology Standards Development Organization. All rights reserved.

This measure assesses the number of patients who received VTE prophylaxis or have documentation why no VTE prophylaxis was given the day of or the day after hospital admission or surgery end date for surgeries that start the day of or the day after hospital admission

Metadata
Title EXM108 - Venous Thromboembolism Prophylaxis
Version 2.0.0
Identifier 108
Identifier urn:oid:2.16.840.1.113883.4.642.40.61.29.3
Effective Period 2018-01-01 through 2018-12-31
Approval Date 2019-03-08
Last Review Date 2019-03-08
Experimental true
Use Context Clinical Venue = EH
Jurisdiction http://unstats.un.org/unsd/methods/m49/m49.htm#001
Topic Health Quality Measure Document
Steward (Publisher) HL7 International / Clinical Quality Information
Description

This measure assesses the number of patients who received VTE prophylaxis or have documentation why no VTE prophylaxis was given the day of or the day after hospital admission or surgery end date for surgeries that start the day of or the day after hospital admission

Copyright

Measure specifications are in the Public Domain.

LOINC(R) is a registered trademark of the Regenstrief Institute.

This material contains SNOMED Clinical Terms(R) (SNOMED CT(C)) copyright 2004-2017 International Health Terminology Standards Development 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

Measure Basis Encounter
Measure Scoring Proportion
Improvement Notation Increased score indicates improvement
Measure Type http://terminology.hl7.org/CodeSystem/measure-type#process
Rationale

Hospitalized patients at high-risk for VTE may develop an asymptomatic deep vein thrombosis (DVT), and die from pulmonary embolism (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).

The estimated annual incidence of deep-vein thrombosis (DVT) and pulmonary embolism (PE), known collectively as venous thromboembolism (VTE), is approximately 900,000 (Geerts, et al, 2008). Approximately two-thirds of cases of DVT or PE are associated with recent hospitalization. This is consistent with the 2001 report by The Agency for Healthcare Research and Quality (AHRQ). AHRQ indicates that "the appropriate application of effective preventive measures in hospitals has major potential for improving patient safety by reducing the incidence of venous thromboembolism" (Shojania, 2001).

Despite its proven effectiveness, rates of appropriate thromboprophylaxis remain low in both medical and surgical patients. A recent analysis from the ENDORSE survey, which evaluated prophylaxis rates in 17,084 major surgery patients, found that more than one third of patients at risk for VTE (38%) did not receive prophylaxis and that rates varied by surgery type (Cohen, et al., 2008).

In a review of evidence-based patient safety practices, the Agency for Healthcare Research and Quality defined thromboprophylaxis against VTE as the "number one patient safety practice" for hospitalized patients (Shojania, 2001). Updated "safe practices" published by the National Quality Forum (NQF) recommend routine evaluation of hospitalized patients for risk of VTE and use of appropriate prophylaxis (National Quality Forum. National Voluntary Consensus Standards for Prevention and Care of Venous Thromboembolism, 2006).

As noted by the ACCP, a vast number of randomized clinical trials provide irrefutable evidence that thromboprophylaxis reduces VTE events, and there are studies that have also shown that fatal PE is prevented by thromboprophylaxis (Geerts, et al. 2008).

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 acutely ill hospitalized patients at high risk for developing a deep vein thrombosis or dying from a pulmonary emboli. 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.

Contents Metadata
Contents
Measure Rates (Groups)
Supplemental Data
Measure Logic
Population Criteria
Logic Definitions
Terminology
Dependencies
Data Requirements
Measure Rates (Groups)
Measure Rate (Group) (ID: primary)
Initial Population ID: primary-exm108-initial-population
Description:

Patients age 18 and older discharged from hospital inpatient acute care without a diagnosis of venous thromboembolism (VTE) or obstetrics with a length of stay less than or equal to 120 days that ends during the measurement period

Criteria: Initial Population
Denominator ID: primary-exm108-denominator
Description:

All patients in the initial population

Criteria: Denominator
Denominator Exclusion ID: primary-exm108-denominator-exclusion
Description:

* Patients who have a length of stay less than 2 days * Patients with comfort measures documented anytime between arrival and the day after hospital admission * Patients with comfort measures documented by the day after surgery end date for surgeries that start the day of or the day after hospital admission * 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 * Patients with a principal diagnosis of mental disorders or stroke * Patients with a principal procedure of Surgical Care Improvement Project (SCIP) VTE selected surgeries

Criteria: Denominator Exclusion
Numerator ID: primary-exm108-numerator
Description:

Patients who received VTE prophylaxis: - the day of or the day after hospital admission - the day of or the day after surgery end date for surgeries that end the day of or the day after hospital admission Patients who have documentation of a reason why no VTE prophylaxis was given: - between arrival and hospital admission - the day of or the day after hospital admission - the day of or the day after surgery end date (for surgeries that end the day of or the day after hospital admission)

Criteria: Numerator
Supplemental Data Elements
Supplemental Data Element Usage Code: Supplemental Data

Logic Definition: SDE Ethnicity
Supplemental Data Element Usage Code: Supplemental Data

Logic Definition: SDE Payer
Supplemental Data Element Usage Code: Supplemental Data

Logic Definition: SDE Race
Supplemental Data Element Usage Code: Supplemental Data

Logic Definition: SDE Sex
Measure Logic
Primary Library EXM108 - Venous Thromboembolism Prophylaxis Library
Population Criteria
Measure Rate (Group) (ID: primary)
Initial Population
define "Initial Population":
  "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions"
Definition
Denominator
define "Denominator":
      "Initial Population"
Definition
Denominator Exclusion
define "Denominator Exclusion":
  "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 SCIP VTE 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 on Day of or 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 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.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' }
      when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' }
      else null
    end
Logic Definition Library Name: SupplementalDataElements
define "SDE Payer":
  [Coverage: type in "Payer"] Payer
        return {
          code: Payer.type,
          period: Payer.period
        }
Logic Definition Library Name: SupplementalDataElements
define "SDE Ethnicity":
  (flatten (
      Patient.extension Extension
        where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity'
          return Extension.extension
    )) E
      where E.url = 'ombCategory'
        or E.url = 'detailed'
      return E.value as Coding
Logic Definition Library Name: SupplementalDataElements
define "SDE Race":
  (flatten (
      Patient.extension Extension
        where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race'
          return Extension.extension
    )) E
      where E.url = 'ombCategory'
        or E.url = 'detailed'
      return E.value as Coding
Logic Definition Library Name: EXM108
define "SDE Sex":
	SDE."SDE Sex"
Logic Definition Library Name: EXM108
define "Admission Without VTE or Obstetrical Conditions":
  Global."Inpatient Encounter" InpatientEncounter
    where not exists (
      (Global.EncounterDiagnosis(InpatientEncounter)) EncounterDiagnosis
        where EncounterDiagnosis.code in "Obstetrics"
          or EncounterDiagnosis.code in "Venous Thromboembolism"
          or EncounterDiagnosis.code in "Obstetrics VTE"
    )
Logic Definition Library Name: EXM108
// Note: added FHIRHelpers.ToDate() in R4
define "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions":
  ( Global."Inpatient Encounter" InpatientEncounter
        where Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(Patient.birthDate), start of InpatientEncounter.period) >= 18
  )
    intersect "Admission Without VTE or Obstetrical Conditions"
Logic Definition Library Name: EXM108
// 10/29: Replaced DeviceUseStatement with Procedure with a new value set and procedure.usdCode for specifying devices
define "VTE Prophylaxis by Medication Administered or Device Applied":
  ( ["MedicationAdministration": medication in "Low Dose Unfractionated Heparin for VTE Prophylaxis"] VTEMedication
      where VTEMedication.status ='completed'
        and VTEMedication.dosage.route in "Subcutaneous route"
  )
   union (["MedicationAdministration": medication in "Low Molecular Weight Heparin for VTE Prophylaxis"] LMWH where LMWH.status = 'completed')
   union (["MedicationAdministration": medication in "Injectable Factor Xa Inhibitor for VTE Prophylaxis"] FactorXa where FactorXa.status = 'completed')
   union (["MedicationAdministration": medication in "Warfarin"] WarfarinAdmin where WarfarinAdmin.status = 'completed')
   union (
    ["Procedure": "Device Application"] DeviceApplied
      where DeviceApplied.status = 'complete'
        and (
          DeviceApplied.usedCode in "Intermittent pneumatic compression devices (IPC)"
            or DeviceApplied.usedCode in"Venous foot pumps (VFP)"
            or DeviceApplied.usedCode in "Graduated compression stockings (GCS)"
        )
  )
Logic Definition Library Name: EXM108
define "Encounter With VTE Prophylaxis Received on Day of or Day After Admission or Procedure":
 	( from
      "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
      "VTE Prophylaxis by Medication Administered or Device Applied" VTEProphylaxis
    where Coalesce(VTEProphylaxis.effective.toInterval(), VTEProphylaxis.performed.toInterval()) starts during TJC."CalendarDayOfOrDayAfter"(start of QualifyingEncounter.period)
    return QualifyingEncounter
 	)
 	union (
    from
      "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
      ["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
      "VTE Prophylaxis by Medication Administered or Device Applied" VTEProphylaxis
    where AnesthesiaProcedure.performed.toInterval() ends 1 day after day of start of QualifyingEncounter.period
      and Coalesce(VTEProphylaxis.effective.toInterval(), VTEProphylaxis.performed.toInterval()) starts during TJC."CalendarDayOfOrDayAfter"(end of AnesthesiaProcedure.performed.toInterval())
    return QualifyingEncounter
	)
Logic Definition Library Name: EXM108
define "Encounter With Medication Oral Factor Xa Inhibitor Administered on Day of or Day After Admission or Procedure":
	( from
   		"Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
			["MedicationAdministration": medication in "Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment"] FactorXaMedication
    where FactorXaMedication.status = 'completed'
      and FactorXaMedication.effective.toInterval() starts during TJC."CalendarDayOfOrDayAfter"(start of QualifyingEncounter.period)
    return QualifyingEncounter
  )
    union ( 
      from
			  "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
 				["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
 				["MedicationAdministration": medication in "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 TJC."CalendarDayOfOrDayAfter"(end of AnesthesiaProcedure.performed.toInterval())
   		return QualifyingEncounter
 		)
Logic Definition Library Name: EXM108
define "Encounter With Prior or Present Diagnosis of Atrial Fibrillation or VTE":
	( "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
		with ["Condition": code in "Atrial Fibrillation/Flutter"] AtrialFibrillation
      such that AtrialFibrillation.prevalenceInterval() starts on or before end of QualifyingEncounter.period
    )
    union ( 
      "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
    	  where Global.EncounterDiagnosis(QualifyingEncounter).code in "Atrial Fibrillation/Flutter"
		)
    union ( 
      "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
				with ["Condition": code in "Venous Thromboembolism"] VTEDiagnosis
  				such that (
            VTEDiagnosis.clinicalStatus ~ Global."inactive"
              or VTEDiagnosis.clinicalStatus ~ Global."remission"
              or VTEDiagnosis.clinicalStatus ~ Global."resolved" 
          )
   	  			and VTEDiagnosis.onset.toInterval() before start of QualifyingEncounter.period
 		)
Logic Definition Library Name: EXM108
define "Encounter With Prior or Present Procedure of Hip or Knee Replacement Surgery":
	"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: EXM108
define "Is In Low Risk for VTE or On Anticoagulant":
	  ( ["Observation": "Risk for venous thromboembolism"] VTERiskAssessment
			  where VTERiskAssessment.value in "Low Risk"
        and VTERiskAssessment.status in {'final','amended', 'corrected'}
	  )
  union ( ["Observation": "INR"] INRLabTest
        where INRLabTest.value as Quantity > 3.0
            and INRLabTest.status in {'final','amended', 'corrected'}
        return "Observation" { id: INRLabTest.id, effective: 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 = 'complete'
         return "Observation" { id: AnticoagulantMedication.id, effective: AnticoagulantMedication.effective }
      )
Logic Definition Library Name: EXM108
define "Low Risk for VTE or Anticoagulant Administered From Day of Start of Hospitalization To Day After Admission":
 	"Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
    with "Is In Low Risk for VTE or On Anticoagulant" VTERiskAssessment
    such that VTERiskAssessment.effective.toInterval() starts during VTEICU."FromDayOfStartOfHospitalizationToDayAfterAdmission"(QualifyingEncounter)
Logic Definition Library Name: EXM108
define "Low Risk for VTE or Anticoagulant Administered on Day of or Day After Procedure":
 	from
 		"Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
 		["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
 		"Is In Low Risk for VTE or On Anticoagulant" VTERiskAssessment
  where AnesthesiaProcedure.performed.toInterval() ends 1 day after day of start of QualifyingEncounter.period
		and VTERiskAssessment.effective.toInterval() starts during TJC."CalendarDayOfOrDayAfter"(end of AnesthesiaProcedure.performed.toInterval())
	return QualifyingEncounter
Logic Definition Library Name: EXM108
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: EXM108
define "No VTE Prophylaxis Medication Administered or Ordered":
  ((	
    ["MedicationAdministration": medication in "Low Dose Unfractionated Heparin for VTE Prophylaxis"]
     union ["MedicationAdministration": medication in "Low Molecular Weight Heparin for VTE Prophylaxis"]
     union ["MedicationAdministration": medication in "Injectable Factor Xa Inhibitor for VTE Prophylaxis"]
     union ["MedicationAdministration": medication in "Warfarin"]
  ) MedicationAdm
    where MedicationAdm.status = 'not-done'
  )
  union
  ((	
    ["MedicationRequest": medication in "Low Dose Unfractionated Heparin for VTE Prophylaxis"]
  	  union ["MedicationRequest": medication in "Low Molecular Weight Heparin for VTE Prophylaxis"]
      union	["MedicationRequest": medication in "Injectable Factor Xa Inhibitor for VTE Prophylaxis"]
      union	["MedicationRequest": medication in "Warfarin"]
    ) MedicationOrder
    	where	MedicationOrder.doNotPerform is true
        and MedicationOrder.status in {'completed', 'cancelled'}
  )
Logic Definition Library Name: EXM108
define "No VTE Prophylaxis Medication Due to Medical Reason From Day of Start of Hospitalization To Day After Admission":
 	"Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
    with	"No VTE Prophylaxis Medication Administered or Ordered" NoVTEMedication
     	such that Coalesce(NoVTEMedication.statusReason, NoVTEMedication.reasonCode) in "Medical Reason"
  			and Coalesce(NoVTEMedication.authoredOn, start of NoVTEMedication.effective.toInterval()) during VTEICU."FromDayOfStartOfHospitalizationToDayAfterAdmission"(QualifyingEncounter)
Logic Definition Library Name: EXM108
define "No VTE Prophylaxis Device Applied or Ordered":
  ((
    ["ServiceRequest": "Venous foot pumps (VFP)"]
      union ["ServiceRequest": "Intermittent pneumatic compression devices (IPC)"]
      union ["ServiceRequest": "Graduated compression stockings (GCS)"]
  ) DeviceOrder
    where DeviceOrder.status = 'completed'
      and DeviceOrder.doNotPerform is true
    return {
      id: DeviceOrder.id, 
      requestStatusReason: DeviceOrder.statusReason(), 
      authoredOn: DeviceOrder.authoredOn
    }
  )
    union (
      ["Procedure": "Device Application"] DeviceApplied
        where (DeviceApplied.usedCode in "Intermittent pneumatic compression devices (IPC)"
          or DeviceApplied.usedCode in "Venous foot pumps (VFP)"
          or DeviceApplied.usedCode in "Graduated compression stockings (GCS)"
        )
          and DeviceApplied.status = 'not-done'
        return {
          id: DeviceApplied.id, 
          requestStatusReason: DeviceApplied.statusReason, 
          authoredOn: DeviceApplied.recorded()
        }

    )
Logic Definition Library Name: EXM108
define "No VTE Prophylaxis Device Due to Medical Reason From Day of Start of Hospitalization To Day After Admission":
  "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
  	with "No VTE Prophylaxis Device Applied or Ordered" NoVTEDevice
      such that NoVTEDevice.requestStatusReason in "Medical Reason"
        and  NoVTEDevice.authoredOn during VTEICU."FromDayOfStartOfHospitalizationToDayAfterAdmission"(QualifyingEncounter)
Logic Definition Library Name: EXM108
define "No VTE Prophylaxis Medication Due to Medical Reason on Day of or Day After Procedure":
	from
		"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 Coalesce(NoVTEMedication.statusReason,NoVTEMedication.reasonCode) in "Medical Reason"
  	and AnesthesiaProcedure.status = 'completed'
	  and AnesthesiaProcedure.performed.toInterval() ends 1 day after day of start of QualifyingEncounter.period
		and Coalesce(NoVTEMedication.authoredOn, start of NoVTEMedication.effective.toInterval()) during TJC."CalendarDayOfOrDayAfter"(end of AnesthesiaProcedure.performed.toInterval())
  return QualifyingEncounter
Logic Definition Library Name: EXM108
define "No VTE Prophylaxis Device Due to Medical Reason on Day of or Day After Procedure":
  from
 		"Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
 		["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
 		"No VTE Prophylaxis Device Applied or Ordered" NoVTEDevice
  where NoVTEDevice.requestStatusReason in "Medical Reason"
    and AnesthesiaProcedure.status = 'completed'
		and AnesthesiaProcedure.performed.toInterval() ends 1 day after day of start of QualifyingEncounter.period
    and NoVTEDevice.authoredOn during TJC."CalendarDayOfOrDayAfter"(end of AnesthesiaProcedure.performed.toInterval())
  return QualifyingEncounter
Logic Definition Library Name: EXM108
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 VTE Prophylaxis Device 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 VTE Prophylaxis Device Due to Medical Reason on Day of or Day After Procedure"
    )
Logic Definition Library Name: EXM108
define "No VTE Prophylaxis Medication or Device Due to Patient Refusal":
  ( 
    "No VTE Prophylaxis Medication Administered or Ordered" NoVTEMedication
      where Coalesce(NoVTEMedication.statusReason,NoVTEMedication.reasonCode) in "Patient Refusal"
  )
  union (
    "No VTE Prophylaxis Device Applied or Ordered" NoVTEDevice
      where NoVTEDevice.requestStatusReason in "Patient Refusal"
  )
Logic Definition Library Name: EXM108
define "No VTE Prophylaxis Due to Patient Refusal From Day of Start of Hospitalization To Day After Admission":
 	"Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
  	with "No VTE Prophylaxis Medication or Device Due to Patient Refusal" PatientRefusal
      such that Coalesce(start of PatientRefusal.effective.toInterval(), PatientRefusal.authoredOn)
        during VTEICU."FromDayOfStartOfHospitalizationToDayAfterAdmission"(QualifyingEncounter)
Logic Definition Library Name: EXM108
define "No VTE Prophylaxis Due to Patient Refusal on Day of or Day After Procedure":
 	from
 		"Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
 		["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
 		"No VTE Prophylaxis Medication or Device Due to Patient Refusal" PatientRefusal
	where AnesthesiaProcedure.performed.toInterval() ends 1 day after day of start of QualifyingEncounter.period
		and Coalesce(start of PatientRefusal.effective.toInterval(), PatientRefusal.authoredOn)
      during TJC."CalendarDayOfOrDayAfter"(end of AnesthesiaProcedure.performed.toInterval())
	return QualifyingEncounter
Logic Definition Library Name: EXM108
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: EXM108
define "Numerator":
  "Encounter With VTE Prophylaxis Received on Day of or 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 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: EXM108
define "Initial Population":
  "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions"
Logic Definition Library Name: EXM108
define "Denominator":
      "Initial Population"
Logic Definition Library Name: EXM108
define "SDE Payer":
	SDE."SDE Payer"
Logic Definition Library Name: EXM108
define "SDE Ethnicity":
  SDE."SDE Ethnicity"
Logic Definition Library Name: EXM108
define "Encounter Less Than 2 Days":
  "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
  	where QualifyingEncounter.period.lengthInDays() < 2
Logic Definition Library Name: EXM108
define "Encounter With ICU Location Stay 1 Day or More":
  "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
    where exists ( QualifyingEncounter.location Location
   		where Global.GetLocation(Location.location).type in "Intensive Care Unit"
   			and Location.period.lengthInDays() >= 1
   			and Location.period starts during TJC."CalendarDayOfOrDayAfter"(start of QualifyingEncounter.period)
    )
Logic Definition Library Name: EXM108
define "Encounter With Principal Diagnosis of Mental Disorder or Stroke":
  "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
    where QualifyingEncounter.principalDiagnosis().diagnosis in "Mental Health Diagnoses"
      or QualifyingEncounter.principalDiagnosis().diagnosis in "Hemorrhagic Stroke"
      or QualifyingEncounter.principalDiagnosis().diagnosis in "Ischemic Stroke"
Logic Definition Library Name: EXM108
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'
Logic Definition Library Name: EXM108
define "Encounter With Principal Procedure of SCIP VTE Selected Surgery":
  from
    "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
    "SCIP VTE Selected Surgery" SelectedProcedure
  let EncounterProcedure: QualifyingEncounter.principalProcedure()
  where EncounterProcedure.procedure.references(SelectedProcedure)
    and SelectedProcedure.performed.toInterval() during QualifyingEncounter.period
Logic Definition Library Name: EXM108
define "Intervention Comfort Measures":
	(["ServiceRequest": "Comfort Measures"] P
 		where P.intent = 'order'
  )
  	union
    	(["Procedure": "Comfort Measures"] InterventionPerformed
      	where InterventionPerformed.status in {'completed', 'in-progress'})
Logic Definition Library Name: EXM108
define "Encounter With Intervention Comfort Measures From Day of Start of Hospitalization To Day After Admission":
	"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 VTEICU."FromDayOfStartOfHospitalizationToDayAfterAdmission"(QualifyingEncounter)
Logic Definition Library Name: EXM108
define "Encounter With Intervention Comfort Measures on Day of or Day After Procedure":
  from
    "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 TJC."CalendarDayOfOrDayAfter"(end of AnesthesiaProcedure.performed.toInterval())
  return QualifyingEncounter
Logic Definition Library Name: EXM108
define "Denominator Exclusion":
  "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 SCIP VTE 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: EXM108
define "SDE Race":
  SDE."SDE Race"
Logic Definition Library Name: TJCOverall
define function "CalendarDayOfOrDayAfter"(StartValue DateTime ):
	Interval(Global."ToDate"(StartValue), Global."ToDate"(StartValue + 2 days))
Logic Definition Library Name: VTEICU
define function "FromDayOfStartOfHospitalizationToDayAfterAdmission"(Encounter FHIR.Encounter ):
	Interval[Global."ToDate"(start of Global."HospitalizationWithObservation"(Encounter)), Global."ToDate"(start of Encounter.period + 2 days))
Logic Definition Library Name: MATGlobalCommonFunctions
define "Inpatient Encounter":
	[Encounter: "Encounter Inpatient"] EncounterInpatient
		where EncounterInpatient.status = 'finished'
		    and "LengthInDays"(EncounterInpatient.period) <= 120
			and EncounterInpatient.period ends during "Measurement Period"
Logic Definition Library Name: MATGlobalCommonFunctions
define function "LengthInDays"(Value Interval<DateTime>):
	difference in days between start of Value and end of Value
Logic Definition Library Name: MATGlobalCommonFunctions
define function "CalendarAgeInYearsAt"(BirthDateTime DateTime, AsOf DateTime):
	years between ToDate(BirthDateTime)and ToDate(AsOf)
Logic Definition Library Name: MATGlobalCommonFunctions
define function "ToDate"(Value DateTime):
	DateTime(year from Value, month from Value, day from Value, 0, 0, 0, 0, timezoneoffset from Value)
Logic Definition Library Name: MATGlobalCommonFunctions
define function "EncounterDiagnosis"(Encounter Encounter):
  Encounter.diagnosis D
    return singleton from ([Condition] C where C.id = "GetId"(D.condition.reference))
Logic Definition Library Name: MATGlobalCommonFunctions
define function "GetId"(uri String):
	Last(Split(uri, '/'))
Logic Definition Library Name: MATGlobalCommonFunctions
define function "HospitalizationWithObservation"(TheEncounter FHIR.Encounter):
	TheEncounter Visit
		let ObsVisit: Last([Encounter: "Observation Services"] LastObs
				where 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.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: MATGlobalCommonFunctions
// Returns the location for the given location reference
define function GetLocation(reference Reference):
  singleton from (
    [Location] L where L.id = GetId(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: Returns an interval representing the normalized prevalence period of a given Condition resource.
@comment: Uses the toInterval and toAbatementInterval functions to determine the widest potential interval from
onset to abatement as specified in the given Condition.
*/
define fluent function prevalenceInterval(condition Condition):
if condition.clinicalStatus ~ "active"
  or condition.clinicalStatus ~ "recurrence"
  or condition.clinicalStatus ~ "relapse" then
  Interval[start of condition.onset.toInterval(), end of condition.abatementInterval()]
else
  (end of condition.abatementInterval()) abatementDate
    return 
	  if abatementDate is null then
        Interval[start of condition.onset.toInterval(), abatementDate)
      else
        Interval[start of condition.onset.toInterval(), abatementDate]
Logic Definition Library Name: FHIRCommon
/*
@description: Returns an interval representing the normalized Abatement of a given Condition resource.
@comment: @comment: If the abatement element of the Condition is represented as a DateTime, the result
is an interval beginning and ending on that DateTime.
If the abatement is represented as a Quantity, the quantity is expected to be a calendar-duration and is interpreted as the age of the patient. The
result is an interval from the date the patient turned that age to immediately before one year later.
If the abatement is represented as a Quantity Interval, the quantities are expected to be calendar-durations and are interpreted as an age range during
which the abatement occurred. The result is an interval from the date the patient turned the starting age of the quantity interval, and ending immediately
before one year later than the date the patient turned the ending age of the quantity interval.

NOTE: Due to the complexity of determining an interval from a String, this function will throw
a run-time exception if used with a Condition instance that has a String as the abatement value.
*/
define fluent function abatementInterval(condition Condition):
  if condition.abatement is FHIR.dateTime then
    Interval[FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime), FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime)]
  else if condition.abatement is FHIR.Period then
    FHIRHelpers.ToInterval(condition.abatement as FHIR.Period)
  else if condition.abatement 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 if condition.abatement is FHIR.Age then
    Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age),
      FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age) + 1 year)
  else if condition.abatement is FHIR.Range then
    Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).low),
      FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).high) + 1 year)
  else if condition.abatement is FHIR.boolean then
    Interval[end of condition.onset.toInterval(), condition.recordedDate)
  else 
    null
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 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 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 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: EXMCommon
define fluent function statusReason(serviceRequest ServiceRequest):
  serviceRequest.ext('http://hl7.org/fhir/StructureDefinition/request-statusReason').value as FHIR.CodeableConcept
Logic Definition Library Name: EXMCommon
define fluent function recorded(procedure Procedure):
  procedure.ext('http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-recorded').value as FHIR.dateTime
Logic Definition Library Name: EXMCommon
define fluent function lengthInDays(Value Interval<DateTime> ):
  difference in days between start of Value and end of Value
Logic Definition Library Name: EXMCommon
define fluent function principalDiagnosis(encounter Encounter):
  singleton from (
    (encounter.claimDiagnosis()) CD
      where CD.type.includesCode("Principal Diagnosis")
  )
Logic Definition Library Name: EXMCommon
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: EXMCommon
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: FHIRHelpers
define function ToString(value AdministrativeGender): 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
define function ToDate(value date): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value string): value.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 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 ToBoolean(value boolean): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value MedicationRequestStatus): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value ServiceRequestStatus): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value uri): 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: FHIRHelpers
define function ToString(value ServiceRequestIntent): value.value
Terminology
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 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 Obstetrics
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 Device Application
Resource: Device Application
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.48
Value Set Description: Value set Intermittent pneumatic compression devices (IPC)
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 Venous foot pumps (VFP)
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 Graduated compression stockings (GCS)
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 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/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 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 Medical Reason
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 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
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.1110.23
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 Code: active
System: http://terminology.hl7.org/CodeSystem/condition-clinical
Direct Reference Code Code: recurrence
System: http://terminology.hl7.org/CodeSystem/condition-clinical
Direct Reference Code Code: relapse
System: http://terminology.hl7.org/CodeSystem/condition-clinical
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: 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: 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: Supplemental Data Elements
Canonical URL: http://hl7.org/fhir/uv/cqm/Library/SupplementalDataElements
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 Global
Resource: MAT Global Common Functions FHIR Library
Canonical URL: http://hl7.org/fhir/uv/cqm/Library/MATGlobalCommonFunctions
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 TJC
Resource: TJC Overall Library
Canonical URL: http://hl7.org/fhir/uv/cqm/Library/TJCOverall
Dependency Description: Library VTEICU
Resource: VTE ICU Library
Canonical URL: http://hl7.org/fhir/uv/cqm/Library/VTEICU
Dependency Description: Library EXMCommon
Resource: EXMCommon
Canonical URL: http://hl7.org/fhir/uv/cqm/Library/EXMCommon
Data Requirements
Data Requirement Type: Patient
Profile(s): Patient
Must Support Elements: url, extension, value
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, status, period, condition, condition.reference, location
Code Filter(s):
Path: type
ValueSet: Encounter Inpatient
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, period, condition, condition.reference, location
Code Filter(s):
Path: type
ValueSet: Observation Services
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, period, condition, condition.reference, location
Code Filter(s):
Path: type
ValueSet: Emergency Department Visit
Data Requirement Type: Condition
Profile(s): Condition
Must Support Elements: id, code
Data Requirement Type: Condition
Profile(s): Condition
Must Support Elements: code
Code Filter(s):
Path: code
ValueSet: Atrial Fibrillation or Flutter
Data Requirement Type: Condition
Profile(s): Condition
Must Support Elements: code, clinicalStatus, onset
Code Filter(s):
Path: code
ValueSet: Venous Thromboembolism
Data Requirement Type: MedicationAdministration
Profile(s): MedicationAdministration
Must Support Elements: medication, status, effective, dosage, dosage.route, 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, dosage, dosage.route, status, id, effective
Code Filter(s):
Path: medication
ValueSet: Unfractionated Heparin
Data Requirement Type: MedicationAdministration
Profile(s): MedicationAdministration
Must Support Elements: medication, dosage, dosage.route, status, id, effective
Code Filter(s):
Path: medication
ValueSet: Direct Thrombin Inhibitor
Data Requirement Type: MedicationAdministration
Profile(s): MedicationAdministration
Must Support Elements: medication, dosage, dosage.route, status, id, effective
Code Filter(s):
Path: medication
ValueSet: Glycoprotein IIb IIIa Inhibitors
Data Requirement Type: MedicationAdministration
Profile(s): MedicationAdministration
Must Support Elements: medication.reference, dosage, dosage.route, status, id, effective
Data Requirement Type: MedicationAdministration
Profile(s): MedicationAdministration
Must Support Elements: medication, status, dosage, dosage.route, id, effective
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, id, effective
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, id, effective
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, id, effective
Code Filter(s):
Path: medication
ValueSet: Warfarin
Data Requirement Type: Procedure
Profile(s): Procedure
Must Support Elements: code, status, usedCode, performed, id, statusReason
Code Filter(s):
Path: code
ValueSet: Device Application
Data Requirement Type: Procedure
Profile(s): Procedure
Must Support Elements: code, status, performed
Code Filter(s):
Path: code
ValueSet: General Surgery
Data Requirement Type: Procedure
Profile(s): Procedure
Must Support Elements: code, status, performed
Code Filter(s):
Path: code
ValueSet: Gynecological Surgery
Data Requirement Type: Procedure
Profile(s): Procedure
Must Support Elements: code, status, performed
Code Filter(s):
Path: code
ValueSet: Hip Fracture Surgery
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: Intracranial Neurosurgery
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: code, status, performed
Code Filter(s):
Path: code
ValueSet: Urological Surgery
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, performed, status
Code Filter(s):
Path: code
ValueSet: General or Neuraxial Anesthesia
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: code, value, status, effective
Code Filter(s):
Path: code
Code(s): LOINC: 72136-5 (Risk for venous thromboembolism)
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: code, value, status, id, issued, effective
Code Filter(s):
Path: code
ValueSet: INR
Data Requirement Type: Medication
Profile(s): Medication
Must Support Elements: id, code
Data Requirement Type: MedicationRequest
Profile(s): MedicationRequest
Must Support Elements: medication, doNotPerform, status
Code Filter(s):
Path: medication
ValueSet: Low Dose Unfractionated Heparin for VTE Prophylaxis
Data Requirement Type: MedicationRequest
Profile(s): MedicationRequest
Must Support Elements: medication, doNotPerform, status
Code Filter(s):
Path: medication
ValueSet: Low Molecular Weight Heparin for VTE Prophylaxis
Data Requirement Type: MedicationRequest
Profile(s): MedicationRequest
Must Support Elements: medication, doNotPerform, status
Code Filter(s):
Path: medication
ValueSet: Injectable Factor Xa Inhibitor for VTE Prophylaxis
Data Requirement Type: MedicationRequest
Profile(s): MedicationRequest
Must Support Elements: medication, doNotPerform, status
Code Filter(s):
Path: medication
ValueSet: Warfarin
Data Requirement Type: ServiceRequest
Profile(s): ServiceRequest
Must Support Elements: code, status, doNotPerform, id, authoredOn
Code Filter(s):
Path: code
ValueSet: Venous foot pumps
Data Requirement Type: ServiceRequest
Profile(s): ServiceRequest
Must Support Elements: code, status, doNotPerform, id, authoredOn
Code Filter(s):
Path: code
ValueSet: Intermittent pneumatic compression devices
Data Requirement Type: ServiceRequest
Profile(s): ServiceRequest
Must Support Elements: code, status, doNotPerform, id, authoredOn
Code Filter(s):
Path: code
ValueSet: Graduated compression stockings
Data Requirement Type: ServiceRequest
Profile(s): ServiceRequest
Must Support Elements: code, intent, status, doNotPerform, id, authoredOn
Code Filter(s):
Path: code
ValueSet: Comfort Measures
Data Requirement Type: Coverage
Profile(s): Coverage
Must Support Elements: type, period
Code Filter(s):
Path: type
ValueSet: Payer Type
Data Requirement Type: Location
Profile(s): Location
Must Support Elements: id
Data Requirement Type: Claim
Profile(s): Claim
Must Support Elements: status, use, item
Generated using version 0.5.6 of the sample-content-ig Liquid templates