CMS Draft FHIR Measures
2024.1.0 - CI Build

CMS Draft FHIR Measures, published by cqframework. This guide is not an authorized publication; it is the continuous build for version 2024.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/dqm-content-cms-2024/ and changes regularly. See the Directory of published versions

## Library: PCSDepressionScreenAndFollowUpFHIR

Official URL: https://madie.cms.gov/Library/PCSDepressionScreenAndFollowUpFHIR | Version: 0.2.000
Active as of 2024-05-16 | Computable Name: PCSDepressionScreenAndFollowUpFHIR
Other Identifiers: https://madie.cms.gov/login#PCSDepressionScreenAndFollowUpFHIR (use: official, )

PCSDepressionScreenAndFollowUpFHIR

Metadata
Title | PCSDepressionScreenAndFollowUpFHIR
Version | 0.2.000
Identifier | PCSDepressionScreenAndFollowUpFHIR
Topic | FHIR
Topic | CQL
Description | PCSDepressionScreenAndFollowUpFHIR
Type | logic-library from http://terminology.hl7.org/CodeSystem/library-type
Dependency | Description: Library QICoreCommon Resource: QICoreCommonversion: null2.1.000) Canonical URL: `https://madie.cms.gov/Library/QICoreCommon|2.1.000`
Dependency | Description: Library SDE Resource: SupplementalDataElementsversion: null3.5.000) Canonical URL: `https://madie.cms.gov/Library/SupplementalDataElements|3.5.000`
Dependency | Description: Library FHIRHelpers Resource: FHIRHelpersversion: null4.4.000) Canonical URL: `https://madie.cms.gov/Library/FHIRHelpers|4.4.000`
Dependency | Description: Code System LOINC Resource: Logical Observation Identifiers, Names and Codes (LOINC) Canonical URL: `http://loinc.org`
Dependency | Description: Code System SNOMEDCT Resource: SNOMED CT (all versions) Canonical URL: `http://snomed.info/sct`
Dependency | Description: Value Set Adolescent Depression Medications Resource: Adolescent Depression Medications Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1567`
Dependency | Description: Value Set Adult Depression Medications Resource: Adult Depression Medications Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1566`
Dependency | Description: Value Set Bipolar Disorder Resource: Bipolar Disorder Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.67.1.101.1.128`
Dependency | Description: Value Set Encounter to Screen for Depression Resource: Encounter to Screen for Depression Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1916`
Dependency | Description: Value Set Follow Up for Adolescent Depression Resource: Follow Up for Adolescent Depression Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1569`
Dependency | Description: Value Set Follow Up for Adult Depression Resource: Follow Up for Adult Depression Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1568`
Dependency | Description: Value Set Medical Reason Resource: Medical Reason Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1007`
Dependency | Description: Value Set Physical Therapy Evaluation Resource: Physical Therapy Evaluation Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1022`
Dependency | Description: Value Set Referral for Adolescent Depression Resource: Referral for Adolescent Depression Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1570`
Dependency | Description: Value Set Referral for Adult Depression Resource: Referral for Adult Depression Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1571`
Dependency | Description: Value Set Telephone Visits Resource: Telephone Visits Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080`
Data Requirement | Type: Encounter Profile(s): QICoreEncounter Code Filter(s): Path: type ValueSet: Encounter to Screen for Depression
Data Requirement | Type: Encounter Profile(s): QICoreEncounter Code Filter(s): Path: type ValueSet: Physical Therapy Evaluation
Data Requirement | Type: Encounter Profile(s): QICoreEncounter Code Filter(s): Path: type ValueSet: Telephone Visits
Data Requirement | Type: Condition Profile(s): QICoreCondition Code Filter(s): Path: code ValueSet: Bipolar Disorder
Data Requirement | Type: ServiceRequest Profile(s): QICoreServiceRequest Code Filter(s): Path: code ValueSet: Referral for Adolescent Depression
Data Requirement | Type: Procedure Profile(s): QICoreProcedure Code Filter(s): Path: code ValueSet: Follow Up for Adolescent Depression
Data Requirement | Type: MedicationRequest Profile(s): QICoreMedicationRequest
Data Requirement | Type: Medication Profile(s): QICoreMedication
Data Requirement | Type: ServiceRequest Profile(s): QICoreServiceRequest Code Filter(s): Path: code ValueSet: Referral for Adult Depression
Data Requirement | Type: Procedure Profile(s): QICoreProcedure Code Filter(s): Path: code ValueSet: Follow Up for Adult Depression
Data Requirement | Type: Observation Profile(s): QICoreObservationNotDone Code Filter(s): Path: code Code(s): LOINC: 73831-0 (Adolescent depression screening assessment)
Data Requirement | Type: Observation Profile(s): QICoreObservation Code Filter(s): Path: code Code(s): LOINC: 73831-0 (Adolescent depression screening assessment)
Data Requirement | Type: Observation Profile(s): QICoreObservationNotDone Code Filter(s): Path: code Code(s): LOINC: 73832-8 (Adult depression screening assessment)
Data Requirement | Type: Observation Profile(s): QICoreObservation Code Filter(s): Path: code Code(s): LOINC: 73832-8 (Adult depression screening assessment)
Parameters
Name | Use | Card. | Type | Documentation
Measurement Period | In | 0..1 | Period |
Patient | Out | 0..1 | Resource |
Patient Age 12 Years or Older at Start of Measurement Period | Out | 0..1 | boolean |
Qualifying Encounter During Measurement Period | Out | 0..* | Resource |
Initial Population | Out | 0..1 | boolean |
Denominator | Out | 0..1 | boolean |
History of Bipolar Diagnosis Before Qualifying Encounter | Out | 0..* | Resource |
Denominator Exclusions | Out | 0..1 | boolean |
Patient Age 12 to 16 Years at Start of Measurement Period | Out | 0..1 | boolean |
Most Recent Adolescent Depression Screening | Out | 0..1 | Resource |
Has Most Recent Adolescent Screening Negative | Out | 0..1 | boolean |
Follow Up Intervention for Positive Adolescent Depression Screening | Out | 0..* | Resource |
Most Recent Adolescent Depression Screening Positive and Follow Up Provided | Out | 0..* | Resource |
Patient Age 17 Years at Start of Measurement Period | Out | 0..1 | boolean |
Most Recent Adult Depression Screening | Out | 0..1 | Resource |
Has Most Recent Adult Screening Negative | Out | 0..1 | boolean |
Follow Up Intervention for Positive Adult Depression Screening | Out | 0..* | Resource |
Most Recent Adult Depression Screening Positive and Follow Up Provided | Out | 0..* | Resource |
Patient Age 18 Years or Older at Start of Measurement Period | Out | 0..1 | boolean |
Numerator | Out | 0..1 | boolean |
Medical or Patient Reason for Not Screening Adolescent for Depression | Out | 0..* | Resource |
Has Adolescent Depression Screening | Out | 0..1 | boolean |
Medical or Patient Reason for Not Screening Adult for Depression | Out | 0..* | Resource |
Has Adult Depression Screening | Out | 0..1 | boolean |
Denominator Exceptions | Out | 0..1 | boolean |
SDE Ethnicity | Out | 0..1 | Resource |
SDE Payer | Out | 0..* | Resource |
SDE Race | Out | 0..1 | Resource |
SDE Sex | Out | 0..1 | Coding |
Library Content
CQL Content |
    library PCSDepressionScreenAndFollowUpFHIR version '0.2.000'

    using QICore version '4.1.1'

    include QICoreCommon version '2.1.000' called QICoreCommon
    include SupplementalDataElements version '3.5.000' called SDE
    include FHIRHelpers version '4.4.000' called FHIRHelpers

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

    valueset "Adolescent Depression Medications": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1567'
    valueset "Adult Depression Medications": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1566'
    valueset "Bipolar Disorder": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.67.1.101.1.128'
    valueset "Encounter to Screen for Depression": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1916'
    valueset "Follow Up for Adolescent Depression": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1569'
    valueset "Follow Up for Adult Depression": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1568'
    valueset "Medical Reason": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1007'
    valueset "Physical Therapy Evaluation": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1022'
    valueset "Referral for Adolescent Depression": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1570'
    valueset "Referral for Adult Depression": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1571'
    valueset "Telephone Visits": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080'

    code "Adolescent depression screening assessment": '73831-0' from "LOINC" display 'Adolescent depression screening assessment'
    code "Adult depression screening assessment": '73832-8' from "LOINC" display 'Adult depression screening assessment'
    code "Depression screening declined (situation)": '720834000' from "SNOMEDCT" display 'Depression screening declined (situation)'
    code "Depression screening negative (finding)": '428171000124102' from "SNOMEDCT" display 'Depression screening negative (finding)'
    code "Depression screening positive (finding)": '428181000124104' from "SNOMEDCT" display 'Depression screening positive (finding)'

    parameter "Measurement Period" Interval<DateTime>
      default Interval[@2025-01-01T00:00:00.000Z, @2025-12-31T23:59:59.999Z]

    context Patient

    define "Initial Population":
      "Patient Age 12 Years or Older at Start of Measurement Period"
        and exists ( "Qualifying Encounter During Measurement Period" )

    define "Denominator":
      "Initial Population"

    define "Denominator Exclusions":
      exists "History of Bipolar Diagnosis Before Qualifying Encounter"

    define "Numerator":
      ( "Patient Age 12 to 16 Years at Start of Measurement Period"
          and ( "Has Most Recent Adolescent Screening Negative"
              or exists "Most Recent Adolescent Depression Screening Positive and Follow Up Provided"
          )
      )
        or ( "Patient Age 17 Years at Start of Measurement Period"
            and ( "Has Most Recent Adolescent Screening Negative"
                or exists "Most Recent Adolescent Depression Screening Positive and Follow Up Provided"
                or "Has Most Recent Adult Screening Negative"
                or exists "Most Recent Adult Depression Screening Positive and Follow Up Provided"
            )
        )
        or ( "Patient Age 18 Years or Older at Start of Measurement Period"
            and ( "Has Most Recent Adult Screening Negative"
                or exists "Most Recent Adult Depression Screening Positive and Follow Up Provided"
            )
        )

    define "Denominator Exceptions":
      ( exists "Medical or Patient Reason for Not Screening Adolescent for Depression"
          and not "Has Adolescent Depression Screening"
      )
        or ( exists "Medical or Patient Reason for Not Screening Adult for Depression"
            and not "Has Adult Depression Screening"
        )

    define "Follow Up Intervention for Positive Adolescent Depression Screening":
      ( ( [MedicationRequest: "Adolescent Depression Medications"] AdolescentMed
            where AdolescentMed.status in { 'active', 'completed' }
              and AdolescentMed.intent = 'order'
        )
          union ( [ServiceRequest: "Referral for Adolescent Depression"] AdolescentReferral
              where AdolescentReferral.status in { 'active', 'completed' }
          )
          union ( [Procedure: "Follow Up for Adolescent Depression"] AdolescentFollowUp
              where AdolescentFollowUp.status = 'completed'
          )
      )

    define "Follow Up Intervention for Positive Adult Depression Screening":
      ( ( [MedicationRequest: "Adult Depression Medications"] AdultMed
            where AdultMed.status in { 'active', 'completed' }
              and AdultMed.intent = 'order'
        )
          union ( [ServiceRequest: "Referral for Adult Depression"] AdultReferral
              where AdultReferral.status in { 'active', 'completed' }
          )
          union ( [Procedure: "Follow Up for Adult Depression"] AdultFollowUp
              where AdultFollowUp.status = 'completed'
          )
      )

    define "Has Adolescent Depression Screening":
      exists ( [Observation: "Adolescent depression screening assessment"] AdolescentScreening
          with "Qualifying Encounter During Measurement Period" QualifyingEncounter
            such that AdolescentScreening.effective.toInterval ( ) 14 days or less on or before day of start of QualifyingEncounter.period
              and AdolescentScreening.value is not null
              and AdolescentScreening.status = 'final'
      )

    define "Has Adult Depression Screening":
      exists ( [Observation: "Adult depression screening assessment"] AdultScreening
          with "Qualifying Encounter During Measurement Period" QualifyingEncounter
            such that AdultScreening.effective.toInterval ( ) 14 days or less on or before day of start of QualifyingEncounter.period
              and AdultScreening.value is not null
              and AdultScreening.status = 'final'
      )

    define "Has Most Recent Adolescent Screening Negative":
      ( "Most Recent Adolescent Depression Screening" AdolescentScreen
          where AdolescentScreen.value ~ "Depression screening negative (finding)"
      ) is not null

    define "Has Most Recent Adult Screening Negative":
      ( "Most Recent Adult Depression Screening" AdultScreen
          where AdultScreen.value ~ "Depression screening negative (finding)"
      ) is not null

    define "History of Bipolar Diagnosis Before Qualifying Encounter":
      [Condition: "Bipolar Disorder"] BipolarDiagnosis
        with "Qualifying Encounter During Measurement Period" QualifyingEncounter
          such that ( BipolarDiagnosis.isProblemListItem ( )
              or BipolarDiagnosis.isHealthConcern ( )
          )
            and BipolarDiagnosis.prevalenceInterval ( ) starts before QualifyingEncounter.period

    define "Medical or Patient Reason for Not Screening Adolescent for Depression":
      [ObservationNotDone: code ~ "Adolescent depression screening assessment"] NoAdolescentScreen
        with "Qualifying Encounter During Measurement Period" QualifyingEncounter
          such that NoAdolescentScreen.issued during QualifyingEncounter.period
        where ( NoAdolescentScreen.notDoneReason ~ "Depression screening declined (situation)"
            or NoAdolescentScreen.notDoneReason in "Medical Reason"
        )
          and NoAdolescentScreen.status = 'cancelled'

    define "Medical or Patient Reason for Not Screening Adult for Depression":
      [ObservationNotDone: code ~ "Adult depression screening assessment"] NoAdultScreen
        with "Qualifying Encounter During Measurement Period" QualifyingEncounter
          such that NoAdultScreen.issued during QualifyingEncounter.period
        where ( NoAdultScreen.notDoneReason ~ "Depression screening declined (situation)"
            or NoAdultScreen.notDoneReason in "Medical Reason"
        )
          and NoAdultScreen.status = 'cancelled'

    define "Most Recent Adolescent Depression Screening":
      Last([Observation: "Adolescent depression screening assessment"] AdolescentDepressionScreening
          with "Qualifying Encounter During Measurement Period" QualifyingEncounter
            such that AdolescentDepressionScreening.effective.toInterval() 14 days or less on or before day of start of QualifyingEncounter.period
              and AdolescentDepressionScreening.value is not null
              and AdolescentDepressionScreening.status = 'final'
          sort by start of effective.toInterval()
      )

    define "Most Recent Adult Depression Screening":
      Last([Observation: "Adult depression screening assessment"] AdultDepressionScreening
          with "Qualifying Encounter During Measurement Period" QualifyingEncounter
            such that AdultDepressionScreening.effective.toInterval() 14 days or less on or before day of start of QualifyingEncounter.period
              and AdultDepressionScreening.value is not null
              and AdultDepressionScreening.status = 'final'
          sort by start of effective.toInterval()
      )

    define "Most Recent Adolescent Depression Screening Positive and Follow Up Provided":
      from
        "Most Recent Adolescent Depression Screening" LastAdolescentScreen,
        "Follow Up Intervention for Positive Adolescent Depression Screening" FollowUpPositiveAdolescentScreen,
        "Qualifying Encounter During Measurement Period" QualifyingEncounter
        where LastAdolescentScreen.effective.toInterval ( ) starts 14 days or less on or before day of start of QualifyingEncounter.period
          and LastAdolescentScreen.value ~ "Depression screening positive (finding)"
          and ( start of FollowUpPositiveAdolescentScreen.performed.toInterval ( ) during QualifyingEncounter.period
              or FollowUpPositiveAdolescentScreen.authoredOn 2 days or less on or after day of end of QualifyingEncounter.period
          )
          and ( Coalesce(start of FollowUpPositiveAdolescentScreen.performed.toInterval(), FollowUpPositiveAdolescentScreen.authoredOn) during day of "Measurement Period" )

    define "Most Recent Adult Depression Screening Positive and Follow Up Provided":
      from
        "Most Recent Adult Depression Screening" LastAdultScreen,
        "Follow Up Intervention for Positive Adult Depression Screening" FollowUpPositiveAdultScreen,
        "Qualifying Encounter During Measurement Period" QualifyingEncounter
        where LastAdultScreen.effective.toInterval ( ) starts 14 days or less on or before day of start of QualifyingEncounter.period
          and LastAdultScreen.value ~ "Depression screening positive (finding)"
          and ( start of FollowUpPositiveAdultScreen.performed.toInterval ( ) during QualifyingEncounter.period
              or FollowUpPositiveAdultScreen.authoredOn 2 days or less on or after day of end of QualifyingEncounter.period
          )
          and ( Coalesce(start of FollowUpPositiveAdultScreen.performed.toInterval(), FollowUpPositiveAdultScreen.authoredOn) during day of "Measurement Period" )

    define "Patient Age 12 to 16 Years at Start of Measurement Period":
      AgeInYearsAt(date from start of "Measurement Period") in Interval[12, 16]

    define "Patient Age 12 Years or Older at Start of Measurement Period":
      AgeInYearsAt(date from start of "Measurement Period") >= 12

    define "Patient Age 17 Years at Start of Measurement Period":
      AgeInYearsAt(date from start of "Measurement Period") = 17

    define "Patient Age 18 Years or Older at Start of Measurement Period":
      AgeInYearsAt(date from start of "Measurement Period") >= 18

    define "Qualifying Encounter During Measurement Period":
      ( [Encounter: "Encounter to Screen for Depression"]
        union [Encounter: "Physical Therapy Evaluation"]
        union [Encounter: "Telephone Visits"] ) QualifyingEncounter
        where QualifyingEncounter.period during day of "Measurement Period"
          and QualifyingEncounter.status = 'finished'

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

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

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

    define "SDE Sex":
      SDE."SDE Sex"
ELM XML Content |
    Encoded data
ELM JSON Content |
    Encoded data
Generated using version 0.5.4-cibuild of the sample-content-ig Liquid templates