Library Name |
Name |
SupplementalDataElements |
SDE Sex |
|
define "SDE Sex":
case
when Patient.gender = 'male' then "M"
when Patient.gender = 'female' then "F"
else null
end
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
SDE Sex |
|
define "SDE Sex":
SDE."SDE Sex"
|
Library Name |
Name |
CQMCommon |
Inpatient Encounter |
|
define "Inpatient Encounter":
[Encounter: "Encounter Inpatient"] EncounterInpatient
where EncounterInpatient.status = 'finished'
and EncounterInpatient.period ends during day of "Measurement Period"
|
Library Name |
Name |
VTE |
Admission without VTE or Obstetrical Conditions |
|
define "Admission without VTE or Obstetrical Conditions":
CQMCommon."Inpatient Encounter" InpatientEncounter
where not (exists (InpatientEncounter.encounterDiagnosis()) EncDx
where (EncDx.code in "Obstetrical or Pregnancy Related Conditions"
or EncDx.code in "Venous Thromboembolism"
or EncDx.code in "Obstetrics VTE"
)
)
|
Library Name |
Name |
VTE |
Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions |
|
define "Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions":
( CQMCommon."Inpatient Encounter" InpatientEncounter
where AgeInYearsAt(date from start of InpatientEncounter.period) >= 18 )
intersect "Admission without VTE or Obstetrical Conditions"
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Pharmacological or Mechanical VTE Prophylaxis Received |
|
define "Pharmacological or Mechanical VTE Prophylaxis Received":
( ["MedicationAdministration": "Low Dose Unfractionated Heparin for VTE Prophylaxis"] VTEMedication
where VTEMedication.status = 'completed'
and VTEMedication.dosage.route in "Subcutaneous route"
)
union ( ["MedicationAdministration": "Low Molecular Weight Heparin for VTE Prophylaxis"] LMWH
where LMWH.status = 'completed'
)
union ( ["MedicationAdministration": "Injectable Factor Xa Inhibitor for VTE Prophylaxis"] FactorXa
where FactorXa.status = 'completed'
)
union ( ["MedicationAdministration": "Warfarin"] Warfarin
where Warfarin.status = 'completed'
)
union ( ["MedicationAdministration": "Rivaroxaban for VTE Prophylaxis"] Rivaroxaban
where Rivaroxaban.status = 'completed'
)
union ( ( ["Procedure": "Application of Intermittent Pneumatic Compression Devices"]
union ["Procedure": "Application of Venous Foot Pumps"]
union ["Procedure": "Application of Graduated Compression Stockings"] ) DeviceApplied
where DeviceApplied.status = 'completed'
)
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Encounter with VTE Prophylaxis Received From Day of Start of Hospitalization To Day After Admission or Procedure |
|
define "Encounter with VTE Prophylaxis Received From Day of Start of Hospitalization To Day After Admission or Procedure":
( from
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
"Pharmacological or Mechanical VTE Prophylaxis Received" VTEProphylaxis
where Coalesce(VTEProphylaxis.effective.toInterval(), VTEProphylaxis.performed.toInterval()) starts during day of QualifyingEncounter.FromDayOfStartOfHospitalizationToDayAfterAdmission ( )
return QualifyingEncounter
)
union ( from
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
"Pharmacological or Mechanical VTE Prophylaxis Received" VTEProphylaxis
where AnesthesiaProcedure.status = 'completed'
and AnesthesiaProcedure.performed.toInterval ( ) ends 1 day after day of start of QualifyingEncounter.period
and Coalesce(VTEProphylaxis.effective.toInterval(), VTEProphylaxis.performed.toInterval()) starts during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).CalendarDayOfOrDayAfter ( )
return QualifyingEncounter
)
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Encounter with Medication Oral Factor Xa Inhibitor Administered on Day of or Day After Admission or Procedure |
|
define "Encounter with Medication Oral Factor Xa Inhibitor Administered on Day of or Day After Admission or Procedure":
( from
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
["MedicationAdministration": "Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment"] FactorXaMedication
where FactorXaMedication.status = 'completed'
and FactorXaMedication.effective.toInterval ( ) starts during day of ( start of QualifyingEncounter.period ).CalendarDayOfOrDayAfter ( )
return QualifyingEncounter
)
union ( from
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
["MedicationAdministration": "Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment"] FactorXaMedication
where FactorXaMedication.status = 'completed'
and AnesthesiaProcedure.status = 'completed'
and AnesthesiaProcedure.performed.toInterval ( ) ends 1 day after day of start of QualifyingEncounter.period
and FactorXaMedication.effective.toInterval ( ) starts during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).CalendarDayOfOrDayAfter ( )
return QualifyingEncounter
)
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Encounter with Prior or Present Diagnosis of Atrial Fibrillation or Prior Diagnosis of VTE |
|
define "Encounter with Prior or Present Diagnosis of Atrial Fibrillation or Prior Diagnosis of VTE":
( VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
with ["Condition": "Atrial Fibrillation or Flutter"] AtrialFibrillation
such that AtrialFibrillation.isActive ( )
and AtrialFibrillation.verificationStatus is not null
and AtrialFibrillation.verificationStatus ~ QICoreCommon."confirmed"
and AtrialFibrillation.onset.toInterval ( ) starts on or before end of QualifyingEncounter.period
)
union ( VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
where QualifyingEncounter.encounterDiagnosis ( ).code in "Atrial Fibrillation or Flutter"
)
union ( VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
with ["Condition": "Venous Thromboembolism"] VTEDiagnosis
such that ( VTEDiagnosis.clinicalStatus ~ QICoreCommon."inactive"
or VTEDiagnosis.clinicalStatus ~ QICoreCommon."remission"
or VTEDiagnosis.clinicalStatus ~ QICoreCommon."resolved"
)
and VTEDiagnosis.verificationStatus is not null
and VTEDiagnosis.verificationStatus ~ QICoreCommon."confirmed"
and VTEDiagnosis.onset.toInterval ( ) before start of QualifyingEncounter.period
)
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Encounter with Prior or Present Procedure of Hip or Knee Replacement Surgery |
|
define "Encounter with Prior or Present Procedure of Hip or Knee Replacement Surgery":
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
with ( ["Procedure": "Hip Replacement Surgery"]
union ["Procedure": "Knee Replacement Surgery"] ) HipKneeProcedure
such that HipKneeProcedure.status = 'completed'
and HipKneeProcedure.performed.toInterval ( ) starts on or before end of QualifyingEncounter.period
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Low Risk Indicator For VTE |
|
define "Low Risk Indicator For VTE":
( ["Observation": "Risk for venous thromboembolism"] VTERiskAssessment
where VTERiskAssessment.value as Concept in "Low Risk"
and VTERiskAssessment.status in { 'final', 'amended', 'corrected' }
return {
id: VTERiskAssessment.id,
LowRiskDatetime: VTERiskAssessment.effective.earliest ( )
}
)
union ( ["US Core Laboratory Result Observation Profile": "INR"] INRLabTest
where INRLabTest.value as Quantity > 3.0
and INRLabTest.status in { 'final', 'amended', 'corrected' }
return {
id: INRLabTest.id,
LowRiskDatetime: INRLabTest.issued
}
)
union ( ( ( ["MedicationAdministration": "Unfractionated Heparin"] UnfractionatedHeparin
where UnfractionatedHeparin.dosage.route in "Intravenous route"
)
union ["MedicationAdministration": "Direct Thrombin Inhibitor"]
union ["MedicationAdministration": "Glycoprotein IIb/IIIa Inhibitors"] ) AnticoagulantMedication
where AnticoagulantMedication.status = 'completed'
return {
id: AnticoagulantMedication.id,
LowRiskDatetime: start of AnticoagulantMedication.effective.toInterval ( )
}
)
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Low Risk for VTE or Anticoagulant Administered From Day of Start of Hospitalization To Day After Admission |
|
define "Low Risk for VTE or Anticoagulant Administered From Day of Start of Hospitalization To Day After Admission":
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
with "Low Risk Indicator For VTE" LowRiskForVTE
such that LowRiskForVTE.LowRiskDatetime during day of QualifyingEncounter.FromDayOfStartOfHospitalizationToDayAfterAdmission ( )
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Low Risk for VTE or Anticoagulant Administered on Day of or Day After Procedure |
|
define "Low Risk for VTE or Anticoagulant Administered on Day of or Day After Procedure":
from
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
"Low Risk Indicator For VTE" LowRiskForVTE
where AnesthesiaProcedure.status = 'completed'
and AnesthesiaProcedure.performed.toInterval ( ) ends 1 day after day of start of QualifyingEncounter.period
and LowRiskForVTE.LowRiskDatetime during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).CalendarDayOfOrDayAfter ( )
return QualifyingEncounter
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Encounter with Low Risk for VTE or Anticoagulant Administered |
|
define "Encounter with Low Risk for VTE or Anticoagulant Administered":
"Low Risk for VTE or Anticoagulant Administered From Day of Start of Hospitalization To Day After Admission"
union "Low Risk for VTE or Anticoagulant Administered on Day of or Day After Procedure"
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
No VTE Prophylaxis Medication Administered or Ordered |
|
define "No VTE Prophylaxis Medication Administered or Ordered":
( ( [MedicationAdministrationNotDone: "Low Dose Unfractionated Heparin for VTE Prophylaxis"]
union [MedicationAdministrationNotDone: "Low Molecular Weight Heparin for VTE Prophylaxis"]
union [MedicationAdministrationNotDone: "Injectable Factor Xa Inhibitor for VTE Prophylaxis"]
union [MedicationAdministrationNotDone: "Warfarin"]
union [MedicationAdministrationNotDone: "Rivaroxaban for VTE Prophylaxis"] ) NoMedicationAdm
return {
id: NoMedicationAdm.id,
MedicationStatusReason: NoMedicationAdm.statusReason,
authoredOn: NoMedicationAdm.recorded
}
)
union ( ( ["MedicationNotRequested": "Low Dose Unfractionated Heparin for VTE Prophylaxis"]
union ["MedicationNotRequested": "Low Molecular Weight Heparin for VTE Prophylaxis"]
union ["MedicationNotRequested": "Injectable Factor Xa Inhibitor for VTE Prophylaxis"]
union ["MedicationNotRequested": "Warfarin"]
union ["MedicationNotRequested": "Rivaroxaban for VTE Prophylaxis"] ) NoMedicationOrder
where NoMedicationOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
return {
id: NoMedicationOrder.id,
MedicationStatusReason: NoMedicationOrder.reasonCode,
authoredOn: NoMedicationOrder.authoredOn
}
)
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
No VTE Prophylaxis Medication Due to Medical Reason From Day of Start of Hospitalization To Day After Admission |
|
define "No VTE Prophylaxis Medication Due to Medical Reason From Day of Start of Hospitalization To Day After Admission":
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
with "No VTE Prophylaxis Medication Administered or Ordered" NoVTEMedication
such that NoVTEMedication.MedicationStatusReason in "Medical Reason For Not Providing Treatment"
and NoVTEMedication.authoredOn during day of QualifyingEncounter.FromDayOfStartOfHospitalizationToDayAfterAdmission ( )
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
No Mechanical VTE Prophylaxis Performed or Ordered |
|
define "No Mechanical VTE Prophylaxis Performed or Ordered":
( ( [ServiceNotRequested: "Venous foot pumps"]
union [ServiceNotRequested: "Intermittent pneumatic compression devices"]
union [ServiceNotRequested: "Graduated compression stockings"] ) DeviceNotOrder
where DeviceNotOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
return {
id: DeviceNotOrder.id,
requestStatusReason: DeviceNotOrder.reasonRefused,
authoredOn: DeviceNotOrder.authoredOn
}
)
union ( ( [ProcedureNotDone: "Application of Intermittent Pneumatic Compression Devices"]
union [ProcedureNotDone: "Application of Venous Foot Pumps"]
union [ProcedureNotDone: "Application of Graduated Compression Stockings"] ) DeviceNotApplied
let DeviceNotDoneTiming: DeviceNotApplied.recorded
return {
id: DeviceNotApplied.id,
requestStatusReason: DeviceNotApplied.statusReason,
authoredOn: DeviceNotDoneTiming
}
)
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
No Mechanical VTE Prophylaxis Due to Medical Reason From Day of Start of Hospitalization To Day After Admission |
|
define "No Mechanical VTE Prophylaxis Due to Medical Reason From Day of Start of Hospitalization To Day After Admission":
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
with "No Mechanical VTE Prophylaxis Performed or Ordered" NoVTEDevice
such that NoVTEDevice.requestStatusReason in "Medical Reason For Not Providing Treatment"
and NoVTEDevice.authoredOn during day of QualifyingEncounter.FromDayOfStartOfHospitalizationToDayAfterAdmission ( )
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
No VTE Prophylaxis Medication Due to Medical Reason on Day of or Day After Procedure |
|
define "No VTE Prophylaxis Medication Due to Medical Reason on Day of or Day After Procedure":
from
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
"No VTE Prophylaxis Medication Administered or Ordered" NoVTEMedication
where NoVTEMedication.MedicationStatusReason in "Medical Reason For Not Providing Treatment"
and AnesthesiaProcedure.status = 'completed'
and AnesthesiaProcedure.performed.toInterval ( ) ends 1 day after day of start of QualifyingEncounter.period
and NoVTEMedication.authoredOn during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).CalendarDayOfOrDayAfter ( )
return QualifyingEncounter
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
No Mechanical VTE Prophylaxis Due to Medical Reason on Day of or Day After Procedure |
|
define "No Mechanical VTE Prophylaxis Due to Medical Reason on Day of or Day After Procedure":
from
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
"No Mechanical VTE Prophylaxis Performed or Ordered" NoVTEDevice
where NoVTEDevice.requestStatusReason in "Medical Reason For Not Providing Treatment"
and AnesthesiaProcedure.status = 'completed'
and AnesthesiaProcedure.performed.toInterval ( ) ends 1 day after day of start of QualifyingEncounter.period
and NoVTEDevice.authoredOn during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).CalendarDayOfOrDayAfter ( )
return QualifyingEncounter
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Encounter with No VTE Prophylaxis Due to Medical Reason |
|
define "Encounter with No VTE Prophylaxis Due to Medical Reason":
( "No VTE Prophylaxis Medication Due to Medical Reason From Day of Start of Hospitalization To Day After Admission"
intersect "No Mechanical VTE Prophylaxis Due to Medical Reason From Day of Start of Hospitalization To Day After Admission"
)
union ( "No VTE Prophylaxis Medication Due to Medical Reason on Day of or Day After Procedure"
intersect "No Mechanical VTE Prophylaxis Due to Medical Reason on Day of or Day After Procedure"
)
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
No Mechanical or Pharmacological VTE Prophylaxis Due to Patient Refusal |
|
define "No Mechanical or Pharmacological VTE Prophylaxis Due to Patient Refusal":
( "No VTE Prophylaxis Medication Administered or Ordered" NoVTEMedication
where NoVTEMedication.MedicationStatusReason in "Patient Refusal"
)
union ( "No Mechanical VTE Prophylaxis Performed or Ordered" NoVTEDevice
where NoVTEDevice.requestStatusReason in "Patient Refusal"
)
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
No VTE Prophylaxis Due to Patient Refusal From Day of Start of Hospitalization To Day After Admission |
|
define "No VTE Prophylaxis Due to Patient Refusal From Day of Start of Hospitalization To Day After Admission":
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
with "No Mechanical or Pharmacological VTE Prophylaxis Due to Patient Refusal" PatientRefusal
such that PatientRefusal.authoredOn during day of QualifyingEncounter.FromDayOfStartOfHospitalizationToDayAfterAdmission ( )
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
No VTE Prophylaxis Due to Patient Refusal on Day of or Day After Procedure |
|
define "No VTE Prophylaxis Due to Patient Refusal on Day of or Day After Procedure":
from
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
"No Mechanical or Pharmacological VTE Prophylaxis Due to Patient Refusal" PatientRefusal
where AnesthesiaProcedure.status = 'completed'
and QICoreCommon."ToInterval" ( AnesthesiaProcedure.performed ) ends 1 day after day of start of QualifyingEncounter.period
and PatientRefusal.authoredOn during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).CalendarDayOfOrDayAfter ( )
return QualifyingEncounter
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Encounter with No VTE Prophylaxis Due to Patient Refusal |
|
define "Encounter with No VTE Prophylaxis Due to Patient Refusal":
"No VTE Prophylaxis Due to Patient Refusal From Day of Start of Hospitalization To Day After Admission"
union "No VTE Prophylaxis Due to Patient Refusal on Day of or Day After Procedure"
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Numerator |
|
define "Numerator":
"Encounter with VTE Prophylaxis Received From Day of Start of Hospitalization To Day After Admission or Procedure"
union ( "Encounter with Medication Oral Factor Xa Inhibitor Administered on Day of or Day After Admission or Procedure"
intersect ( "Encounter with Prior or Present Diagnosis of Atrial Fibrillation or Prior Diagnosis of VTE"
union "Encounter with Prior or Present Procedure of Hip or Knee Replacement Surgery"
)
)
union "Encounter with Low Risk for VTE or Anticoagulant Administered"
union "Encounter with No VTE Prophylaxis Due to Medical Reason"
union "Encounter with No VTE Prophylaxis Due to Patient Refusal"
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Initial Population |
|
define "Initial Population":
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions"
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Denominator |
|
define "Denominator":
"Initial Population"
|
Library Name |
Name |
SupplementalDataElements |
SDE Payer |
|
define "SDE Payer":
[Coverage: type in "Payer Type"] Payer
return {
code: Payer.type,
period: Payer.period
}
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
SDE Payer |
|
define "SDE Payer":
SDE."SDE Payer"
|
Library Name |
Name |
SupplementalDataElements |
SDE Ethnicity |
|
define "SDE Ethnicity":
Patient.ethnicity E
return Tuple {
codes: { E.ombCategory } union E.detailed,
display: E.text
}
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
SDE Ethnicity |
|
define "SDE Ethnicity":
SDE."SDE Ethnicity"
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Encounter Less Than 2 Days |
|
define "Encounter Less Than 2 Days":
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
where QualifyingEncounter.period.lengthInDays ( ) < 2
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Encounter with ICU Location Stay 1 Day or More |
|
define "Encounter with ICU Location Stay 1 Day or More":
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
where exists ( QualifyingEncounter.location Location
where Location.location.getLocation ( ).type in "Intensive Care Unit"
and Location.period.lengthInDays ( ) >= 1
and Location.period starts on or after start of QualifyingEncounter.period
and date from ( start of Location.period ) during ( start of QualifyingEncounter.period ).CalendarDayOfOrDayAfter ( )
)
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Encounter with Principal Diagnosis of Mental Disorder or Stroke |
|
define "Encounter with Principal Diagnosis of Mental Disorder or Stroke":
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
where QualifyingEncounter.principalDiagnosis ( ).code in "Mental Health Diagnoses"
or QualifyingEncounter.principalDiagnosis ( ).code in "Hemorrhagic Stroke"
or QualifyingEncounter.principalDiagnosis ( ).code in "Ischemic Stroke"
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
SCIP VTE Selected Surgery |
|
define "SCIP VTE Selected Surgery":
( ["Procedure": "General Surgery"]
union ["Procedure": "Gynecological Surgery"]
union ["Procedure": "Hip Fracture Surgery"]
union ["Procedure": "Hip Replacement Surgery"]
union ["Procedure": "Intracranial Neurosurgery"]
union ["Procedure": "Knee Replacement Surgery"]
union ["Procedure": "Urological Surgery"] ) Procedure
where Procedure.status = 'completed'
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Encounter with Principal Procedure of SCIP VTE Selected Surgery |
|
define "Encounter with Principal Procedure of SCIP VTE Selected Surgery":
from
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
"SCIP VTE Selected Surgery" SelectedProcedure
let EncounterProcedure: singleton from ( QualifyingEncounter.procedure P
where P.rank = 1
)
where EncounterProcedure.procedure.reference.getId ( ) = SelectedProcedure.id
and end of SelectedProcedure.performed.toInterval ( ) during QualifyingEncounter.period
return QualifyingEncounter
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Intervention Comfort Measures |
|
define "Intervention Comfort Measures":
( ["ServiceRequest": "Comfort Measures"] InterventionRequest
where InterventionRequest.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
and InterventionRequest.status in { 'active', 'on-hold', 'completed' }
and InterventionRequest.doNotPerform is not true
)
union ( ["Procedure": "Comfort Measures"] InterventionPerformed
where InterventionPerformed.status in { 'completed', 'in-progress' }
)
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Encounter with Intervention Comfort Measures From Day of Start of Hospitalization To Day After Admission |
|
define "Encounter with Intervention Comfort Measures From Day of Start of Hospitalization To Day After Admission":
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter
with "Intervention Comfort Measures" ComfortMeasure
such that Coalesce(start of ComfortMeasure.performed.toInterval(), ComfortMeasure.authoredOn) during day of QualifyingEncounter.FromDayOfStartOfHospitalizationToDayAfterAdmission ( )
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Encounter with Intervention Comfort Measures on Day of or Day After Procedure |
|
define "Encounter with Intervention Comfort Measures on Day of or Day After Procedure":
from
VTE."Encounter with Age Range and without VTE Diagnosis or Obstetrical Conditions" QualifyingEncounter,
["Procedure": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
"Intervention Comfort Measures" ComfortMeasure
where AnesthesiaProcedure.status = 'completed'
and AnesthesiaProcedure.performed.toInterval ( ) ends 1 day after day of start of QualifyingEncounter.period
and Coalesce(start of ComfortMeasure.performed.toInterval(), ComfortMeasure.authoredOn) during day of ( end of AnesthesiaProcedure.performed.toInterval ( ) ).CalendarDayOfOrDayAfter ( )
return QualifyingEncounter
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
Denominator Exclusions |
|
define "Denominator Exclusions":
"Encounter Less Than 2 Days"
union "Encounter with ICU Location Stay 1 Day or More"
union "Encounter with Principal Diagnosis of Mental Disorder or Stroke"
union "Encounter with Principal Procedure of 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"
|
Library Name |
Name |
SupplementalDataElements |
SDE Race |
|
define "SDE Race":
Patient.race R
return Tuple {
codes: R.ombCategory union R.detailed,
display: R.text
}
|
Library Name |
Name |
VenousThromboembolismProphylaxisFHIR |
SDE Race |
|
define "SDE Race":
SDE."SDE Race"
|
Library Name |
Name |
CQMCommon |
encounterDiagnosis |
|
/*
@description: Returns the Condition resources referenced by the diagnosis element of the Encounter
*/
define fluent function encounterDiagnosis(Encounter Encounter ):
Encounter.diagnosis D
return singleton from ([Condition] C where C.id = D.condition.reference.getId())
|
Library Name |
Name |
QICoreCommon |
getId |
|
/*
@description: Returns the tail of the given uri (i.e. everything after the last slash in the URI).
@comment: This function can be used to determine the logical id of a given resource. It can be used in
a single-server environment to trace references. However, this function does not attempt to resolve
or distinguish the base of the given url, and so cannot be used safely in multi-server environments.
*/
define fluent function getId(uri String):
Last(Split(uri, '/'))
|
Library Name |
Name |
VTE |
FromDayOfStartOfHospitalizationToDayAfterAdmission |
|
define fluent function "FromDayOfStartOfHospitalizationToDayAfterAdmission"(Encounter Encounter ):
Interval[ date from (start of Encounter.hospitalizationWithObservation()), date from (start of Encounter.period) + 1 days]
|
Library Name |
Name |
CQMCommon |
hospitalizationWithObservation |
|
/*
@description: Hospitalization with Observation returns the total interval from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter
*/
define fluent function hospitalizationWithObservation(TheEncounter Encounter ):
TheEncounter Visit
let ObsVisit: Last([Encounter: "Observation Services"] LastObs
where LastObs.status = 'finished'
and LastObs.period ends 1 hour or less on or before start of Visit.period
sort by end of period
),
VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),
EDVisit: Last([Encounter: "Emergency Department Visit"] LastED
where LastED.status = 'finished'
and LastED.period ends 1 hour or less on or before VisitStart
sort by end of period
)
return Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]
|
Library Name |
Name |
TJCOverall |
CalendarDayOfOrDayAfter |
|
define fluent function CalendarDayOfOrDayAfter(StartValue DateTime):
Interval [date from (StartValue), date from (StartValue) + 1 day]
|
Library Name |
Name |
QICoreCommon |
isActive |
|
/* Candidates for FHIRCommon */
/*
@description: Returns true if the given condition has a clinical status of active, recurrence, or relapse
*/
define fluent function isActive(condition Condition):
condition.clinicalStatus ~ "active"
or condition.clinicalStatus ~ "recurrence"
or condition.clinicalStatus ~ "relapse"
|
Library Name |
Name |
QICoreCommon |
earliest |
|
/*
@description: Given an interval, return the starting point if the interval has a starting boundary specified,
otherwise, return the ending point
*/
define fluent function earliest(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>> ):
(choice.toInterval()) period
return
if (period."hasStart"()) then start of period
else end of period
|
Library Name |
Name |
FHIRHelpers |
ToConcept |
|
/*
@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.
*/
define function ToConcept(concept FHIR.CodeableConcept):
if concept is null then
null
else
System.Concept {
codes: concept.coding C return ToCode(C),
display: concept.text.value
}
|
Library Name |
Name |
FHIRHelpers |
ToString |
|
define function ToString(value uri): value.value
|
Library Name |
Name |
FHIRHelpers |
ToCode |
|
/*
@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.
*/
define function ToCode(coding FHIR.Coding):
if coding is null then
null
else
System.Code {
code: coding.code.value,
system: coding.system.value,
version: coding.version.value,
display: coding.display.value
}
|
Library Name |
Name |
CQMCommon |
lengthInDays |
|
/*
@description: Calculates the difference in calendar days between the start and end of the given interval.
*/
define fluent function lengthInDays(Value Interval<DateTime> ):
difference in days between start of Value and end of Value
|
Library Name |
Name |
CQMCommon |
getLocation |
|
/*
@description: Returns the Location resource specified by the given reference.
*/
define fluent function getLocation(reference Reference ):
singleton from (
[Location] L where L.id = reference.reference.getId()
)
|
Library Name |
Name |
CQMCommon |
principalDiagnosis |
|
/*
@description: Returns the condition that is specified as the principal diagnosis for the encounter
*/
define fluent function principalDiagnosis(Encounter Encounter ):
singleton from ((Encounter.diagnosis D where D.rank = 1 and D.use ~ "Billing") PD
return singleton from ([Condition] C where C.id = PD.condition.reference.getId())
)
|