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

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

AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR

Id: | AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR
Url: | http://ecqi.healthit.gov/ecqms/Library/AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR
Version: | 0.0.004
Identifier: | value: AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR
Name: | AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR
Title: | AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR
Status: | active
Experimental: | false
Type: | system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library
Date: | 2023-08-14T14:38:57+00:00
Description: | AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR
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 | ;; |
Condition | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition | ;; |
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.464.1003.101.12.1010
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.1008
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.526.3.1141
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.1031
Procedure | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure | ;;;; | code filter: path: code system: http://snomed.info/sct code: 225337009 display: Suicide risk assessment (procedure)
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 | ;; |
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 AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR version '0.0.004'

    using QICore version '4.1.1'

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

    codesystem "SNOMEDCT": 'http://snomed.info/sct'
    codesystem "LOINC": 'http://loinc.org'
    codesystem "ActCode": 'http://terminology.hl7.org/CodeSystem/v3-ActCode'

    valueset "Emergency Department Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1010'
    valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837'
    valueset "Major Depressive Disorder Active": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1491'
    valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001'
    valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1'
    valueset "Outpatient Consultation": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1008'
    valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591'
    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 "Psychoanalysis": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1141'
    valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836'
    valueset "Telehealth Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1031'

    code "Birth date": '21112-8' from "LOINC" display 'Birth date'
    code "Suicide risk assessment (procedure)": '225337009' from "SNOMEDCT" display 'Suicide risk assessment (procedure)'
    code "AMB": 'AMB' from "ActCode" display 'Ambulatory'

    parameter "Measurement Period" Interval<DateTime>

    context Patient

    define "Initial Population":
      "New or Recurrent Major Depressive Disorder Encounter" NewOrRecurrentMDDEncounter
        where "AgeInYearsAt"(date from start of "Measurement Period") >= 17

    define "Denominator":
      "Initial Population"

    define "Numerator":
      "New or Recurrent Major Depressive Disorder Encounter" NewOrRecurrentMDDEncounter
        with ["Procedure": "Suicide risk assessment (procedure)"] SuicideRiskAssessment
          such that SuicideRiskAssessment.status = 'completed'
            and QICoreCommon."ToInterval" ( SuicideRiskAssessment.performed ) during NewOrRecurrentMDDEncounter.period

    define "New or Recurrent Major Depressive Disorder Encounter":
      "Major Depressive Disorder Encounter" NewOrRecurrentMDDEncounter
        without "Major Depressive Disorder Encounter" PriorMDDEpisodeEncounter
          such that ( PriorMDDEpisodeEncounter !~ NewOrRecurrentMDDEncounter
              and PriorMDDEpisodeEncounter.period ends 104 days or less before day of start of NewOrRecurrentMDDEncounter.period
          )
        where NewOrRecurrentMDDEncounter.period during "Measurement Period"

    define "Major Depressive Disorder Encounter":
      ( ["Encounter": "Psych Visit Diagnostic Evaluation"]
        union ["Encounter": "Emergency Department Visit"]
        union ["Encounter": "Office Visit"]
        union ["Encounter": "Outpatient Consultation"]
        union ["Encounter": "Psych Visit Psychotherapy"]
        union ["Encounter": "Psychoanalysis"]
        union ["Encounter": "Telehealth Services"] ) ValidEncounter
        where ValidEncounter.status = 'finished'
          and ValidEncounter.class ~ "AMB"
          and ( ValidEncounter.reasonCode in "Major Depressive Disorder Active"
              or exists ( ( CQMCommon."EncounterDiagnosis" ( ValidEncounter ) ) EncounterDiagnosis
                  where EncounterDiagnosis.code in "Major Depressive Disorder Active"
              )
          )

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

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

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

    define "SDE Sex":
      SDE."SDE Sex"
Content: application/elm+xml
    Encoded data (87128 characters)
Content: application/elm+json
    Encoded data (122084 characters)