Metadata Title EXM108 - Venous Thromboembolism Prophylaxis Library Version 1.0.0-ballot Identifier EXM108 Approval Date 2019-08-03 Last Review Date 2019-08-03 Experimental true Jurisdiction World Steward (Publisher) HL7 International / Clinical Quality Information Description This library is used as an example for Venous Thromboembolism Prophylaxis Type logic-library from http://terminology.hl7.org/CodeSystem/library-type Data Requirement Type: Coverage Profile(s): Coverage Code Filter(s): Path: type ValueSet: Payer Type Data Requirement Type: Encounter Profile(s): Encounter Code Filter(s): Path: type ValueSet: Encounter Inpatient Data Requirement Type: Patient Profile(s): Patient Data Requirement Type: Location Profile(s): Location Data Requirement Type: Condition Profile(s): Condition Data Requirement Type: Procedure Profile(s): Procedure Code Filter(s): Path: code ValueSet: General Surgery Data Requirement Type: Procedure Profile(s): Procedure Code Filter(s): Path: code ValueSet: Gynecological Surgery Data Requirement Type: Procedure Profile(s): Procedure Code Filter(s): Path: code ValueSet: Hip Fracture Surgery Data Requirement Type: Procedure Profile(s): Procedure Code Filter(s): Path: code ValueSet: Intracranial Neurosurgery Data Requirement Type: Procedure Profile(s): Procedure Code Filter(s): Path: code ValueSet: Urological Surgery Data Requirement Type: ServiceRequest Profile(s): ServiceRequest Code Filter(s): Path: code ValueSet: Comfort Measures Data Requirement Type: Procedure Profile(s): Procedure Code Filter(s): Path: code ValueSet: Comfort Measures Data Requirement Type: Encounter Profile(s): Encounter Code Filter(s): Path: type ValueSet: Observation Services Data Requirement Type: Encounter Profile(s): Encounter Code Filter(s): Path: type ValueSet: Emergency Department Visit Data Requirement Type: MedicationAdministration Profile(s): MedicationAdministration Code Filter(s): Path: medication ValueSet: Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment Data Requirement Type: Condition Profile(s): Condition Code Filter(s): Path: code ValueSet: Atrial Fibrillation or Flutter Data Requirement Type: Condition Profile(s): Condition Code Filter(s): Path: code ValueSet: Venous Thromboembolism Data Requirement Type: Procedure Profile(s): Procedure Code Filter(s): Path: code ValueSet: Hip Replacement Surgery Data Requirement Type: Procedure Profile(s): Procedure Code Filter(s): Path: code ValueSet: Knee Replacement Surgery Data Requirement Type: Observation Profile(s): Observation Code Filter(s): Path: code Code(s): LOINC: 72136-5 (Risk for venous thromboembolism) Data Requirement Type: Observation Profile(s): Observation Code Filter(s): Path: code ValueSet: INR Data Requirement Type: MedicationAdministration Profile(s): MedicationAdministration Code Filter(s): Path: medication ValueSet: Unfractionated Heparin Data Requirement Type: MedicationAdministration Profile(s): MedicationAdministration Code Filter(s): Path: medication ValueSet: Direct Thrombin Inhibitor Data Requirement Type: MedicationAdministration Profile(s): MedicationAdministration Code Filter(s): Path: medication ValueSet: Glycoprotein IIb IIIa Inhibitors Data Requirement Type: MedicationAdministration Profile(s): MedicationAdministration Code Filter(s): Path: medication ValueSet: Low Dose Unfractionated Heparin for VTE Prophylaxis Data Requirement Type: MedicationAdministration Profile(s): MedicationAdministration Code Filter(s): Path: medication ValueSet: Low Molecular Weight Heparin for VTE Prophylaxis Data Requirement Type: MedicationAdministration Profile(s): MedicationAdministration Code Filter(s): Path: medication ValueSet: Injectable Factor Xa Inhibitor for VTE Prophylaxis Data Requirement Type: MedicationAdministration Profile(s): MedicationAdministration Code Filter(s): Path: medication ValueSet: Warfarin Data Requirement Type: MedicationRequest Profile(s): MedicationRequest Code Filter(s): Path: medication ValueSet: Low Dose Unfractionated Heparin for VTE Prophylaxis Data Requirement Type: MedicationRequest Profile(s): MedicationRequest Code Filter(s): Path: medication ValueSet: Low Molecular Weight Heparin for VTE Prophylaxis Data Requirement Type: MedicationRequest Profile(s): MedicationRequest Code Filter(s): Path: medication ValueSet: Injectable Factor Xa Inhibitor for VTE Prophylaxis Data Requirement Type: MedicationRequest Profile(s): MedicationRequest Code Filter(s): Path: medication ValueSet: Warfarin Data Requirement Type: ServiceRequest Profile(s): ServiceRequest Code Filter(s): Path: code ValueSet: Venous foot pumps Data Requirement Type: ServiceRequest Profile(s): ServiceRequest Code Filter(s): Path: code ValueSet: Intermittent pneumatic compression devices Data Requirement Type: ServiceRequest Profile(s): ServiceRequest Code Filter(s): Path: code ValueSet: Graduated compression stockings Data Requirement Type: Procedure Profile(s): Procedure Code Filter(s): Path: code ValueSet: Device Application Data Requirement Type: Procedure Profile(s): Procedure Code Filter(s): Path: code ValueSet: General or Neuraxial Anesthesia Parameters Parameter None Library Content CQL Content /*#xD; This example is a work in progress and should not be considered a final specification#xD; or recommendation for guidance. This example will help guide and direct the process#xD; of finding conventions and usage patterns that meet the needs of the various stakeholders#xD; in the measure development community.#xD; #xD; @author: TJC#xD; Based on CMS108v8 2020 reporting year. QDM to QI-4#xD; Venous Thromboembolism Prophylaxis#xD; */#xD; library EXM108 version '8.2.000'#xD; #xD; using FHIR version '4.0.1'#xD; #xD; include FHIRHelpers version '4.0.1' called FHIRHelpers#xD; include MATGlobalCommonFunctions version '5.0.000' called Global#xD; include SupplementalDataElements version '2.0.000' called SDE#xD; include VTEICU version '5.0.000' called VTEICU#xD; include TJCOverall version '4.0.000' called TJC#xD; #xD; codesystem "SNOMEDCT": 'http://snomed.info/sct'#xD; codesystem "LOINC": 'http://loinc.org'#xD; // NOTE: R4 code system URLs changed to be based on terminology.hl7.org...#xD; codesystem "RequestIntent": 'http://terminology.hl7.org/CodeSystem/request-intent'#xD; //NOTE: Created for ActPriority for Encounter.category which is codeableConcept#xD; codesystem "ActPriority": 'http://terminology.hl7.org/ValueSet/v3-ActPriority'#xD; #xD; valueset "Device Application": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.48'#xD; valueset "Atrial Fibrillation/Flutter": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.202'#xD; valueset "Comfort Measures": 'http://cts.nlm.nih.gov/fhir/ValueSet/1.3.6.1.4.1.33895.1.3.0.45'#xD; valueset "Direct Thrombin Inhibitor": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.205'#xD; valueset "Emergency Department Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292'#xD; valueset "General or Neuraxial Anesthesia": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.1743'#xD; valueset "General Surgery": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.255'#xD; valueset "Glycoprotein IIb/IIIa Inhibitors": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.41'#xD; valueset "Graduated compression stockings (GCS)": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.256'#xD; valueset "Gynecological Surgery": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.257'#xD; valueset "Hemorrhagic Stroke": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.212'#xD; valueset "Hip Fracture Surgery": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.258'#xD; valueset "Hip Replacement Surgery": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.259'#xD; valueset "Injectable Factor Xa Inhibitor for VTE Prophylaxis": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.211'#xD; valueset "INR": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.213'#xD; valueset "Intermittent pneumatic compression devices (IPC)": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.214'#xD; valueset "Intracranial Neurosurgery": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.260'#xD; valueset "Intravenous route": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.222'#xD; valueset "Ischemic Stroke": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.247'#xD; valueset "Knee Replacement Surgery": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.261'#xD; valueset "Low Dose Unfractionated Heparin for VTE Prophylaxis": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.39'#xD; valueset "Low Molecular Weight Heparin for VTE Prophylaxis": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.219'#xD; valueset "Low Risk": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.400'#xD; valueset "Medical Reason": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.473'#xD; valueset "Mental Health Diagnoses": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.105.12.1004'#xD; valueset "Obstetrics": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.263'#xD; valueset "Obstetrics VTE": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.264'#xD; valueset "Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.134'#xD; valueset "Patient Refusal": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.93'#xD; valueset "Subcutaneous route": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.223'#xD; valueset "Unfractionated Heparin": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.218'#xD; valueset "Urological Surgery": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.272'#xD; valueset "Venous foot pumps (VFP)": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.230'#xD; valueset "Venous Thromboembolism": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.279'#xD; valueset "Warfarin": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.232'#xD; valueset "Intensive Care Unit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.23'#xD; #xD; code "Risk for venous thromboembolism": '72136-5' from "LOINC" display 'Risk for venous thromboembolism'#xD; #xD; context Patient#xD; #xD; define "SDE Ethnicity":#xD; SDE."SDE Ethnicity"#xD; #xD; define "SDE Payer":#xD; SDE."SDE Payer"#xD; #xD; define "SDE Race":#xD; SDE."SDE Race"#xD; #xD; define "SDE Sex":#xD; SDE."SDE Sex"#xD; #xD; define "Initial Population":#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions"#xD; #xD; // Note: added FHIRHelpers.ToDate() in R4#xD; define "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions":#xD; ( Global."Inpatient Encounter" InpatientEncounter#xD; with ["Patient"] BirthDate#xD; such that Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(BirthDate.birthDate), start of InpatientEncounter.period) >= 18#xD; )#xD; intersect "Admission Without VTE or Obstetrical Conditions"#xD; #xD; define "Admission Without VTE or Obstetrical Conditions":#xD; Global."Inpatient Encounter" InpatientEncounter#xD; where not (exists (Global.EncounterDiagnosis(InpatientEncounter)) EncounterDiagnosis#xD; where (EncounterDiagnosis.code in "Obstetrics"#xD; or EncounterDiagnosis.code in "Venous Thromboembolism"#xD; or EncounterDiagnosis.code in "Obstetrics VTE"#xD; )#xD; )#xD; #xD; define "Denominator":#xD; "Initial Population"#xD; #xD; define "Denominator Exclusion":#xD; "Encounter Less Than 2 Days"#xD; union "Encounter With ICU Location Stay 1 Day or More"#xD; union "Encounter With Principal Diagnosis of Mental Disorder or Stroke"#xD; union "Encounter With Principal Procedure of SCIP VTE Selected Surgery"#xD; union "Encounter With Intervention Comfort Measures From Day of Start of Hospitalization To Day After Admission"#xD; union "Encounter With Intervention Comfort Measures on Day of or Day After Procedure"#xD; #xD; define "Encounter Less Than 2 Days":#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter#xD; where Global."LengthInDays"(QualifyingEncounter.period)< 2#xD; #xD; define "Encounter With ICU Location Stay 1 Day or More":#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter#xD; where exists ( QualifyingEncounter.location Location#xD; where Global.GetLocation(Location.location).type in "Intensive Care Unit"#xD; and Global."LengthInDays"(Location.period)>= 1#xD; and Location.period starts during TJC."CalendarDayOfOrDayAfter"(start of QualifyingEncounter.period)#xD; )#xD; #xD; define "Encounter With Principal Diagnosis of Mental Disorder or Stroke":#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter#xD; where Global."PrincipalDiagnosis"(QualifyingEncounter).code in "Mental Health Diagnoses"#xD; or Global."PrincipalDiagnosis"(QualifyingEncounter).code in "Hemorrhagic Stroke"#xD; or Global."PrincipalDiagnosis"(QualifyingEncounter).code in "Ischemic Stroke"#xD; #xD; /* NOTE: 2 options to express Principal Procedure to retrive "encounter Procedure as an url" and proedure "rank as extension" in R4#xD; VTE-1 uses Option 1 - generic extension funtion#xD; VTE-2 uses Option 2 - Specific extension functions#xD; TODO: Mapping Table needs revision on using "Encounter.procedure.code", "Encounter.procedure.sequence"#xD; */#xD; #xD; define "Encounter With Principal Procedure of SCIP VTE Selected Surgery":#xD; from#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,#xD; "SCIP VTE Selected Surgery" SelectedProcedure#xD; let EncounterProcedure: Global.GetExtension(QualifyingEncounter, 'qicore-encounter-procedure')#xD; where FHIRHelpers.ToInteger(Global.GetExtension(EncounterProcedure, 'rank').value as FHIR.positiveInt) = 1#xD; and Global.GetId(FHIRHelpers.ToString((Global.GetExtension(EncounterProcedure, 'procedure').value as FHIR.Reference).reference)) = SelectedProcedure.id#xD; and Global."Normalize Interval"(SelectedProcedure.performed) during QualifyingEncounter.period#xD; #xD; define "SCIP VTE Selected Surgery":#xD; ( ["Procedure": "General Surgery"]#xD; union ["Procedure": "Gynecological Surgery"]#xD; union ["Procedure": "Hip Fracture Surgery"]#xD; union ["Procedure": "Hip Replacement Surgery"]#xD; union ["Procedure": "Intracranial Neurosurgery"]#xD; union ["Procedure": "Knee Replacement Surgery"]#xD; union ["Procedure": "Urological Surgery"] ) Procedure#xD; where Procedure.status = 'completed'#xD; #xD; define "Encounter With Intervention Comfort Measures From Day of Start of Hospitalization To Day After Admission":#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter#xD; with "Intervention Comfort Measures" ComfortMeasure#xD; such that Coalesce(start of Global."Normalize Interval"(ComfortMeasure.performed), ComfortMeasure.authoredOn) during VTEICU."FromDayOfStartOfHospitalizationToDayAfterAdmission"(QualifyingEncounter)#xD; #xD; define "Intervention Comfort Measures":#xD; (["ServiceRequest": "Comfort Measures"] P#xD; where P.intent = 'order'#xD; )#xD; union#xD; (["Procedure": "Comfort Measures"] InterventionPerformed#xD; where InterventionPerformed.status in {'completed', 'in-progress'})#xD; #xD; define "Encounter With Intervention Comfort Measures on Day of or Day After Procedure":#xD; from#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,#xD; ["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,#xD; "Intervention Comfort Measures" ComfortMeasure#xD; where AnesthesiaProcedure.status = 'completed'#xD; and Global."Normalize Interval"(AnesthesiaProcedure.performed) ends 1 day after day of start of QualifyingEncounter.period#xD; and Coalesce(start of Global."Normalize Interval"(ComfortMeasure.performed), ComfortMeasure.authoredOn) during TJC."CalendarDayOfOrDayAfter"(end of Global."Normalize Interval"(AnesthesiaProcedure.performed))#xD; return QualifyingEncounter#xD; #xD; define "Numerator":#xD; "Encounter With VTE Prophylaxis Received on Day of or Day After Admission or Procedure"#xD; union ( "Encounter With Medication Oral Factor Xa Inhibitor Administered on Day of or Day After Admission or Procedure"#xD; intersect ( "Encounter With Prior or Present Diagnosis of Atrial Fibrillation or VTE"#xD; union "Encounter With Prior or Present Procedure of Hip or Knee Replacement Surgery"#xD; )#xD; )#xD; union "Encounter With Low Risk for VTE or Anticoagulant Administered"#xD; union "Encounter With No VTE Prophylaxis Due to Medical Reason"#xD; union "Encounter With No VTE Prophylaxis Due to Patient Refusal"#xD; #xD; define "Encounter With VTE Prophylaxis Received on Day of or Day After Admission or Procedure":#xD; ( from#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,#xD; "VTE Prophylaxis by Medication Administered or Device Applied" VTEProphylaxis#xD; where Coalesce(Global."Normalize Interval"(VTEProphylaxis.effective), Global."Normalize Interval"(VTEProphylaxis.performed)) starts during TJC."CalendarDayOfOrDayAfter"(start of QualifyingEncounter.period)#xD; return QualifyingEncounter#xD; )#xD; union (#xD; from#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,#xD; ["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,#xD; "VTE Prophylaxis by Medication Administered or Device Applied" VTEProphylaxis#xD; where Global."Normalize Interval"(AnesthesiaProcedure.performed) ends 1 day after day of start of QualifyingEncounter.period#xD; and Coalesce(Global."Normalize Interval"(VTEProphylaxis.effective), Global."Normalize Interval"(VTEProphylaxis.performed)) starts during TJC."CalendarDayOfOrDayAfter"(end of Global."Normalize Interval"(AnesthesiaProcedure.performed))#xD; return QualifyingEncounter#xD; )#xD; #xD; // 10/29: Replaced DeviceUseStatement with Procedure with a new value set and procedure.usdCode for specifying devices#xD; define "VTE Prophylaxis by Medication Administered or Device Applied":#xD; ( ["MedicationAdministration": medication in "Low Dose Unfractionated Heparin for VTE Prophylaxis"] VTEMedication#xD; where VTEMedication.status ='completed'#xD; and VTEMedication.dosage.route in "Subcutaneous route"#xD; )#xD; union (["MedicationAdministration": medication in "Low Molecular Weight Heparin for VTE Prophylaxis"] LMWH where LMWH.status = 'completed')#xD; union (["MedicationAdministration": medication in "Injectable Factor Xa Inhibitor for VTE Prophylaxis"] FactorXa where FactorXa.status = 'completed')#xD; union (["MedicationAdministration": medication in "Warfarin"] Warfarin where Warfarin.status = 'completed')#xD; union (#xD; ["Procedure": "Device Application"] DeviceApplied#xD; where DeviceApplied.status = 'complete'#xD; and (DeviceApplied.usedCode in "Intermittent pneumatic compression devices (IPC)"#xD; or DeviceApplied.usedCode in"Venous foot pumps (VFP)"#xD; or DeviceApplied.usedCode in "Graduated compression stockings (GCS)"#xD; )#xD; )#xD; #xD; define "Encounter With Medication Oral Factor Xa Inhibitor Administered on Day of or Day After Admission or Procedure":#xD; ( from#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,#xD; ["MedicationAdministration": medication in "Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment"] FactorXaMedication#xD; where FactorXaMedication.status = 'completed'#xD; and Global."Normalize Interval"(FactorXaMedication.effective) starts during TJC."CalendarDayOfOrDayAfter"(start of QualifyingEncounter.period)#xD; return QualifyingEncounter#xD; )#xD; union ( from#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,#xD; ["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,#xD; ["MedicationAdministration": medication in "Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment"] FactorXaMedication#xD; where FactorXaMedication.status = 'completed'#xD; and AnesthesiaProcedure.status = 'completed'#xD; and Global."Normalize Interval"(AnesthesiaProcedure.performed) ends 1 day after day of start of QualifyingEncounter.period#xD; and Global."Normalize Interval"(FactorXaMedication.effective) starts during TJC."CalendarDayOfOrDayAfter"(end of Global."Normalize Interval"(AnesthesiaProcedure.performed))#xD; return QualifyingEncounter#xD; )#xD; #xD; /*NOTE: Feedback at Digitial Quality Summit 2019 indicates verificationStatus may be difficult for implementers to retrieve#xD; both condition.clinicalStatus and condition.verificationStatus = 'confirmed'#xD; */#xD; define "Encounter With Prior or Present Diagnosis of Atrial Fibrillation or VTE":#xD; ( "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter#xD; with ["Condition": code in "Atrial Fibrillation/Flutter"] AtrialFibrillation#xD; such that FHIRHelpers.ToConcept(AtrialFibrillation.clinicalStatus) in { Global."active", Global."recurrence", Global."relapse" }#xD; and Global."Normalize Interval"(AtrialFibrillation.onset) starts on or before end of QualifyingEncounter.period#xD; )#xD; union ( "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter#xD; where Global.EncounterDiagnosis(QualifyingEncounter).code in "Atrial Fibrillation/Flutter"#xD; )#xD; union ( "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter#xD; with ["Condition": code in "Venous Thromboembolism"] VTEDiagnosis#xD; such that FHIRHelpers.ToConcept(VTEDiagnosis.clinicalStatus) in { Global."inactive", Global."remission", Global."resolved" }#xD; //and VTEDiagnosis.verificationStatus = 'confirmed'#xD; and Global."Normalize Interval"(VTEDiagnosis.onset) before start of QualifyingEncounter.period#xD; )#xD; #xD; define "Encounter With Prior or Present Procedure of Hip or Knee Replacement Surgery":#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter#xD; with ( ["Procedure": "Hip Replacement Surgery"]#xD; union ["Procedure": "Knee Replacement Surgery"] ) HipKneeProcedure#xD; such that HipKneeProcedure.status = 'completed'#xD; and Global."Normalize Interval"(HipKneeProcedure.performed) starts on or before end of QualifyingEncounter.period#xD; #xD; #xD; define "Encounter With Low Risk for VTE or Anticoagulant Administered":#xD; "Low Risk for VTE or Anticoagulant Administered From Day of Start of Hospitalization To Day After Admission"#xD; union "Low Risk for VTE or Anticoagulant Administered on Day of or Day After Procedure"#xD; #xD; define "Low Risk for VTE or Anticoagulant Administered From Day of Start of Hospitalization To Day After Admission":#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter#xD; with "Is In Low Risk for VTE or On Anticoagulant" VTERiskAssessment#xD; such that Global."Normalize Interval"(VTERiskAssessment.effective) starts during VTEICU."FromDayOfStartOfHospitalizationToDayAfterAdmission"(QualifyingEncounter)#xD; #xD; define "Is In Low Risk for VTE or On Anticoagulant":#xD; ( ["Observation": "Risk for venous thromboembolism"] VTERiskAssessment#xD; where VTERiskAssessment.value in "Low Risk"#xD; and VTERiskAssessment.status in {'final','amended', 'corrected'}#xD; )#xD; union ( ["Observation": "INR"] INRLabTest#xD; where INRLabTest.value as Quantity > 3.0#xD; and INRLabTest.status in {'final','amended', 'corrected'}#xD; return "Observation" { id: INRLabTest.id, effective: INRLabTest.issued }#xD; )#xD; union ((( ["MedicationAdministration": "Unfractionated Heparin"] UnfractionatedHeparin#xD; where UnfractionatedHeparin.dosage.route in "Intravenous route"#xD; )#xD; union ["MedicationAdministration": "Direct Thrombin Inhibitor"]#xD; union ["MedicationAdministration": "Glycoprotein IIb/IIIa Inhibitors"] ) AnticoagulantMedication#xD; where AnticoagulantMedication.status = 'complete'#xD; return "Observation" { id: AnticoagulantMedication.id, effective: AnticoagulantMedication.effective }#xD; )#xD; #xD; define "Low Risk for VTE or Anticoagulant Administered on Day of or Day After Procedure":#xD; from#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,#xD; ["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,#xD; "Is In Low Risk for VTE or On Anticoagulant" VTERiskAssessment#xD; where Global."Normalize Interval"(AnesthesiaProcedure.performed) ends 1 day after day of start of QualifyingEncounter.period#xD; and Global."Normalize Interval"(VTERiskAssessment.effective) starts during TJC."CalendarDayOfOrDayAfter"(end of Global."Normalize Interval"(AnesthesiaProcedure.performed))#xD; return QualifyingEncounter#xD; #xD; define "Encounter With No VTE Prophylaxis Due to Medical Reason":#xD; ( "No VTE Prophylaxis Medication Due to Medical Reason From Day of Start of Hospitalization To Day After Admission"#xD; intersect "No VTE Prophylaxis Device Due to Medical Reason From Day of Start of Hospitalization To Day After Admission"#xD; )#xD; union ( "No VTE Prophylaxis Medication Due to Medical Reason on Day of or Day After Procedure"#xD; intersect "No VTE Prophylaxis Device Due to Medical Reason on Day of or Day After Procedure"#xD; )#xD; #xD; define "No VTE Prophylaxis Medication Due to Medical Reason From Day of Start of Hospitalization To Day After Admission":#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter#xD; with "No VTE Prophylaxis Medication Administered or Ordered" NoVTEMedication#xD; such that Coalesce(NoVTEMedication.statusReason,NoVTEMedication.reasonCode) in "Medical Reason"#xD; and Coalesce(NoVTEMedication.authoredOn, start of Global."Normalize Interval"(NoVTEMedication.effective)) during VTEICU."FromDayOfStartOfHospitalizationToDayAfterAdmission"(QualifyingEncounter)#xD; #xD; define "No VTE Prophylaxis Medication Administered or Ordered":#xD; (( ["MedicationAdministration": medication in "Low Dose Unfractionated Heparin for VTE Prophylaxis"]#xD; union#xD; ["MedicationAdministration": medication in "Low Molecular Weight Heparin for VTE Prophylaxis"]#xD; union#xD; ["MedicationAdministration": medication in "Injectable Factor Xa Inhibitor for VTE Prophylaxis"]#xD; union#xD; ["MedicationAdministration": medication in "Warfarin"]#xD; ) MedicationAdm#xD; where MedicationAdm.status = 'not-done'#xD; )#xD; union#xD; (( ["MedicationRequest": medication in "Low Dose Unfractionated Heparin for VTE Prophylaxis"]#xD; union#xD; ["MedicationRequest": medication in "Low Molecular Weight Heparin for VTE Prophylaxis"]#xD; union#xD; ["MedicationRequest": medication in "Injectable Factor Xa Inhibitor for VTE Prophylaxis"]#xD; union#xD; ["MedicationRequest": medication in "Warfarin"]#xD; ) MedicationOrder#xD; where MedicationOrder.doNotPerform is true#xD; and MedicationOrder.status in {'completed', 'cancelled'}#xD; //11/5 discussion: all expressions for QI-Core must include a status.#xD; //Therefore, we need ServiceRequest.status = completed; and MedicationRequest.status = cancelled (or completed, since cancelled indicates it was once ordered but intentionally never filled).#xD; //So the not done issue is handled by ServiceRequest.doNotPerform = True Or MedicationRequest.doNotPerform = True#xD; )#xD; #xD; define "No VTE Prophylaxis Medication Due to Medical Reason on Day of or Day After Procedure":#xD; from#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,#xD; ["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,#xD; "No VTE Prophylaxis Medication Administered or Ordered" NoVTEMedication#xD; where Coalesce(NoVTEMedication.statusReason,NoVTEMedication.reasonCode) in "Medical Reason"#xD; and AnesthesiaProcedure.status = 'completed'#xD; and Global."Normalize Interval"(AnesthesiaProcedure.performed) ends 1 day after day of start of QualifyingEncounter.period#xD; and Coalesce(NoVTEMedication.authoredOn, start of Global."Normalize Interval"(NoVTEMedication.effective)) during TJC."CalendarDayOfOrDayAfter"(end of Global."Normalize Interval"(AnesthesiaProcedure.performed))#xD; return QualifyingEncounter#xD; #xD; define "No VTE Prophylaxis Device Due to Medical Reason From Day of Start of Hospitalization To Day After Admission":#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter#xD; with "No VTE Prophylaxis Device Applied or Ordered" NoVTEDevice#xD; such that NoVTEDevice.requestStatusReason in "Medical Reason"#xD; and NoVTEDevice.authoredOn during VTEICU."FromDayOfStartOfHospitalizationToDayAfterAdmission"(QualifyingEncounter)#xD; #xD; //11/5: ServiceRequest not done reason is an extension in QI-Core R4 as ServiceRequest.extension:statusReason#xD; define function GetStatusReason(requestReason ServiceRequest):#xD; Global.GetBaseExtension(requestReason, 'request-statusReason')#xD; #xD; define "No VTE Prophylaxis Device Applied or Ordered":#xD; ((#xD; ["ServiceRequest": "Venous foot pumps (VFP)"]#xD; union ["ServiceRequest": "Intermittent pneumatic compression devices (IPC)"]#xD; union ["ServiceRequest": "Graduated compression stockings (GCS)"]#xD; ) DeviceOrder#xD; where DeviceOrder.status = 'completed'#xD; //11/5 discussion: all expressions for QI-Core must include a status#xD; //ServiceRequest.status - draft | active | suspended | completed | entered-in-error | cancelled#xD; and DeviceOrder.doNotPerform is true#xD; return {id: DeviceOrder.id, requestStatusReason: GetStatusReason(DeviceOrder), authoredOn: DeviceOrder.authoredOn}#xD; )#xD; union#xD; (#xD; ["Procedure": "Device Application"] DeviceApplied#xD; let DeviceNotDoneTiming: Global.GetExtension(DeviceApplied, 'qicore-recorded').value#xD; where (DeviceApplied.usedCode in "Intermittent pneumatic compression devices (IPC)"#xD; or DeviceApplied.usedCode in "Venous foot pumps (VFP)"#xD; or DeviceApplied.usedCode in "Graduated compression stockings (GCS)"#xD; )#xD; and DeviceApplied.status = 'not-done'#xD; return {id: DeviceApplied.id, requestStatusReason: DeviceApplied.statusReason, authoredOn: DeviceNotDoneTiming}#xD; #xD; )#xD; #xD; define "No VTE Prophylaxis Device Due to Medical Reason on Day of or Day After Procedure":#xD; from#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,#xD; ["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,#xD; "No VTE Prophylaxis Device Applied or Ordered" NoVTEDevice#xD; where NoVTEDevice.requestStatusReason in "Medical Reason"#xD; and AnesthesiaProcedure.status = 'completed'#xD; and Global."Normalize Interval"(AnesthesiaProcedure.performed) ends 1 day after day of start of QualifyingEncounter.period#xD; and NoVTEDevice.authoredOn during TJC."CalendarDayOfOrDayAfter"(end of Global."Normalize Interval"(AnesthesiaProcedure.performed))#xD; return QualifyingEncounter#xD; #xD; define "Encounter With No VTE Prophylaxis Due to Patient Refusal":#xD; "No VTE Prophylaxis Due to Patient Refusal From Day of Start of Hospitalization To Day After Admission"#xD; union "No VTE Prophylaxis Due to Patient Refusal on Day of or Day After Procedure"#xD; #xD; define "No VTE Prophylaxis Due to Patient Refusal From Day of Start of Hospitalization To Day After Admission":#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter#xD; with "No VTE Prophylaxis Medication or Device Due to Patient Refusal" PatientRefusal#xD; such that Coalesce(start of Global."Normalize Interval"(PatientRefusal.effective), PatientRefusal.authoredOn)#xD; during VTEICU."FromDayOfStartOfHospitalizationToDayAfterAdmission"(QualifyingEncounter)#xD; #xD; define "No VTE Prophylaxis Medication or Device Due to Patient Refusal":#xD; ( "No VTE Prophylaxis Medication Administered or Ordered" NoVTEMedication#xD; where Coalesce(NoVTEMedication.statusReason,NoVTEMedication.reasonCode) in "Patient Refusal"#xD; )#xD; union ("No VTE Prophylaxis Device Applied or Ordered" NoVTEDevice#xD; where NoVTEDevice.requestStatusReason in "Patient Refusal"#xD; )#xD; #xD; define "No VTE Prophylaxis Due to Patient Refusal on Day of or Day After Procedure":#xD; from#xD; "Encounter With Age Range and Without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,#xD; ["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,#xD; "No VTE Prophylaxis Medication or Device Due to Patient Refusal" PatientRefusal#xD; where Global."Normalize Interval"(AnesthesiaProcedure.performed) ends 1 day after day of start of QualifyingEncounter.period#xD; and Coalesce(start of Global."Normalize Interval"(PatientRefusal.effective), PatientRefusal.authoredOn)#xD; during TJC."CalendarDayOfOrDayAfter"(end of Global."Normalize Interval"(AnesthesiaProcedure.performed))#xD; return QualifyingEncounter#xD; ELM XML Content Encoded data ELM JSON Content Encoded data Generated using version 0.5.4-cibuild of the sample-content-ig Liquid templates
EXM108 - Venous Thromboembolism Prophylaxis Library
HL7 International / Clinical Quality Information
This library is used as an example for Venous Thromboembolism Prophylaxis