eCQM QICore Content Implementation Guide
2025.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 2025.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-2025/ and changes regularly. See the Directory of published versions

Library: CMS128FHIRAntidepressantMedManagement

Official URL: https://madie.cms.gov/Library/CMS128FHIRAntidepressantMedManagement Version: 0.3.000
Active as of 2025-04-15 Responsible: National Committee for Quality Assurance Computable Name: CMS128FHIRAntidepressantMedManagement
Other Identifiers: https://madie.cms.gov/login#CMS128FHIRAntidepressantMedManagement (use: official, )

CMS128FHIRAntidepressantMedManagement

Title: CMS128FHIRAntidepressantMedManagement
Id: CMS128FHIRAntidepressantMedManagement
Version: 0.3.000
Url: https://madie.cms.gov/Library/CMS128FHIRAntidepressantMedManagement
official

CMS128FHIRAntidepressantMedManagement

Type:

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

code: logic-library

Date: 2025-04-15T20:43:08+00:00
Publisher: National Committee for Quality Assurance
Description: CMS128FHIRAntidepressantMedManagement
Related Artifacts:

Dependencies

  • https://madie.cms.gov/Library/SupplementalDataElements|5.1.000
  • https://madie.cms.gov/Library/Status|1.13.000
  • https://madie.cms.gov/Library/FHIRHelpers|4.4.000
  • https://madie.cms.gov/Library/CumulativeMedicationDuration|6.0.000
  • https://madie.cms.gov/Library/QICoreCommon|4.0.000
  • https://madie.cms.gov/Library/Hospice|6.15.000
  • https://madie.cms.gov/Library/CQMCommon|4.0.000
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1213
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.105.12.1007
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1012
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1492
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1496
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1089
Data Requirements:
TypeProfileMSCode Filter
Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;;
MedicationDispense http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationdispense ; code filter:
path: medication
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1213
MedicationDispense http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationdispense ;
Medication http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medication ;;
Condition http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns ; code filter:
path: code
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.105.12.1007
Condition http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns ; code filter:
path: code
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1165
Condition http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-encounter-diagnosis ; code filter:
path: code
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.105.12.1007
Condition http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-encounter-diagnosis ; code filter:
path: code
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1165
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.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.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.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.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.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.526.3.1492
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.1496
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 ;;;; 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
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
Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-screening-assessment ;;; 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
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
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.1213
MedicationRequest http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest ;
Content: text/cql
library CMS128FHIRAntidepressantMedManagement version '0.3.000'

using QICore version '6.0.0'

include FHIRHelpers version '4.4.000' called FHIRHelpers
include SupplementalDataElements version '5.1.000' called SDE
include Hospice version '6.15.000' called Hospice
include CumulativeMedicationDuration version '6.0.000' called CMD
include Status version '1.13.000' called Status
include QICoreCommon version '4.0.000' called QICoreCommon
include CQMCommon version '4.0.000' called CQMCommon

valueset "Annual Wellness Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240'
valueset "Antidepressant Medication": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1213'
valueset "Home Healthcare Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016'
valueset "Major Depression": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.105.12.1007'
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 "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 "Psych Visit Diagnostic Evaluation": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1492'
valueset "Psych Visit Psychotherapy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1496'
valueset "Telephone Visits": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080'
valueset "Virtual Encounter": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1089'

parameter "Measurement Period" Interval<DateTime>

context Patient

define "Initial Population":
  AgeInYearsAt(date from "IPSD") >= 18
    and "Has IPSD and Major Depression Diagnosis"
    and exists "Qualifying Encounters"

define "April 30 of the Measurement Period":
  DateTime((year from start of "Measurement Period"), 4, 30, 23, 59, 59, 0, 0)

define "Has IPSD and Major Depression Diagnosis":
  exists ( ( [ConditionProblemsHealthConcerns: "Major Depression"]
      union [ConditionEncounterDiagnosis: "Major Depression"] ) MajorDepression
      where "IPSD" is not null
        and date from start of MajorDepression.prevalenceInterval ( ) within 60 days of "IPSD"
  )

define "IPSD":
  First((([MedicationDispense: "Antidepressant Medication"]).isMedicationDispensed()) Antidepressant
      where start of Antidepressant.medicationDispensePeriod() in day of "Intake Period"
      return {
        AntidepressantDate: date from start of Antidepressant.medicationDispensePeriod()
      }
      sort by AntidepressantDate
  ).AntidepressantDate

define "Intake Period":
  Interval["May 1 of the Year Prior to the Measurement Period", "April 30 of the Measurement Period"]

define "May 1 of the Year Prior to the Measurement Period":
  DateTime((year from start of "Measurement Period" - 1), 5, 1, 0, 0, 0, 0, 0)

define "Qualifying Encounters":
  ( ( [Encounter: "Office Visit"]
      union [Encounter: "Preventive Care Services Established Office Visit, 18 and Up"]
      union [Encounter: "Preventive Care Services Initial Office Visit, 18 and Up"]
      union [Encounter: "Home Healthcare Services"]
      union [Encounter: "Annual Wellness Visit"]
      union [Encounter: "Nursing Facility Visit"]
      union [Encounter: "Psych Visit Diagnostic Evaluation"]
      union [Encounter: "Psych Visit Psychotherapy"]
      union [Encounter: "Telephone Visits"]
      union [Encounter: "Virtual Encounter"]
  ).isEncounterPerformed ( ) ) ValidEncounter
    where date from start of ValidEncounter.period.toInterval ( ) within 60 days of "IPSD"

define "Denominator":
  "Initial Population"

define "Denominator Exclusions":
  Hospice."Has Hospice Services"
    or exists ( ( ( [MedicationRequest: "Antidepressant Medication"] ).isMedicationActive ( ) ) ActiveAntidepressant
        where "IPSD" is not null
          and CQMCommon.ToDateInterval ( ActiveAntidepressant.medicationRequestPeriod ( ) ) overlaps Interval["IPSD" - 105 days, "IPSD" )
    )

define "Numerator 1":
  "Cumulative Medication Duration Greater Than or Equal to 84 Days"

define "Cumulative Medication Duration Greater Than or Equal to 84 Days":
  ( "Antidepressant Medication Period Between IPSD and 114 Days After IPSD".cumulativeDuration ( ) ) >= 84

define "Antidepressant Medication Period Between IPSD and 114 Days After IPSD":
  ( ( [MedicationDispense: "Antidepressant Medication"] ).isMedicationDispensed ( ) ) Antidepressant
    let MedicationPeriod: Antidepressant.medicationDispensePeriod ( )
    return MedicationPeriod
      intersect Interval["IPSD", "IPSD" + 114 days]

define "Numerator 2":
  "Cumulative Medication Duration Greater Than or Equal to 180 Days"

define "Cumulative Medication Duration Greater Than or Equal to 180 Days":
  ( "Antidepressant Medication Period Between IPSD and 231 Days After IPSD".cumulativeDuration ( ) ) >= 180

define "Antidepressant Medication Period Between IPSD and 231 Days After IPSD":
  ( ( [MedicationDispense: "Antidepressant Medication"] ).isMedicationDispensed ( ) ) Antidepressant
    let MedicationPeriod: Antidepressant.medicationDispensePeriod ( )
    return MedicationPeriod
      intersect Interval["IPSD", "IPSD" + 231 days]

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

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

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

define "SDE Sex":
  SDE."SDE Sex"