Chronic Disease Surveillance
0.1.0 - CI Build International flag

Chronic Disease Surveillance, published by Clinical Quality Framework. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/aphl-chronic-ig/ and changes regularly. See the Directory of published versions

: Preventive Care and Screening: Screening for Depression and Follow-Up Plan - XML Representation

Draft as of 2025-09-25

Raw xml | Download


<Measure xmlns="http://hl7.org/fhir">
  <id value="DepressionScreeningandFollowUp"/>
  <meta>
    <profile
             value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/computable-measure-cqfm"/>
  </meta>
  <text>
    <status value="extensions"/>
    <div xmlns="http://www.w3.org/1999/xhtml">
  <table class="narrative-table">
    <tbody>
<tr>


<th colspan="2" scope="row" class="row-header">Metadata</th>


</tr>

<tr>


<th scope="row" class="row-header">Title</th>



<td class="content-container">Preventive Care and Screening: Screening for Depression and Follow-Up Plan</td>


</tr>



<tr>


<th scope="row" class="row-header">Version</th>



<td class="content-container">0.1.0</td>


</tr>







  
<tr>


<th scope="row" class="row-header">Identifier</th>



<td class="content-container">CMS2v13</td>


</tr>


  
<tr>


<th scope="row" class="row-header">Identifier</th>



<td class="content-container">134</td>


</tr>


  
<tr>


<th scope="row" class="row-header">Identifier</th>



<td class="content-container">2c928083-8651-08a3-0186-c82995a91d28</td>


</tr>



  
    
    
<tr>


<th scope="row" class="row-header">Effective Period</th>



<td class="content-container">2024-01-01 through 2024-12-31</td>


</tr>

  





<tr>


<th scope="row" class="row-header">Status</th>



<td class="content-container">Draft</td>


</tr>






<tr>


<th scope="row" class="row-header">Jurisdiction</th>



<td class="content-container">
    001 from <a href="http://unstats.un.org/unsd/methods/m49/m49.htm">http://unstats.un.org/unsd/methods/m49/m49.htm</a> 


</td>


</tr>








<tr>


<th scope="row" class="row-header">Steward (Publisher)</th>



<td class="content-container">Clinical Quality Framework</td>


</tr>









<tr>


<th scope="row" class="row-header">Description</th>



<td class="content-container"><div><p>Percentage of patients aged 12 years and older screened for depression on the date of the encounter or up to 14 days prior to the date of the encounter using an age-appropriate standardized depression screening tool AND if positive, a follow-up plan is documented on the date of or up to two days after the date of the qualifying encounter</p>
</div></td>


</tr>



<tr>


<th scope="row" class="row-header">Purpose</th>



<td class="content-container"><div><p>Unknown</p>
</div></td>


</tr>



<tr>


<th scope="row" class="row-header">Copyright</th>



<td class="content-container"><div><p>Limited proprietary coding is contained in the measure specifications for convenience. Users of the proprietary code sets should obtain all necessary licenses from the owners of these code sets. 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>
</div></td>


</tr>


<tr>


<th scope="row" class="row-header">Disclaimer</th>



<td class="content-container"><div><p>These performance measures are not clinical guidelines and do not establish a standard of medical care, and have not been tested for all potential applications. THE MEASURES AND SPECIFICATIONS ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND. Due to technical limitations, registered trademarks are indicated by (R) or [R] and unregistered trademarks are indicated by (TM) or [TM].</p>
</div></td>


</tr>




<tr>


<th scope="row" class="row-header">Measure Scoring</th>



<td class="content-container">
    Proportion


</td>


</tr>




<tr>


<th scope="row" class="row-header">Improvement Notation</th>



<td class="content-container">
    Higher score indicates better quality


</td>


</tr>




<tr>


<th scope="row" class="row-header">Measure Type</th>



<td class="content-container">
    process


</td>


</tr>




<tr>


<th scope="row" class="row-header">Rationale</th>



<td class="content-container"><div><p>Depression affects more than two hundred sixty million people across the world and is a leading cause of disability, with a variety of depressive disorders that are independent risk factors for chronic diseases, such as cardiovascular disease and diabetes, lending screening for depression as paramount to identify depressive disorders that can affect the most vulnerable populations (Costantini et al., 2021). Results from a 2018 U.S. survey indicated that 14.4 percent of adolescents (3.5 million adolescents) had a major depressive episode (MDE) in the past year, with nine percent of adolescents (2.4 million adolescents) having one MDE with severe impairment (Substance Abuse and Mental Health Services Administration, 2019). The odds of a diagnosis of depression are believed to be 2.6 times greater for children and adolescents exposed to trauma as compared to those unexposed or less exposed (Vibhakar et al., 2019). Children and teens with major depressive disorder (MDD) have been found to have difficulty carrying out their daily activities, relating to others, growing up healthy, and are at an increased risk of suicide (Siu on behalf of the U.S. Preventive Services Task Force [USPSTF], 2016). The same 2018 study indicated that 7.2 percent of adults aged 18 or older (17.7 million adults) had at least one MDE with 4.7 percent of adults (11.5 million adults) having one MDE with severe impairment in the past year (Substance Abuse and Mental Health Services Administration, 2019). Moreover, it is estimated 22.9 percent of adult patients with chronic pain (2.2 million adults) were diagnosed with comorbid depression from 2011 to 2015, with an upward trend of prevalence among Black Americans, patients aged 65 to 84 years old, Medicare and Medicaid insured patients, and patients from zip code areas with low annual household incomes (Orhurhu et al., 2019). Depression and other mood disorders, such as bipolar disorder and anxiety disorders, especially during the perinatal period, can have devastating effects on women, infants, and families (American College of Obstetricians and Gynecologists, 2018). It's estimated that the global prevalence of antenatal (or perinatal) depression ranges from 15 to 65 percent, with current or previous exposure to abuse and violence, lack of social support, and family history of mental disorders being risk factors. Depressive symptoms measured during pregnancy have been shown to influence the quality of the postpartum mother-infant relationship (Hazell Raine et al., 2020). Additionally, the risk of low birth weight and preterm birth is higher among infants born from depressed mothers (Dadi, Miller, Bisetegn, &amp; Mwanri, 2020). Negative outcomes associated with depression make it crucial to screen in order to identify and treat depression in its early stages. Multiple social costs of depression have been identified, such as reduced educational achievements, poor financial success and role performance, higher amount of days out of role, and increased risk of job loss (Costantini et al., 2021). Depression also imposes significant economic burden through direct and indirect costs, supporting the need for regular depression screening. &quot;In the United States, an estimated $22.8 billion was spent on depression treatment in 2009, and lost productivity cost an additional estimated $23 billion in 2011&quot; (Siu &amp; USPSTF, 2016, p. 383-384). Numerous studies have found significant disparities in depression prevalence and treatment among racial/ethnic minorities. One study revealed that Indigenous adults are at a high risk for posttraumatic stress disorder, depression, suicide, substance use disorder, and concurrent behavioral health disorders secondary to these initial health problems (Ka’apu and Burnette, 2019). Additionally, though rates of depression are lower among Blacks and Hispanics than among whites, depression among Blacks and Hispanics is likely to be more recurrent. Furthermore, 48 percent of whites receive mental health services, compared to just 31 percent of Blacks and Hispanics, and 22 percent of Asians (American Psychiatric Association, 2017). Asian Americans and Black Americans are also significantly more likely to utilize emergency rooms for depression treatment, which contributes to inconsistent follow-up care (Lee et al., 2014). While primary care providers (PCPs) serve as the first line of defense in the detection of depression, studies show that PCPs fail to recognize up to 46 percent of depressed patients (Borner et al., 2010). &quot;In nationally representative U.S. surveys, about eight percent of adolescents reported having major depression in the past year. Only 36 percent to 44 percent of children and adolescents with depression receive treatment, suggesting that the majority of depressed youth are undiagnosed and untreated&quot; (Siu on behalf of USPSTF, 2016, p. 360 &amp; p. 364). Furthermore, evidence supports that screening for depression in pregnant and postpartum women is of moderate net benefit, and treatment options for positive depression screening should be available for patients twelve and older including pregnant and postpartum women. This measure seeks to align with USPSTF clinical guideline recommendations as well as the Healthy People 2030 recommendation to increase the proportion of adolescents and adults who are screened and receive treatment for depression (U.S. Preventive Services Task Force, 2016) and makes an important contribution to the quality domain of community and population health.</p>
</div></td>


</tr>


<tr>


<th scope="row" class="row-header">Clinical Recommendation Statement</th>



<td class="content-container"><div><p>Adolescent Recommendation (12-18 years): &quot;The USPSTF recommends screening for MDD in adolescents aged 12 to 18 years. Screening should be implemented with adequate systems in place to ensure accurate diagnosis, effective treatment, and appropriate follow-up (B recommendation)&quot; (Siu on behalf of USPSTF, 2016, p. 360). Adult Recommendation (18 years and older): &quot;The USPSTF recommends screening for depression in the general adult population, including pregnant and postpartum women. Screening should be implemented with adequate systems in place to ensure accurate diagnosis, effective treatment, and appropriate follow-up (B recommendation)&quot; (Siu &amp; USPSTF, 2016, p. 380). “The USPSTF recommends that clinicians provide or refer pregnant and postpartum persons who are at increased risk of perinatal depression to counseling interventions (B recommendation)” (U.S. Preventive Services Task Force, 2019). The American College of Obstetricians and Gynecologists (ACOG) provides the following recommendation: &quot;All obstetrician–gynecologists and other obstetric care providers should complete a full assessment of mood and emotional well-being (including screening for postpartum depression and anxiety with a validated instrument) during the comprehensive postpartum visit for each patient&quot; (American College of Obstetricians and Gynecologists, 2018). The Institute for Clinical Systems Improvement (ICSI) health care guideline, Adult Depression in Primary Care, provides the following recommendations: 1. &quot;Clinicians should routinely screen all adults for depression using a standardized instrument.&quot; 2. &quot;Clinicians should establish and maintain follow-up with patients.&quot; 3. &quot;Clinicians should screen and monitor depression in pregnant and post-partum women&quot; (Trangle et al., 2016, p. 8-10).</p>
</div></td>


</tr>









  
  
  
    <tr>


<th colspan="2" scope="row" class="row-header">Measure Group (Rate)</th>


</tr>
  
  
  











  
  
    
    
    <tr>
      
        

<th scope="row" class="row-header">Initial Population</th>


      
      <td class="content-container">
        
        <em>ID</em>: AD83208C-1313-401E-BB62-ABCCE0982B49
        <br/>
        
        
          <em>Description</em>:
          <p style="white-space: pre-line" class="tab-one">All patients aged 12 years and older at the beginning of the measurement period with at least one qualifying encounter during the measurement period</p>
        
        
          
            
              
              <em>Criteria</em>: <a href="#grp-AD83208C-1313-401E-BB62-ABCCE0982B49">Initial Population</a> 
            
          
          
        
        
        
      </td>
    </tr>
  

  
    
    
    <tr>
      
        

<th scope="row" class="row-header">Denominator</th>


      
      <td class="content-container">
        
        <em>ID</em>: 696066C7-C558-4849-A325-A3CDDB58CF8F
        <br/>
        
        
          <em>Description</em>:
          <p style="white-space: pre-line" class="tab-one">All patients aged 12 years and older at the beginning of the measurement period with at least one qualifying encounter during the measurement period</p>
        
        
          
            
              
              <em>Criteria</em>: <a href="#grp-696066C7-C558-4849-A325-A3CDDB58CF8F">Denominator</a> 
            
          
          
        
        
        
      </td>
    </tr>
  

  
    
    
    <tr>
      
        

<th scope="row" class="row-header">Numerator</th>


      
      <td class="content-container">
        
        <em>ID</em>: E2557B71-1B97-413F-BE26-2B037E4D590B
        <br/>
        
        
          <em>Description</em>:
          <p style="white-space: pre-line" class="tab-one">Patients screened for depression on the date of the encounter or up to 14 days prior to the date of the encounter using an age-appropriate standardized tool AND if positive, a follow-up plan is documented on the date of or up to two days after the date of the qualifying encounter</p>
        
        
          
            
              
              <em>Criteria</em>: <a href="#grp-E2557B71-1B97-413F-BE26-2B037E4D590B">Numerator</a> 
            
          
          
        
        
        
      </td>
    </tr>
  

  
    
    
    <tr>
      
        

<th scope="row" class="row-header">Denominator Exclusions</th>


      
      <td class="content-container">
        
        <em>ID</em>: E52F7FAE-96D9-417A-8538-6E3DB4A31D7A
        <br/>
        
        
          <em>Description</em>:
          <p style="white-space: pre-line" class="tab-one">Patients who have ever been diagnosed with bipolar disorder at any time prior to the qualifying encounter</p>
        
        
          
            
              
              <em>Criteria</em>: <a href="#grp-E52F7FAE-96D9-417A-8538-6E3DB4A31D7A">Denominator Exclusions</a> 
            
          
          
        
        
        
      </td>
    </tr>
  

  
    
    
    <tr>
      
        

<th scope="row" class="row-header">Denominator Exceptions</th>


      
      <td class="content-container">
        
        <em>ID</em>: FBA7B9D9-8588-4CB2-AB72-642CBD980334
        <br/>
        
        
          <em>Description</em>:
          <p style="white-space: pre-line" class="tab-one">Patient Reason(s) Patient refuses to participate in or complete the depression screening OR Medical Reason(s) Documentation of medical reason for not screening patient for depression</p>
        
        
          
            
              
              <em>Criteria</em>: <a href="#grp-FBA7B9D9-8588-4CB2-AB72-642CBD980334">Denominator Exceptions</a> 
            
          
          
        
        
        
      </td>
    </tr>
  

  
<tr>
  

<th scope="row" class="row-header">Stratifier</th>


  <td class="content-container">
    
      <em>ID</em>: stratifier-ethnicity
      
        <br/>
      
    
    
      
        <em>Code</em>: Ethnicity
      
      
        <br/>
      
    
    
      <em>Description</em>: Ethnicity (CDC Value Set)
    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Stratifier</th>


  <td class="content-container">
    
      <em>ID</em>: stratifier-payer
      
        <br/>
      
    
    
      
        <em>Code</em>: SDE Payer
      
      
        <br/>
      
    
    
      <em>Description</em>: Payer
    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Stratifier</th>


  <td class="content-container">
    
      <em>ID</em>: stratifier-race
      
        <br/>
      
    
    
      
        <em>Code</em>: SDE Race
      
      
        <br/>
      
    
    
      <em>Description</em>: Race (CDC Value Set)
    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Stratifier</th>


  <td class="content-container">
    
      <em>ID</em>: stratifier-sex
      
        <br/>
      
    
    
      
        <em>Code</em>: Sex [HL7.v3]
      
      
        <br/>
      
    
    
      <em>Description</em>: Administrative sex
    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Stratifier</th>


  <td class="content-container">
    
      <em>ID</em>: stratifier-age
      
        <br/>
      
    
    
      
        <em>Code</em>: Age
      
      
        <br/>
      
    
    
      <em>Description</em>: Age
    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Stratifier</th>


  <td class="content-container">
    
      <em>ID</em>: stratifier-state-of-residence
      
        <br/>
      
    
    
      
        <em>Code</em>: State, district or territory federal abbreviation
      
      
        <br/>
      
    
    
      <em>Description</em>: State of residence
    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Stratifier</th>


  <td class="content-container">
    
      <em>ID</em>: stratifier-postal-code-of-residence
      
        <br/>
      
    
    
      
        <em>Code</em>: Postal code
      
      
        <br/>
      
    
    
      <em>Description</em>: Postal code of residence
    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Stratifier</th>


  <td class="content-container">
    
      <em>ID</em>: stratifier-food-insecurity-risk-status
      
        <br/>
      
    
    
      
        <em>Code</em>: Food insecurity risk [HVS]
      
      
        <br/>
      
    
    
      <em>Description</em>: Food insecurity risk status
    
  </td>
</tr>




  <tr>


<th colspan="2" scope="row" class="row-header">Supplemental Data Elements</th>


</tr>


<tr>
  

<th scope="row" class="row-header">Supplemental Data Element</th>


  <td class="content-container">
    
      <em>ID</em>: sde-ethnicity
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: Ethnicity (CDC Value Set)
    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#depressionscreeningandfollowup-sde-ethnicity">SDE Ethnicity</a> 
        
      
    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Supplemental Data Element</th>


  <td class="content-container">
    
      <em>ID</em>: sde-payer
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: Payer
    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#depressionscreeningandfollowup-sde-payer">SDE Payer</a> 
        
      
    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Supplemental Data Element</th>


  <td class="content-container">
    
      <em>ID</em>: sde-race
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: Race (CDC Value Set)
    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#depressionscreeningandfollowup-sde-race">SDE Race</a> 
        
      
    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Supplemental Data Element</th>


  <td class="content-container">
    
      <em>ID</em>: sde-sex
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: Administrative sex
    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#depressionscreeningandfollowup-sde-sex">SDE Sex</a> 
        
      
    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Supplemental Data Element</th>


  <td class="content-container">
    
      <em>ID</em>: sde-age
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: Age
    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#depressionscreeningandfollowup-sde-age">SDE Age</a> 
        
      
    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Supplemental Data Element</th>


  <td class="content-container">
    
      <em>ID</em>: sde-state-of-residence
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: State of residence
    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#depressionscreeningandfollowup-sde-state-of-residence">SDE State of Residence</a> 
        
      
    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Supplemental Data Element</th>


  <td class="content-container">
    
      <em>ID</em>: sde-postal-code-of-residence
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: Postal code of residence
    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#depressionscreeningandfollowup-sde-postal-code-of-residence">SDE Postal Code of Residence</a> 
        
      
    
  </td>
</tr>

<tr>
  

<th scope="row" class="row-header">Supplemental Data Element</th>


  <td class="content-container">
    
      <em>ID</em>: sde-food-insecurity-risk-status
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: Food insecurity risk status
    
    
      
        <br/>
        
          
          <em>Logic Definition</em>: <a href="#depressionscreeningandfollowup-sde-food-insecurity-risk-status">SDE Food Insecurity Risk Status</a> 
        
      
    
  </td>
</tr>


<tr>


<th colspan="2" scope="row" class="row-header">Measure Logic</th>


</tr>

<tr>


<th scope="row" class="row-header">Primary Library</th>



<td class="content-container"><a href="Library-DepressionScreeningandFollowUp.html">DepressionScreeningandFollowUp</a></td>


</tr>




<tr>
  <th scope="row" class="row-header">Contents</th>
  <td class="content-container">
    <em><a href="#population-criteria">Population Criteria</a></em>
    <br/>
    <em><a href="#definitions">Logic Definitions</a></em>
    <br/>
    <em><a href="#terminology">Terminology</a></em>
    <br/>
    <em><a href="#dependencies">Dependencies</a></em>
    <br/>
    <em><a href="#data-requirements">Data Requirements</a></em>
    <br/>
  </td>
</tr>


  <tr>


<th colspan="2" scope="row" class="row-header"><a name="population-criteria"> </a>Population Criteria</th>


</tr>
  
  
  

  
  
  
    <tr>


<th colspan="2" scope="row" class="row-header">Measure Group (Rate)</th>


</tr>
  
  
  
  
    
      
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            
              
            
            
            
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Initial Population
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
      
      <a name="grp-AD83208C-1313-401E-BB62-ABCCE0982B49"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Initial Population&quot;:
  AgeInYearsAt(start of &quot;Measurement Period&quot;) &gt;= 12
    and exists(
      &quot;Qualifying Encounters During Measurement Period&quot; E 
        where FC.ToInterval(E.period) during &quot;Measurement Period&quot;
    )</code></pre>
    
      
      <a href="#depressionscreeningandfollowup-initial-population"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
      
    
  

  
    
      
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            
              
            
            
            
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Denominator
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
      
      <a name="grp-696066C7-C558-4849-A325-A3CDDB58CF8F"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Denominator&quot;:
  &quot;Initial Population&quot;</code></pre>
    
      
      <a href="#depressionscreeningandfollowup-denominator"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
      
    
  

  
    
      
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            
              
            
            
            
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Numerator
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
      
      <a name="grp-E2557B71-1B97-413F-BE26-2B037E4D590B"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Numerator&quot;:
  ( &quot;Patient Age 12 to 16 Years at Start of Measurement Period&quot;
      and ( &quot;Most Recent Adolescent Screening Negative&quot;
        or &quot;Most Recent Adolescent Depression Screening Positive and Follow Up Provided&quot; )
)
  or ( &quot;Patient Age 17 Years at Start of Measurement Period&quot;
    and ( &quot;Most Recent Adolescent Screening Negative&quot;
      or &quot;Most Recent Adolescent Depression Screening Positive and Follow Up Provided&quot;
      or &quot;Most Recent Adult Screening Negative&quot;
      or  &quot;Most Recent Adult Depression Screening Positive and Follow Up Provided&quot;) 
  )
  or ( &quot;Patient Age 18 Years or Older at Start of Measurement Period&quot;
    and ( &quot;Most Recent Adult Screening Negative&quot;
      or &quot;Most Recent Adult Depression Screening Positive and Follow Up Provided&quot; ) )</code></pre>
    
      
      <a href="#depressionscreeningandfollowup-numerator"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
      
    
  

  
    
      
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            
              
            
            
            
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Denominator Exclusions
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
      
      <a name="grp-E52F7FAE-96D9-417A-8538-6E3DB4A31D7A"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Denominator Exclusions&quot;:
  exists(&quot;History of Bipolar Diagnosis Before Qualifying Encounter&quot;)</code></pre>
    
      
      <a href="#depressionscreeningandfollowup-denominator-exclusions"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
      
    
  

  
    
      
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            
              
            
            
            
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Denominator Exceptions
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
      
      <a name="grp-FBA7B9D9-8588-4CB2-AB72-642CBD980334"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Denominator Exceptions&quot;:
  (exists(&quot;Medical or Patient Reason for Not Screening Adolescent for Depression&quot;)
    and not exists(&quot;Has Adolescent Depression Screening&quot;))
  or (exists(&quot;Medical or Patient Reason for Not Screening Adult for Depression&quot;)
    and not exists(&quot;Has Adult Depression Screening&quot;))</code></pre>
    
      
      <a href="#depressionscreeningandfollowup-denominator-exceptions"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
      
    
  

  
  
    
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Stratifier
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Ethnicity&quot;:
  (flatten (
      Patient.extension Extension
        where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity'
          return Extension.extension
    )) E
      where E.url = 'ombCategory'
        or E.url = 'detailed'
      return E.value as Coding</code></pre>
    
      
      <a href="#supplementaldataelementsfhir4-sde-ethnicity"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Stratifier
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Ethnicity&quot;:
  SDE.&quot;SDE Ethnicity&quot;</code></pre>
    
      
      <a href="#depressionscreeningandfollowup-sde-ethnicity"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
    
  

  
    
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Stratifier
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Payer&quot;:
  [Coverage: type in &quot;Payer&quot;] Payer
        return {
          code: Payer.type,
          period: Payer.period
        }</code></pre>
    
      
      <a href="#supplementaldataelementsfhir4-sde-payer"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Stratifier
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Payer&quot;:
  SDE.&quot;SDE Payer&quot;</code></pre>
    
      
      <a href="#depressionscreeningandfollowup-sde-payer"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
    
  

  
    
        
          
        
          
        
          
        
          
        
          
        
          
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Stratifier
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Race&quot;:
  (flatten (
      Patient.extension Extension
        where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race'
          return Extension.extension
    )) E
      where E.url = 'ombCategory'
        or E.url = 'detailed'
      return E.value as Coding</code></pre>
    
      
      <a href="#supplementaldataelementsfhir4-sde-race"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Stratifier
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Race&quot;:
  SDE.&quot;SDE Race&quot;</code></pre>
    
      
      <a href="#depressionscreeningandfollowup-sde-race"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
    
  

  
    
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Stratifier
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Sex&quot;:
  case
      when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' }
      when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' }
      else null
    end</code></pre>
    
      
      <a href="#supplementaldataelementsfhir4-sde-sex"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Stratifier
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Sex&quot;:
  SDE.&quot;SDE Sex&quot;</code></pre>
    
      
      <a href="#depressionscreeningandfollowup-sde-sex"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
    
  

  
    
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Stratifier
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Age&quot;:
  SurveillanceDataElements.&quot;Age&quot;</code></pre>
    
      
      <a href="#depressionscreeningandfollowup-sde-age"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
    
  

  
    
        
          
        
          
        
          
        
          
        
          
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Stratifier
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE State of Residence&quot;:
  SurveillanceDataElements.&quot;State of Residence&quot;</code></pre>
    
      
      <a href="#depressionscreeningandfollowup-sde-state-of-residence"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
    
  

  
    
        
          
        
          
        
          
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Stratifier
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Postal Code of Residence&quot;:
  SurveillanceDataElements.&quot;Postal Code of Residence&quot;</code></pre>
    
      
      <a href="#depressionscreeningandfollowup-sde-postal-code-of-residence"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
    
  

  
    
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
            <tr>
  <th scope="row" rowspan="2" class="row-header">
    
    Stratifier
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Food Insecurity Risk Status&quot;:
  SurveillanceDataElements.&quot;Food Insecurity Risk Status&quot;</code></pre>
    
      
      <a href="#depressionscreeningandfollowup-sde-food-insecurity-risk-status"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
    
  

  

  
  


  <tr>


<th colspan="2" scope="row" class="row-header"><a name="definitions"> </a>Logic Definitions</th>


</tr>
  
  
          
        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SupplementalDataElementsFHIR4</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="supplementaldataelementsfhir4-sde-race"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Race&quot;:
  (flatten (
      Patient.extension Extension
        where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race'
          return Extension.extension
    )) E
      where E.url = 'ombCategory'
        or E.url = 'detailed'
      return E.value as Coding</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SupplementalDataElementsFHIR4</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="supplementaldataelementsfhir4-sde-sex"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Sex&quot;:
  case
      when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' }
      when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' }
      else null
    end</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SupplementalDataElementsFHIR4</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="supplementaldataelementsfhir4-sde-payer"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Payer&quot;:
  [Coverage: type in &quot;Payer&quot;] Payer
        return {
          code: Payer.type,
          period: Payer.period
        }</code></pre>
  </td>

</tr>



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SupplementalDataElementsFHIR4</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="supplementaldataelementsfhir4-sde-ethnicity"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Ethnicity&quot;:
  (flatten (
      Patient.extension Extension
        where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity'
          return Extension.extension
    )) E
      where E.url = 'ombCategory'
        or E.url = 'detailed'
      return E.value as Coding</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        




        
        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SurveillanceDataElementsFHIR4</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="surveillancedataelementsfhir4-most-recent-physical-home-address"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">// Jurisdiction of residence (jurisdiction of the patient)
define &quot;Most recent physical home address&quot;:
  First(
    Patient.address A
      where A.use = 'home'
        and A.type = 'physical'
      sort by end of period desc
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SurveillanceDataElementsFHIR4</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="surveillancedataelementsfhir4-postal-code-of-residence"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Postal Code of Residence&quot;:
  &quot;Most recent physical home address&quot;.postalCode</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SurveillanceDataElementsFHIR4</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="surveillancedataelementsfhir4-state-of-residence"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;State of Residence&quot;:
  &quot;Most recent physical home address&quot;.state</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SurveillanceDataElementsFHIR4</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="surveillancedataelementsfhir4-food-insecurity-risk-status"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">// Jurisdiction of care (jurisdiction of the most recent encounter)
// TODO:
//define &quot;Most recent address of care&quot;:

// NOTE: Included in eICR
// Occupational Data for Health - Past or Present Job
// http://hl7.org/fhir/us/odh/StructureDefinition-odh-PastOrPresentJob.html
// Observation: LOINC#11341-5, valueCodeableConcept in https://phinvads.cdc.gov/vads/ViewValueSet.action?oid=2.16.840.1.114222.4.11.7186

// Social Determinants of Health (SDOH)
// http://build.fhir.org/ig/HL7/fhir-sdoh-clinicalcare/StructureDefinition-SDOHCC-ObservationScreeningResponse.html
// Food insecurity risk: http://build.fhir.org/ig/HL7/fhir-sdoh-clinicalcare/Observation-SDOHCC-ObservationResponseHungerVitalSignQuestion3Example.html
// Observation: LOINC#88124-3, valueCodeableConcept in https://loinc.org/LL2510-7/ (At risk, No risk)
define &quot;Food Insecurity Risk Status&quot;:
  First(
    [Observation: &quot;Food insecurity risk [HVS]&quot;] O
      sort by issued desc
  ).value as CodeableConcept</code></pre>
  </td>

</tr>



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SurveillanceDataElementsFHIR4</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="surveillancedataelementsfhir4-age"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">// Age
define &quot;Age&quot;:
  AgeInYearsAt(end of &quot;Measurement Period&quot;)</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        




        
        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-sde-postal-code-of-residence"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Postal Code of Residence&quot;:
  SurveillanceDataElements.&quot;Postal Code of Residence&quot;</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-sde-state-of-residence"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE State of Residence&quot;:
  SurveillanceDataElements.&quot;State of Residence&quot;</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-sde-race"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Race&quot;:
  SDE.&quot;SDE Race&quot;</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-sde-sex"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Sex&quot;:
  SDE.&quot;SDE Sex&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-patient-age-12-to-16-years-at-start-of-measurement-period"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">//Numerator
define &quot;Patient Age 12 to 16 Years at Start of Measurement Period&quot;:
  AgeInYearsAt(start of &quot;Measurement Period&quot;) in Interval[12, 16]</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-qualifying-encounters-during-measurement-period"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Qualifying Encounters During Measurement Period&quot;:
  (AC.QualifiedEncounters([Encounter: &quot;Encounter to Screen for Depression&quot;])
    union AC.QualifiedEncounters([Encounter: &quot;Physical Therapy Evaluation&quot;])
    union AC.QualifiedEncounters([Encounter: &quot;Telephone Visits&quot;])) QualifyingEnc 
    where FC.ToInterval(QualifyingEnc.period) during &quot;Measurement Period&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-has-adolescent-depression-screening"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Has Adolescent Depression Screening&quot;:
  ((AC.QualifiedObservations([Observation: &quot;Adolescent Depression Screening Assessment&quot;])) AdolescentScreening
    with &quot;Qualifying Encounters During Measurement Period&quot; QualifyingEnc
      such that &quot;Screening Within 14 Days of Encounter&quot;(AdolescentScreening, QualifyingEnc))</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-most-recent-adolescent-depression-screening"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">//Adolescent Numerator
define &quot;Most Recent Adolescent Depression Screening&quot;:
  AC.MostRecent((&quot;Has Adolescent Depression Screening&quot;))</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-most-recent-adolescent-screening-negative"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Most Recent Adolescent Screening Negative&quot;:
  (&quot;Most Recent Adolescent Depression Screening&quot; AdolescentScreening
    where AdolescentScreening.value ~ ToConcept(&quot;Depression Screening Negative&quot;)) is not null</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-most-recent-adolescent-positive-depression-screening"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Most Recent Adolescent Positive Depression Screening&quot;:
  &quot;Most Recent Adolescent Depression Screening&quot; RecentScreening
    where RecentScreening.value ~ ToConcept(&quot;Depression Screening Positive&quot;)</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-follow-up-interventions-for-positive-adolescent-depression-screening"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Follow Up Interventions For Positive Adolescent Depression Screening&quot;:
  (AC.QualifiedMedicationRequests([MedicationRequest: &quot;Adolescent Depression Medications&quot;])
    union AC.QualifiedServiceRequests([ServiceRequest: &quot;Referral for Adolescent Depression&quot;])
    union AC.QualifiedProcedures([Procedure: &quot;Follow Up for Adolescent Depression&quot;])) FollowUpInterventions
    let &quot;Intervention Day&quot;: Coalesce(FC.ToInterval(FollowUpInterventions.authoredOn), FC.ToInterval(FollowUpInterventions.performed))
    with &quot;Qualifying Encounters During Measurement Period&quot; QualifyingEnc
      such that &quot;Intervention Day&quot; same day as QualifyingEnc.period
      or &quot;Intervention Day&quot; 2 days or less after day of end of FC.ToInterval(QualifyingEnc.period)</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-most-recent-adolescent-depression-screening-positive-and-follow-up-provided"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Most Recent Adolescent Depression Screening Positive and Follow Up Provided&quot;:
  (&quot;Most Recent Adolescent Positive Depression Screening&quot; RecentScreening
  let &quot;Screening Day&quot;: Coalesce(FC.ToInterval(RecentScreening.effective), FC.ToInterval(RecentScreening.issued))
  with &quot;Follow Up Interventions For Positive Adolescent Depression Screening&quot; FollowUpInterventions
    such that &quot;Screening Day&quot; 14 days or less before start of Coalesce(FC.ToInterval(FollowUpInterventions.authoredOn), FC.ToInterval(FollowUpInterventions.performed))
  ) is not null</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-patient-age-17-years-at-start-of-measurement-period"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Patient Age 17 Years at Start of Measurement Period&quot;:
  AgeInYearsAt(start of &quot;Measurement Period&quot;) = 17</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-has-adult-depression-screening"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Has Adult Depression Screening&quot;:
  ((AC.QualifiedObservations([Observation: &quot;Adult Depression Screening Assessment&quot;])) AdolescentScreening
    with &quot;Qualifying Encounters During Measurement Period&quot; QualifyingEnc
      such that &quot;Screening Within 14 Days of Encounter&quot;(AdolescentScreening, QualifyingEnc))</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-most-recent-adult-depression-screening"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">//Adult Numerator
define &quot;Most Recent Adult Depression Screening&quot;:
  AC.MostRecent((&quot;Has Adult Depression Screening&quot;))</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-most-recent-adult-screening-negative"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Most Recent Adult Screening Negative&quot;:
  (&quot;Most Recent Adult Depression Screening&quot; AdultScreening
    where AdultScreening.value ~ ToConcept(&quot;Depression Screening Negative&quot;)) is not null</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-most-recent-adult-positive-depression-screening"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Most Recent Adult Positive Depression Screening&quot;:
  &quot;Most Recent Adult Depression Screening&quot; RecentScreening
    where RecentScreening.value ~ ToConcept(&quot;Depression Screening Positive&quot;)</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-follow-up-interventions-for-positive-adult-depression-screening"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Follow Up Interventions For Positive Adult Depression Screening&quot;:
  ((AC.QualifiedMedicationRequests([MedicationRequest: &quot;Adult Depression Medications&quot;])
    union AC.QualifiedServiceRequests([ServiceRequest: &quot;Referral for Adult Depression&quot;])
    union AC.QualifiedProcedures([Procedure: &quot;Follow Up for Adult Depression&quot;]))) FollowUpInterventions
    let &quot;Intervention Day&quot;: Coalesce(FC.ToInterval(FollowUpInterventions.authoredOn), FC.ToInterval(FollowUpInterventions.performed))
    with &quot;Qualifying Encounters During Measurement Period&quot; QualifyingEnc
      such that &quot;Intervention Day&quot; same day as QualifyingEnc.period
      or &quot;Intervention Day&quot; 2 days or less after day of end of FC.ToInterval(QualifyingEnc.period)</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-most-recent-adult-depression-screening-positive-and-follow-up-provided"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Most Recent Adult Depression Screening Positive and Follow Up Provided&quot;:
  (&quot;Most Recent Adult Positive Depression Screening&quot; RecentScreening
  let &quot;Screening Day&quot;: Coalesce(FC.ToInterval(RecentScreening.effective), FC.ToInterval(RecentScreening.issued))
  with &quot;Follow Up Interventions For Positive Adult Depression Screening&quot; FollowUpInterventions
    such that &quot;Screening Day&quot; 14 days or less before start of Coalesce(FC.ToInterval(FollowUpInterventions.authoredOn), FC.ToInterval(FollowUpInterventions.performed))
  ) is not null</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-patient-age-18-years-or-older-at-start-of-measurement-period"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Patient Age 18 Years or Older at Start of Measurement Period&quot;:
  AgeInYearsAt(start of &quot;Measurement Period&quot;) &gt;= 18</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-numerator"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Numerator&quot;:
  ( &quot;Patient Age 12 to 16 Years at Start of Measurement Period&quot;
      and ( &quot;Most Recent Adolescent Screening Negative&quot;
        or &quot;Most Recent Adolescent Depression Screening Positive and Follow Up Provided&quot; )
)
  or ( &quot;Patient Age 17 Years at Start of Measurement Period&quot;
    and ( &quot;Most Recent Adolescent Screening Negative&quot;
      or &quot;Most Recent Adolescent Depression Screening Positive and Follow Up Provided&quot;
      or &quot;Most Recent Adult Screening Negative&quot;
      or  &quot;Most Recent Adult Depression Screening Positive and Follow Up Provided&quot;) 
  )
  or ( &quot;Patient Age 18 Years or Older at Start of Measurement Period&quot;
    and ( &quot;Most Recent Adult Screening Negative&quot;
      or &quot;Most Recent Adult Depression Screening Positive and Follow Up Provided&quot; ) )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-initial-population"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Initial Population&quot;:
  AgeInYearsAt(start of &quot;Measurement Period&quot;) &gt;= 12
    and exists(
      &quot;Qualifying Encounters During Measurement Period&quot; E 
        where FC.ToInterval(E.period) during &quot;Measurement Period&quot;
    )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-denominator"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Denominator&quot;:
  &quot;Initial Population&quot;</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-sde-payer"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Payer&quot;:
  SDE.&quot;SDE Payer&quot;</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-sde-food-insecurity-risk-status"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Food Insecurity Risk Status&quot;:
  SurveillanceDataElements.&quot;Food Insecurity Risk Status&quot;</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-sde-ethnicity"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Ethnicity&quot;:
  SDE.&quot;SDE Ethnicity&quot;</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-sde-age"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Age&quot;:
  SurveillanceDataElements.&quot;Age&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-history-of-bipolar-diagnosis-before-qualifying-encounter"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">//Denominator Exclusion 
define &quot;History of Bipolar Diagnosis Before Qualifying Encounter&quot;: 
  (AC.QualifiedConditions([Condition: &quot;Bipolar Disorder&quot;])) BipolarDiagnosis 
  with &quot;Qualifying Encounters During Measurement Period&quot; QualifyingEnc
    such that FC.ToPrevalenceInterval(BipolarDiagnosis) starts before QualifyingEnc.period</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-denominator-exclusions"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Denominator Exclusions&quot;:
  exists(&quot;History of Bipolar Diagnosis Before Qualifying Encounter&quot;)</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-medical-or-patient-reason-for-not-screening-adolescent-for-depression"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">//Denominator Exception
define &quot;Medical or Patient Reason for Not Screening Adolescent for Depression&quot;:
  AC.AbsentData([Observation: &quot;Adolescent Depression Screening Assessment&quot;], &quot;Qualifying Encounters During Measurement Period&quot;, &quot;Depression Screening Declined&quot;, &quot;Medical Reason&quot;)</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-medical-or-patient-reason-for-not-screening-adult-for-depression"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Medical or Patient Reason for Not Screening Adult for Depression&quot;:
  AC.AbsentData([Observation: &quot;Adult Depression Screening Assessment&quot;], &quot;Qualifying Encounters During Measurement Period&quot;, &quot;Depression Screening Declined&quot;, &quot;Medical Reason&quot;)</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-denominator-exceptions"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Denominator Exceptions&quot;:
  (exists(&quot;Medical or Patient Reason for Not Screening Adolescent for Depression&quot;)
    and not exists(&quot;Has Adolescent Depression Screening&quot;))
  or (exists(&quot;Medical or Patient Reason for Not Screening Adult for Depression&quot;)
    and not exists(&quot;Has Adult Depression Screening&quot;))</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> DepressionScreeningandFollowUp</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="depressionscreeningandfollowup-screening-within-14-days-of-encounter"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function &quot;Screening Within 14 Days of Encounter&quot;(observation FHIR.Observation, encounter FHIR.Encounter)
returns System.Boolean:
  Coalesce(end of FC.ToInterval(observation.effective), observation.issued) 14 days or less before day of start of encounter.period
    and observation.value is not null</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value AddressUse): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value AddressType): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tointerval"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToInterval(period FHIR.Period):
    if period is null then
        null
    else
        if period.&quot;start&quot; is null then
            Interval(period.&quot;start&quot;.value, period.&quot;end&quot;.value]
        else
            Interval[period.&quot;start&quot;.value, period.&quot;end&quot;.value]</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value uri): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value AdministrativeGender): value.value</code></pre>
  </td>

</tr>



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value ObservationStatus): value.value</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value EncounterStatus): value.value</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-todatetime"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToDateTime(value dateTime): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-todatetime"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToDateTime(value instant): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-todate"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToDate(value date): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-toquantity"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToQuantity(quantity FHIR.Quantity):
    case
        when quantity is null then null
        when quantity.value is null then null
        when quantity.comparator is not null then
            Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')
        when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'
              or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then
            System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }
        else
            Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' &amp; quantity.unit.value &amp; ' (' &amp; quantity.system.value &amp; '|' &amp; quantity.code.value &amp; ')')
    end</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tocalendarunit"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToCalendarUnit(unit System.String):
    case unit
        when 'ms' then 'millisecond'
        when 's' then 'second'
        when 'min' then 'minute'
        when 'h' then 'hour'
        when 'd' then 'day'
        when 'wk' then 'week'
        when 'mo' then 'month'
        when 'a' then 'year'
        else unit
    end</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-toconcept"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">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 scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tocode"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">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>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value MedicationRequestStatus): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-toboolean"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToBoolean(value boolean): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value MedicationRequestIntent): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value string): value.value</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value ServiceRequestStatus): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value ServiceRequestIntent): value.value</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value ProcedureStatus): value.value</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhircommon-tointerval"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
@comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range types
to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible
representations for timing-valued elements in FHIR, allowing this function to be used across any resource.

The input can be provided as a dateTime, Period, Timing, instant, string, Age, or Range.
The intent of this function is to provide a clear and concise mechanism to treat single
elements that have multiple possible representations as intervals so that logic doesn't have to account
for the variability. More complex calculations (such as medication request period or dispense period
calculation) need specific guidance and consideration. That guidance may make use of this function, but
the focus of this function is on single element calculations where the semantics are unambiguous.
If the input is a dateTime, the result a DateTime Interval beginning and ending on that dateTime.
If the input is a Period, the result is a DateTime Interval.
If the input is a Timing, an error is raised indicating a single interval cannot be computed from a Timing.
If the input is an instant, the result is a DateTime Interval beginning and ending on that instant.
If the input is a string, an error is raised indicating a single interval cannot be computed from a string.
If the input is an Age, the result is a DateTime Interval beginning when the patient was the given Age,
and ending immediately prior to when the patient was the given Age plus one year.
If the input is a Range, the result is a DateTime Interval beginning when the patient was the Age given
by the low end of the Range, and ending immediately prior to when the patient was the Age given by the
high end of the Range plus one year.

NOTE: Due to the
complexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used
with a Timing or String.
*/
define function ToInterval(choice Choice&lt;FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range&gt;):
  case
	  when choice is FHIR.dateTime then
    	Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]
		when choice is FHIR.Period then
  		FHIRHelpers.ToInterval(choice as FHIR.Period)
		when choice is FHIR.instant then
			Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]
		when choice is FHIR.Age then
		  Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),
			  FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)
		when choice is FHIR.Range then
		  Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),
			  FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)
		when choice is FHIR.Timing then
			//Interval[FHIRHelpers.ToDateTime(choice as FHIR.timing), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]
		  Message(null as Interval&lt;DateTime&gt;, true, '1', 'Error', 'Cannot compute a single interval from a Timing type')
    when choice is FHIR.string then
      Message(null as Interval&lt;DateTime&gt;, true, '1', 'Error', 'Cannot compute an interval from a String value')
		else
			null as Interval&lt;DateTime&gt;
	end</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhircommon-toprevalenceinterval"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns an interval representing the normalized prevalence period of a given Condition resource.
@comment: Uses the ToInterval and ToAbatementInterval functions to determine the widest potential interval from
onset to abatement as specified in the given Condition.
*/
define function ToPrevalenceInterval(condition Condition):
if condition.clinicalStatus ~ &quot;active&quot;
  or condition.clinicalStatus ~ &quot;recurrence&quot;
  or condition.clinicalStatus ~ &quot;relapse&quot; then
  Interval[start of ToInterval(condition.onset), end of ToAbatementInterval(condition)]
else
  Interval[start of ToInterval(condition.onset), end of ToAbatementInterval(condition))</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhircommon-toabatementinterval"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns an interval representing the normalized Abatement of a given Condition resource.
@comment: NOTE: Due to the complexity of determining an interval from a String, this function will throw
a run-time exception if used with a Condition instance that has a String as the abatement value.
*/
define function ToAbatementInterval(condition Condition):
	if condition.abatement is FHIR.dateTime then
	  Interval[FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime), FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime)]
	else if condition.abatement is FHIR.Period then
	  FHIRHelpers.ToInterval(condition.abatement as FHIR.Period)
	else if condition.abatement is FHIR.string then
    Message(null as Interval&lt;DateTime&gt;, true, '1', 'Error', 'Cannot compute an interval from a String value')
	else if condition.abatement is FHIR.Age then
		Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age),
			FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age) + 1 year)
	else if condition.abatement is FHIR.Range then
	  Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).low),
		  FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).high) + 1 year)
	else if condition.abatement is FHIR.boolean then
	  Interval[end of ToInterval(condition.onset), condition.recordedDate)
	else null</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AlphoraCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="alphoracommon-mostrecent"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function MostRecent(observations List&lt;Observation&gt;):
  Last(
    observations O
      sort by start of FC.ToInterval(effective)
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AlphoraCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="alphoracommon-qualifiedobservations"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function QualifiedObservations(value List&lt;FHIR.Observation&gt;):
  value Observation
		where (
      //registered | preliminary | final | amended | corrected | cancelled | entered-in-error | unknown
      Observation.status ~ 'final'
			or Observation.status ~ 'amended'
			or Observation.status ~ 'corrected'
		)</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AlphoraCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="alphoracommon-qualifiedencounters"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/* Common Resource Qualifications and Negations */
define function QualifiedEncounters(value List&lt;FHIR.Encounter&gt;):
  value Encounter
    where (
      //planned | arrived | triaged | in-progress | onleave | finished | cancelled | entered-in-error | unknown
      Encounter.status ~ 'arrived'
      or Encounter.status ~ 'in-progress'
      or Encounter.status ~ 'finished'
      or Encounter.status ~ 'onleave'
      or Encounter.status ~ 'triaged'
    )</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AlphoraCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="alphoracommon-qualifiedmedicationrequests"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function QualifiedMedicationRequests(value List&lt;FHIR.MedicationRequest&gt;):
  value MedicationRequest
    where (
      //active | on-hold | cancelled | completed | entered-in-error | stopped | draft | unknown
      (MedicationRequest.status ~ 'active'
        or MedicationRequest.status ~ 'completed'
      )
        and (
          MedicationRequest.doNotPerform is null
          or MedicationRequest.doNotPerform = false
        )
        and MedicationRequest.intent ~ 'order'
    )</code></pre>
  </td>

</tr>



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AlphoraCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="alphoracommon-qualifiedservicerequests"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function QualifiedServiceRequests(value List&lt;FHIR.ServiceRequest&gt;):
  value ServiceRequest
    where (
      //draft | active | on-hold | revoked | completed | entered-in-error | unknown
      ServiceRequest.status ~ 'active'
      or ServiceRequest.status ~ 'completed'
      and ServiceRequest.intent ~ 'order'
    )
    and (
      ServiceRequest.doNotPerform is null
      or ServiceRequest.doNotPerform = false
    )</code></pre>
  </td>

</tr>



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AlphoraCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="alphoracommon-qualifiedprocedures"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function QualifiedProcedures(value List&lt;FHIR.Procedure&gt;):
  value Procedure
    where (
      //preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown
      Procedure.status ~ 'completed'
    )</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AlphoraCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="alphoracommon-qualifiedconditions"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function QualifiedConditions(value List&lt;FHIR.Condition&gt;):
  value Condition
    where (
      FHIRHelpers.ToConcept(Condition.clinicalStatus) ~ FC.&quot;active&quot;
    )
    and (
      FHIRHelpers.ToConcept(Condition.verificationStatus) ~ FC.&quot;confirmed&quot;
    )</code></pre>
  </td>

</tr>



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AlphoraCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="alphoracommon-absentdata"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function AbsentData(observation List&lt;FHIR.Observation&gt;, enc List&lt;FHIR.Encounter&gt;, code1 System.Code, valueset1 System.ValueSet)
returns List&lt;FHIR.Observation&gt;:
  (QualifiedObservations(observation)) Obs
    with enc QualifyingEnc
      such that Coalesce(end of FC.ToInterval(Obs.effective), end of FC.ToInterval(Obs.issued)) same day as end of QualifyingEnc.period
    where exists(
        Obs.component c where(
            c.code as CodeableConcept ~ code1
            or c.code as CodeableConcept in valueset1
        ))
      and not exists(Obs.component c where(c.value is not null))
      or (ResourceNotDone(Obs).value as FHIR.boolean = true
        and (ResourceNotDoneReason(Obs).value as CodeableConcept ~ code1
        or ResourceNotDoneReason(Obs).value as CodeableConcept in valueset1))</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AlphoraCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="alphoracommon-resourcenotdone"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ResourceNotDone(notDone DomainResource):
  QICoreModifierExtension(notDone, 'qicore-notDone')</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AlphoraCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="alphoracommon-qicoremodifierextension"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function QICoreModifierExtension(domainResource DomainResource, url String):
  singleton from QICoreModifierExtensions(domainResource, url)</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AlphoraCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="alphoracommon-qicoremodifierextensions"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/* QI-CORE Extensions */

/*
NOTE: Extensions are not the preferred approach, but are used as a way to access
content that is defined by extensions but not yet surfaced in the
CQL model info.
*/
define function QICoreModifierExtensions(domainResource DomainResource, url String):
  domainResource.modifierExtension E
    where E.url = ('http://hl7.org/fhir/us/qicore/StructureDefinition/' + url)
    return E</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AlphoraCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="alphoracommon-resourcenotdonereason"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ResourceNotDoneReason(notDoneReason DomainResource):
  QICoreExtension(notDoneReason, 'qicore-notDoneReason')</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AlphoraCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="alphoracommon-qicoreextension"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function QICoreExtension(domainResource DomainResource, url String):
  singleton from QICoreExtensions(domainResource, url)</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AlphoraCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="alphoracommon-qicoreextensions"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function QICoreExtensions(domainResource DomainResource, url String):
  domainResource.extension E
    where E.url = ('http://hl7.org/fhir/us/qicore/StructureDefinition/' + url)
    return E</code></pre>
  </td>

</tr>





  
  


  <tr>


<th colspan="2" scope="row" class="row-header"><a name="terminology"> </a>Terminology</th>


</tr>
  
  
  

 

 

 

 

 

 


<tr>
  
  
  

<th scope="row" class="row-header">Code System</th>


  
  <td class="content-container">
    
    <em>Description</em>: Code system SNOMEDCT
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://hl7.org/fhir/R4/codesystem-snomedct.html">SNOMED CT (all versions)</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://snomed.info/sct</tt>
    
  </td>
</tr>
 


<tr>
  
  
  

<th scope="row" class="row-header">Code System</th>


  
  <td class="content-container">
    
    <em>Description</em>: Code system LOINC
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://terminology.hl7.org/6.5.0/CodeSystem-v3-loinc.html">Logical Observation Identifiers, Names and Codes (LOINC)</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://loinc.org</tt>
    
  </td>
</tr>
 


<tr>
  
  
  

<th scope="row" class="row-header">Code System</th>


  
  <td class="content-container">
    
    <em>Description</em>: Code system ConditionClinicalStatusCodes
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://terminology.hl7.org/6.5.0/CodeSystem-condition-clinical.html">Condition Clinical Status Codes</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical</tt>
    
  </td>
</tr>
 


<tr>
  
  
  

<th scope="row" class="row-header">Code System</th>


  
  <td class="content-container">
    
    <em>Description</em>: Code system ConditionVerificationStatusCodes
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://terminology.hl7.org/6.5.0/CodeSystem-condition-ver-status.html">ConditionVerificationStatus</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-ver-status</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Adolescent Depression Screening Assessment
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <code>http://fhir.org/guides/cqf/aphl/chronic-ds/ValueSet/adolescent-depression-screening-assessment</code>
    <br/>
    <em>Canonical URL</em>: <tt>http://fhir.org/guides/cqf/aphl/chronic-ds/ValueSet/adolescent-depression-screening-assessment</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Encounter to Screen for Depression
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.600.1916/expansion">Encounter to Screen for Depression</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1916</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Physical Therapy Evaluation
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1022/expansion">Physical Therapy Evaluation</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1022</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Telephone Visits
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.464.1003.101.12.1080/expansion">Telephone Visits</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Adolescent Depression Medications
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1567/expansion">Adolescent Depression Medications</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1567</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Referral for Adolescent Depression
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1570/expansion">Referral for Adolescent Depression</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1570</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Follow Up for Adolescent Depression
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1569/expansion">Follow Up for Adolescent Depression</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1569</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Adult Depression Screening Assessment
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <code>http://fhir.org/guides/cqf/aphl/chronic-ds/ValueSet/adult-depression-screening-assessment</code>
    <br/>
    <em>Canonical URL</em>: <tt>http://fhir.org/guides/cqf/aphl/chronic-ds/ValueSet/adult-depression-screening-assessment</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Adult Depression Medications
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1566/expansion">Adult Depression Medications</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1566</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Referral for Adult Depression
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1571/expansion">Referral for Adult Depression</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1571</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Follow Up for Adult Depression
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1568/expansion">Follow Up for Adult Depression</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1568</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Payer
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion">Payer</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Bipolar Disorder
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.67.1.101.1.128/expansion">Bipolar Disorder</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.67.1.101.1.128</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Medical Reason
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1007/expansion">Medical Reason</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1007</tt>
    
  </td>
</tr>
 


  
  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Depression Screening Negative (finding)
        <br/>
      
      <em>Code</em>: 428171000124102
      <br/>
      <em>System</em>: <tt>http://snomed.info/sct</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Depression Screening Positive (finding)
        <br/>
      
      <em>Code</em>: 428181000124104
      <br/>
      <em>System</em>: <tt>http://snomed.info/sct</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Food insecurity risk [HVS]
        <br/>
      
      <em>Code</em>: 88124-3
      <br/>
      <em>System</em>: <tt>http://loinc.org</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
      <em>Code</em>: active
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
      <em>Code</em>: confirmed
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-ver-status</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
      <em>Code</em>: recurrence
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
      <em>Code</em>: relapse
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Depression Screening Declined (situation)
        <br/>
      
      <em>Code</em>: 720834000
      <br/>
      <em>System</em>: <tt>http://snomed.info/sct</tt>
    </td>
  </tr>

  
  


  <tr>


<th colspan="2" scope="row" class="row-header"><a name="dependencies"> </a>Dependencies</th>


</tr>
  
  
  
<tr>


<th scope="row" class="row-header">Dependency</th>



<td class="content-container">None</td>


</tr>

  
  


  <tr>


<th colspan="2" scope="row" class="row-header"><a name="data-requirements"> </a>Data Requirements</th>


</tr>
  
  
  
<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Patient
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/patient.html">Patient</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: use, type, url, extension, value
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, period
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.600.1916/expansion">Encounter to Screen for Depression</a>
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, period
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1022/expansion">Physical Therapy Evaluation</a>
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, period
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.464.1003.101.12.1080/expansion">Telephone Visits</a>
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/observation.html">Observation</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, value, effective, issued, component
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <code>http://fhir.org/guides/cqf/aphl/chronic-ds/ValueSet/adolescent-depression-screening-assessment</code>
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/observation.html">Observation</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, value, effective, issued, component
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <code>http://fhir.org/guides/cqf/aphl/chronic-ds/ValueSet/adult-depression-screening-assessment</code>
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/observation.html">Observation</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, value, effective, issued, component
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      <a href="https://loinc.org/88124-3">LOINC 88124-3</a>: Food insecurity risk [HVS]
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: MedicationRequest
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/medicationrequest.html">MedicationRequest</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: medication, status, doNotPerform, intent
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: medication</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1567/expansion">Adolescent Depression Medications</a>
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: MedicationRequest
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/medicationrequest.html">MedicationRequest</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: medication, status, doNotPerform, intent
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: medication</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1566/expansion">Adult Depression Medications</a>
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: MedicationRequest
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/medicationrequest.html">MedicationRequest</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: medication.reference, status, doNotPerform, intent
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Medication
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/medication.html">Medication</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: id, code
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: ServiceRequest
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/servicerequest.html">ServiceRequest</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, intent, doNotPerform
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1570/expansion">Referral for Adolescent Depression</a>
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: ServiceRequest
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/servicerequest.html">ServiceRequest</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, intent, doNotPerform
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1571/expansion">Referral for Adult Depression</a>
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Procedure
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/procedure.html">Procedure</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1569/expansion">Follow Up for Adolescent Depression</a>
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Procedure
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/procedure.html">Procedure</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.526.3.1568/expansion">Follow Up for Adult Depression</a>
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Coverage
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/coverage.html">Coverage</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, period
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion">Payer</a>
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Condition
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/condition.html">Condition</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, clinicalStatus, verificationStatus
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.67.1.101.1.128/expansion">Bipolar Disorder</a>
    <br/> 
  
  
  
   
  </td>
</tr>

  
  

<tr>
  <th colspan="2" scope="row" class="row-header">Generated using version 0.5.1-cibuild of the sample-content-ig Liquid templates</th>
</tr>

    </tbody>
  </table>
</div>
  </text>
  <contained>
    <Library>
      <id value="effective-data-requirements"/>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://snomed.info/sct"/>
          <code value="428171000124102"/>
          <display value="Depression Screening Negative (finding)"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://snomed.info/sct"/>
          <code value="428181000124104"/>
          <display value="Depression Screening Positive (finding)"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://loinc.org"/>
          <code value="88124-3"/>
          <display value="Food insecurity risk [HVS]"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/condition-clinical"/>
          <code value="active"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/condition-ver-status"/>
          <code value="confirmed"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/condition-clinical"/>
          <code value="recurrence"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/condition-clinical"/>
          <code value="relapse"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://snomed.info/sct"/>
          <code value="720834000"/>
          <display value="Depression Screening Declined (situation)"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SurveillanceDataElementsFHIR4"/>
        </extension>
        <extension url="name">
          <valueString value="Most recent physical home address"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="// Jurisdiction of residence (jurisdiction of the patient)
define &quot;Most recent physical home address&quot;:
  First(
    Patient.address A
      where A.use = 'home'
        and A.type = 'physical'
      sort by end of period desc
  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="0"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SurveillanceDataElementsFHIR4"/>
        </extension>
        <extension url="name">
          <valueString value="Postal Code of Residence"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Postal Code of Residence&quot;:
  &quot;Most recent physical home address&quot;.postalCode"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="1"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Postal Code of Residence"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Postal Code of Residence&quot;:
  SurveillanceDataElements.&quot;Postal Code of Residence&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="2"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SurveillanceDataElementsFHIR4"/>
        </extension>
        <extension url="name">
          <valueString value="State of Residence"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;State of Residence&quot;:
  &quot;Most recent physical home address&quot;.state"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="3"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString value="SDE State of Residence"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE State of Residence&quot;:
  SurveillanceDataElements.&quot;State of Residence&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="4"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SupplementalDataElementsFHIR4"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Race"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Race&quot;:
  (flatten (
      Patient.extension Extension
        where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race'
          return Extension.extension
    )) E
      where E.url = 'ombCategory'
        or E.url = 'detailed'
      return E.value as Coding"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="5"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </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="6"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SupplementalDataElementsFHIR4"/>
        </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 Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' }
      when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' }
      else null
    end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="7"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </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="8"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Patient Age 12 to 16 Years at Start of Measurement Period"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="//Numerator
define &quot;Patient Age 12 to 16 Years at Start of Measurement Period&quot;:
  AgeInYearsAt(start of &quot;Measurement Period&quot;) in Interval[12, 16]"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="9"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Qualifying Encounters During Measurement Period"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Qualifying Encounters During Measurement Period&quot;:
  (AC.QualifiedEncounters([Encounter: &quot;Encounter to Screen for Depression&quot;])
    union AC.QualifiedEncounters([Encounter: &quot;Physical Therapy Evaluation&quot;])
    union AC.QualifiedEncounters([Encounter: &quot;Telephone Visits&quot;])) QualifyingEnc 
    where FC.ToInterval(QualifyingEnc.period) during &quot;Measurement Period&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="10"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString value="Has Adolescent Depression Screening"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Has Adolescent Depression Screening&quot;:
  ((AC.QualifiedObservations([Observation: &quot;Adolescent Depression Screening Assessment&quot;])) AdolescentScreening
    with &quot;Qualifying Encounters During Measurement Period&quot; QualifyingEnc
      such that &quot;Screening Within 14 Days of Encounter&quot;(AdolescentScreening, QualifyingEnc))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="11"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString value="Most Recent Adolescent Depression Screening"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="//Adolescent Numerator
define &quot;Most Recent Adolescent Depression Screening&quot;:
  AC.MostRecent((&quot;Has Adolescent Depression Screening&quot;))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="12"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString value="Most Recent Adolescent Screening Negative"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Most Recent Adolescent Screening Negative&quot;:
  (&quot;Most Recent Adolescent Depression Screening&quot; AdolescentScreening
    where AdolescentScreening.value ~ ToConcept(&quot;Depression Screening Negative&quot;)) is not null"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="13"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Most Recent Adolescent Positive Depression Screening"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Most Recent Adolescent Positive Depression Screening&quot;:
  &quot;Most Recent Adolescent Depression Screening&quot; RecentScreening
    where RecentScreening.value ~ ToConcept(&quot;Depression Screening Positive&quot;)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="14"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Follow Up Interventions For Positive Adolescent Depression Screening"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Follow Up Interventions For Positive Adolescent Depression Screening&quot;:
  (AC.QualifiedMedicationRequests([MedicationRequest: &quot;Adolescent Depression Medications&quot;])
    union AC.QualifiedServiceRequests([ServiceRequest: &quot;Referral for Adolescent Depression&quot;])
    union AC.QualifiedProcedures([Procedure: &quot;Follow Up for Adolescent Depression&quot;])) FollowUpInterventions
    let &quot;Intervention Day&quot;: Coalesce(FC.ToInterval(FollowUpInterventions.authoredOn), FC.ToInterval(FollowUpInterventions.performed))
    with &quot;Qualifying Encounters During Measurement Period&quot; QualifyingEnc
      such that &quot;Intervention Day&quot; same day as QualifyingEnc.period
      or &quot;Intervention Day&quot; 2 days or less after day of end of FC.ToInterval(QualifyingEnc.period)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="15"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Most Recent Adolescent Depression Screening Positive and Follow Up Provided"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Most Recent Adolescent Depression Screening Positive and Follow Up Provided&quot;:
  (&quot;Most Recent Adolescent Positive Depression Screening&quot; RecentScreening
  let &quot;Screening Day&quot;: Coalesce(FC.ToInterval(RecentScreening.effective), FC.ToInterval(RecentScreening.issued))
  with &quot;Follow Up Interventions For Positive Adolescent Depression Screening&quot; FollowUpInterventions
    such that &quot;Screening Day&quot; 14 days or less before start of Coalesce(FC.ToInterval(FollowUpInterventions.authoredOn), FC.ToInterval(FollowUpInterventions.performed))
  ) is not null"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="16"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Patient Age 17 Years at Start of Measurement Period"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Patient Age 17 Years at Start of Measurement Period&quot;:
  AgeInYearsAt(start of &quot;Measurement Period&quot;) = 17"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="17"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString value="Has Adult Depression Screening"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Has Adult Depression Screening&quot;:
  ((AC.QualifiedObservations([Observation: &quot;Adult Depression Screening Assessment&quot;])) AdolescentScreening
    with &quot;Qualifying Encounters During Measurement Period&quot; QualifyingEnc
      such that &quot;Screening Within 14 Days of Encounter&quot;(AdolescentScreening, QualifyingEnc))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="18"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString value="Most Recent Adult Depression Screening"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="//Adult Numerator
define &quot;Most Recent Adult Depression Screening&quot;:
  AC.MostRecent((&quot;Has Adult Depression Screening&quot;))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="19"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString value="Most Recent Adult Screening Negative"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Most Recent Adult Screening Negative&quot;:
  (&quot;Most Recent Adult Depression Screening&quot; AdultScreening
    where AdultScreening.value ~ ToConcept(&quot;Depression Screening Negative&quot;)) is not null"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="20"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Most Recent Adult Positive Depression Screening"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Most Recent Adult Positive Depression Screening&quot;:
  &quot;Most Recent Adult Depression Screening&quot; RecentScreening
    where RecentScreening.value ~ ToConcept(&quot;Depression Screening Positive&quot;)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="21"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Follow Up Interventions For Positive Adult Depression Screening"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Follow Up Interventions For Positive Adult Depression Screening&quot;:
  ((AC.QualifiedMedicationRequests([MedicationRequest: &quot;Adult Depression Medications&quot;])
    union AC.QualifiedServiceRequests([ServiceRequest: &quot;Referral for Adult Depression&quot;])
    union AC.QualifiedProcedures([Procedure: &quot;Follow Up for Adult Depression&quot;]))) FollowUpInterventions
    let &quot;Intervention Day&quot;: Coalesce(FC.ToInterval(FollowUpInterventions.authoredOn), FC.ToInterval(FollowUpInterventions.performed))
    with &quot;Qualifying Encounters During Measurement Period&quot; QualifyingEnc
      such that &quot;Intervention Day&quot; same day as QualifyingEnc.period
      or &quot;Intervention Day&quot; 2 days or less after day of end of FC.ToInterval(QualifyingEnc.period)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="22"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Most Recent Adult Depression Screening Positive and Follow Up Provided"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Most Recent Adult Depression Screening Positive and Follow Up Provided&quot;:
  (&quot;Most Recent Adult Positive Depression Screening&quot; RecentScreening
  let &quot;Screening Day&quot;: Coalesce(FC.ToInterval(RecentScreening.effective), FC.ToInterval(RecentScreening.issued))
  with &quot;Follow Up Interventions For Positive Adult Depression Screening&quot; FollowUpInterventions
    such that &quot;Screening Day&quot; 14 days or less before start of Coalesce(FC.ToInterval(FollowUpInterventions.authoredOn), FC.ToInterval(FollowUpInterventions.performed))
  ) is not null"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="23"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Patient Age 18 Years or Older at Start of Measurement Period"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Patient Age 18 Years or Older at Start of Measurement Period&quot;:
  AgeInYearsAt(start of &quot;Measurement Period&quot;) &gt;= 18"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="24"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString value="Numerator"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Numerator&quot;:
  ( &quot;Patient Age 12 to 16 Years at Start of Measurement Period&quot;
      and ( &quot;Most Recent Adolescent Screening Negative&quot;
        or &quot;Most Recent Adolescent Depression Screening Positive and Follow Up Provided&quot; )
)
  or ( &quot;Patient Age 17 Years at Start of Measurement Period&quot;
    and ( &quot;Most Recent Adolescent Screening Negative&quot;
      or &quot;Most Recent Adolescent Depression Screening Positive and Follow Up Provided&quot;
      or &quot;Most Recent Adult Screening Negative&quot;
      or  &quot;Most Recent Adult Depression Screening Positive and Follow Up Provided&quot;) 
  )
  or ( &quot;Patient Age 18 Years or Older at Start of Measurement Period&quot;
    and ( &quot;Most Recent Adult Screening Negative&quot;
      or &quot;Most Recent Adult Depression Screening Positive and Follow Up Provided&quot; ) )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="25"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString value="Initial Population"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Initial Population&quot;:
  AgeInYearsAt(start of &quot;Measurement Period&quot;) &gt;= 12
    and exists(
      &quot;Qualifying Encounters During Measurement Period&quot; E 
        where FC.ToInterval(E.period) during &quot;Measurement Period&quot;
    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="26"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </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="27"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SupplementalDataElementsFHIR4"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Payer"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Payer&quot;:
  [Coverage: type in &quot;Payer&quot;] Payer
        return {
          code: Payer.type,
          period: Payer.period
        }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="28"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </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="29"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SurveillanceDataElementsFHIR4"/>
        </extension>
        <extension url="name">
          <valueString value="Food Insecurity Risk Status"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="// Jurisdiction of care (jurisdiction of the most recent encounter)
// TODO:
//define &quot;Most recent address of care&quot;:

// NOTE: Included in eICR
// Occupational Data for Health - Past or Present Job
// http://hl7.org/fhir/us/odh/StructureDefinition-odh-PastOrPresentJob.html
// Observation: LOINC#11341-5, valueCodeableConcept in https://phinvads.cdc.gov/vads/ViewValueSet.action?oid=2.16.840.1.114222.4.11.7186

// Social Determinants of Health (SDOH)
// http://build.fhir.org/ig/HL7/fhir-sdoh-clinicalcare/StructureDefinition-SDOHCC-ObservationScreeningResponse.html
// Food insecurity risk: http://build.fhir.org/ig/HL7/fhir-sdoh-clinicalcare/Observation-SDOHCC-ObservationResponseHungerVitalSignQuestion3Example.html
// Observation: LOINC#88124-3, valueCodeableConcept in https://loinc.org/LL2510-7/ (At risk, No risk)
define &quot;Food Insecurity Risk Status&quot;:
  First(
    [Observation: &quot;Food insecurity risk [HVS]&quot;] O
      sort by issued desc
  ).value as CodeableConcept"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="30"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Food Insecurity Risk Status"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Food Insecurity Risk Status&quot;:
  SurveillanceDataElements.&quot;Food Insecurity Risk Status&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="31"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SupplementalDataElementsFHIR4"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Ethnicity"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Ethnicity&quot;:
  (flatten (
      Patient.extension Extension
        where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity'
          return Extension.extension
    )) E
      where E.url = 'ombCategory'
        or E.url = 'detailed'
      return E.value as Coding"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="32"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </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="33"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SurveillanceDataElementsFHIR4"/>
        </extension>
        <extension url="name">
          <valueString value="Age"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="// Age
define &quot;Age&quot;:
  AgeInYearsAt(end of &quot;Measurement Period&quot;)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="34"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Age"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Age&quot;:
  SurveillanceDataElements.&quot;Age&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="35"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString
                       value="History of Bipolar Diagnosis Before Qualifying Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="//Denominator Exclusion 
define &quot;History of Bipolar Diagnosis Before Qualifying Encounter&quot;: 
  (AC.QualifiedConditions([Condition: &quot;Bipolar Disorder&quot;])) BipolarDiagnosis 
  with &quot;Qualifying Encounters During Measurement Period&quot; QualifyingEnc
    such that FC.ToPrevalenceInterval(BipolarDiagnosis) starts before QualifyingEnc.period"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="36"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString value="Denominator Exclusions"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Denominator Exclusions&quot;:
  exists(&quot;History of Bipolar Diagnosis Before Qualifying Encounter&quot;)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="37"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Medical or Patient Reason for Not Screening Adolescent for Depression"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="//Denominator Exception
define &quot;Medical or Patient Reason for Not Screening Adolescent for Depression&quot;:
  AC.AbsentData([Observation: &quot;Adolescent Depression Screening Assessment&quot;], &quot;Qualifying Encounters During Measurement Period&quot;, &quot;Depression Screening Declined&quot;, &quot;Medical Reason&quot;)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="38"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString
                       value="Medical or Patient Reason for Not Screening Adult for Depression"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Medical or Patient Reason for Not Screening Adult for Depression&quot;:
  AC.AbsentData([Observation: &quot;Adult Depression Screening Assessment&quot;], &quot;Qualifying Encounters During Measurement Period&quot;, &quot;Depression Screening Declined&quot;, &quot;Medical Reason&quot;)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="39"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString value="Denominator Exceptions"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Denominator Exceptions&quot;:
  (exists(&quot;Medical or Patient Reason for Not Screening Adolescent for Depression&quot;)
    and not exists(&quot;Has Adolescent Depression Screening&quot;))
  or (exists(&quot;Medical or Patient Reason for Not Screening Adult for Depression&quot;)
    and not exists(&quot;Has Adult Depression Screening&quot;))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="40"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToString(value AddressUse): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="41"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToString(value AddressType): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="42"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToInterval"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToInterval(period FHIR.Period):
    if period is null then
        null
    else
        if period.&quot;start&quot; is null then
            Interval(period.&quot;start&quot;.value, period.&quot;end&quot;.value]
        else
            Interval[period.&quot;start&quot;.value, period.&quot;end&quot;.value]"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="43"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-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="44"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToString(value AdministrativeGender): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="45"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AlphoraCommon"/>
        </extension>
        <extension url="name">
          <valueString value="MostRecent"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function MostRecent(observations List&lt;Observation&gt;):
  Last(
    observations O
      sort by start of FC.ToInterval(effective)
  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="46"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AlphoraCommon"/>
        </extension>
        <extension url="name">
          <valueString value="QualifiedObservations"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function QualifiedObservations(value List&lt;FHIR.Observation&gt;):
  value Observation
		where (
      //registered | preliminary | final | amended | corrected | cancelled | entered-in-error | unknown
      Observation.status ~ 'final'
			or Observation.status ~ 'amended'
			or Observation.status ~ 'corrected'
		)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="47"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToString(value ObservationStatus): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="48"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AlphoraCommon"/>
        </extension>
        <extension url="name">
          <valueString value="QualifiedEncounters"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/* Common Resource Qualifications and Negations */
define function QualifiedEncounters(value List&lt;FHIR.Encounter&gt;):
  value Encounter
    where (
      //planned | arrived | triaged | in-progress | onleave | finished | cancelled | entered-in-error | unknown
      Encounter.status ~ 'arrived'
      or Encounter.status ~ 'in-progress'
      or Encounter.status ~ 'finished'
      or Encounter.status ~ 'onleave'
      or Encounter.status ~ 'triaged'
    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="49"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToString(value EncounterStatus): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="50"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="ToInterval"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
@comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range types
to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible
representations for timing-valued elements in FHIR, allowing this function to be used across any resource.

The input can be provided as a dateTime, Period, Timing, instant, string, Age, or Range.
The intent of this function is to provide a clear and concise mechanism to treat single
elements that have multiple possible representations as intervals so that logic doesn't have to account
for the variability. More complex calculations (such as medication request period or dispense period
calculation) need specific guidance and consideration. That guidance may make use of this function, but
the focus of this function is on single element calculations where the semantics are unambiguous.
If the input is a dateTime, the result a DateTime Interval beginning and ending on that dateTime.
If the input is a Period, the result is a DateTime Interval.
If the input is a Timing, an error is raised indicating a single interval cannot be computed from a Timing.
If the input is an instant, the result is a DateTime Interval beginning and ending on that instant.
If the input is a string, an error is raised indicating a single interval cannot be computed from a string.
If the input is an Age, the result is a DateTime Interval beginning when the patient was the given Age,
and ending immediately prior to when the patient was the given Age plus one year.
If the input is a Range, the result is a DateTime Interval beginning when the patient was the Age given
by the low end of the Range, and ending immediately prior to when the patient was the Age given by the
high end of the Range plus one year.

NOTE: Due to the
complexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used
with a Timing or String.
*/
define function ToInterval(choice Choice&lt;FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range&gt;):
  case
	  when choice is FHIR.dateTime then
    	Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]
		when choice is FHIR.Period then
  		FHIRHelpers.ToInterval(choice as FHIR.Period)
		when choice is FHIR.instant then
			Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]
		when choice is FHIR.Age then
		  Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),
			  FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)
		when choice is FHIR.Range then
		  Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),
			  FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)
		when choice is FHIR.Timing then
			//Interval[FHIRHelpers.ToDateTime(choice as FHIR.timing), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]
		  Message(null as Interval&lt;DateTime&gt;, true, '1', 'Error', 'Cannot compute a single interval from a Timing type')
    when choice is FHIR.string then
      Message(null as Interval&lt;DateTime&gt;, true, '1', 'Error', 'Cannot compute an interval from a String value')
		else
			null as Interval&lt;DateTime&gt;
	end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="51"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToDateTime"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToDateTime(value dateTime): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="52"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToDateTime"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToDateTime(value instant): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="53"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToDate"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToDate(value date): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="54"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToQuantity"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToQuantity(quantity FHIR.Quantity):
    case
        when quantity is null then null
        when quantity.value is null then null
        when quantity.comparator is not null then
            Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')
        when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'
              or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then
            System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }
        else
            Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' &amp; quantity.unit.value &amp; ' (' &amp; quantity.system.value &amp; '|' &amp; quantity.code.value &amp; ')')
    end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="55"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToCalendarUnit"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToCalendarUnit(unit System.String):
    case unit
        when 'ms' then 'millisecond'
        when 's' then 'second'
        when 'min' then 'minute'
        when 'h' then 'hour'
        when 'd' then 'day'
        when 'wk' then 'week'
        when 'mo' then 'month'
        when 'a' then 'year'
        else unit
    end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="56"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="DepressionScreeningandFollowUp"/>
        </extension>
        <extension url="name">
          <valueString value="Screening Within 14 Days of Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function &quot;Screening Within 14 Days of Encounter&quot;(observation FHIR.Observation, encounter FHIR.Encounter)
returns System.Boolean:
  Coalesce(end of FC.ToInterval(observation.effective), observation.issued) 14 days or less before day of start of encounter.period
    and observation.value is not null"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="57"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToConcept"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="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="58"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToCode"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="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="59"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AlphoraCommon"/>
        </extension>
        <extension url="name">
          <valueString value="QualifiedMedicationRequests"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function QualifiedMedicationRequests(value List&lt;FHIR.MedicationRequest&gt;):
  value MedicationRequest
    where (
      //active | on-hold | cancelled | completed | entered-in-error | stopped | draft | unknown
      (MedicationRequest.status ~ 'active'
        or MedicationRequest.status ~ 'completed'
      )
        and (
          MedicationRequest.doNotPerform is null
          or MedicationRequest.doNotPerform = false
        )
        and MedicationRequest.intent ~ 'order'
    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="60"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToString(value MedicationRequestStatus): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="61"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToBoolean"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToBoolean(value boolean): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="62"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToString(value MedicationRequestIntent): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="63"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToString(value string): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="64"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AlphoraCommon"/>
        </extension>
        <extension url="name">
          <valueString value="QualifiedServiceRequests"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function QualifiedServiceRequests(value List&lt;FHIR.ServiceRequest&gt;):
  value ServiceRequest
    where (
      //draft | active | on-hold | revoked | completed | entered-in-error | unknown
      ServiceRequest.status ~ 'active'
      or ServiceRequest.status ~ 'completed'
      and ServiceRequest.intent ~ 'order'
    )
    and (
      ServiceRequest.doNotPerform is null
      or ServiceRequest.doNotPerform = false
    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="65"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToString(value ServiceRequestStatus): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="66"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToString(value ServiceRequestIntent): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="67"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AlphoraCommon"/>
        </extension>
        <extension url="name">
          <valueString value="QualifiedProcedures"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function QualifiedProcedures(value List&lt;FHIR.Procedure&gt;):
  value Procedure
    where (
      //preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown
      Procedure.status ~ 'completed'
    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="68"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToString(value ProcedureStatus): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="69"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AlphoraCommon"/>
        </extension>
        <extension url="name">
          <valueString value="QualifiedConditions"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function QualifiedConditions(value List&lt;FHIR.Condition&gt;):
  value Condition
    where (
      FHIRHelpers.ToConcept(Condition.clinicalStatus) ~ FC.&quot;active&quot;
    )
    and (
      FHIRHelpers.ToConcept(Condition.verificationStatus) ~ FC.&quot;confirmed&quot;
    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="70"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="ToPrevalenceInterval"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns an interval representing the normalized prevalence period of a given Condition resource.
@comment: Uses the ToInterval and ToAbatementInterval functions to determine the widest potential interval from
onset to abatement as specified in the given Condition.
*/
define function ToPrevalenceInterval(condition Condition):
if condition.clinicalStatus ~ &quot;active&quot;
  or condition.clinicalStatus ~ &quot;recurrence&quot;
  or condition.clinicalStatus ~ &quot;relapse&quot; then
  Interval[start of ToInterval(condition.onset), end of ToAbatementInterval(condition)]
else
  Interval[start of ToInterval(condition.onset), end of ToAbatementInterval(condition))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="71"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRCommon"/>
        </extension>
        <extension url="name">
          <valueString value="ToAbatementInterval"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns an interval representing the normalized Abatement of a given Condition resource.
@comment: NOTE: Due to the complexity of determining an interval from a String, this function will throw
a run-time exception if used with a Condition instance that has a String as the abatement value.
*/
define function ToAbatementInterval(condition Condition):
	if condition.abatement is FHIR.dateTime then
	  Interval[FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime), FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime)]
	else if condition.abatement is FHIR.Period then
	  FHIRHelpers.ToInterval(condition.abatement as FHIR.Period)
	else if condition.abatement is FHIR.string then
    Message(null as Interval&lt;DateTime&gt;, true, '1', 'Error', 'Cannot compute an interval from a String value')
	else if condition.abatement is FHIR.Age then
		Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age),
			FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age) + 1 year)
	else if condition.abatement is FHIR.Range then
	  Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).low),
		  FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).high) + 1 year)
	else if condition.abatement is FHIR.boolean then
	  Interval[end of ToInterval(condition.onset), condition.recordedDate)
	else null"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="72"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AlphoraCommon"/>
        </extension>
        <extension url="name">
          <valueString value="AbsentData"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function AbsentData(observation List&lt;FHIR.Observation&gt;, enc List&lt;FHIR.Encounter&gt;, code1 System.Code, valueset1 System.ValueSet)
returns List&lt;FHIR.Observation&gt;:
  (QualifiedObservations(observation)) Obs
    with enc QualifyingEnc
      such that Coalesce(end of FC.ToInterval(Obs.effective), end of FC.ToInterval(Obs.issued)) same day as end of QualifyingEnc.period
    where exists(
        Obs.component c where(
            c.code as CodeableConcept ~ code1
            or c.code as CodeableConcept in valueset1
        ))
      and not exists(Obs.component c where(c.value is not null))
      or (ResourceNotDone(Obs).value as FHIR.boolean = true
        and (ResourceNotDoneReason(Obs).value as CodeableConcept ~ code1
        or ResourceNotDoneReason(Obs).value as CodeableConcept in valueset1))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="73"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AlphoraCommon"/>
        </extension>
        <extension url="name">
          <valueString value="ResourceNotDone"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ResourceNotDone(notDone DomainResource):
  QICoreModifierExtension(notDone, 'qicore-notDone')"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="74"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AlphoraCommon"/>
        </extension>
        <extension url="name">
          <valueString value="QICoreModifierExtension"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function QICoreModifierExtension(domainResource DomainResource, url String):
  singleton from QICoreModifierExtensions(domainResource, url)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="75"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AlphoraCommon"/>
        </extension>
        <extension url="name">
          <valueString value="QICoreModifierExtensions"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/* QI-CORE Extensions */

/*
NOTE: Extensions are not the preferred approach, but are used as a way to access
content that is defined by extensions but not yet surfaced in the
CQL model info.
*/
define function QICoreModifierExtensions(domainResource DomainResource, url String):
  domainResource.modifierExtension E
    where E.url = ('http://hl7.org/fhir/us/qicore/StructureDefinition/' + url)
    return E"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="76"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AlphoraCommon"/>
        </extension>
        <extension url="name">
          <valueString value="ResourceNotDoneReason"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ResourceNotDoneReason(notDoneReason DomainResource):
  QICoreExtension(notDoneReason, 'qicore-notDoneReason')"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="77"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AlphoraCommon"/>
        </extension>
        <extension url="name">
          <valueString value="QICoreExtension"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function QICoreExtension(domainResource DomainResource, url String):
  singleton from QICoreExtensions(domainResource, url)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="78"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AlphoraCommon"/>
        </extension>
        <extension url="name">
          <valueString value="QICoreExtensions"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function QICoreExtensions(domainResource DomainResource, url String):
  domainResource.extension E
    where E.url = ('http://hl7.org/fhir/us/qicore/StructureDefinition/' + url)
    return E"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="79"/>
        </extension>
      </extension>
      <name value="EffectiveDataRequirements"/>
      <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 SurveillanceDataElements"/>
        <resource
                  value="http://fhir.org/guides/cqf/aphl/chronic-ds/Library/SurveillanceDataElementsFHIR4|1.0.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library FHIRHelpers"/>
        <resource
                  value="http://fhir.org/guides/cqf/aphl/chronic-ds/Library/FHIRHelpers|4.1.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library SDE"/>
        <resource
                  value="http://fhir.org/guides/cqf/aphl/chronic-ds/Library/SupplementalDataElementsFHIR4|2.0.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library AC"/>
        <resource
                  value="http://fhir.org/guides/cqf/aphl/chronic-ds/Library/AlphoraCommon"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library FC"/>
        <resource
                  value="http://fhir.org/guides/cqf/aphl/chronic-ds/Library/FHIRCommon|1.1.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library Common"/>
        <resource
                  value="http://fhir.org/guides/cqf/aphl/chronic-ds/Library/MATGlobalCommonFunctionsFHIR4|6.0.000"/>
      </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="Code system LOINC"/>
        <resource value="http://loinc.org"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system ConditionClinicalStatusCodes"/>
        <resource
                  value="http://terminology.hl7.org/CodeSystem/condition-clinical"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system ConditionVerificationStatusCodes"/>
        <resource
                  value="http://terminology.hl7.org/CodeSystem/condition-ver-status"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display
                 value="Value set Adolescent Depression Screening Assessment"/>
        <resource
                  value="http://fhir.org/guides/cqf/aphl/chronic-ds/ValueSet/adolescent-depression-screening-assessment"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Encounter to Screen for Depression"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1916"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Physical Therapy Evaluation"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1022"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Telephone Visits"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Adolescent Depression Medications"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1567"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Referral for Adolescent Depression"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1570"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Follow Up for Adolescent Depression"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1569"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Adult Depression Screening Assessment"/>
        <resource
                  value="http://fhir.org/guides/cqf/aphl/chronic-ds/ValueSet/adult-depression-screening-assessment"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Adult Depression Medications"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1566"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Referral for Adult Depression"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1571"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Follow Up for Adult Depression"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1568"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Payer"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Bipolar Disorder"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.67.1.101.1.128"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Medical Reason"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1007"/>
      </relatedArtifact>
      <parameter>
        <name value="Measurement Period"/>
        <use value="in"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Period"/>
      </parameter>
      <parameter>
        <name value="SDE Postal Code of Residence"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="string"/>
      </parameter>
      <parameter>
        <name value="SDE State of Residence"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="string"/>
      </parameter>
      <parameter>
        <name value="SDE Race"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Coding"/>
      </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="1"/>
        <type value="boolean"/>
      </parameter>
      <parameter>
        <name value="Denominator"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="boolean"/>
      </parameter>
      <parameter>
        <name value="SDE Payer"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Resource"/>
      </parameter>
      <parameter>
        <name value="SDE Food Insecurity Risk Status"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="CodeableConcept"/>
      </parameter>
      <parameter>
        <name value="Initial Population"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="boolean"/>
      </parameter>
      <parameter>
        <name value="SDE Ethnicity"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Coding"/>
      </parameter>
      <parameter>
        <name value="SDE Age"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="integer"/>
      </parameter>
      <parameter>
        <name value="Denominator Exclusions"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="boolean"/>
      </parameter>
      <parameter>
        <name value="Denominator Exceptions"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="boolean"/>
      </parameter>
      <dataRequirement>
        <type value="Patient"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
        <mustSupport value="use"/>
        <mustSupport value="type"/>
        <mustSupport value="url"/>
        <mustSupport value="extension"/>
        <mustSupport value="value"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1916"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1022"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <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.1080"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="value"/>
        <mustSupport value="effective"/>
        <mustSupport value="issued"/>
        <mustSupport value="component"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://fhir.org/guides/cqf/aphl/chronic-ds/ValueSet/adolescent-depression-screening-assessment"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="value"/>
        <mustSupport value="effective"/>
        <mustSupport value="issued"/>
        <mustSupport value="component"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://fhir.org/guides/cqf/aphl/chronic-ds/ValueSet/adult-depression-screening-assessment"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="value"/>
        <mustSupport value="effective"/>
        <mustSupport value="issued"/>
        <mustSupport value="component"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://loinc.org"/>
            <code value="88124-3"/>
            <display value="Food insecurity risk [HVS]"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="MedicationRequest"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/MedicationRequest"/>
        <mustSupport value="medication"/>
        <mustSupport value="status"/>
        <mustSupport value="doNotPerform"/>
        <mustSupport value="intent"/>
        <codeFilter>
          <path value="medication"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1567"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="MedicationRequest"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/MedicationRequest"/>
        <mustSupport value="medication"/>
        <mustSupport value="status"/>
        <mustSupport value="doNotPerform"/>
        <mustSupport value="intent"/>
        <codeFilter>
          <path value="medication"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1566"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="MedicationRequest"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/MedicationRequest"/>
        <mustSupport value="medication.reference"/>
        <mustSupport value="status"/>
        <mustSupport value="doNotPerform"/>
        <mustSupport value="intent"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Medication"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Medication"/>
        <mustSupport value="id"/>
        <mustSupport value="code"/>
      </dataRequirement>
      <dataRequirement>
        <type value="ServiceRequest"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/ServiceRequest"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="intent"/>
        <mustSupport value="doNotPerform"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1570"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="ServiceRequest"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/ServiceRequest"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="intent"/>
        <mustSupport value="doNotPerform"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1571"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Procedure"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Procedure"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1569"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Procedure"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Procedure"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1568"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Coverage"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/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>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Condition"/>
        <mustSupport value="code"/>
        <mustSupport value="clinicalStatus"/>
        <mustSupport value="verificationStatus"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.67.1.101.1.128"/>
        </codeFilter>
      </dataRequirement>
    </Library>
  </contained>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-softwaresystem" id="cqf-tooling">
    <valueReference>
      <reference value="Device/cqf-tooling"/>
    </valueReference>
  </extension>
  <extension
             url="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements">
    <valueCanonical value="#effective-data-requirements"/>
  </extension>
  <url
       value="http://fhir.org/guides/cqf/aphl/chronic-ds/Measure/DepressionScreeningandFollowUp"/>
  <identifier>
    <use value="usual"/>
    <system value="short-name"/>
    <value value="CMS2v13"/>
  </identifier>
  <identifier>
    <use value="official"/>
    <system value="publisher"/>
    <value value="134"/>
  </identifier>
  <identifier>
    <use value="official"/>
    <system value="http://hl7.org/fhir/cqi/ecqm/Measure/Identifier/guid"/>
    <value value="2c928083-8651-08a3-0186-c82995a91d28"/>
  </identifier>
  <version value="0.1.0"/>
  <name value="DepressionScreeningandFollowUp"/>
  <title
         value="Preventive Care and Screening: Screening for Depression and Follow-Up Plan"/>
  <status value="draft"/>
  <experimental value="false"/>
  <date value="2025-09-25T07:40:03-06:00"/>
  <publisher value="Clinical Quality Framework"/>
  <contact>
    <telecom>
      <system value="url"/>
      <value value="http://cqframework.org"/>
    </telecom>
  </contact>
  <description
               value="Percentage of patients aged 12 years and older screened for depression on the date of the encounter or up to 14 days prior to the date of the encounter using an age-appropriate standardized depression screening tool AND if positive, a follow-up plan is documented on the date of or up to two days after the date of the qualifying encounter"/>
  <jurisdiction>
    <coding>
      <system value="http://unstats.un.org/unsd/methods/m49/m49.htm"/>
      <code value="001"/>
    </coding>
  </jurisdiction>
  <purpose value="Unknown"/>
  <copyright
             value="Limited proprietary coding is contained in the measure specifications for convenience. Users of the proprietary code sets should obtain all necessary licenses from the owners of these code sets. 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."/>
  <effectivePeriod>
    <start value="2024-01-01"/>
    <end value="2024-12-31"/>
  </effectivePeriod>
  <library
           value="http://fhir.org/guides/cqf/aphl/chronic-ds/Library/DepressionScreeningandFollowUp"/>
  <disclaimer
              value="These performance measures are not clinical guidelines and do not establish a standard of medical care, and have not been tested for all potential applications. THE MEASURES AND SPECIFICATIONS ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND. Due to technical limitations, registered trademarks are indicated by (R) or [R] and unregistered trademarks are indicated by (TM) or [TM]."/>
  <scoring>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/measure-scoring"/>
      <code value="proportion"/>
      <display value="Proportion"/>
    </coding>
  </scoring>
  <type>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/measure-type"/>
      <code value="process"/>
      <display value="process"/>
    </coding>
  </type>
  <rationale
             value="Depression affects more than two hundred sixty million people across the world and is a leading cause of disability, with a variety of depressive disorders that are independent risk factors for chronic diseases, such as cardiovascular disease and diabetes, lending screening for depression as paramount to identify depressive disorders that can affect the most vulnerable populations (Costantini et al., 2021). Results from a 2018 U.S. survey indicated that 14.4 percent of adolescents (3.5 million adolescents) had a major depressive episode (MDE) in the past year, with nine percent of adolescents (2.4 million adolescents) having one MDE with severe impairment (Substance Abuse and Mental Health Services Administration, 2019). The odds of a diagnosis of depression are believed to be 2.6 times greater for children and adolescents exposed to trauma as compared to those unexposed or less exposed (Vibhakar et al., 2019). Children and teens with major depressive disorder (MDD) have been found to have difficulty carrying out their daily activities, relating to others, growing up healthy, and are at an increased risk of suicide (Siu on behalf of the U.S. Preventive Services Task Force [USPSTF], 2016). The same 2018 study indicated that 7.2 percent of adults aged 18 or older (17.7 million adults) had at least one MDE with 4.7 percent of adults (11.5 million adults) having one MDE with severe impairment in the past year (Substance Abuse and Mental Health Services Administration, 2019). Moreover, it is estimated 22.9 percent of adult patients with chronic pain (2.2 million adults) were diagnosed with comorbid depression from 2011 to 2015, with an upward trend of prevalence among Black Americans, patients aged 65 to 84 years old, Medicare and Medicaid insured patients, and patients from zip code areas with low annual household incomes (Orhurhu et al., 2019). Depression and other mood disorders, such as bipolar disorder and anxiety disorders, especially during the perinatal period, can have devastating effects on women, infants, and families (American College of Obstetricians and Gynecologists, 2018). It's estimated that the global prevalence of antenatal (or perinatal) depression ranges from 15 to 65 percent, with current or previous exposure to abuse and violence, lack of social support, and family history of mental disorders being risk factors. Depressive symptoms measured during pregnancy have been shown to influence the quality of the postpartum mother-infant relationship (Hazell Raine et al., 2020). Additionally, the risk of low birth weight and preterm birth is higher among infants born from depressed mothers (Dadi, Miller, Bisetegn, &amp; Mwanri, 2020). Negative outcomes associated with depression make it crucial to screen in order to identify and treat depression in its early stages. Multiple social costs of depression have been identified, such as reduced educational achievements, poor financial success and role performance, higher amount of days out of role, and increased risk of job loss (Costantini et al., 2021). Depression also imposes significant economic burden through direct and indirect costs, supporting the need for regular depression screening. &quot;In the United States, an estimated $22.8 billion was spent on depression treatment in 2009, and lost productivity cost an additional estimated $23 billion in 2011&quot; (Siu &amp; USPSTF, 2016, p. 383-384). Numerous studies have found significant disparities in depression prevalence and treatment among racial/ethnic minorities. One study revealed that Indigenous adults are at a high risk for posttraumatic stress disorder, depression, suicide, substance use disorder, and concurrent behavioral health disorders secondary to these initial health problems (Ka’apu and Burnette, 2019). Additionally, though rates of depression are lower among Blacks and Hispanics than among whites, depression among Blacks and Hispanics is likely to be more recurrent. Furthermore, 48 percent of whites receive mental health services, compared to just 31 percent of Blacks and Hispanics, and 22 percent of Asians (American Psychiatric Association, 2017). Asian Americans and Black Americans are also significantly more likely to utilize emergency rooms for depression treatment, which contributes to inconsistent follow-up care (Lee et al., 2014). While primary care providers (PCPs) serve as the first line of defense in the detection of depression, studies show that PCPs fail to recognize up to 46 percent of depressed patients (Borner et al., 2010). &quot;In nationally representative U.S. surveys, about eight percent of adolescents reported having major depression in the past year. Only 36 percent to 44 percent of children and adolescents with depression receive treatment, suggesting that the majority of depressed youth are undiagnosed and untreated&quot; (Siu on behalf of USPSTF, 2016, p. 360 &amp; p. 364). Furthermore, evidence supports that screening for depression in pregnant and postpartum women is of moderate net benefit, and treatment options for positive depression screening should be available for patients twelve and older including pregnant and postpartum women. This measure seeks to align with USPSTF clinical guideline recommendations as well as the Healthy People 2030 recommendation to increase the proportion of adolescents and adults who are screened and receive treatment for depression (U.S. Preventive Services Task Force, 2016) and makes an important contribution to the quality domain of community and population health."/>
  <clinicalRecommendationStatement
                                   value="Adolescent Recommendation (12-18 years): &quot;The USPSTF recommends screening for MDD in adolescents aged 12 to 18 years. Screening should be implemented with adequate systems in place to ensure accurate diagnosis, effective treatment, and appropriate follow-up (B recommendation)&quot; (Siu on behalf of USPSTF, 2016, p. 360). Adult Recommendation (18 years and older): &quot;The USPSTF recommends screening for depression in the general adult population, including pregnant and postpartum women. Screening should be implemented with adequate systems in place to ensure accurate diagnosis, effective treatment, and appropriate follow-up (B recommendation)&quot; (Siu &amp; USPSTF, 2016, p. 380). “The USPSTF recommends that clinicians provide or refer pregnant and postpartum persons who are at increased risk of perinatal depression to counseling interventions (B recommendation)” (U.S. Preventive Services Task Force, 2019). The American College of Obstetricians and Gynecologists (ACOG) provides the following recommendation: &quot;All obstetrician–gynecologists and other obstetric care providers should complete a full assessment of mood and emotional well-being (including screening for postpartum depression and anxiety with a validated instrument) during the comprehensive postpartum visit for each patient&quot; (American College of Obstetricians and Gynecologists, 2018). The Institute for Clinical Systems Improvement (ICSI) health care guideline, Adult Depression in Primary Care, provides the following recommendations: 1. &quot;Clinicians should routinely screen all adults for depression using a standardized instrument.&quot; 2. &quot;Clinicians should establish and maintain follow-up with patients.&quot; 3. &quot;Clinicians should screen and monitor depression in pregnant and post-partum women&quot; (Trangle et al., 2016, p. 8-10)."/>
  <improvementNotation>
    <coding>
      <system
              value="http://terminology.hl7.org/CodeSystem/measure-improvement-notation"/>
      <code value="increase"/>
      <display value="Higher score indicates better quality"/>
    </coding>
  </improvementNotation>
  <guidance
            value="The intent of the measure is to screen for new cases of depression in patients who have never had a diagnosis of bipolar disorder. Patients who have ever been diagnosed with bipolar disorder prior to the qualifying encounter used to evaluate the numerator will be excluded from the measure regardless of whether the diagnosis is active or not.
A depression screen is completed on the date of the encounter or up to 14 calendar days prior to the date of the encounter using an age-appropriate standardized depression screening tool AND if positive, a follow-up plan must be documented on the date of or up to two calendar days after the date of the encounter, such as referral to a provider for additional evaluation, pharmacological interventions, or other interventions for the treatment of depression. An example to illustrate the follow-up plan documentation timing: if the encounter is on a Monday from 3-4 pm (day 0) and the patient screens positive, the clinician has through anytime on Wednesday (day 2) to complete follow-up plan documentation.
This measure does not require documentation of a specific score, just whether results of the normalized and validated depression screening tool used are considered positive or negative. Each standardized screening tool provides guidance on whether a particular score is considered positive for depression. 
This eCQM is a patient-based measure. Depression screening is required once per measurement period, not at all encounters. 
Screening Tools:
 -  An age-appropriate, standardized, and validated depression screening tool must be used for numerator compliance.
 -  The name of the age-appropriate standardized depression screening tool utilized must be documented in the medical record.
 -  The depression screening must be reviewed and addressed by the provider, filing the code, on the date of the encounter. Positive pre-screening results indicating a patient is at high risk for self-harm should receive more urgent intervention as determined by the provider practice.
 -  The screening should occur during a qualifying encounter or up to 14 calendar days prior to the date of the qualifying encounter.
 -  The measure assesses the most recent depression screening completed either during the qualifying encounter or within the 14 calendar days prior to that encounter. Therefore, a clinician would not be able to complete another screening at the time of the encounter to count towards a follow-up, because that would serve as the most recent screening. In order to satisfy the follow-up requirement for a patient screening positively, the eligible clinician would need to provide one of the aforementioned follow-up actions, which does not include use of a standardized depression screening tool.
Follow-Up Plan:
The follow-up plan MUST still be provided for and discussed with the patient during the qualifying encounter used to evaluate the numerator. However, documentation of the follow-up plan can occur up to two calendar days after the qualifying encounter, in accordance with the policies of an eligible clinician or provider’s practice or health system. All services should be documented during, or as soon as practicable, after the qualifying encounter in order to maintain an accurate medical record.
The follow-up plan must be related to a positive depression screening, for example: \&quot;Patient referred for psychiatric evaluation due to positive depression screening.\&quot;
Examples of a follow-up plan include but are not limited to: 
 -  Referral to a provider or program for further evaluation for depression, for example, referral to a psychiatrist, psychiatric nurse practitioner, psychologist, clinical social worker, mental health counselor, or other mental health service such as family or group therapy, support group, depression management program, or other service for treatment of depression
 -  Other interventions designed to treat depression such as behavioral health evaluation, psychotherapy, pharmacological interventions, or additional treatment options
Should a patient screen positive for depression, a clinician should:
-  Only order pharmacological intervention when appropriate and after sufficient diagnostic evaluation. However, for the purposes of this measure, additional screening and assessment during the qualifying encounter will not qualify as a follow-up plan.
-  Opt to complete a suicide risk assessment when appropriate and based on individual patient characteristics. However, for the purposes of this measure, a suicide risk assessment or additional screening using a standardized tool will not qualify as a follow-up plan.
This version of the eCQM uses QDM version 5.6. Please refer to the eCQI resource center (https://ecqi.healthit.gov/qdm) for more information on the QDM."/>
  <group>
    <population id="AD83208C-1313-401E-BB62-ABCCE0982B49">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="initial-population"/>
          <display value="Initial Population"/>
        </coding>
      </code>
      <description
                   value="All patients aged 12 years and older at the beginning of the measurement period with at least one qualifying encounter during the measurement period"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Initial Population"/>
      </criteria>
    </population>
    <population id="696066C7-C558-4849-A325-A3CDDB58CF8F">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="denominator"/>
          <display value="Denominator"/>
        </coding>
      </code>
      <description
                   value="All patients aged 12 years and older at the beginning of the measurement period with at least one qualifying encounter during the measurement period"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Denominator"/>
      </criteria>
    </population>
    <population id="E2557B71-1B97-413F-BE26-2B037E4D590B">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="numerator"/>
          <display value="Numerator"/>
        </coding>
      </code>
      <description
                   value="Patients screened for depression on the date of the encounter or up to 14 days prior to the date of the encounter using an age-appropriate standardized tool AND if positive, a follow-up plan is documented on the date of or up to two days after the date of the qualifying encounter"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Numerator"/>
      </criteria>
    </population>
    <population id="E52F7FAE-96D9-417A-8538-6E3DB4A31D7A">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="denominator-exclusion"/>
          <display value="Denominator Exclusions"/>
        </coding>
      </code>
      <description
                   value="Patients who have ever been diagnosed with bipolar disorder at any time prior to the qualifying encounter"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Denominator Exclusions"/>
      </criteria>
    </population>
    <population id="FBA7B9D9-8588-4CB2-AB72-642CBD980334">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="denominator-exception"/>
          <display value="Denominator Exceptions"/>
        </coding>
      </code>
      <description
                   value="Patient Reason(s) Patient refuses to participate in or complete the depression screening OR Medical Reason(s) Documentation of medical reason for not screening patient for depression"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Denominator Exceptions"/>
      </criteria>
    </population>
    <stratifier id="stratifier-ethnicity">
      <code>
        <coding>
          <system value="http://loinc.org"/>
          <code value="54133-4"/>
          <display value="Ethnicity"/>
        </coding>
      </code>
      <description value="Ethnicity (CDC Value Set)"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="SDE Ethnicity"/>
      </criteria>
    </stratifier>
    <stratifier id="stratifier-payer">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/coverage-class"/>
          <code value="plan"/>
          <display value="SDE Payer"/>
        </coding>
      </code>
      <description value="Payer"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="SDE Payer"/>
      </criteria>
    </stratifier>
    <stratifier id="stratifier-race">
      <code>
        <coding>
          <system value="http://loinc.org"/>
          <code value="32624-9"/>
          <display value="SDE Race"/>
        </coding>
      </code>
      <description value="Race (CDC Value Set)"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="SDE Race"/>
      </criteria>
    </stratifier>
    <stratifier id="stratifier-sex">
      <code>
        <coding>
          <system value="http://loinc.org"/>
          <code value="72143-1"/>
          <display value="Sex [HL7.v3]"/>
        </coding>
      </code>
      <description value="Administrative sex"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="SDE Sex"/>
      </criteria>
    </stratifier>
    <stratifier id="stratifier-age">
      <code>
        <coding>
          <system value="http://loinc.org"/>
          <code value="30525-0"/>
          <display value="Age"/>
        </coding>
      </code>
      <description value="Age"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="SDE Age"/>
      </criteria>
    </stratifier>
    <stratifier id="stratifier-state-of-residence">
      <code>
        <coding>
          <system value="http://loinc.org"/>
          <code value="52830-7"/>
          <display value="State, district or territory federal abbreviation"/>
        </coding>
      </code>
      <description value="State of residence"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="SDE State of Residence"/>
      </criteria>
    </stratifier>
    <stratifier id="stratifier-postal-code-of-residence">
      <code>
        <coding>
          <system value="http://loinc.org"/>
          <code value="45401-7"/>
          <display value="Postal code"/>
        </coding>
      </code>
      <description value="Postal code of residence"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="SDE Postal Code of Residence"/>
      </criteria>
    </stratifier>
    <stratifier id="stratifier-food-insecurity-risk-status">
      <code>
        <coding>
          <system value="http://loinc.org"/>
          <code value="88124-3"/>
          <display value="Food insecurity risk [HVS]"/>
        </coding>
      </code>
      <description value="Food insecurity risk status"/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="SDE Food Insecurity Risk Status"/>
      </criteria>
    </stratifier>
  </group>
  <supplementalData id="sde-ethnicity">
    <code>
      <coding>
        <system value="http://loinc.org"/>
        <code value="54133-4"/>
        <display value="Ethnicity"/>
      </coding>
    </code>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="Ethnicity (CDC Value Set)"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Ethnicity"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-payer">
    <code>
      <coding>
        <system value="http://terminology.hl7.org/CodeSystem/coverage-class"/>
        <code value="plan"/>
        <display value="SDE Payer"/>
      </coding>
    </code>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="Payer"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Payer"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-race">
    <code>
      <coding>
        <system value="http://loinc.org"/>
        <code value="32624-9"/>
        <display value="SDE Race"/>
      </coding>
    </code>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="Race (CDC Value Set)"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Race"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-sex">
    <code>
      <coding>
        <system value="http://loinc.org"/>
        <code value="72143-1"/>
        <display value="Sex [HL7.v3]"/>
      </coding>
    </code>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="Administrative sex"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Sex"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-age">
    <code>
      <coding>
        <system value="http://loinc.org"/>
        <code value="30525-0"/>
        <display value="Age"/>
      </coding>
    </code>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="Age"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Age"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-state-of-residence">
    <code>
      <coding>
        <system value="http://loinc.org"/>
        <code value="52830-7"/>
        <display value="State, district or territory federal abbreviation"/>
      </coding>
    </code>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="State of residence"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE State of Residence"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-postal-code-of-residence">
    <code>
      <coding>
        <system value="http://loinc.org"/>
        <code value="45401-7"/>
        <display value="Postal code"/>
      </coding>
    </code>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="Postal code of residence"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Postal Code of Residence"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-food-insecurity-risk-status">
    <code>
      <coding>
        <system value="http://loinc.org"/>
        <code value="88124-3"/>
        <display value="Food insecurity risk [HVS]"/>
      </coding>
    </code>
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="Food insecurity risk status"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Food Insecurity Risk Status"/>
    </criteria>
  </supplementalData>
</Measure>