eCQM QICore Content Implementation Guide
2023.0.0 - CI Build

eCQM QICore Content Implementation Guide, published by cqframework. This guide is not an authorized publication; it is the continuous build for version 2023.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/ecqm-content-qicore-2023/ and changes regularly. See the Directory of published versions

Library: UseofHighRiskMedicationsintheElderlyFHIR

Official URL: http://ecqi.healthit.gov/ecqms/Library/UseofHighRiskMedicationsintheElderlyFHIR Version: 0.0.001
Active as of 2023-08-28 Computable Name: UseofHighRiskMedicationsintheElderlyFHIR
Other Identifiers: https://madie.cms.gov/login#UseofHighRiskMedicationsintheElderlyFHIR (use: official, )

Usage:Program: EP/EC

UseofHighRiskMedicationsintheElderlyFHIR

Id: UseofHighRiskMedicationsintheElderlyFHIR
Url: http://ecqi.healthit.gov/ecqms/Library/UseofHighRiskMedicationsintheElderlyFHIR
Version: 0.0.001
Identifier:

value: UseofHighRiskMedicationsintheElderlyFHIR

Name: UseofHighRiskMedicationsintheElderlyFHIR
Title: UseofHighRiskMedicationsintheElderlyFHIR
Status: active
Experimental: false
Type:

system: http://terminology.hl7.org/CodeSystem/library-type

code: logic-library

Date: 2023-08-28T21:00:37+00:00
Description: UseofHighRiskMedicationsintheElderlyFHIR
Use Context:
codevaluedisplay
program ep-ec EP/EC
Related Artifacts:

Dependencies

Data Requirements:
TypeProfileMSCode Filter
Quantity urn:hl7-org:elm-types:r1/Quantity ;;
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.113883.3.464.1003.196.12.1523
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.113883.3.464.1003.196.12.1523
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.113883.3.464.1003.196.12.1523
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.113883.3.464.1003.196.12.1523
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.113883.3.464.1003.196.12.1522
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.113883.3.464.1003.196.12.1522
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.113883.3.464.1003.196.12.1522
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.113883.3.464.1003.196.12.1522
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.113883.3.464.1003.105.12.1205
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.113883.3.464.1003.105.12.1157
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.113883.3.464.1003.105.12.1206
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.113883.3.464.1003.105.12.1207
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.113883.3.464.1003.105.12.1208
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.113883.3.464.1003.105.12.1209
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.113883.3.464.1003.105.12.1210
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.113883.3.464.1003.1043
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.113883.3.464.1003.1043
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.113883.3.464.1003.1049
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.113883.3.464.1003.1049
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.113883.3.464.1003.1050
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.113883.3.464.1003.1050
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.113883.3.464.1003.1051
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.113883.3.464.1003.1051
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.113883.3.464.1003.1052
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.113883.3.464.1003.1052
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.113883.3.464.1003.1053
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.113883.3.464.1003.1053
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.113883.3.464.1003.1054
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.113883.3.464.1003.1054
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.113883.3.464.1003.1055
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.113883.3.464.1003.1055
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.113883.3.464.1003.1056
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.113883.3.464.1003.1056
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.113883.3.464.1003.1057
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.113883.3.464.1003.1057
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.113883.3.464.1003.1058
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.113883.3.464.1003.1058
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.113883.3.464.1003.1059
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.113883.3.464.1003.1059
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.113883.3.464.1003.1060
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.113883.3.464.1003.1060
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.113883.3.464.1003.196.12.1480
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.113883.3.464.1003.196.12.1480
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.113883.3.464.1003.1062
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.113883.3.464.1003.1062
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.113883.3.464.1003.1063
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.113883.3.464.1003.1063
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.113883.3.464.1003.196.12.1481
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.113883.3.464.1003.196.12.1481
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.113883.3.464.1003.1044
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.113883.3.464.1003.1044
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.113883.3.464.1003.1065
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.113883.3.464.1003.1065
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.113883.3.464.1003.1067
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.113883.3.464.1003.1067
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.464.1003.101.12.1001
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.464.1003.101.11.1206
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.464.1003.101.12.1025
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.464.1003.101.12.1013
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.464.1003.101.12.1012
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.464.1003.101.12.1014
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.464.1003.101.12.1023
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.526.3.1240
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.464.1003.101.12.1016
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.464.1003.101.12.1080
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.464.1003.101.12.1089
Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;
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
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.464.1003.1003
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.464.1003.1003
Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ; code filter:
path: code

system: http://loinc.org

code: 45755-6

display: Hospice care [Minimum Data Set]

Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ;;; code filter:
path: code

system: http://loinc.org

code: 45755-6

display: Hospice care [Minimum Data Set]

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.526.3.1584
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.526.3.1584
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.526.3.1584
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.526.3.1584
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.113883.3.464.1003.1165
Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ; code filter:
path: code

system: http://loinc.org

code: 71007-9

display: Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)

Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ;; code filter:
path: code

system: http://loinc.org

code: 71007-9

display: Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)

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.113883.3.464.1003.1167
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.464.1003.101.12.1090
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.464.1003.101.12.1090
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.464.1003.198.12.1135
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.464.1003.198.12.1135
Content: text/cql
library UseofHighRiskMedicationsintheElderlyFHIR version '0.0.001'

using QICore version '4.1.1'

include FHIRHelpers version '4.3.000' called FHIRHelpers
include SupplementalDataElements version '3.4.000' called SDE
include CQMCommon version '1.4.000' called CQMCommon
include Hospice version '6.7.000' called Hospice
include PalliativeCare version '1.7.000' called PalliativeCare
include CumulativeMedicationDuration version '3.3.000' called CMD
include QICoreCommon version '1.5.000' called QICoreCommon
include Status version '1.6.000' called Status

codesystem "RXNORM": 'http://www.nlm.nih.gov/research/umls/rxnorm'
codesystem "CPT": 'http://www.ama-assn.org/go/cpt'

valueset "Alcohol Withdrawal": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.105.12.1209'
valueset "Annual Wellness Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240'
valueset "Anti Infectives, other": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1481'
valueset "Anticholinergics, anti Parkinson agents": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1049'
valueset "Anticholinergics, first generation antihistamines": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1043'
valueset "Antipsychotic": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1523'
valueset "Antispasmodics": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1050'
valueset "Antithrombotic": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1051'
valueset "Benzodiazepine Withdrawal": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.105.12.1208'
valueset "Benzodiazepine": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1522'
valueset "Bipolar Disorder": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.105.12.1157'
valueset "Cardiovascular, alpha agonists, central": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1052'
valueset "Cardiovascular, other": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1053'
valueset "Care Services in Long Term Residential Facility": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1014'
valueset "Central nervous system, antidepressants": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1054'
valueset "Central nervous system, barbiturates": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1055'
valueset "Central nervous system, other": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1057'
valueset "Central nervous system, vasodilators": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1056'
valueset "Digoxin": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1065'
valueset "Discharge Services Nursing Facility": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1013'
valueset "Doxepin": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1067'
valueset "Endocrine system, estrogens with or without progestins": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1058'
valueset "Endocrine system, other": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1060'
valueset "Endocrine system, sulfonylureas, long duration": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1059'
valueset "Generalized Anxiety Disorder": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.105.12.1210'
valueset "Home Healthcare Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016'
valueset "Nonbenzodiazepine hypnotics": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1480'
valueset "Nursing Facility Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1012'
valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001'
valueset "Online Assessments": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1089'
valueset "Ophthalmologic Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.11.1206'
valueset "Pain medications, other": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1063'
valueset "Pain medications, skeletal muscle relaxants": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1062'
valueset "Preventive Care Services Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025'
valueset "Preventive Care Services Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023'
valueset "REM Sleep Behavior Disorder": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.105.12.1207'
valueset "Reserpine": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1044'
valueset "Schizophrenia": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.105.12.1205'
valueset "Seizure Disorder": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.105.12.1206'
valueset "Telephone Visits": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080'

code "1 ML digoxin 0.1 MG/ML Injection": '204504' from "RXNORM" display '1 ML digoxin 0.1 MG/ML Injection'
code "2 ML digoxin 0.25 MG/ML Injection": '104208' from "RXNORM" display '2 ML digoxin 0.25 MG/ML Injection'
code "digoxin 0.05 MG/ML Oral Solution": '393245' from "RXNORM" display 'digoxin 0.05 MG/ML Oral Solution'
code "digoxin 0.0625 MG Oral Tablet": '245273' from "RXNORM" display 'digoxin 0.0625 MG Oral Tablet'
code "digoxin 0.125 MG Oral Tablet": '197604' from "RXNORM" display 'digoxin 0.125 MG Oral Tablet'
code "digoxin 0.1875 MG Oral Tablet": '1441565' from "RXNORM" display 'digoxin 0.1875 MG Oral Tablet'
code "digoxin 0.25 MG Oral Tablet": '197606' from "RXNORM" display 'digoxin 0.25 MG Oral Tablet'
code "doxepin 3 MG Oral Tablet": '966787' from "RXNORM" display 'doxepin 3 MG Oral Tablet'
code "doxepin 6 MG Oral Tablet": '966793' from "RXNORM" display 'doxepin 6 MG Oral Tablet'
code "doxepin hydrochloride 10 MG Oral Capsule": '1000048' from "RXNORM" display 'doxepin hydrochloride 10 MG Oral Capsule'
code "doxepin hydrochloride 10 MG/ML Oral Solution": '1000054' from "RXNORM" display 'doxepin hydrochloride 10 MG/ML Oral Solution'
code "doxepin hydrochloride 100 MG Oral Capsule": '1000058' from "RXNORM" display 'doxepin hydrochloride 100 MG Oral Capsule'
code "doxepin hydrochloride 150 MG Oral Capsule": '1000064' from "RXNORM" display 'doxepin hydrochloride 150 MG Oral Capsule'
code "doxepin hydrochloride 25 MG Oral Capsule": '1000070' from "RXNORM" display 'doxepin hydrochloride 25 MG Oral Capsule'
code "doxepin hydrochloride 50 MG Oral Capsule": '1000076' from "RXNORM" display 'doxepin hydrochloride 50 MG Oral Capsule'
code "doxepin hydrochloride 75 MG Oral Capsule": '1000097' from "RXNORM" display 'doxepin hydrochloride 75 MG Oral Capsule'
code "Office or other outpatient visit for the evaluation and management of an established patient, that may not require the presence of a physician or other qualified health care professional. Usually, the presenting problem(s) are minimal.": '99211' from "CPT" display 'Office or other outpatient visit for the evaluation and management of an established patient, that may not require the presence of a physician or other qualified health care professional. Usually, the presenting problem(s) are minimal.'
code "reserpine 0.1 MG Oral Tablet": '198196' from "RXNORM" display 'reserpine 0.1 MG Oral Tablet'
code "reserpine 0.25 MG Oral Tablet": '198197' from "RXNORM" display 'reserpine 0.25 MG Oral Tablet'

parameter "Measurement Period" Interval<DateTime>

context Patient

define "Initial Population":
  AgeInYearsAt(date from 
    end of "Measurement Period"
  ) >= 65
    and exists ( "Qualifying Encounters" )

define "Qualifying Encounters":
  ( ["Encounter": "Office Visit"]
    union ["Encounter": "Ophthalmologic Services"]
    union ["Encounter": "Preventive Care Services Established Office Visit, 18 and Up"]
    union ["Encounter": "Discharge Services Nursing Facility"]
    union ["Encounter": "Nursing Facility Visit"]
    union ["Encounter": "Care Services in Long Term Residential Facility"]
    union ["Encounter": "Preventive Care Services Initial Office Visit, 18 and Up"]
    union ["Encounter": "Annual Wellness Visit"]
    union ["Encounter": "Home Healthcare Services"]
    union ["Encounter": "Telephone Visits"]
    union ["Encounter": "Online Assessments"]
    union ( [Encounter] E
        where exists ( ( E.type ) T
            where T ~ "Office or other outpatient visit for the evaluation and management of an established patient, that may not require the presence of a physician or other qualified health care professional. Usually, the presenting problem(s) are minimal."
        )
    ) ) ValidEncounters
    where ValidEncounters.period during "Measurement Period"

define "Denominator":
  "Initial Population"

define "Denominator Exclusions":
  Hospice."Has Hospice Services"
    or PalliativeCare."Has Palliative Care in the Measurement Period"

define "Numerator 1":
  exists ( "Same High Risk Medications Ordered on Different Days" )
    or ( "Two High Risk Medications with Prolonged Duration" )
    or ( "High Risk Medications with Average Daily Dose Criteria" )

define "Same High Risk Medications Ordered on Different Days":
  "More Than One Order"(["MedicationRequest": "Anticholinergics, first generation antihistamines"])
    union "More Than One Order"(["MedicationRequest": "Anticholinergics, anti Parkinson agents"])
    union "More Than One Order"(["MedicationRequest": "Antispasmodics"])
    union "More Than One Order"(["MedicationRequest": "Antithrombotic"])
    union "More Than One Order"(["MedicationRequest": "Cardiovascular, alpha agonists, central"])
    union "More Than One Order"(["MedicationRequest": "Cardiovascular, other"])
    union "More Than One Order"(["MedicationRequest": "Central nervous system, antidepressants"])
    union "More Than One Order"(["MedicationRequest": "Central nervous system, barbiturates"])
    union "More Than One Order"(["MedicationRequest": "Central nervous system, vasodilators"])
    union "More Than One Order"(["MedicationRequest": "Central nervous system, other"])
    union "More Than One Order"(["MedicationRequest": "Endocrine system, estrogens with or without progestins"])
    union "More Than One Order"(["MedicationRequest": "Endocrine system, sulfonylureas, long duration"])
    union "More Than One Order"(["MedicationRequest": "Endocrine system, other"])
    union "More Than One Order"(["MedicationRequest": "Nonbenzodiazepine hypnotics"])
    union "More Than One Order"(["MedicationRequest": "Pain medications, skeletal muscle relaxants"])
    union "More Than One Order"(["MedicationRequest": "Pain medications, other"])

define "Two High Risk Medications with Prolonged Duration":
  Sum(("More Than One Order"([MedicationRequest: "Anti Infectives, other"])) AntiInfectives
      let DaysSupply: AntiInfectives.MedicationRequestPeriodInDays()
      return all DaysSupply
  ) > 90

define "High Risk Medications with Average Daily Dose Criteria":
  exists ( "More Than One Order"([MedicationRequest: "Reserpine"] ReserpineOrdered
        where "Average Daily Dose"(ReserpineOrdered) > 0.1 'mg/d'
    )
  )
    or exists ( "More Than One Order"([MedicationRequest: "Digoxin"] DigoxinOrdered
          where "Average Daily Dose"(DigoxinOrdered) > 0.125 'mg/d'
      )
    )
    or exists ( "More Than One Order"([MedicationRequest: "Doxepin"] DoxepinOrdered
          where "Average Daily Dose"(DoxepinOrdered) > 6 'mg/d'
      )
    )

define "Numerator 2":
  ( "More than One Antipsychotic Order"
      and ( not exists ( ( [Condition: "Schizophrenia"]
            union [Condition: "Bipolar Disorder"] ) AntipsychoticTreatedDiagnoses
            where QICoreCommon."ToPrevalenceInterval" ( AntipsychoticTreatedDiagnoses ) overlaps Interval[start of "Measurement Period" - 1 year, "Antipsychotic Index Prescription Start Date"]
        )
      )
  )
    or ( "More than One Benzodiazepine Order"
        and ( not exists ( ( [Condition: "Seizure Disorder"]
              union [Condition: "REM Sleep Behavior Disorder"]
              union [Condition: "Benzodiazepine Withdrawal"]
              union [Condition: "Alcohol Withdrawal"]
              union [Condition: "Generalized Anxiety Disorder"] ) BenzodiazepineTreatedDiagnoses
              where QICoreCommon."ToPrevalenceInterval" ( BenzodiazepineTreatedDiagnoses ) overlaps Interval[start of "Measurement Period" - 1 year, "Benzodiazepine Index Prescription Start Date"]
          )
        )
    )

define "More than One Antipsychotic Order":
  exists ( "More Than One Order"([MedicationRequest: "Antipsychotic"]) )

define "More than One Benzodiazepine Order":
  exists ( "More Than One Order"([MedicationRequest: "Benzodiazepine"]) )

define "Antipsychotic Index Prescription Start Date":
  First((Status."Active or Completed Medication Request"([MedicationRequest: "Antipsychotic"])) AntipsychoticMedication
      where AntipsychoticMedication.authoredOn during "Measurement Period"
      return AntipsychoticMedication.authoredOn
      sort asc
  )

define "Benzodiazepine Index Prescription Start Date":
  First((Status."Active or Completed Medication Request"([MedicationRequest: "Benzodiazepine"])) BenzodiazepineMedication
      where BenzodiazepineMedication.authoredOn during "Measurement Period"
      return BenzodiazepineMedication.authoredOn
      sort asc
  )

define "Numerator 3":
  "Numerator 2"
    or ( "Numerator 1"
        and not "Numerator 2"
    )

define "SDE Ethnicity":
  SDE."SDE Ethnicity"

define "SDE Payer":
  SDE."SDE Payer"

define "SDE Race":
  SDE."SDE Race"

define "SDE Sex":
  SDE."SDE Sex"
  
//Functions


define function "More Than One Order"(Medication List<"MedicationRequest">):
  ( Status."Active or Completed Medication Request" ( "Medication" ) ) OrderMedication1
    with ( Status."Active or Completed Medication Request" ( "Medication" ) ) OrderMedication2
      such that ( OrderMedication1.authoredOn during "Measurement Period"
          and OrderMedication1.dispenseRequest.numberOfRepeatsAllowed >= 1
      )
        or ( date from OrderMedication1.authoredOn !~ date from OrderMedication2.authoredOn
            and OrderMedication1.authoredOn during "Measurement Period"
            and OrderMedication2.authoredOn during "Measurement Period"
        )
        or ( date from OrderMedication1.authoredOn ~ date from OrderMedication2.authoredOn
            and OrderMedication1.authoredOn during "Measurement Period"
            and date from start of CMD."MedicationRequestPeriod" ( OrderMedication1 ) !~ date from start of CMD."MedicationRequestPeriod" ( OrderMedication2 )
            and start of CMD."MedicationRequestPeriod" ( OrderMedication1 ) during "Measurement Period"
            and start of CMD."MedicationRequestPeriod" ( OrderMedication2 ) during "Measurement Period"
        )
    return OrderMedication1

define fluent function MedicationStrengthPerUnit(Strength Concept):
  case
    when Strength ~ "reserpine 0.1 MG Oral Tablet" then 0.1 'mg'
    when Strength ~ "reserpine 0.25 MG Oral Tablet" then 0.25 'mg'
    when Strength ~ "digoxin 0.05 MG/ML Oral Solution" then 0.05 'mg/mL'
    when Strength ~ "digoxin 0.0625 MG Oral Tablet" then 0.0625 'mg'
    when Strength ~ "1 ML digoxin 0.1 MG/ML Injection" then 0.1 'mg/mL'
    when Strength ~ "digoxin 0.125 MG Oral Tablet" then 0.125 'mg'
    when Strength ~ "digoxin 0.1875 MG Oral Tablet" then 0.1875 'mg'
    when Strength ~ "digoxin 0.25 MG Oral Tablet" then 0.25 'mg'
    when Strength ~ "2 ML digoxin 0.25 MG/ML Injection" then 0.25 'mg/mL'
    when Strength ~ "doxepin 3 MG Oral Tablet" then 3 'mg'
    when Strength ~ "doxepin 6 MG Oral Tablet" then 6 'mg'
    when Strength ~ "doxepin hydrochloride 10 MG Oral Capsule" then 10 'mg'
    when Strength ~ "doxepin hydrochloride 10 MG/ML Oral Solution" then 10 'mg/mL'
    when Strength ~ "doxepin hydrochloride 25 MG Oral Capsule" then 25 'mg'
    when Strength ~ "doxepin hydrochloride 50 MG Oral Capsule" then 50 'mg'
    when Strength ~ "doxepin hydrochloride 75 MG Oral Capsule" then 75 'mg'
    when Strength ~ "doxepin hydrochloride 100 MG Oral Capsule" then 100 'mg'
    when Strength ~ "doxepin hydrochloride 150 MG Oral Capsule" then 150 'mg' 
    else null end

define fluent function MedicationRequestPeriodInDays(Request "MedicationRequest"):
  Request R
    let dosage: singleton from R.dosageInstruction,
    doseAndRate: singleton from dosage.doseAndRate,
    timing: dosage.timing,
    frequency: Coalesce(timing.repeat.frequencyMax, timing.repeat.frequency),
    period: CMD."Quantity" ( timing.repeat.period, timing.repeat.periodUnit ),
    doseRange: doseAndRate.dose,
    doseQuantity: doseAndRate.dose,
    dose: Coalesce(
      end of doseRange, doseQuantity
    ),
    dosesPerDay: Coalesce((CMD."ToDaily"(frequency, period)), Count(timing.repeat.timeOfDay), 1.0),
    boundsPeriod: timing.repeat.bounds as Interval<DateTime>,
    daysSupply: ( convert R.dispenseRequest.expectedSupplyDuration to days ).value,
    quantity: R.dispenseRequest.quantity,
    refills: Coalesce(R.dispenseRequest.numberOfRepeatsAllowed, 0),
    startDate: Coalesce(date from start of boundsPeriod, date from R.authoredOn, date from start of R.dispenseRequest.validityPeriod),
    totalDaysSupplied: Coalesce(daysSupply, quantity.value /(dose.value * dosesPerDay)) * ( 1 + refills )
    return totalDaysSupplied

define function "Average Daily Dose"(MedicationRequest "MedicationRequest"):
  MedicationRequest Order
    let MedicationStrength: Order.getMedicationCode ( ).MedicationStrengthPerUnit ( ),
    DaysSupplied: Order.MedicationRequestPeriodInDays ( )
    return if DaysSupplied is not null
      and ( MedicationStrength.unit = 'mg'
          or ( MedicationStrength.unit = 'mg/mL'
              and Order.dispenseRequest.quantity.unit = 'mL'
          )
      ) then ( ( Order.dispenseRequest.quantity * MedicationStrength ) / Quantity { value: DaysSupplied, unit: 'd' } ) 
      else null
Content: application/elm+xml
Encoded data (434204 characters)
Content: application/elm+json
Encoded data (626780 characters)