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

: Adult Major Depressive Disorder (MDD): Suicide Risk AssessmentFHIR - XML Representation

Draft as of 2023-10-27

Raw xml | Download


<Measure xmlns="http://hl7.org/fhir">
  <id value="AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR"/>
  <meta>
    <profile
             value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/computable-measure-cqfm"/>
    <profile
             value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/publishable-measure-cqfm"/>
    <profile
             value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/executable-measure-cqfm"/>
  </meta>
  <text>
    <status value="extensions"/>
    <div xmlns="http://www.w3.org/1999/xhtml">
    <table class="grid dict">
        
            <tr>
                <th scope="row"><b>Title: </b></th>
                <td style="padding-left: 4px;">Adult Major Depressive Disorder (MDD): Suicide Risk AssessmentFHIR</td>
            </tr>
        

        

        
            <tr>
                <th scope="row"><b>Id: </b></th>
                <td style="padding-left: 4px;">AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR</td>
            </tr>
            
                <tr>
                    <th scope="row"><b>Download cql: </b></th>
                    <td style="padding-left: 4px;"><a href="Library-AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR.cql">AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR.cql</a></td>
                </tr>
            
        

        
            <tr>
                <th scope="row"><b>Version: </b></th>
                <td style="padding-left: 4px;">0.0.004</td>
            </tr>
        

        
            <tr>
                <th scope="row"><b>Url: </b></th>
                <td style="padding-left: 4px;"><a href="Measure-AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR.html">Adult Major Depressive Disorder (MDD): Suicide Risk AssessmentFHIR</a></td>
            </tr>
        

        
            <tr>
                <th scope="row">
                    <b>
                        
                            
                                short-name identifier:
                            
                        
                    </b>
                </th>

                <td style="padding-left: 4px;">
                    
                        <p style="margin-bottom: 5px;">
                            <span>CMS161FHIR</span>
                        </p>
                    
                </td>
            </tr>
        
            <tr>
                <th scope="row">
                    <b>
                        
                            
                                version-independent identifier:
                            
                        
                    </b>
                </th>

                <td style="padding-left: 4px;">
                    
                        <p style="margin-bottom: 5px;">
                            <span>urn:uuid:9e056df9-6c0c-4847-a88e-bc9932dd69bd</span>
                        </p>
                    
                </td>
            </tr>
        
            <tr>
                <th scope="row">
                    <b>
                        
                            
                                version-specific identifier:
                            
                        
                    </b>
                </th>

                <td style="padding-left: 4px;">
                    
                        <p style="margin-bottom: 5px;">
                            <span>urn:uuid:2c928085806c39a20180859994bf050e</span>
                        </p>
                    
                </td>
            </tr>
        
            <tr>
                <th scope="row">
                    <b>
                        
                            
                                endorser (NQF) identifier:
                            
                        
                    </b>
                </th>

                <td style="padding-left: 4px;">
                    
                        <p style="margin-bottom: 5px;">
                            <span>0104e</span>
                        </p>
                    
                </td>
            </tr>
        
            <tr>
                <th scope="row">
                    <b>
                        
                            
                                publisher (CMS) identifier:
                            
                        
                    </b>
                </th>

                <td style="padding-left: 4px;">
                    
                        <p style="margin-bottom: 5px;">
                            <span>161FHIR</span>
                        </p>
                    
                </td>
            </tr>
        

        
            <tr>
                <th scope="row"><b>Effective Period: </b></th>
                <td style="padding-left: 4px;">2024-01-01
                    ..2024-12-31</td>
            </tr>
        

        
            <tr>
                <th scope="row"><b>Status: </b></th>
                <td style="padding-left: 4px;">draft</td>
            </tr>
        

        

        
            <tr>
                <th scope="row"><b>Date: </b></th>
                <td style="padding-left: 4px;">2023-10-27 08:12:31+0000</td>
            </tr>
        

        
            <tr>
                <th scope="row"><b>Approval Date: </b></th>
                <td style="padding-left: 4px;">2023-08-14</td>
            </tr>
        

        
            <tr>
                <th scope="row"><b>Last Review Date: </b></th>
                <td style="padding-left: 4px;">2023-08-14</td>
            </tr>
        

        
            <tr>
                <th scope="row"><b>Name: </b></th>
                <td style="padding-left: 4px;">AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR</td>
            </tr>
        

        
            <tr>
                <th scope="row"><b>Publisher: </b></th>
                <td style="padding-left: 4px;">Mathematica</td>
            </tr>
        

        
        <tr>
            <th scope="row"><b>Author: </b></th>
            <td style="padding-left: 4px;">Mathematica: <a href="https://www.mathematica.org/">https://www.mathematica.org/</a>, American Medical Association (AMA): <a href="https://www.ama-assn.org/">https://www.ama-assn.org/</a></td>
        </tr>
        

        

        
            <tr>
                <th scope="row"><b>Description: </b></th>
                <td style="padding-left: 4px;"><div><p>Percentage of all patient visits for those patients that are 17 years of age or older at the start of the measurement period in which a new or recurrent diagnosis of major depressive disorder (MDD) was identified and a suicide risk assessment was completed during the visit</p>
</div></td>
            </tr>
        

        

        

        
            <tr>
                <th scope="row"><b>Use Context: </b></th>
                <td style="padding-left: 4px;">
                    <table class="grid-dict">
                        <tr>
                            <th><b>code</b></th>
                            <th><b>value</b></th>
                        </tr>
                        
                            <tr>
                                <td>program</td>
                                <td/>
                            </tr>
                        
                    </table>
                </td>
            </tr>
        

        

        

        
            <tr>
                <th scope="row"><b>Purpose: </b></th>
                <td style="padding-left: 4px;"><div><p>UNKNOWN</p>
</div></td>
            </tr>
        

        
            <tr>
                <th scope="row"><b>Copyright: </b></th>
                <td style="padding-left: 4px;"><div><p>Copyright 2023 Mathematica Inc. All Rights Reserved.
The PCPI and American Medical Association's (AMA) significant past efforts and contributions to the development and updating of the Measure is acknowledged.</p>
</div></td>
            </tr>
        

        
            <tr>
                <th scope="row"><b>Disclaimer: </b></th>
                <td style="padding-left: 4px;"><div><p>The Measure is not a clinical guideline, does not establish a standard of medical care, and has not been tested for all potential applications.</p>
<p>The Measure, while copyrighted, can be reproduced and distributed, without modification, for noncommercial purposes, e.g., use by health care providers in connection with their practices. Commercial use is defined as the sale, license, or distribution of the Measure for commercial gain, or incorporation of the Measure into a product or service that is sold, licensed or distributed for commercial gain.</p>
<p>Commercial uses of the Measure require a license agreement between the user and Mathematica. Neither Mathematica, the PCPI, nor the American Medical Association (AMA), nor the former AMA-convened Physician Consortium for Performance Improvement(R) (AMA-PCPI), nor their members shall be responsible for any use of the Measure.</p>
<p>Mathematica encourages use of the Measure by other health care professionals, where appropriate.</p>
<p>THE MEASURE AND SPECIFICATIONS ARE PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND.</p>
<p>Limited proprietary coding may be contained in the Measure specifications for convenience. A license agreement must be entered prior to a third party's use of Current Procedural Terminology (CPT[R]) or other proprietary code set contained in the Measure. Any other use of CPT or other coding by a third party is strictly prohibited. Mathematica, the AMA, and former members of the PCPI disclaim all liability for use or accuracy of any CPT(R) or other coding contained in the specifications.</p>
<p>CPT(R) contained in the Measure specifications is copyright 2004-2022 American Medical Association. LOINC(R) is copyright 2004-2022 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2022 International Health Terminology Standards Development Organisation. ICD-10 is copyright 2022 World Health Organization. All Rights Reserved.</p>
<p>Due to technical limitations, registered trademarks are indicated by (R) or [R].</p>
</div></td>
            </tr>
        

        

        

        

        

        

        

        

        

        
        <tr>
            <th scope="row"><b>Rationale: </b></th>
            <td style="padding-left: 4px;"><div><p>This measure aims to improve rates of clinician assessment of suicide risk during an encounter where a new or recurrent episode of major depressive disorder (MDD) is identified. In an epidemiologic study of mental illness in the United States with a large, representative sample, 69% of respondents with lifetime suicide attempts had also met diagnostic criteria for MDD. When considering other mood disorders related to depression, such as dysthymia and bipolar disorders, this rate increases to 74% (Bolton &amp; Robinson, 2010). In a study of individuals who had died by suicide and were enrolled in one of eight major health systems in the United States, individuals with a depressive disorder diagnosis had 7.20 increased odds of dying by suicide within one year, after adjusting for age and sociodemographic factors (Yeh et al., 2019). A recent meta-analysis (Moitra et al., 2021) presented similar findings in which depressive disorder conferred a predictive relative risk for suicide of 7.64 after adjusting for relevant factors.</p>
<p>Suicide is associated with increased use of healthcare services, which provides an opportunity for intervention through assessment and intervention. Individuals who die by suicide are more likely to have any healthcare utilization (Ahmedani et al., 2019) and a higher frequency of healthcare visits than the general population (Chock, Bommersbach, Geske, &amp; Bostwick, 2015). A study of individuals who died by suicide and were enrolled within one of eight health systems in the Mental Health Research Network in the United States found that 50% of these individuals had been seen in a healthcare setting within four weeks prior to death (Ahmedani et al., 2014). Better assessment and identification of suicide risk in the healthcare setting should lead to improved connection to treatment and reduction in suicide attempts and deaths by suicide. A recent analysis of depression severity and suicidal ideation symptom trajectories (Witt et al., 2021) found that suicidal ideation among children and young adults (15-25 years) might not improve with depression symptom severity. This evidence suggests the potential utility of continued suicide risk screening after improvements in depression symptoms.</p>
</div></td>
        </tr>
        

        
        <tr>
            <th scope="row"><b>Clinical recommendation statement: </b></th>
            <td style="padding-left: 4px;"><div><p>A careful and ongoing evaluation of suicide risk is necessary for all patients with major depressive disorder (American Psychiatric Association, 2010a).</p>
<p>Such an assessment includes specific inquiry about suicidal thoughts, intent, plans, means, and behaviors; identification of specific psychiatric symptoms (e.g., psychosis, severe anxiety, substance use, hopelessness, insomnia, agitation) or general medical conditions that may increase the likelihood of acting on suicidal ideas; assessment of past and, particularly, recent suicidal behavior; delineation of current stressors and potential protective factors (e.g., positive reasons for living, strong social support); and identification of any family history of suicide or mental illness (American Psychiatric Association, 2010a; Department of Veterans Affairs and Department of Defense, 2019).</p>
<p>As part of the assessment process, impulsivity and potential for risk to others should also be evaluated, including any history of violence or violent or homicidal ideas, plans, or intentions, or the availability of firearms (American Psychiatric Association, 2010a; Department of Veterans Affairs and Department of Defense, 2019).</p>
<p>The patient's risk of harm to him- or herself and to others should also be monitored as treatment proceeds (American Psychiatric Association, 2010a).</p>
<p>Guidelines for Selecting a Treatment Setting for Patients at Risk for Suicide or Suicidal Behaviors (from American Psychiatric Association’s Practice Guideline for Assessment and Treatment of Patients With Suicidal Behaviors, 2010b):</p>
<p>ADMISSION GENERALLY INDICATED
After a suicide attempt or aborted suicide attempt if:</p>
<ul>
<li>Patient is psychotic</li>
<li>Attempt was violent, near-lethal, or premeditated</li>
<li>Precautions were taken to avoid rescue or discovery</li>
<li>Persistent plan and/or intent is present</li>
<li>Distress is increased or patient regrets surviving</li>
<li>Patient is male, older than age 45 years, especially with new onset of psychiatric illness or suicidal thinking</li>
<li>Patient has limited family and/or social support, including lack of stable living situation</li>
<li>Current impulsive behavior, severe agitation, poor judgment, or refusal of help is evident</li>
<li>Patient has change in mental status with a metabolic, toxic, infectious, or other etiology requiring further workup in a structured setting</li>
</ul>
<p>In the presence of suicidal ideation with:</p>
<ul>
<li>Specific plan with high lethality</li>
<li>High suicidal intent</li>
</ul>
<p>ADMISSION MAY BE NECESSARY
After a suicide attempt or aborted suicide attempt, except in circumstances for which admission is generally indicated</p>
<p>In the presence of suicidal ideation with:</p>
<ul>
<li>Psychosis</li>
<li>Major psychiatric disorder</li>
<li>Past attempts, particularly if medically serious</li>
<li>Possibly contributing medical condition (e.g., acute neurological disorder, cancer, infection)</li>
<li>Lack of response to or inability to cooperate with partial hospital or outpatient treatment</li>
<li>Need for supervised setting for medication trial or electroconvulsive therapy (ECT)</li>
<li>Need for skilled observation, clinical tests, or diagnostic assessments that require a structured setting</li>
<li>Limited family and/or social support, including lack of stable living situation</li>
<li>Lack of an ongoing clinician-patient relationship or lack of access to timely outpatient follow-up</li>
<li>Evidence of putting one's affairs in order (e.g., giving away possessions, writing a will)</li>
</ul>
<p>In the absence of suicide attempts or reported suicidal ideation/plan/intent but evidence from the psychiatric evaluation and/or history from others suggests a high level of suicide risk and a recent acute increase in risk</p>
<p>RELEASE FROM EMERGENCY DEPARTMENT WITH FOLLOW-UP RECOMMENDATIONS MAY BE POSSIBLE
After a suicide attempt or in the presence of suicidal ideation/plan when:</p>
<ul>
<li>Suicidality is a reaction to precipitating events (e.g., exam failure, relationship difficulties), particularly if the patient's view of situation has changed since coming to emergency department</li>
<li>Plan/method and intent have low lethality</li>
<li>Patient has stable and supportive living situation</li>
<li>Patient is able to cooperate with recommendations for follow-up, with treater contacted, if possible, if patient is currently in treatment</li>
</ul>
<p>OUTPATIENT TREATMENT MAY BE MORE BENEFICIAL THAN HOSPITALIZATION</p>
<p>Patient has chronic suicidal ideation and/or self-injury without prior medically serious attempts, if a safe and supportive living situation is available and outpatient psychiatric care is ongoing</p>
</div></td>
        </tr>
        

        

        
            <tr>
                <th scope="row"><b>Guidance (Usage): </b></th>
                <td style="padding-left: 4px;">This eCQM is an episode-based measure and should be reported for each instance of a new or recurrent episode of major depressive disorder (MDD) during the measurement period. This measure should be reported for each eligible encounter during which a new or recurrent episode of MDD is identified in adults that turn 18 or older during the measurement period.

As the guidelines state, it is important to assess for additional factors which may increase or decrease suicide risk, such as presence of additional symptoms (e.g., psychosis, severe anxiety, hopelessness, severe chronic pain); presence of substance abuse; history and seriousness of previous attempts, particularly, recent suicidal behavior; current stressors and potential protective factors (e.g., positive reasons for living, strong social support); family history of suicide or mental illness or recent exposure to suicide; impulsivity and potential for risk to others, including history of violence or violent or homicidal ideas, plans, or intentions; and putting one's affairs in order (e.g., giving away possessions, writing a will). In addition, although the measure focuses on the initial visit, it is critical that suicide risk be monitored especially for the 90 days following the initial visit and throughout MDD treatment.

It is expected that a suicide risk assessment will be completed at the visit during which a new diagnosis is made or at the visit during which a recurrent episode is first identified (i.e., at the initial evaluation). For the purposes of this measure, an episode of MDD would be considered to be recurrent if a patient has not had an MDD-related encounter in the past 105 days. If there is a gap of 105 or more days between visits for MDD, that would imply a recurrent episode. The 105-day look-back period is an operational provision and not a clinical recommendation, or definition of relapse, remission, or recurrence.

In recognition of the growing use of integrated and team-based care, the diagnosis of depression and the assessment for suicide risk need not be performed by the same provider or clinician.

Suicide risk assessments completed via telehealth services can also meet numerator performance.

Use of a standardized tool(s) or instrument(s) to assess suicide risk will meet numerator performance. Standardized tools can be mapped to the concept &quot;Intervention, Performed&quot;: &quot;Suicide risk assessment (procedure)&quot; included in the numerator logic below, as no individual suicide risk assessment tool or instrument would satisfy the requirements alone.

To ensure all patients with MDD are assessed for suicide risk, there are two clinical quality measures addressing suicide risk assessment; CMS177-Child and Adolescent Major Depressive Disorder (MDD): Suicide Risk Assessment covers children and adolescents aged 6 through 16 at the start of the measurement period, and CMS161 covers the adult population aged 17 years and older at the start of the measurement period.

This FHIR-based measure has been derived from the QDM-based measure: CMS161v12.

Please refer to the HL7 QI-Core Implementation Guide (http://hl7.org/fhir/us/qicore/index.html) for more information on QI-Core and mapping recommendations from QDM to QI-Core 4.1.1 (http://hl7.org/fhir/us/qicore/qdm-to-qicore.html).</td>
            </tr>
        

        
            
                <tr>
                    <th scope="row"><b>Population Criteria: </b></th>
                    <td style="padding-left: 4px;">
                        
                            <table class="grid-dict">
                                
                                    <tr>
                                        <th><b>6419eb169ef3a941fbe47b3b</b></th>
                                    </tr>
                                
                                
                                    <tr>
                                        <td>Initial Population:</td>
                                        
                                            <td>Patient visits for patients that are 17 years of age or older at the start of the measurement period during which a new diagnosis of MDD, single or recurrent episode, was identified</td>
                                        
                                    </tr>
                                
                                    <tr>
                                        <td>Denominator:</td>
                                        
                                            <td>Equals Initial Population</td>
                                        
                                    </tr>
                                
                                    <tr>
                                        <td>Denominator Exclusion:</td>
                                        
                                            <td>None</td>
                                        
                                    </tr>
                                
                                    <tr>
                                        <td>Numerator:</td>
                                        
                                            <td>Patient visits during which a new diagnosis of MDD, single or recurrent episode, was identified and a suicide risk assessment was completed during the visit</td>
                                        
                                    </tr>
                                
                                    <tr>
                                        <td>Numerator Exclusion:</td>
                                        
                                            <td>Not Applicable</td>
                                        
                                    </tr>
                                
                                    <tr>
                                        <td>Denominator Exception:</td>
                                        
                                            <td>None</td>
                                        
                                    </tr>
                                
                                
                            </table>
                        
                    </td>
                </tr>
            
        

        
            <tr>
                <th scope="row">
                    <b> Supplemental Data Guidance
                        : </b></th>
                <td style="padding-left: 4px;"> test1 test 2
 test 3 test4 </td>
            </tr>
        

        
            <tr>
                <th scope="row"><b> Supplemental Data Elements: </b></th>
                <td style="padding-left: 4px;">
                    
                        
                            
                                SDE Ethnicity
                            
                        
                    
                        
                            
                                SDE Payer
                            
                        
                    
                        
                            
                                SDE Race
                            
                        
                    
                        
                            
                                SDE Sex
                            
                        
                    
                </td>
            </tr>
        

        
            <tr>
                <th scope="row"><b>Libraries: </b></th>
                <td style="padding-left: 4px;">
                    <table class="grid-dict">
                        
                            <tr>
                                <td><a href="Library-AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR.html">AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR</a></td>
                            </tr>
                        
                    </table>
                </td>
            </tr>
        

        

        
            
                <tr>
                    <th scope="row"><b>Related Artifact Dependencies: </b></th>
                    <td style="padding-left: 4px;">
                        
                            <li><a href="Library-SupplementalDataElements.html">SupplementalDataElements</a> version: 3.4.000</li>
                        
                            <li><a href="Library-FHIRHelpers.html">FHIRHelpers</a> version: 4.3.000</li>
                        
                            <li><a href="Library-CQMCommon.html">CQMCommon</a> version: 1.4.000</li>
                        
                            <li><a href="Library-QICoreCommon.html">QICoreCommon</a> version: 1.5.000</li>
                        
                            <li><code>http://hl7.org/fhir/v3/AdministrativeGender</code></li>
                        
                            <li><a href="http://terminology.hl7.org/7.1.0/CodeSystem-v3-ActCode.html">ActCode</a></li>
                        
                            <li><a href="http://hl7.org/fhir/R4/codesystem-snomedct.html">SNOMED CT (all versions)</a></li>
                        
                            <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1492/expansion">Psych Visit - Diagnostic Evaluation</a></li>
                        
                            <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.464.1003.101.12.1010/expansion">Emergency Department Visit</a></li>
                        
                            <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.464.1003.101.12.1001/expansion">Office Visit</a></li>
                        
                            <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.464.1003.101.12.1008/expansion">Outpatient Consultation</a></li>
                        
                            <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1496/expansion">Psych Visit - Psychotherapy</a></li>
                        
                            <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1141/expansion">Psychoanalysis</a></li>
                        
                            <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.464.1003.101.12.1031/expansion">Telehealth Services</a></li>
                        
                            <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1491/expansion">Major Depressive Disorder-Active</a></li>
                        
                            <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion">Payer</a></li>
                        
                    </td>
                </tr>
                <tr>
                    <th scope="row"><b>Parameters:</b></th>
                    <td style="padding-left: 4px;">
                        <table class="grid-dict">
                            <tr>
                                <th><b>name</b></th>
                                <th><b>use</b></th>
                                <th><b>min</b></th>
                                <th><b>max</b></th>
                                <th><b>type</b></th>
                            </tr>
                            
                                <tr>
                                    <td>Measurement Period</td>
                                    <td>In</td>
                                    <td>0</td>
                                    <td>1</td>
                                    <td>Period</td>
                                </tr>
                            
                                <tr>
                                    <td>SDE Sex</td>
                                    <td>Out</td>
                                    <td>0</td>
                                    <td>1</td>
                                    <td>Coding</td>
                                </tr>
                            
                                <tr>
                                    <td>Numerator</td>
                                    <td>Out</td>
                                    <td>0</td>
                                    <td>*</td>
                                    <td>Resource</td>
                                </tr>
                            
                                <tr>
                                    <td>Denominator</td>
                                    <td>Out</td>
                                    <td>0</td>
                                    <td>*</td>
                                    <td>Resource</td>
                                </tr>
                            
                                <tr>
                                    <td>SDE Payer</td>
                                    <td>Out</td>
                                    <td>0</td>
                                    <td>*</td>
                                    <td>Resource</td>
                                </tr>
                            
                                <tr>
                                    <td>Initial Population</td>
                                    <td>Out</td>
                                    <td>0</td>
                                    <td>*</td>
                                    <td>Resource</td>
                                </tr>
                            
                                <tr>
                                    <td>SDE Ethnicity</td>
                                    <td>Out</td>
                                    <td>0</td>
                                    <td>1</td>
                                    <td>Resource</td>
                                </tr>
                            
                                <tr>
                                    <td>SDE Race</td>
                                    <td>Out</td>
                                    <td>0</td>
                                    <td>1</td>
                                    <td>Resource</td>
                                </tr>
                            
                        </table>
                    </td>
                </tr>

                <tr>
                    <th scope="row"><b>DataRequirements:</b></th>
                    <td style="padding-left: 4px;">
                        <table class="grid-dict">
                            <tr>
                                <th><b>Type</b></th>
                                <th><b>Elements</b></th>
                                <th><b>Valueset Name</b></th>
                                <th><b>Valueset</b></th>
                            </tr>
                            
                                <tr>
                                    <td>Patient(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-patient.html">QICorePatient</a>)</td>
                                    <td>
                                        
                                            ethnicity
                                        
                                            race
                                        
                                    </td>
                                    <td>
                                        
                                    </td>
                                    <td/>
                                </tr>
                            
                                <tr>
                                    <td>Condition(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-condition.html">QICoreCondition</a>)</td>
                                    <td>
                                        
                                            id
                                        
                                            id.value
                                        
                                            code
                                        
                                    </td>
                                    <td>
                                        
                                    </td>
                                    <td/>
                                </tr>
                            
                                <tr>
                                    <td>Encounter(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-encounter.html">QICoreEncounter</a>)</td>
                                    <td>
                                        
                                            type
                                        
                                            condition
                                        
                                            condition.reference
                                        
                                            condition.reference.value
                                        
                                            status
                                        
                                            status.value
                                        
                                            class
                                        
                                            reasonCode
                                        
                                            period
                                        
                                    </td>
                                    <td>
                                        
                                            
                                                 Psych Visit Diagnostic Evaluation
                                            
                                        
                                    </td>
                                    <td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1492/expansion">Psych Visit - Diagnostic Evaluation</a></td>
                                </tr>
                            
                                <tr>
                                    <td>Encounter(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-encounter.html">QICoreEncounter</a>)</td>
                                    <td>
                                        
                                            type
                                        
                                            condition
                                        
                                            condition.reference
                                        
                                            condition.reference.value
                                        
                                            status
                                        
                                            status.value
                                        
                                            class
                                        
                                            reasonCode
                                        
                                            period
                                        
                                    </td>
                                    <td>
                                        
                                            
                                                 Emergency Department Visit
                                            
                                        
                                    </td>
                                    <td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.464.1003.101.12.1010/expansion">Emergency Department Visit</a></td>
                                </tr>
                            
                                <tr>
                                    <td>Encounter(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-encounter.html">QICoreEncounter</a>)</td>
                                    <td>
                                        
                                            type
                                        
                                            condition
                                        
                                            condition.reference
                                        
                                            condition.reference.value
                                        
                                            status
                                        
                                            status.value
                                        
                                            class
                                        
                                            reasonCode
                                        
                                            period
                                        
                                    </td>
                                    <td>
                                        
                                            
                                                 Office Visit
                                            
                                        
                                    </td>
                                    <td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.464.1003.101.12.1001/expansion">Office Visit</a></td>
                                </tr>
                            
                                <tr>
                                    <td>Encounter(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-encounter.html">QICoreEncounter</a>)</td>
                                    <td>
                                        
                                            type
                                        
                                            condition
                                        
                                            condition.reference
                                        
                                            condition.reference.value
                                        
                                            status
                                        
                                            status.value
                                        
                                            class
                                        
                                            reasonCode
                                        
                                            period
                                        
                                    </td>
                                    <td>
                                        
                                            
                                                 Outpatient Consultation
                                            
                                        
                                    </td>
                                    <td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.464.1003.101.12.1008/expansion">Outpatient Consultation</a></td>
                                </tr>
                            
                                <tr>
                                    <td>Encounter(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-encounter.html">QICoreEncounter</a>)</td>
                                    <td>
                                        
                                            type
                                        
                                            condition
                                        
                                            condition.reference
                                        
                                            condition.reference.value
                                        
                                            status
                                        
                                            status.value
                                        
                                            class
                                        
                                            reasonCode
                                        
                                            period
                                        
                                    </td>
                                    <td>
                                        
                                            
                                                 Psych Visit Psychotherapy
                                            
                                        
                                    </td>
                                    <td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1496/expansion">Psych Visit - Psychotherapy</a></td>
                                </tr>
                            
                                <tr>
                                    <td>Encounter(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-encounter.html">QICoreEncounter</a>)</td>
                                    <td>
                                        
                                            type
                                        
                                            condition
                                        
                                            condition.reference
                                        
                                            condition.reference.value
                                        
                                            status
                                        
                                            status.value
                                        
                                            class
                                        
                                            reasonCode
                                        
                                            period
                                        
                                    </td>
                                    <td>
                                        
                                            
                                                 Psychoanalysis
                                            
                                        
                                    </td>
                                    <td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1141/expansion">Psychoanalysis</a></td>
                                </tr>
                            
                                <tr>
                                    <td>Encounter(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-encounter.html">QICoreEncounter</a>)</td>
                                    <td>
                                        
                                            type
                                        
                                            condition
                                        
                                            condition.reference
                                        
                                            condition.reference.value
                                        
                                            status
                                        
                                            status.value
                                        
                                            class
                                        
                                            reasonCode
                                        
                                            period
                                        
                                    </td>
                                    <td>
                                        
                                            
                                                 Telehealth Services
                                            
                                        
                                    </td>
                                    <td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.464.1003.101.12.1031/expansion">Telehealth Services</a></td>
                                </tr>
                            
                                <tr>
                                    <td>Procedure(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-procedure.html">QICoreProcedure</a>)</td>
                                    <td>
                                        
                                            code
                                        
                                            status
                                        
                                            status.value
                                        
                                            performed
                                        
                                    </td>
                                    <td>
                                        
                                    </td>
                                    <td/>
                                </tr>
                            
                                <tr>
                                    <td>Coverage(<a href="http://hl7.org/fhir/us/qicore/STU4.1.1/StructureDefinition-qicore-coverage.html">QICoreCoverage</a>)</td>
                                    <td>
                                        
                                            type
                                        
                                            period
                                        
                                    </td>
                                    <td>
                                        
                                            
                                                 Payer Type
                                            
                                        
                                    </td>
                                    <td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion">Payer</a></td>
                                </tr>
                            
                        </table>
                    </td>
                </tr>

                
                    <tr>
                        <th scope="row"><b>Direct Reference Codes:</b></th>
                        <td style="padding-left: 4px;">
                            <table class="grid-dict">
                                <tr>
                                    <th><b>display</b></th>
                                    <th><b>code</b></th>
                                    <th><b>system</b></th>
                                </tr>
                                
                                    <tr>
                                        <td>Male</td>
                                        <td>M</td>
                                        <td><a href="http://hl7.org/fhir/v3/AdministrativeGender">http://hl7.org/fhir/v3/AdministrativeGender</a></td>
                                    </tr>
                                
                                    <tr>
                                        <td>Female</td>
                                        <td>F</td>
                                        <td><a href="http://hl7.org/fhir/v3/AdministrativeGender">http://hl7.org/fhir/v3/AdministrativeGender</a></td>
                                    </tr>
                                
                                    <tr>
                                        <td>Ambulatory</td>
                                        <td>AMB</td>
                                        <td><a href="http://terminology.hl7.org/7.1.0/CodeSystem-v3-ActCode.html">http://terminology.hl7.org/CodeSystem/v3-ActCode</a></td>
                                    </tr>
                                
                                    <tr>
                                        <td>Suicide risk assessment (procedure)</td>
                                        <td>225337009</td>
                                        <td><a href="https://browser.ihtsdotools.org/">http://snomed.info/sct</a></td>
                                    </tr>
                                
                            </table>
                        </td>
                    </tr>
                

                
                <tr>
                    <th scope="row"><b>Logic Definitions:</b></th>
                    <td style="padding-left: 4px;">
                        
                        <table class="grid-dict">
                            <tr>
                                <th><b>Group</b></th>
                                <th><b>Scoring</b></th>
                                <th><b>Population Criteria</b></th>
                                <th><b>Expression</b></th>
                            </tr>
                            <tr>
                                
                                <td> 6419eb169ef3a941fbe47b3b </td>
                                <td>
                                    
                                        <b>Group scoring:</b>
                                        
                                            <span>  proportion </span>
                                        
                                    

                                    

                                    

                                    

                                    

                                    

                                    

                                    

                                </td>
                                
                                <tr>
                                    <td/>
                                    <td/>
                                    <td>Initial Population</td>
                                    <td>
                                        
                                            <pre><code class="language-cql">define &quot;Initial Population&quot;:
  &quot;New or Recurrent Major Depressive Disorder Encounter&quot; NewOrRecurrentMDDEncounter
    where &quot;AgeInYearsAt&quot;(date from start of &quot;Measurement Period&quot;) &gt;= 17</code></pre>
                                        
                                    </td>
                                </tr>
                                
                                <tr>
                                    <td/>
                                    <td/>
                                    <td>Denominator</td>
                                    <td>
                                        
                                            <pre><code class="language-cql">define &quot;Denominator&quot;:
  &quot;Initial Population&quot;</code></pre>
                                        
                                    </td>
                                </tr>
                                
                                <tr>
                                    <td/>
                                    <td/>
                                    <td>Denominator Exclusion</td>
                                    <td>
                                        
                                            None
                                        
                                    </td>
                                </tr>
                                
                                <tr>
                                    <td/>
                                    <td/>
                                    <td>Numerator</td>
                                    <td>
                                        
                                            <pre><code class="language-cql">define &quot;Numerator&quot;:
  &quot;New or Recurrent Major Depressive Disorder Encounter&quot; NewOrRecurrentMDDEncounter
    with [&quot;Procedure&quot;: &quot;Suicide risk assessment (procedure)&quot;] SuicideRiskAssessment
      such that SuicideRiskAssessment.status = 'completed'
        and QICoreCommon.&quot;ToInterval&quot; ( SuicideRiskAssessment.performed ) during NewOrRecurrentMDDEncounter.period</code></pre>
                                        
                                    </td>
                                </tr>
                                
                                <tr>
                                    <td/>
                                    <td/>
                                    <td>Numerator Exclusion</td>
                                    <td>
                                        
                                            None
                                        
                                    </td>
                                </tr>
                                
                                <tr>
                                    <td/>
                                    <td/>
                                    <td>Denominator Exception</td>
                                    <td>
                                        
                                            None
                                        
                                    </td>
                                </tr>
                                
                                
                            
                            </tr>
                        </table>
                

                <table class="grid-dict">
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>SupplementalDataElements</td>
                            
                            
                                <td>SDE Sex</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;SDE Sex&quot;:
  case
      when Patient.gender = 'male' then &quot;M&quot;
      when Patient.gender = 'female' then &quot;F&quot;
      else null
    end</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR</td>
                            
                            
                                <td>SDE Sex</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;SDE Sex&quot;:
  SDE.&quot;SDE Sex&quot;</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR</td>
                            
                            
                                <td>Major Depressive Disorder Encounter</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;Major Depressive Disorder Encounter&quot;:
  ( [&quot;Encounter&quot;: &quot;Psych Visit Diagnostic Evaluation&quot;]
    union [&quot;Encounter&quot;: &quot;Emergency Department Visit&quot;]
    union [&quot;Encounter&quot;: &quot;Office Visit&quot;]
    union [&quot;Encounter&quot;: &quot;Outpatient Consultation&quot;]
    union [&quot;Encounter&quot;: &quot;Psych Visit Psychotherapy&quot;]
    union [&quot;Encounter&quot;: &quot;Psychoanalysis&quot;]
    union [&quot;Encounter&quot;: &quot;Telehealth Services&quot;] ) ValidEncounter
    where ValidEncounter.status = 'finished'
      and ValidEncounter.class ~ &quot;AMB&quot;
      and ( ValidEncounter.reasonCode in &quot;Major Depressive Disorder Active&quot;
          or exists ( ( CQMCommon.&quot;EncounterDiagnosis&quot; ( ValidEncounter ) ) EncounterDiagnosis
              where EncounterDiagnosis.code in &quot;Major Depressive Disorder Active&quot;
          )
      )</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR</td>
                            
                            
                                <td>New or Recurrent Major Depressive Disorder Encounter</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;New or Recurrent Major Depressive Disorder Encounter&quot;:
  &quot;Major Depressive Disorder Encounter&quot; NewOrRecurrentMDDEncounter
    without &quot;Major Depressive Disorder Encounter&quot; PriorMDDEpisodeEncounter
      such that ( PriorMDDEpisodeEncounter !~ NewOrRecurrentMDDEncounter
          and PriorMDDEpisodeEncounter.period ends 104 days or less before day of start of NewOrRecurrentMDDEncounter.period
      )
    where NewOrRecurrentMDDEncounter.period during &quot;Measurement Period&quot;</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR</td>
                            
                            
                                <td>Numerator</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;Numerator&quot;:
  &quot;New or Recurrent Major Depressive Disorder Encounter&quot; NewOrRecurrentMDDEncounter
    with [&quot;Procedure&quot;: &quot;Suicide risk assessment (procedure)&quot;] SuicideRiskAssessment
      such that SuicideRiskAssessment.status = 'completed'
        and QICoreCommon.&quot;ToInterval&quot; ( SuicideRiskAssessment.performed ) during NewOrRecurrentMDDEncounter.period</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR</td>
                            
                            
                                <td>Initial Population</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;Initial Population&quot;:
  &quot;New or Recurrent Major Depressive Disorder Encounter&quot; NewOrRecurrentMDDEncounter
    where &quot;AgeInYearsAt&quot;(date from start of &quot;Measurement Period&quot;) &gt;= 17</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR</td>
                            
                            
                                <td>Denominator</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;Denominator&quot;:
  &quot;Initial Population&quot;</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>SupplementalDataElements</td>
                            
                            
                                <td>SDE Payer</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;SDE Payer&quot;:
  [Coverage: type in &quot;Payer Type&quot;] Payer
    return {
      code: Payer.type,
      period: Payer.period
    }</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR</td>
                            
                            
                                <td>SDE Payer</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;SDE Payer&quot;:
  SDE.&quot;SDE Payer&quot;</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>SupplementalDataElements</td>
                            
                            
                                <td>SDE Ethnicity</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;SDE Ethnicity&quot;:
  Patient.ethnicity E
    return Tuple {
      codes: { E.ombCategory } union E.detailed,
      display: E.text
    }</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR</td>
                            
                            
                                <td>SDE Ethnicity</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;SDE Ethnicity&quot;:
  SDE.&quot;SDE Ethnicity&quot;</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>SupplementalDataElements</td>
                            
                            
                                <td>SDE Race</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;SDE Race&quot;:
  Patient.race R
    return Tuple {
      codes: R.ombCategory union R.detailed,
      display: R.text
    }</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR</td>
                            
                            
                                <td>SDE Race</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define &quot;SDE Race&quot;:
  SDE.&quot;SDE Race&quot;</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>FHIRHelpers</td>
                            
                            
                                <td>ToConcept</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">/*
@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.
*/
define function ToConcept(concept FHIR.CodeableConcept):
    if concept is null then
        null
    else
        System.Concept {
            codes: concept.coding C return ToCode(C),
            display: concept.text.value
        }</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>CQMCommon</td>
                            
                            
                                <td>EncounterDiagnosis</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">/*
@description: Returns the Condition resource referenced by the `diagnosis.condition` element of the Encounter
@deprecated: This function is deprecated. Use the fluent function `encounterDiagnosis()` instead.
*/
define function &quot;EncounterDiagnosis&quot;(Encounter Encounter ):
  Encounter.diagnosis D
	return singleton from ([Condition] C where C.id = D.condition.reference.getId())</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>QICoreCommon</td>
                            
                            
                                <td>getId</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">/*
@description: Returns the tail of the given uri (i.e. everything after the last slash in the URI).
@comment: This function can be used to determine the logical id of a given resource. It can be used in
a single-server environment to trace references. However, this function does not attempt to resolve
or distinguish the base of the given url, and so cannot be used safely in multi-server environments.
*/
define fluent function getId(uri String):
  Last(Split(uri, '/'))</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>FHIRHelpers</td>
                            
                            
                                <td>ToString</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">define function ToString(value uri): value.value</code></pre>
                                </td>
                            
                        </tr>
                    
                        <tr>
                            <th><b>Library Name</b></th>
                            <th><b>Name</b></th>
                        </tr>
                        <tr>
                            
                                <td>FHIRHelpers</td>
                            
                            
                                <td>ToCode</td>
                            
                        </tr>
                        <tr>
                            
                                <td/>
                                <td>
                                    <pre class="highlight language-cql"><code class="language-cql">/*
@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.
*/
define function ToCode(coding FHIR.Coding):
    if coding is null then
        null
    else
        System.Code {
          code: coding.code.value,
          system: coding.system.value,
          version: coding.version.value,
          display: coding.display.value
        }</code></pre>
                                </td>
                            
                        </tr>
                    
                    </table>
                </td>
            </tr>
            
        
    

    </table>
</div>
  </text>
  <contained>
    <Library>
      <id value="effective-data-requirements"/>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-directReferenceCode">
        <valueCoding>
          <system value="http://hl7.org/fhir/v3/AdministrativeGender"/>
          <code value="M"/>
          <display value="Male"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-directReferenceCode">
        <valueCoding>
          <system value="http://hl7.org/fhir/v3/AdministrativeGender"/>
          <code value="F"/>
          <display value="Female"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-directReferenceCode">
        <valueCoding>
          <system value="http://terminology.hl7.org/CodeSystem/v3-ActCode"/>
          <code value="AMB"/>
          <display value="Ambulatory"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-directReferenceCode">
        <valueCoding>
          <system value="http://snomed.info/sct"/>
          <code value="225337009"/>
          <display value="Suicide risk assessment (procedure)"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="SupplementalDataElements"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Sex"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Sex&quot;:
  case
      when Patient.gender = 'male' then &quot;M&quot;
      when Patient.gender = 'female' then &quot;F&quot;
      else null
    end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="0"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Sex"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Sex&quot;:
  SDE.&quot;SDE Sex&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="1"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="Major Depressive Disorder Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Major Depressive Disorder Encounter&quot;:
  ( [&quot;Encounter&quot;: &quot;Psych Visit Diagnostic Evaluation&quot;]
    union [&quot;Encounter&quot;: &quot;Emergency Department Visit&quot;]
    union [&quot;Encounter&quot;: &quot;Office Visit&quot;]
    union [&quot;Encounter&quot;: &quot;Outpatient Consultation&quot;]
    union [&quot;Encounter&quot;: &quot;Psych Visit Psychotherapy&quot;]
    union [&quot;Encounter&quot;: &quot;Psychoanalysis&quot;]
    union [&quot;Encounter&quot;: &quot;Telehealth Services&quot;] ) ValidEncounter
    where ValidEncounter.status = 'finished'
      and ValidEncounter.class ~ &quot;AMB&quot;
      and ( ValidEncounter.reasonCode in &quot;Major Depressive Disorder Active&quot;
          or exists ( ( CQMCommon.&quot;EncounterDiagnosis&quot; ( ValidEncounter ) ) EncounterDiagnosis
              where EncounterDiagnosis.code in &quot;Major Depressive Disorder Active&quot;
          )
      )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="2"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR"/>
        </extension>
        <extension url="name">
          <valueString
                       value="New or Recurrent Major Depressive Disorder Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;New or Recurrent Major Depressive Disorder Encounter&quot;:
  &quot;Major Depressive Disorder Encounter&quot; NewOrRecurrentMDDEncounter
    without &quot;Major Depressive Disorder Encounter&quot; PriorMDDEpisodeEncounter
      such that ( PriorMDDEpisodeEncounter !~ NewOrRecurrentMDDEncounter
          and PriorMDDEpisodeEncounter.period ends 104 days or less before day of start of NewOrRecurrentMDDEncounter.period
      )
    where NewOrRecurrentMDDEncounter.period during &quot;Measurement Period&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="3"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="Numerator"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Numerator&quot;:
  &quot;New or Recurrent Major Depressive Disorder Encounter&quot; NewOrRecurrentMDDEncounter
    with [&quot;Procedure&quot;: &quot;Suicide risk assessment (procedure)&quot;] SuicideRiskAssessment
      such that SuicideRiskAssessment.status = 'completed'
        and QICoreCommon.&quot;ToInterval&quot; ( SuicideRiskAssessment.performed ) during NewOrRecurrentMDDEncounter.period"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="4"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="Initial Population"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Initial Population&quot;:
  &quot;New or Recurrent Major Depressive Disorder Encounter&quot; NewOrRecurrentMDDEncounter
    where &quot;AgeInYearsAt&quot;(date from start of &quot;Measurement Period&quot;) &gt;= 17"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="5"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="Denominator"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Denominator&quot;:
  &quot;Initial Population&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="6"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="SupplementalDataElements"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Payer"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Payer&quot;:
  [Coverage: type in &quot;Payer Type&quot;] Payer
    return {
      code: Payer.type,
      period: Payer.period
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="7"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Payer"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Payer&quot;:
  SDE.&quot;SDE Payer&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="8"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="SupplementalDataElements"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Ethnicity"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Ethnicity&quot;:
  Patient.ethnicity E
    return Tuple {
      codes: { E.ombCategory } union E.detailed,
      display: E.text
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="9"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Ethnicity"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Ethnicity&quot;:
  SDE.&quot;SDE Ethnicity&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="10"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="SupplementalDataElements"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Race"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Race&quot;:
  Patient.race R
    return Tuple {
      codes: R.ombCategory union R.detailed,
      display: R.text
    }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="11"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString
                       value="AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Race"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Race&quot;:
  SDE.&quot;SDE Race&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="12"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToConcept"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.
*/
define function ToConcept(concept FHIR.CodeableConcept):
    if concept is null then
        null
    else
        System.Concept {
            codes: concept.coding C return ToCode(C),
            display: concept.text.value
        }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="13"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="CQMCommon"/>
        </extension>
        <extension url="name">
          <valueString value="EncounterDiagnosis"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns the Condition resource referenced by the `diagnosis.condition` element of the Encounter
@deprecated: This function is deprecated. Use the fluent function `encounterDiagnosis()` instead.
*/
define function &quot;EncounterDiagnosis&quot;(Encounter Encounter ):
  Encounter.diagnosis D
	return singleton from ([Condition] C where C.id = D.condition.reference.getId())"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="14"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="QICoreCommon"/>
        </extension>
        <extension url="name">
          <valueString value="getId"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns the tail of the given uri (i.e. everything after the last slash in the URI).
@comment: This function can be used to determine the logical id of a given resource. It can be used in
a single-server environment to trace references. However, this function does not attempt to resolve
or distinguish the base of the given url, and so cannot be used safely in multi-server environments.
*/
define fluent function getId(uri String):
  Last(Split(uri, '/'))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="15"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToString(value uri): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="16"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToCode"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.
*/
define function ToCode(coding FHIR.Coding):
    if coding is null then
        null
    else
        System.Code {
          code: coding.code.value,
          system: coding.system.value,
          version: coding.version.value,
          display: coding.display.value
        }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="17"/>
        </extension>
      </extension>
      <status value="active"/>
      <type>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/library-type"/>
          <code value="module-definition"/>
        </coding>
      </type>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library SDE"/>
        <resource
                  value="http://ecqi.healthit.gov/ecqms/Library/SupplementalDataElements|3.4.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library FHIRHelpers"/>
        <resource
                  value="http://ecqi.healthit.gov/ecqms/Library/FHIRHelpers|4.3.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library CQMCommon"/>
        <resource
                  value="http://ecqi.healthit.gov/ecqms/Library/CQMCommon|1.4.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library QICoreCommon"/>
        <resource
                  value="http://ecqi.healthit.gov/ecqms/Library/QICoreCommon|1.5.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system AdministrativeGender"/>
        <resource value="http://hl7.org/fhir/v3/AdministrativeGender"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system ActCode"/>
        <resource value="http://terminology.hl7.org/CodeSystem/v3-ActCode"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system SNOMEDCT"/>
        <resource value="http://snomed.info/sct"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Psych Visit Diagnostic Evaluation"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1492"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Emergency Department Visit"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1010"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Office Visit"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Outpatient Consultation"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1008"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Psych Visit Psychotherapy"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1496"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Psychoanalysis"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1141"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Telehealth Services"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1031"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Major Depressive Disorder Active"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1491"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Payer Type"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"/>
      </relatedArtifact>
      <parameter>
        <name value="Measurement Period"/>
        <use value="in"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Period"/>
      </parameter>
      <parameter>
        <name value="SDE Sex"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Coding"/>
      </parameter>
      <parameter>
        <name value="Numerator"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Denominator"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Payer"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="Initial Population"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Ethnicity"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Race"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Resource"/>
      </parameter>
      <dataRequirement>
        <type value="Patient"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient"/>
        <mustSupport value="ethnicity"/>
        <mustSupport value="race"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition"/>
        <mustSupport value="id"/>
        <mustSupport value="id.value"/>
        <mustSupport value="code"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="condition"/>
        <mustSupport value="condition.reference"/>
        <mustSupport value="condition.reference.value"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="class"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1492"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="condition"/>
        <mustSupport value="condition.reference"/>
        <mustSupport value="condition.reference.value"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="class"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1010"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="condition"/>
        <mustSupport value="condition.reference"/>
        <mustSupport value="condition.reference.value"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="class"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="condition"/>
        <mustSupport value="condition.reference"/>
        <mustSupport value="condition.reference.value"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="class"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1008"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="condition"/>
        <mustSupport value="condition.reference"/>
        <mustSupport value="condition.reference.value"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="class"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1496"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="condition"/>
        <mustSupport value="condition.reference"/>
        <mustSupport value="condition.reference.value"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="class"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1141"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="condition"/>
        <mustSupport value="condition.reference"/>
        <mustSupport value="condition.reference.value"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="class"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1031"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Procedure"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <mustSupport value="performed"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://snomed.info/sct"/>
            <code value="225337009"/>
            <display value="Suicide risk assessment (procedure)"/>
          </code>
        </codeFilter>
        <codeFilter>
          <path value="status.value"/>
          <code>
            <code value="completed"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Coverage"/>
        <profile
                 value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage"/>
        <mustSupport value="type"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"/>
        </codeFilter>
      </dataRequirement>
    </Library>
  </contained>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-supplementalDataGuidance" id="supplementalDataGuidance">
    <extension url="guidance">
      <valueString value="test1 test 2
 test 3 test4"/>
    </extension>
    <extension url="usage">
      <valueCodeableConcept>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
          <code value="supplemental-data"/>
          <display value="Supplemental Data"/>
        </coding>
        <text value="Supplemental Data Guidance"/>
      </valueCodeableConcept>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-softwaresystem">
    <valueReference>
      <reference value="Device/cqf-tooling"/>
    </valueReference>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-effectiveDataRequirements" id="effective-data-requirements">
    <valueReference>
      <reference value="#effective-data-requirements"/>
    </valueReference>
  </extension>
  <url
       value="http://ecqi.healthit.gov/ecqms/Measure/AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR"/>
  <identifier>
    <use value="usual"/>
    <type>
      <coding>
        <system
                value="http://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type"/>
        <code value="short-name"/>
      </coding>
    </type>
    <system value="https://madie.cms.gov/measure/shortName"/>
    <value value="CMS161FHIR"/>
  </identifier>
  <identifier>
    <use value="official"/>
    <type>
      <coding>
        <system
                value="http://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type"/>
        <code value="version-independent"/>
      </coding>
    </type>
    <system value="urn:ietf:rfc:3986"/>
    <value value="urn:uuid:9e056df9-6c0c-4847-a88e-bc9932dd69bd"/>
  </identifier>
  <identifier>
    <use value="official"/>
    <type>
      <coding>
        <system
                value="http://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type"/>
        <code value="version-specific"/>
      </coding>
    </type>
    <system value="urn:ietf:rfc:3986"/>
    <value value="urn:uuid:2c928085806c39a20180859994bf050e"/>
  </identifier>
  <identifier>
    <use value="official"/>
    <type>
      <coding>
        <system
                value="http://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type"/>
        <code value="endorser"/>
      </coding>
    </type>
    <system value="https://madie.cms.gov/measure/nqfId"/>
    <value value="0104e"/>
    <assigner>
      <display value="NQF"/>
    </assigner>
  </identifier>
  <identifier>
    <use value="official"/>
    <type>
      <coding>
        <system
                value="http://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type"/>
        <code value="publisher"/>
      </coding>
    </type>
    <system value="https://madie.cms.gov/measure/cmsId"/>
    <value value="161FHIR"/>
    <assigner>
      <display value="CMS"/>
    </assigner>
  </identifier>
  <version value="0.0.004"/>
  <name value="AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR"/>
  <title
         value="Adult Major Depressive Disorder (MDD): Suicide Risk AssessmentFHIR"/>
  <status value="draft"/>
  <experimental value="false"/>
  <date value="2023-10-27T08:12:31+00:00"/>
  <publisher value="Mathematica"/>
  <contact>
    <telecom>
      <system value="url"/>
      <value value="https://www.mathematica.org/"/>
    </telecom>
  </contact>
  <description
               value="Percentage of all patient visits for those patients that are 17 years of age or older at the start of the measurement period in which a new or recurrent diagnosis of major depressive disorder (MDD) was identified and a suicide risk assessment was completed during the visit"/>
  <useContext>
    <code>
      <system
              value="http://terminology.hl7.org/CodeSystem/usage-context-type"/>
      <code value="program"/>
    </code>
    <valueCodeableConcept>
      <coding>
        <system
                value="http://hl7.org/fhir/us/cqfmeasures/CodeSystem/quality-programs"/>
        <code value="ep-ec"/>
        <display value="EP/EC"/>
      </coding>
    </valueCodeableConcept>
  </useContext>
  <purpose value="UNKNOWN"/>
  <usage
         value="This eCQM is an episode-based measure and should be reported for each instance of a new or recurrent episode of major depressive disorder (MDD) during the measurement period. This measure should be reported for each eligible encounter during which a new or recurrent episode of MDD is identified in adults that turn 18 or older during the measurement period.

As the guidelines state, it is important to assess for additional factors which may increase or decrease suicide risk, such as presence of additional symptoms (e.g., psychosis, severe anxiety, hopelessness, severe chronic pain); presence of substance abuse; history and seriousness of previous attempts, particularly, recent suicidal behavior; current stressors and potential protective factors (e.g., positive reasons for living, strong social support); family history of suicide or mental illness or recent exposure to suicide; impulsivity and potential for risk to others, including history of violence or violent or homicidal ideas, plans, or intentions; and putting one's affairs in order (e.g., giving away possessions, writing a will). In addition, although the measure focuses on the initial visit, it is critical that suicide risk be monitored especially for the 90 days following the initial visit and throughout MDD treatment.

It is expected that a suicide risk assessment will be completed at the visit during which a new diagnosis is made or at the visit during which a recurrent episode is first identified (i.e., at the initial evaluation). For the purposes of this measure, an episode of MDD would be considered to be recurrent if a patient has not had an MDD-related encounter in the past 105 days. If there is a gap of 105 or more days between visits for MDD, that would imply a recurrent episode. The 105-day look-back period is an operational provision and not a clinical recommendation, or definition of relapse, remission, or recurrence.

In recognition of the growing use of integrated and team-based care, the diagnosis of depression and the assessment for suicide risk need not be performed by the same provider or clinician.

Suicide risk assessments completed via telehealth services can also meet numerator performance.

Use of a standardized tool(s) or instrument(s) to assess suicide risk will meet numerator performance. Standardized tools can be mapped to the concept &quot;Intervention, Performed&quot;: &quot;Suicide risk assessment (procedure)&quot; included in the numerator logic below, as no individual suicide risk assessment tool or instrument would satisfy the requirements alone.

To ensure all patients with MDD are assessed for suicide risk, there are two clinical quality measures addressing suicide risk assessment; CMS177-Child and Adolescent Major Depressive Disorder (MDD): Suicide Risk Assessment covers children and adolescents aged 6 through 16 at the start of the measurement period, and CMS161 covers the adult population aged 17 years and older at the start of the measurement period.

This FHIR-based measure has been derived from the QDM-based measure: CMS161v12.

Please refer to the HL7 QI-Core Implementation Guide (http://hl7.org/fhir/us/qicore/index.html) for more information on QI-Core and mapping recommendations from QDM to QI-Core 4.1.1 (http://hl7.org/fhir/us/qicore/qdm-to-qicore.html)."/>
  <copyright
             value="Copyright 2023 Mathematica Inc. All Rights Reserved.
The PCPI and American Medical Association's (AMA) significant past efforts and contributions to the development and updating of the Measure is acknowledged."/>
  <approvalDate value="2023-08-14"/>
  <lastReviewDate value="2023-08-14"/>
  <effectivePeriod>
    <start value="2024-01-01"/>
    <end value="2024-12-31"/>
  </effectivePeriod>
  <author>
    <name value="Mathematica"/>
    <telecom>
      <system value="url"/>
      <value value="https://www.mathematica.org/"/>
    </telecom>
  </author>
  <author>
    <name value="American Medical Association (AMA)"/>
    <telecom>
      <system value="url"/>
      <value value="https://www.ama-assn.org/"/>
    </telecom>
  </author>
  <library
           value="http://ecqi.healthit.gov/ecqms/Library/AdultMajorDepressiveDisorderMDDSuicideRiskAssessmentFHIR"/>
  <disclaimer
              value="The Measure is not a clinical guideline, does not establish a standard of medical care, and has not been tested for all potential applications. 

The Measure, while copyrighted, can be reproduced and distributed, without modification, for noncommercial purposes, e.g., use by health care providers in connection with their practices. Commercial use is defined as the sale, license, or distribution of the Measure for commercial gain, or incorporation of the Measure into a product or service that is sold, licensed or distributed for commercial gain. 

Commercial uses of the Measure require a license agreement between the user and Mathematica. Neither Mathematica, the PCPI, nor the American Medical Association (AMA), nor the former AMA-convened Physician Consortium for Performance Improvement(R) (AMA-PCPI), nor their members shall be responsible for any use of the Measure.

Mathematica encourages use of the Measure by other health care professionals, where appropriate.

THE MEASURE AND SPECIFICATIONS ARE PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND.

Limited proprietary coding may be contained in the Measure specifications for convenience. A license agreement must be entered prior to a third party's use of Current Procedural Terminology (CPT[R]) or other proprietary code set contained in the Measure. Any other use of CPT or other coding by a third party is strictly prohibited. Mathematica, the AMA, and former members of the PCPI disclaim all liability for use or accuracy of any CPT(R) or other coding contained in the specifications. 

CPT(R) contained in the Measure specifications is copyright 2004-2022 American Medical Association. LOINC(R) is copyright 2004-2022 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2022 International Health Terminology Standards Development Organisation. ICD-10 is copyright 2022 World Health Organization. All Rights Reserved.

Due to technical limitations, registered trademarks are indicated by (R) or [R]."/>
  <rationale
             value="This measure aims to improve rates of clinician assessment of suicide risk during an encounter where a new or recurrent episode of major depressive disorder (MDD) is identified. In an epidemiologic study of mental illness in the United States with a large, representative sample, 69% of respondents with lifetime suicide attempts had also met diagnostic criteria for MDD. When considering other mood disorders related to depression, such as dysthymia and bipolar disorders, this rate increases to 74% (Bolton &amp; Robinson, 2010). In a study of individuals who had died by suicide and were enrolled in one of eight major health systems in the United States, individuals with a depressive disorder diagnosis had 7.20 increased odds of dying by suicide within one year, after adjusting for age and sociodemographic factors (Yeh et al., 2019). A recent meta-analysis (Moitra et al., 2021) presented similar findings in which depressive disorder conferred a predictive relative risk for suicide of 7.64 after adjusting for relevant factors.

Suicide is associated with increased use of healthcare services, which provides an opportunity for intervention through assessment and intervention. Individuals who die by suicide are more likely to have any healthcare utilization (Ahmedani et al., 2019) and a higher frequency of healthcare visits than the general population (Chock, Bommersbach, Geske, &amp; Bostwick, 2015). A study of individuals who died by suicide and were enrolled within one of eight health systems in the Mental Health Research Network in the United States found that 50% of these individuals had been seen in a healthcare setting within four weeks prior to death (Ahmedani et al., 2014). Better assessment and identification of suicide risk in the healthcare setting should lead to improved connection to treatment and reduction in suicide attempts and deaths by suicide. A recent analysis of depression severity and suicidal ideation symptom trajectories (Witt et al., 2021) found that suicidal ideation among children and young adults (15-25 years) might not improve with depression symptom severity. This evidence suggests the potential utility of continued suicide risk screening after improvements in depression symptoms."/>
  <clinicalRecommendationStatement
                                   value="A careful and ongoing evaluation of suicide risk is necessary for all patients with major depressive disorder (American Psychiatric Association, 2010a).

Such an assessment includes specific inquiry about suicidal thoughts, intent, plans, means, and behaviors; identification of specific psychiatric symptoms (e.g., psychosis, severe anxiety, substance use, hopelessness, insomnia, agitation) or general medical conditions that may increase the likelihood of acting on suicidal ideas; assessment of past and, particularly, recent suicidal behavior; delineation of current stressors and potential protective factors (e.g., positive reasons for living, strong social support); and identification of any family history of suicide or mental illness (American Psychiatric Association, 2010a; Department of Veterans Affairs and Department of Defense, 2019).

As part of the assessment process, impulsivity and potential for risk to others should also be evaluated, including any history of violence or violent or homicidal ideas, plans, or intentions, or the availability of firearms (American Psychiatric Association, 2010a; Department of Veterans Affairs and Department of Defense, 2019).

The patient's risk of harm to him- or herself and to others should also be monitored as treatment proceeds (American Psychiatric Association, 2010a).

Guidelines for Selecting a Treatment Setting for Patients at Risk for Suicide or Suicidal Behaviors (from American Psychiatric Association’s Practice Guideline for Assessment and Treatment of Patients With Suicidal Behaviors, 2010b):

ADMISSION GENERALLY INDICATED
After a suicide attempt or aborted suicide attempt if:
- Patient is psychotic
- Attempt was violent, near-lethal, or premeditated
- Precautions were taken to avoid rescue or discovery
- Persistent plan and/or intent is present
- Distress is increased or patient regrets surviving
- Patient is male, older than age 45 years, especially with new onset of psychiatric illness or suicidal thinking
- Patient has limited family and/or social support, including lack of stable living situation
- Current impulsive behavior, severe agitation, poor judgment, or refusal of help is evident
- Patient has change in mental status with a metabolic, toxic, infectious, or other etiology requiring further workup in a structured setting

In the presence of suicidal ideation with:
- Specific plan with high lethality
- High suicidal intent

ADMISSION MAY BE NECESSARY
After a suicide attempt or aborted suicide attempt, except in circumstances for which admission is generally indicated

In the presence of suicidal ideation with:
- Psychosis
- Major psychiatric disorder
- Past attempts, particularly if medically serious
- Possibly contributing medical condition (e.g., acute neurological disorder, cancer, infection)
- Lack of response to or inability to cooperate with partial hospital or outpatient treatment
- Need for supervised setting for medication trial or electroconvulsive therapy (ECT)
- Need for skilled observation, clinical tests, or diagnostic assessments that require a structured setting
- Limited family and/or social support, including lack of stable living situation
- Lack of an ongoing clinician-patient relationship or lack of access to timely outpatient follow-up
- Evidence of putting one's affairs in order (e.g., giving away possessions, writing a will)

In the absence of suicide attempts or reported suicidal ideation/plan/intent but evidence from the psychiatric evaluation and/or history from others suggests a high level of suicide risk and a recent acute increase in risk

RELEASE FROM EMERGENCY DEPARTMENT WITH FOLLOW-UP RECOMMENDATIONS MAY BE POSSIBLE
After a suicide attempt or in the presence of suicidal ideation/plan when:
- Suicidality is a reaction to precipitating events (e.g., exam failure, relationship difficulties), particularly if the patient's view of situation has changed since coming to emergency department
- Plan/method and intent have low lethality
- Patient has stable and supportive living situation
- Patient is able to cooperate with recommendations for follow-up, with treater contacted, if possible, if patient is currently in treatment

OUTPATIENT TREATMENT MAY BE MORE BENEFICIAL THAN HOSPITALIZATION

Patient has chronic suicidal ideation and/or self-injury without prior medically serious attempts, if a safe and supportive living situation is available and outpatient psychiatric care is ongoing"/>
  <group id="6419eb169ef3a941fbe47b3b">
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-scoring">
      <valueCodeableConcept>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-scoring"/>
          <code value="proportion"/>
          <display value="Proportion"/>
        </coding>
      </valueCodeableConcept>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-populationBasis">
      <valueCode value="Encounter"/>
    </extension>
    <extension
               url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-type">
      <valueCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/measure-type"/>
          <code value="process"/>
          <display value="Process"/>
        </coding>
      </valueCodeableConcept>
    </extension>
    <description value="CMS161FHIR"/>
    <population id="0d3520c9-ba24-4caf-87fb-e8277a5848fc">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="initial-population"/>
          <display value="Initial Population"/>
        </coding>
      </code>
      <description
                   value="Patient visits for patients that are 17 years of age or older at the start of the measurement period during which a new diagnosis of MDD, single or recurrent episode, was identified"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Initial Population"/>
      </criteria>
    </population>
    <population id="dadb23d6-32b1-4508-8e66-155d1ea1d9cb">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="denominator"/>
          <display value="Denominator"/>
        </coding>
      </code>
      <description value="Equals Initial Population"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Denominator"/>
      </criteria>
    </population>
    <population id="b36eebb3-6f28-4ef0-af25-98d1bf1e7edc">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="denominator-exclusion"/>
          <display value="Denominator Exclusion"/>
        </coding>
      </code>
      <description value="None"/>
      <criteria>
        <language value="text/cql-identifier"/>
      </criteria>
    </population>
    <population id="5072c83f-c169-4f31-b5d0-857fd1d141a0">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="numerator"/>
          <display value="Numerator"/>
        </coding>
      </code>
      <description
                   value="Patient visits during which a new diagnosis of MDD, single or recurrent episode, was identified and a suicide risk assessment was completed during the visit"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Numerator"/>
      </criteria>
    </population>
    <population id="f0562aa4-2642-47e7-bd49-3fade03805b4">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="numerator-exclusion"/>
          <display value="Numerator Exclusion"/>
        </coding>
      </code>
      <description value="Not Applicable"/>
      <criteria>
        <language value="text/cql-identifier"/>
      </criteria>
    </population>
    <population id="7cef58d0-dea6-4d10-a2f2-d8e7ca8dadb9">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="denominator-exception"/>
          <display value="Denominator Exception"/>
        </coding>
      </code>
      <description value="None"/>
      <criteria>
        <language value="text/cql-identifier"/>
      </criteria>
    </population>
  </group>
  <supplementalData id="sde-ethnicity">
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="SDE Ethnicity"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Ethnicity"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-payer">
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="SDE Payer"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Payer"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-race">
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="SDE Race"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Race"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-sex">
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="SDE Sex"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Sex"/>
    </criteria>
  </supplementalData>
</Measure>