Id: SafeUseofOpioidsConcurrentPrescribingFHIR Url: http://ecqi.healthit.gov/ecqms/Library/SafeUseofOpioidsConcurrentPrescribingFHIR Version: 0.1.000 Identifier: value: SafeUseofOpioidsConcurrentPrescribingFHIR Name: SafeUseofOpioidsConcurrentPrescribingFHIR Title: SafeUseofOpioidsConcurrentPrescribingFHIR Status: active Experimental: false Type: system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library Date: 2023-08-18T15:25:34+00:00 Description: SafeUseofOpioidsConcurrentPrescribingFHIR Use Context: code value display program eh-cah EH/CAH Related Artifacts: Dependencies Data Requirements: Type Profile MS Code Filter Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient Patient http://hl7.org/fhir/Patient ;;;; Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307 Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307 MedicationRequest http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest ; code filter: path: medication value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.165 MedicationRequest http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest ; code filter: path: medication value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.165 MedicationRequest http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest ; code filter: path: medication value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1125.1 MedicationRequest http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest ;;;;;;; code filter: path: medication value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1125.1 Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307 MedicationRequest http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest ;;;;;;; code filter: path: medication value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1125.1 Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307 Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307 Coverage http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage ;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591 uri http://hl7.org/fhir/uri ; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Condition http://hl7.org/fhir/Condition ; Condition http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition ;; ServiceRequest http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1579 Procedure http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1579 Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143 Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292 Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143 Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292 Condition http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.161 Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Coverage http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage ;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591 Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Content: text/cql library SafeUseofOpioidsConcurrentPrescribingFHIR version '0.1.000'#xD; #xD; using QICore version '4.1.1'#xD; #xD; include CQMCommon version '1.4.000' called CQMCommon#xD; include FHIRHelpers version '4.3.000' called FHIRHelpers#xD; include Hospice version '6.7.000' called Hospice#xD; include QICoreCommon version '1.5.000' called QICoreCommon#xD; include SupplementalDataElements version '3.4.000' called SDE#xD; #xD; codesystem "LOINC": 'http://loinc.org'#xD; #xD; valueset "All Primary and Secondary Cancer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.161'#xD; valueset "Discharge To Acute Care Facility": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.87'#xD; valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'#xD; valueset "Hospice Care Referral or Admission": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1116.365'#xD; valueset "Palliative or Hospice Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1579'#xD; valueset "Patient Expired": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.309'#xD; valueset "Schedule II & III Opioid Medications": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.165'#xD; valueset "Schedule IV Benzodiazepines": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1125.1'#xD; #xD; code "Birth date": '21112-8' from "LOINC" display 'Birth date'#xD; #xD; parameter "Measurement Period" Interval<DateTime>#xD; #xD; context Patient#xD; #xD; define "Initial Population":#xD; "Inpatient Encounters with an Opioid or Benzodiazepine at Discharge"#xD; #xD; define "Denominator":#xD; "Initial Population"#xD; #xD; define "Denominator Exclusion": /*Excludes encounters of patients with cancer or who are receiving palliative or hospice care at the time of the encounter*/#xD; #xD; "Inpatient Encounters with an Opioid or Benzodiazepine at Discharge" InpatientEncounter#xD; where exists ( [Condition: "All Primary and Secondary Cancer"] Cancer#xD; where ( Cancer.isProblemListItem ( )#xD; or Cancer.isHealthConcern ( )#xD; )#xD; and Cancer.isActive ( )#xD; and Cancer.prevalenceInterval ( ) overlaps InpatientEncounter.period#xD; )#xD; or exists ( ( InpatientEncounter.encounterDiagnosis ( ) ) InpatientEncounterDiagnosis#xD; where InpatientEncounterDiagnosis.code in "All Primary and Secondary Cancer"#xD; )#xD; or exists ( "Intervention Palliative or Hospice Care" PalliativeOrHospiceCare#xD; where Coalesce(PalliativeOrHospiceCare.performed.toInterval(), PalliativeOrHospiceCare.authoredOn.toInterval()) during day of CQMCommon."HospitalizationWithObservation" ( InpatientEncounter )#xD; )#xD; or ( InpatientEncounter.hospitalization.dischargeDisposition in "Discharge To Acute Care Facility"#xD; or InpatientEncounter.hospitalization.dischargeDisposition in "Hospice Care Referral or Admission"#xD; or InpatientEncounter.hospitalization.dischargeDisposition in "Patient Expired"#xD; )#xD; #xD; define "Numerator": /*Encounters of patients prescribed two or more opioids or an opioid and benzodiazepine at discharge.*/#xD; #xD; ( "Inpatient Encounter with Age Greater than or Equal to 18" InpatientEncounter#xD; where ( Count("Opioid at Discharge" Opioids#xD; return distinct Opioids.medication#xD; ) >= 2#xD; )#xD; )#xD; union ( "Inpatient Encounter with Age Greater than or Equal to 18" InpatientEncounter#xD; with "Opioid at Discharge" OpioidsDischarge#xD; such that OpioidsDischarge.authoredOn during InpatientEncounter.period#xD; with "Benzodiazepine at Discharge" BenzodiazepinesDischarge#xD; such that BenzodiazepinesDischarge.authoredOn during day of InpatientEncounter.period#xD; )#xD; #xD; define "Benzodiazepine at Discharge":#xD; ( [MedicationRequest: medication in "Schedule IV Benzodiazepines"] BenzoMedications#xD; where ( BenzoMedications.isCommunity ( )#xD; or BenzoMedications.isDischarge ( )#xD; ) ) BenzodiazepineDischargeMedication#xD; where BenzodiazepineDischargeMedication.status in { 'active', 'completed' }#xD; and BenzodiazepineDischargeMedication.intent = 'order'#xD; #xD; define "Inpatient Encounter with Age Greater than or Equal to 18":#xD; CQMCommon."Inpatient Encounter" InpatientHospitalEncounter#xD; where AgeInYearsAt(date from start of InpatientHospitalEncounter.period) >= 18#xD; #xD; define "Inpatient Encounters with an Opioid or Benzodiazepine at Discharge":#xD; "Inpatient Encounter with Age Greater than or Equal to 18" InpatientEncounter#xD; with ( "Opioid at Discharge"#xD; union "Benzodiazepine at Discharge" ) OpioidOrBenzodiazepineAtDischarge#xD; such that OpioidOrBenzodiazepineAtDischarge.authoredOn during day of InpatientEncounter.period#xD; #xD; define "Intervention Palliative or Hospice Care":#xD; [ServiceRequest: "Palliative or Hospice Care"]#xD; union [Procedure: "Palliative or Hospice Care"]#xD; #xD; define "Opioid at Discharge":#xD; ( [MedicationRequest: "Schedule II & III Opioid Medications"] OpioidMedications#xD; where ( OpioidMedications.isCommunity ( )#xD; or OpioidMedications.isDischarge ( )#xD; ) ) OpioidDischargeMedication#xD; where OpioidDischargeMedication.status in { 'active', 'completed' }#xD; and OpioidDischargeMedication.intent = 'order'#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" Content: application/elm+xml Encoded data (136148 characters) Content: application/elm+json Encoded data (190988 characters)
Code system USCoreConditionCategoryExtensionCodes
Code system ConditionClinicalStatusCodes
Value set All Primary and Secondary Cancer
Value set Discharge To Acute Care Facility
Value set Hospice Care Referral or Admission
Value set Schedule II & III Opioid Medications
Inpatient Encounter with Age Greater than or Equal to 18
Inpatient Encounters with an Opioid or Benzodiazepine at Discharge
Error attempting to determine filter value: toFhirValue not implemented for Subtract