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

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

DepressionRemissionatTwelveMonthsFHIR

Id: | DepressionRemissionatTwelveMonthsFHIR
Url: | http://ecqi.healthit.gov/ecqms/Library/DepressionRemissionatTwelveMonthsFHIR
Version: | 0.0.001
Identifier: | value: DepressionRemissionatTwelveMonthsFHIR
Name: | DepressionRemissionatTwelveMonthsFHIR
Title: | DepressionRemissionatTwelveMonthsFHIR
Status: | active
Experimental: | false
Type: | system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library
Date: | 2023-08-28T17:13:09+00:00
Description: | DepressionRemissionatTwelveMonthsFHIR
Use Context: |
code | value | display
--- | --- | ---
program | ep-ec | EP/EC
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 | ;;;;; |
Patient | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient |  |
Observation | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation | ;;;;; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.67.1.101.1.263
Condition | http://hl7.org/fhir/Condition | ; |
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.113883.3.67.1.101.3.2444
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.67.1.101.1.254
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.1080.5
Observation | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation | ;;;;; | 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 | ;;;; | 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/Observation | ;; |
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
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 | ;; |
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
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
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)
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
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
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.67.1.101.1.128
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.67.1.101.1.246
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.1104
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.1152
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 DepressionRemissionatTwelveMonthsFHIR version '0.0.001'

    using QICore version '4.1.1'

    /*This spec aligns with AU2022/PY2023 QDM version*/

    include FHIRHelpers version '4.3.000' called FHIRHelpers
    include SupplementalDataElements version '3.4.000' called SDE
    include QICoreCommon version '1.5.000' called QICoreCommon

    codesystem "LOINC": 'http://loinc.org'
    codesystem "SNOMEDCT": 'http://snomed.info/sct'

    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 "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>

    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([Observation: "PHQ 9 and PHQ 9M Tools"] DepressionAssessment
          where ToDate(start of DepressionAssessment.effective.toInterval()) during "Measure Assessment Period"
            and DepressionAssessment.status in { 'final', 'amended', 'corrected' }
          sort by start of effective.toInterval()
      ).value < 5

    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

    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":
      [Observation: "PHQ 9 and PHQ 9M Tools"] DepressionAssessment
        where DepressionAssessment.value > 9
          and DepressionAssessment.status in { 'final', 'amended', 'corrected' }

    define "Depression Diagnoses":
      ( [Condition: "Major Depression Including Remission"]
        union [Condition: "Dysthymia"] ) Depression
        where Depression.isActive ( )
          and not ( Depression.verificationStatus ~ QICoreCommon."unconfirmed"
              or Depression.verificationStatus ~ QICoreCommon."refuted"
              or Depression.verificationStatus ~ QICoreCommon."entered-in-error"
          )

    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 "Denominator Identification Period"
            and ValidEncounter.status = 'finished'

    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 ( [Observation: "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: code in "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' }
        )
        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 ( [Condition: "Hospice Diagnosis"] HospiceCareDiagnosis
            where HospiceCareDiagnosis.prevalenceInterval ( ) overlaps day of Interval[start of "Denominator Identification Period", end of "Measure Assessment Period"]
              and HospiceCareDiagnosis.isActive ( )
              and not ( HospiceCareDiagnosis.verificationStatus ~ QICoreCommon."unconfirmed"
                  or HospiceCareDiagnosis.verificationStatus ~ QICoreCommon."refuted"
                  or HospiceCareDiagnosis.verificationStatus ~ QICoreCommon."entered-in-error"
              )
        )

    define "Has Mental Health Disorder Diagnoses":
      exists ( ( [Condition: "Bipolar Disorder"]
          union [Condition: "Personality Disorder Emotionally Labile"]
          union [Condition: "Schizophrenia or Psychotic Disorder"]
          union [Condition: "Pervasive Developmental Disorder"] ) MentalHealthDisorderDiagnoses
          where ToDate(start of MentalHealthDisorderDiagnoses.prevalenceInterval()) on or before end of "Measure Assessment Period"
            and MentalHealthDisorderDiagnoses.isActive ( )
            and not ( MentalHealthDisorderDiagnoses.verificationStatus ~ QICoreCommon."unconfirmed"
                or MentalHealthDisorderDiagnoses.verificationStatus ~ QICoreCommon."refuted"
                or MentalHealthDisorderDiagnoses.verificationStatus ~ QICoreCommon."entered-in-error"
            )
      )

    define "Has Palliative Care in the Measure Assessment Period":
      exists ( [Observation: "Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)"] PalliativeAssessment
          where PalliativeAssessment.effective.toInterval ( ) overlaps Interval[start of "Denominator Identification Period", end of "Measure Assessment Period"]
            and PalliativeAssessment.status in { 'final', 'amended', 'corrected' }
      )
        or exists ( [Condition: "Palliative Care Diagnosis"] PalliativeDiagnosis
            where PalliativeDiagnosis.prevalenceInterval ( ) overlaps Interval[start of "Denominator Identification Period", end of "Measure Assessment Period"]
              and PalliativeDiagnosis.isActive ( )
              and not ( PalliativeDiagnosis.verificationStatus ~ QICoreCommon."unconfirmed"
                  or PalliativeDiagnosis.verificationStatus ~ QICoreCommon."refuted"
                  or PalliativeDiagnosis.verificationStatus ~ QICoreCommon."entered-in-error"
              )
        )
        or exists ( [Encounter: "Palliative Care Encounter"] PalliativeEncounter
            where PalliativeEncounter.period overlaps 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 Interval[start of "Denominator Identification Period", end of "Measure Assessment Period"]
              and not ( PalliativeIntervention.status in { 'not-done', 'entered-in-error', 'unknown' } )
        )

    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 "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 on or before end of "Measure Assessment Period"
Content: application/elm+xml
    Encoded data (498176 characters)
Content: application/elm+json
    Encoded data (727864 characters)