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: CMS159FHIRDepressionRemissionatTwelveMonths

Official URL: https://madie.cms.gov/Library/CMS159FHIRDepressionRemissionatTwelveMonths Version: 0.3.000
Active as of 2025-04-15 Responsible: MN Community Measurement Computable Name: CMS159FHIRDepressionRemissionatTwelveMonths
Other Identifiers: https://madie.cms.gov/login#CMS159FHIRDepressionRemissionatTwelveMonths (use: official, )

CMS159FHIRDepressionRemissionatTwelveMonths

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

CMS159FHIRDepressionRemissionatTwelveMonths

Type:

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

code: logic-library

Date: 2025-04-15T18:54:11+00:00
Publisher: MN Community Measurement
Description: CMS159FHIRDepressionRemissionatTwelveMonths
Related Artifacts:

Dependencies

  • https://madie.cms.gov/Library/SupplementalDataElements|5.1.000
  • https://madie.cms.gov/Library/FHIRHelpers|4.4.000
  • https://madie.cms.gov/Library/QICoreCommon|4.0.000
  • http://snomed.info/sct
  • http://loinc.org
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.67.1.101.1.263
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1080.5
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.113883.3.67.1.101.3.2444
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.67.1.101.1.254
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1003
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1584
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1165
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1167
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1090
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1135
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.67.1.101.1.128
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.67.1.101.1.246
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.105.12.1104
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.105.12.1152
Data Requirements:
TypeProfileMSCode Filter
Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;;;
Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-screening-assessment ;;;; code filter:
path: code
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.67.1.101.1.263
Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-screening-assessment ;;
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]

Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-screening-assessment ;;;; 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-problems-health-concerns ; code filter:
path: code
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.113883.3.67.1.101.3.2444
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.67.1.101.1.254
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-problems-health-concerns ; code filter:
path: code
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1167
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.67.1.101.1.128
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.67.1.101.1.246
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.1104
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.1152
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.113883.3.67.1.101.3.2444
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.67.1.101.1.254
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
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.1167
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.67.1.101.1.128
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.67.1.101.1.246
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.1104
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.1152
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
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.101.12.1090
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.464.1003.198.12.1135
Content: text/cql
library CMS159FHIRDepressionRemissionatTwelveMonths 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 QICoreCommon version '4.0.000' called QICoreCommon

codesystem "LOINC": 'http://loinc.org'
codesystem "SNOMEDCT": 'http://snomed.info/sct'
codesystem "ConditionVerificationStatusCodes": 'http://terminology.hl7.org/CodeSystem/condition-ver-status'

valueset "Bipolar Disorder": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.67.1.101.1.128'
valueset "Contact or Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1080.5'
valueset "Dysthymia": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.67.1.101.1.254'
valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'
valueset "Hospice Care Ambulatory": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1584'
valueset "Hospice Diagnosis": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1165'
valueset "Hospice Encounter": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1003'
valueset "Major Depression Including Remission": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.113883.3.67.1.101.3.2444'
valueset "Palliative Care Diagnosis": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1167'
valueset "Palliative Care Encounter": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1090'
valueset "Palliative Care Intervention": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1135'
valueset "Palliative or Hospice Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1579'
valueset "Personality Disorder Emotionally Labile": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.67.1.101.1.246'
valueset "Pervasive Developmental Disorder": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.105.12.1152'
valueset "PHQ 9 and PHQ 9M Tools": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.67.1.101.1.263'
valueset "Schizophrenia or Psychotic Disorder": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.105.12.1104'

code "Discharge to healthcare facility for hospice care (procedure)": '428371000124100' from "SNOMEDCT" display 'Discharge to healthcare facility for hospice care (procedure)'
code "Discharge to home for hospice care (procedure)": '428361000124107' from "SNOMEDCT" display 'Discharge to home for hospice care (procedure)'
code "Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)": '71007-9' from "LOINC" display 'Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)'
code "Hospice care [Minimum Data Set]": '45755-6' from "LOINC" display 'Hospice care [Minimum Data Set]'
code "Yes (qualifier value)": '373066001' from "SNOMEDCT" display 'Yes (qualifier value)'

parameter "Measurement Period" Interval<DateTime>default Interval[@2026-01-01, @2027-01-01 )

context Patient

define "Initial Population":
  AgeInYearsAt(start of("Index Depression Assessment".effective.toInterval())) >= 12

define "Denominator":
  "Initial Population"

define "Denominator Exclusions":
  "Has Hospice Services in the Measure Assessment Period"
    or "Has Palliative Care in the Measure Assessment Period"
    or "Patient Expired"
    or "Has Mental Health Disorder Diagnoses"

define "Numerator":
  Last([ObservationScreeningAssessment: "PHQ 9 and PHQ 9M Tools"] DepressionAssessment
      where ToDate(start of DepressionAssessment.effective.toInterval()) during day of "Measure Assessment Period"
        and DepressionAssessment.status in { 'final', 'amended', 'corrected' }
      sort by start of effective.toInterval()
  ).value < 5

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

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

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

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

define "Denominator Identification Period":
  Interval[start of "Measurement Period" - 14 months, start of "Measurement Period" - 2 months )

define "Depression Assessments Greater Than 9":
  [ObservationScreeningAssessment: "PHQ 9 and PHQ 9M Tools"] DepressionAssessment
    where DepressionAssessment.value > 9
      and DepressionAssessment.status in { 'final', 'amended', 'corrected' }

define "Depression Diagnoses":
  ( ( [ConditionProblemsHealthConcerns: "Major Depression Including Remission"]
      union [ConditionEncounterDiagnosis: "Major Depression Including Remission"]
  )
    union ( [ConditionProblemsHealthConcerns: "Dysthymia"]
        union [ConditionEncounterDiagnosis: "Dysthymia"]
    ) ) Depression
    where Depression.isConfirmedActiveDiagnosis ( )

define "Depression Encounter":
  [Encounter: "Contact or Office Visit"] ValidEncounter
    with "Depression Diagnoses" Depression
      such that ValidEncounter.period overlaps Depression.prevalenceInterval ( )
        and ValidEncounter.period ends during day of "Denominator Identification Period"
        and ValidEncounter.status = 'finished'

define "Has Mental Health Disorder Diagnoses":
  exists ( ( ( [ConditionProblemsHealthConcerns: "Bipolar Disorder"]
        union [ConditionEncounterDiagnosis: "Bipolar Disorder"]
    )
      union ( [ConditionProblemsHealthConcerns: "Personality Disorder Emotionally Labile"]
          union [ConditionEncounterDiagnosis: "Personality Disorder Emotionally Labile"]
      )
      union ( [ConditionProblemsHealthConcerns: "Schizophrenia or Psychotic Disorder"]
          union [ConditionEncounterDiagnosis: "Schizophrenia or Psychotic Disorder"]
      )
      union ( [ConditionProblemsHealthConcerns: "Pervasive Developmental Disorder"]
          union [ConditionEncounterDiagnosis: "Pervasive Developmental Disorder"]
      ) ) MentalHealthDisorderDiagnoses
      where ToDate(start of MentalHealthDisorderDiagnoses.prevalenceInterval()) on or before day of end of "Measure Assessment Period"
        and MentalHealthDisorderDiagnoses.isConfirmedActiveDiagnosis ( )
  )

define "Measure Assessment Period":
  "Index Depression Assessment" FirstIndexAssessment
    let YearAfterIndexAssessment: date from start of FirstIndexAssessment.effective.toInterval ( ) + 12 months
    return Interval[YearAfterIndexAssessment - 60 days, YearAfterIndexAssessment + 60 days]

define "Patient Expired":
  Patient.deceased occurs on or before day of end of "Measure Assessment Period"

define "Has Hospice Services in the Measure Assessment Period":
  exists ( [Encounter: "Encounter Inpatient"] InpatientEncounter
      where ( InpatientEncounter.hospitalization.dischargeDisposition ~ "Discharge to home for hospice care (procedure)"
          or InpatientEncounter.hospitalization.dischargeDisposition ~ "Discharge to healthcare facility for hospice care (procedure)"
      )
        and InpatientEncounter.period ends during day of Interval[start of "Denominator Identification Period", end of "Measure Assessment Period"]
        and InpatientEncounter.status = 'finished'
  )
    or exists ( [Encounter: "Hospice Encounter"] HospiceEncounter
        where HospiceEncounter.period overlaps day of Interval[start of "Denominator Identification Period", end of "Measure Assessment Period"]
          and not ( HospiceEncounter.status in { 'cancelled', 'entered-in-error', 'unknown' } )
    )
    or exists ( [ObservationScreeningAssessment: "Hospice care [Minimum Data Set]"] HospiceAssessment
        where HospiceAssessment.value ~ "Yes (qualifier value)"
          and HospiceAssessment.effective.toInterval ( ) overlaps day of Interval[start of "Denominator Identification Period", end of "Measure Assessment Period"]
          and HospiceAssessment.status in { 'final', 'amended', 'corrected' }
    )
    or exists ( [ServiceRequest: "Hospice Care Ambulatory"] HospiceOrder
        where HospiceOrder.authoredOn during day of Interval[start of "Denominator Identification Period", end of "Measure Assessment Period"]
          and HospiceOrder.status in { 'active', 'completed' }
          and HospiceOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
          and HospiceOrder.doNotPerform is not true
    )
    or exists ( [Procedure: "Hospice Care Ambulatory"] HospicePerformed
        where HospicePerformed.performed.toInterval ( ) overlaps day of Interval[start of "Denominator Identification Period", end of "Measure Assessment Period"]
          and not ( HospicePerformed.status in { 'not-done', 'entered-in-error', 'unknown' } )
    )
    or exists ( ( [ConditionProblemsHealthConcerns: "Hospice Diagnosis"]
        union [ConditionEncounterDiagnosis: "Hospice Diagnosis"] ) HospiceCareDiagnosis
        where HospiceCareDiagnosis.prevalenceInterval ( ) overlaps day of Interval[start of "Denominator Identification Period", end of "Measure Assessment Period"]
          and HospiceCareDiagnosis.isConfirmedActiveDiagnosis ( )
    )

define "Index Depression Assessment":
  First("Depression Assessments Greater Than 9" DepressionAssessment
      with "Depression Encounter" DepressionEncounter
        such that DepressionAssessment.effective.toInterval() during day of Interval[ToDate((start of DepressionEncounter.period) - 7 days), 
        end of DepressionEncounter.period]
      sort by start of effective.toInterval()
  )

define "Has Palliative Care in the Measure Assessment Period":
  exists ( [ObservationScreeningAssessment: "Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)"] PalliativeAssessment
      where PalliativeAssessment.effective.toInterval ( ) overlaps day of Interval[start of "Denominator Identification Period", end of "Measure Assessment Period"]
        and PalliativeAssessment.status in { 'final', 'amended', 'corrected' }
  )
    or exists ( ( [ConditionProblemsHealthConcerns: "Palliative Care Diagnosis"]
        union [ConditionEncounterDiagnosis: "Palliative Care Diagnosis"] ) PalliativeDiagnosis
        where PalliativeDiagnosis.prevalenceInterval ( ) overlaps day of Interval[start of "Denominator Identification Period", end of "Measure Assessment Period"]
          and PalliativeDiagnosis.isConfirmedActiveDiagnosis ( )
    )
    or exists ( [Encounter: "Palliative Care Encounter"] PalliativeEncounter
        where PalliativeEncounter.period overlaps day of Interval[start of "Denominator Identification Period", end of "Measure Assessment Period"]
          and PalliativeEncounter.status = 'finished'
    )
    or exists ( [Procedure: "Palliative Care Intervention"] PalliativeIntervention
        where PalliativeIntervention.performed.toInterval ( ) overlaps day of Interval[start of "Denominator Identification Period", end of "Measure Assessment Period"]
          and not ( PalliativeIntervention.status in { 'not-done', 'entered-in-error', 'unknown' } )
    )

define fluent function isConfirmedActiveDiagnosis(condition ConditionProblemsHealthConcerns):
  condition.isActive ( )
    and condition.verificationStatus ~ QICoreCommon."confirmed"
        
/* Commented out due to issues noted in https://oncprojectracking.healthit.gov/support/browse/BONNIEMAT-1489.
Also, refer to https://github.com/cqframework/sample-content-ig/issues/70.
define "Stratification 1":
  "Index Depression Assessment" IndexAssessment
    return AgeInYearsAt(date from start of IndexAssessment.effective.toInterval()) in Interval[12, 17]
         
define "Stratification 2":
  "Index Depression Assessment" IndexAssessment
    return AgeInYearsAt(date from start of IndexAssessment.effective.toInterval()) >= 18
*/