2022 CDC Clinical Practice Guideline for Prescribing Opioids Implementation Guide
2022.1.0 - CI Build

2022 CDC Clinical Practice Guideline for Prescribing Opioids Implementation Guide, published by Centers for Disease Control and Prevention (CDC). This guide is not an authorized publication; it is the continuous build for version 2022.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/opioid-cds-r4/ and changes regularly. See the Directory of published versions

: PlanDefinition - 2022 CDC Clinical Practice Guideline for Prescribing Opioids for Pain: Recommendation #10 (patient-view) - XML Representation

Draft as of 2023-05-01

Raw xml | Download



<PlanDefinition xmlns="http://hl7.org/fhir">
  <id value="opioidcds-10-patient-view"/>
  <meta>
    <profile
             value="http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-recommendationdefinition"/>
    <profile
             value="http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-publishableplandefinition"/>
  </meta>
  <text>
    <status value="extensions"/>
    <div xmlns="http://www.w3.org/1999/xhtml">
    <table class="grid dict">
        
        <tr>
            <th scope="row"><b>Id: </b></th>
            <td style="padding-left: 4px;">opioidcds-10-patient-view</td>
        </tr>
        
        
        <tr>
            <th scope="row"><b>Url: </b></th>
            <td style="padding-left: 4px;"><a href="PlanDefinition-opioidcds-10-patient-view.html">PlanDefinition - 2022 CDC Clinical Practice Guideline for Prescribing Opioids for Pain: Recommendation #10 (patient-view)</a></td>
        </tr>
        
        
        <tr>
            <th scope="row"><b>Version: </b></th>
            <td style="padding-left: 4px;">2022.1.0</td>
        </tr>
        
        
        <tr>
            <th scope="row"><b>Identifier: </b></th>
            <td style="padding-left: 4px;">
                
                
                <p style="margin-bottom: 5px;">
                    <b>value: </b> <span>cdc-opioid-guidance</span>
                </p>
                
            </td>
        </tr>
        
        
        <tr>
            <th scope="row"><b>Name: </b></th>
            <td style="padding-left: 4px;">PlanDefinition_Recommendation_10_Patient_View</td>
        </tr>
        
        
        <tr>
            <th scope="row"><b>Title: </b></th>
            <td style="padding-left: 4px;">PlanDefinition - 2022 CDC Clinical Practice Guideline for Prescribing Opioids for Pain: Recommendation #10 (patient-view)</td>
        </tr>
        
        
        
        <tr>
            <th scope="row"><b>Status: </b></th>
            <td style="padding-left: 4px;">draft</td>
        </tr>
        
        
        <tr>
            <th scope="row"><b>Experimental: </b></th>
            <td style="padding-left: 4px;">true</td>
        </tr>
        
        
        <tr>
            <th scope="row"><b>Type: </b></th>
            <td style="padding-left: 4px;">
                
                    
                        
                        <p style="margin-bottom: 5px;">
                            <b>system: </b> <span><a href="http://hl7.org/fhir/R4/codesystem-plan-definition-type.html">http://terminology.hl7.org/CodeSystem/plan-definition-type</a></span>
                        </p>
                        
                        
                        <p style="margin-bottom: 5px;">
                            <b>code: </b> <span>eca-rule</span>
                        </p>
                        
                        
                        <p style="margin-bottom: 5px;">
                            <b>display: </b> <span>ECA Rule</span>
                        </p>
                        
                    
                
                
            </td>
        </tr>
        
        
        
        <tr>
            <th scope="row"><b>Date: </b></th>
            <td style="padding-left: 4px;">2023-05-01</td>
        </tr>
        
        
        <tr>
            <th scope="row"><b>Publisher: </b></th>
            <td style="padding-left: 4px;">Centers for Disease Control and Prevention (CDC)</td>
        </tr>
        
        
        <tr>
            <th scope="row"><b>Description: </b></th>
            <td style="padding-left: 4px;">When prescribing opioids for subacute or chronic pain, providers should use urine drug testing before starting opioid therapy and consider urine drug testing at least annually to assess for prescribed medications as well as other controlled prescription drugs and illicit drugs.</td>
        </tr>
        
        
            <tr>
                <th scope="row"><a name="effective-data-requirements"> </a><b>Logic Definitions: </b></th>
                <td style="padding-left: 4px;">
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSCommon</td>
                                
                                
                                    <td>Active Ambulatory Opioid Rx</td>
                                
                                
                                    <td>0</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Active Ambulatory Opioid Rx&quot;:
    if Config.&quot;Can the implementing EHR support queries for past medications by date range?&quot; then
      (
        &quot;Get MedicationRequest Medication as Code&quot;(&quot;Get Active Ambulatory Medication Requests&quot;([MedicationRequest]))
      ) Rx
        where date from Rx.authoredOn 2 years or less on or before Today()
          and Rx.medication in &quot;Opioid analgesics with ambulatory misuse potential&quot;
    else
        List&lt;FHIR.MedicationRequest&gt;{}</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSREC10PatientView</td>
                                
                                
                                    <td>Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions</td>
                                
                                
                                    <td>1</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions&quot;:
  Common.&quot;Active Ambulatory Opioid Rx&quot; AmbulatoryOpioidPrescription
    where Routines.&quot;Is Subacute or Chronic Pain Prescription?&quot;(AmbulatoryOpioidPrescription)</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSREC10PatientView</td>
                                
                                
                                    <td>Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential</td>
                                
                                
                                    <td>2</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential&quot;:
  exists (&quot;Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions&quot;)</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSRoutines</td>
                                
                                
                                    <td>Patient Age Less Than 18</td>
                                
                                
                                    <td>3</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Patient Age Less Than 18&quot;:
  if (Config.&quot;Age Less than 18 Years Is Enabled&quot;) then
    AgeInYearsAt(Today()) &lt; 18
  else
    false</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSRoutines</td>
                                
                                
                                    <td>Condition Positive for Sickle Cell</td>
                                
                                
                                    <td>4</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Condition Positive for Sickle Cell&quot;:
      if (Config.&quot;Sickle Cell Check Enabled&quot;) then
        exists(
            Common.&quot;Positive Sickle Cell Condition&quot;
        )  else
        false</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSCommon</td>
                                
                                
                                    <td>US Core-Categorized Conditions</td>
                                
                                
                                    <td>5</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// 3. Medications indicating end of life
    /* or exists (
      &quot;Medications Indicating End of Life&quot;
    ) */
define &quot;US Core-Categorized Conditions&quot;:
  [Condition: category in &quot;Encounter Diagnosis Condition Category&quot;]
    union [Condition: category in &quot;Problem List Condition Category&quot;]
    union [Condition: category in &quot;US Core Health Concern Condition Category&quot;]</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSRoutines</td>
                                
                                
                                    <td>Conditions Indicating End Of Life Present</td>
                                
                                
                                    <td>6</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Conditions Indicating End Of Life Present&quot;:
  exists (
    Common.&quot;US Core-Categorized Conditions&quot; LLEC
      where LLEC.code in Common.&quot;Limited life expectancy conditions&quot;
        and LLEC.clinicalStatus in Common.&quot;Active Condition&quot;
  )</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSCommon</td>
                                
                                
                                    <td>Service Requests</td>
                                
                                
                                    <td>7</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Service Requests&quot;:
   [ServiceRequest] SR
    return SR</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSRoutines</td>
                                
                                
                                    <td>Palliative Care Lookback Period</td>
                                
                                
                                    <td>8</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">/*
**  Routine #1
**  Opioid Review Useful Routine
**
**  Definition              | Answer to Proceed   | Details                                      | Data (Terminology) Requirement
**  ------------------------------------------------------------------------------------------------------------------------------------
**  Age &lt; 18 years?         | No                  | Calculate age from date of birth; exclude    | Date of birth
**                          |                     | patients with age less than 18 years at the  |
**                          |                     | time of the prescription                     |
**  ------------------------------------------------------------------------------------------------------------------------------------
**  Evidence of             | No                  | Look for documented findings consistent      | Sickle cell disease conditions
**  sickle cell disease?    |                     | with those listed in the sickle cell         |
**                          |                     | value set                                    |
**  ------------------------------------------------------------------------------------------------------------------------------------
**  Limited life            | No                  | Look for documented findings consistent      | Limited life expectancy conditions
**  expectancy conditions   |                     | with those listed in the limited life        |
**  present?                |                     | expectancy value set (terminal illness, bad  |
**                          |                     | prognosis, pre-terminal)                     |
**  ------------------------------------------------------------------------------------------------------------------------------------
**  Order for therapies     | No                  | Look for patients with an existing order for | Therapies indicating end of life care
**  indicating end of life  |                     | therapies indicating end of life care        |
**  care in past 90 days?   |                     | written within past 90 days                  |
**  ------------------------------------------------------------------------------------------------------------------------------------
**  Active cancer           | No                  | See sub-routine 3                            | See sub-routine 3
**  treatment?              |                     |                                              |
**  ------------------------------------------------------------------------------------------------------------------------------------
**  Conditions Likely       | No                  | Look for patients with active conditions in  | Conditions likely terminal for opioid
**  Terminal for opioid     |                     | the value set end-of-life-conditions         | prescribing
**  prescribing present?    |                     |                                              |
**  ------------------------------------------------------------------------------------------------------------------------------------
**
*/
define &quot;Palliative Care Lookback Period&quot;:
  Interval[Today() - 90 days, Today()]</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSRoutines</td>
                                
                                
                                    <td>Order For Palliative Care In Past 90 Days</td>
                                
                                
                                    <td>9</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Order For Palliative Care In Past 90 Days&quot;:
  exists (
    Common.&quot;Service Requests&quot; SR
    where SR.status in { 'active', 'completed'}
      and SR.intent in {'proposal', 'plan,', 'directive', 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'}
      and FHIRHelpers.ToDateTime(SR.authoredOn) during day of &quot;Palliative Care Lookback Period&quot;
      and SR.code in Common.&quot;Therapies indicating end of life care&quot;
  )</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSRoutines</td>
                                
                                
                                    <td>Is Active Cancer Treatment?</td>
                                
                                
                                    <td>10</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Is Active Cancer Treatment?&quot;:
  if (Config.&quot;Active Cancer Treatment Encounters Condition Is Enabled&quot;) then
      &quot;Has Two or More Encounters with Cancer Diagnosis During Encounter Period&quot;
    else
      false</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSRoutines</td>
                                
                                
                                    <td>Conditions Including Cancer To Exclude Opioid Management Indicating End-Stage Disease Present</td>
                                
                                
                                    <td>11</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Conditions Including Cancer To Exclude Opioid Management Indicating End-Stage Disease Present&quot;:
  if (Config.&quot;End-Stage Disease Criteria Enabled&quot;) then
    exists (
      Common.&quot;US Core-Categorized Conditions&quot; EOLC
        where EOLC.code in Common.&quot;Conditions likely terminal for opioid prescribing&quot;
          and EOLC.clinicalStatus in Common.&quot;Active Condition&quot;
    )
  else
    false</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSRoutines</td>
                                
                                
                                    <td>Is Opioid Review Useful?</td>
                                
                                
                                    <td>12</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Is Opioid Review Useful?&quot;:
  not &quot;Patient Age Less Than 18&quot;
    and not &quot;Condition Positive for Sickle Cell&quot;
    and not &quot;Conditions Indicating End Of Life Present&quot;
    and not &quot;Order For Palliative Care In Past 90 Days&quot;
    and not &quot;Is Active Cancer Treatment?&quot;
    and not &quot;Conditions Including Cancer To Exclude Opioid Management Indicating End-Stage Disease Present&quot;</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Lookback Year</td>
                                
                                
                                    <td>13</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Lookback Year&quot;:
  Interval[Today() - 12 months - 1 days, Today() - 1 day]</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Laboratory Observations</td>
                                
                                
                                    <td>14</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Laboratory Observations&quot;:
  [Observation: &quot;category&quot; in Common.&quot;Observation Category Laboratory&quot;]</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Non-opioid Screenings</td>
                                
                                
                                    <td>15</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Non-opioid Screenings&quot;:
  GetRelevantScreenings(&quot;Laboratory Observations&quot; LabObservations
    where (LabObservations.code in Common.&quot;Non-opioid drug urine screening&quot;)
  )</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Cocaine Screenings</td>
                                
                                
                                    <td>16</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Cocaine Screenings&quot;:
  GetRelevantScreenings(&quot;Laboratory Observations&quot; LabObservations
    where (LabObservations.code in Common.&quot;Cocaine Urine Tests&quot;)
  )</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSREC10Common</td>
                                
                                
                                    <td>PCP Screenings</td>
                                
                                
                                    <td>17</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;PCP Screenings&quot;:
  GetRelevantScreenings(&quot;Laboratory Observations&quot; LabObservations
    where (LabObservations.code in Common.&quot;PCP Urine Tests&quot;)
  )</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Patient had Urine Screening in Last 12 Months</td>
                                
                                
                                    <td>18</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Patient had Urine Screening in Last 12 Months&quot;:
  (
    exists (&quot;Non-opioid Screenings&quot;)
    or exists (&quot;Cocaine Screenings&quot;)
    or exists (&quot;PCP Screenings&quot;)
  )
  or
    if Config.&quot;Opiate Urine Screening Check Enabled&quot; then
      exists (&quot;Opiate Screenings&quot;)
    else
      false</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Inclusion Criteria</td>
                                
                                
                                    <td>19</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Inclusion Criteria&quot;:
  Routines.&quot;Is Opioid Review Useful?&quot;
  and (not &quot;Patient had Urine Screening in Last 12 Months&quot;)</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSCommon</td>
                                
                                
                                    <td>Conditions Indicating End of Life or With Limited Life Expectancy</td>
                                
                                
                                    <td>20</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Conditions Indicating End of Life or With Limited Life Expectancy&quot;:
  (
    &quot;US Core-Categorized Conditions&quot; C
      where C.code in &quot;Conditions likely terminal for opioid prescribing&quot;
        and C.clinicalStatus in &quot;Active Condition&quot;
  )
  union
  (
    &quot;US Core-Categorized Conditions&quot; C
      where C.code in &quot;Limited life expectancy conditions&quot;
        and C.clinicalStatus in &quot;Active Condition&quot;
  )</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSCommon</td>
                                
                                
                                    <td>Admitted/Referred/Discharged to Hospice Care</td>
                                
                                
                                    <td>21</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Admitted/Referred/Discharged to Hospice Care&quot;:
  (
    [Procedure: code in &quot;Hospice Procedure Codes&quot;] P
      where P.status.value in { 'in-progress', 'completed' }
  )
  union
  (
    &quot;Service Requests&quot; SR
      where SR.code in &quot;Hospice Procedure Codes&quot;
        and SR.status.value in { 'active', 'completed' }
  )
  union
  (
    if (Config.&quot;Hospice Findings Exclusion Enabled&quot;) then
      [Observation: code in &quot;Hospice Finding Codes&quot;] O
        where not (O.status.value in { 'unknown', 'entered-in-error', 'cancelled' })
    else
      {}
  )
  union
  (
    [Encounter] E
      where date from E.period.start 1 year or less on or before Today()
        and (
          if E.hospitalization.dischargeDisposition.coding is null
              or not exists (E.hospitalization.dischargeDisposition.coding)
            then false
          else E.hospitalization.dischargeDisposition in &quot;Hospice Disposition&quot;
        )
        and E.status.value in { 'planned', 'arrived', 'in-progress', 'finished', 'onleave' }
  )</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSCommon</td>
                                
                                
                                    <td>End of Life Assessment</td>
                                
                                
                                    <td>22</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;End of Life Assessment&quot;:
    // 1. Conditions indicating end of life or with limited life expectancy
    exists (
      &quot;Conditions Indicating End of Life or With Limited Life Expectancy&quot;
    )
    // 2. Admitted/referred/discharged to hospice care
    or exists (
      &quot;Admitted/Referred/Discharged to Hospice Care&quot;
    )</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Exclusion Criteria</td>
                                
                                
                                    <td>23</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Exclusion Criteria&quot;:
  Common.&quot;End of Life Assessment&quot;</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSREC10PatientView</td>
                                
                                
                                    <td>Is Perform Drug Screen Recommendation Applicable?</td>
                                
                                
                                    <td>24</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Is Perform Drug Screen Recommendation Applicable?&quot;:
  &quot;Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential&quot;
    and Rec10Common.&quot;Inclusion Criteria&quot;
    and not Rec10Common.&quot;Exclusion Criteria&quot;</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSREC10PatientView</td>
                                
                                
                                    <td>Summary</td>
                                
                                
                                    <td>25</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Summary&quot;:
  Rec10Common.&quot;Get Summary&quot; (&quot;Is Perform Drug Screen Recommendation Applicable?&quot;)</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSREC10PatientView</td>
                                
                                
                                    <td>Detail</td>
                                
                                
                                    <td>26</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Detail&quot;:
  Rec10Common.&quot;Get Detail&quot; (&quot;Is Perform Drug Screen Recommendation Applicable?&quot;)</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Indicator</td>
                                
                                
                                    <td>27</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Indicator&quot;:
  'warning'</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSREC10PatientView</td>
                                
                                
                                    <td>Indicator</td>
                                
                                
                                    <td>28</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Indicator&quot;:
  Rec10Common.&quot;Indicator&quot;</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Applicable Because of Positive Cocaine or PCP or Opiates</td>
                                
                                
                                    <td>29</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Applicable Because of Positive Cocaine or PCP or Opiates&quot;:
  if exists (Common.&quot;Opioid Other Than Synthetic Ordered In Last 12 Months&quot;) then
    &quot;Has Positive Screening for Cocaine in Last 12 Months&quot;
    or &quot;Has Positive Screening for PCP in Last 12 Months&quot;
  else
    &quot;Has Positive Screening for Cocaine in Last 12 Months&quot;
      or &quot;Has Positive Screening for PCP in Last 12 Months&quot;
      or
        if Config.&quot;Opiate Urine Screening Check Enabled&quot; then
          &quot;Has Positive Screening for Opiates in Last 12 Months&quot;
        else false</code></pre>
                        
                        <br/><br/>
                    
                        <table class="grid-dict">
                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>
                            <tr>
                                
                                    <td>OpioidCDSREC10PatientView</td>
                                
                                
                                    <td>Applicable Because of Positive Cocaine or PCP or Opiates</td>
                                
                                
                                    <td>30</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Applicable Because of Positive Cocaine or PCP or Opiates&quot;:
  Rec10Common.&quot;Applicable Because of Positive Cocaine or PCP or Opiates&quot;</code></pre>
                        
                        <br/><br/>
                    
                </td>
            </tr>
        
        
        <tr>
          <th scope="row"><b>Knowledge Capability: </b></th>
          <td style="padding-left: 4px;">
            shareable computable executable publishable 
          </td>
        </tr>
        
        
        
        <tr>
            <th scope="row"><b>Use Context: </b></th>
            <td style="padding-left: 4px;">
                <table class="grid-dict">
                    <tr><th><b>code</b></th><th><b>value</b></th><th><b>display</b></th></tr>
                    
                      <tr>
                        <td>focus</td>
                        <td>182888003</td>
                        <td>Medication requested (situation)</td>
                      </tr>
                    
                      <tr>
                        <td>focus</td>
                        <td>82423001</td>
                        <td>Chronic pain (finding)</td>
                      </tr>
                    
                </table>
            </td>
        </tr>
        
        
        
        <tr>
            <th scope="row"><b>Purpose: </b></th>
            <td style="padding-left: 4px;"><div><p>The 2022 CDC Clinical Practice Guideline for Prescribing Opioids for Pain is intended to improve communication between providers and patients about the risks and benefits of opioid therapy for chronic pain, improve the safety and effectiveness of pain treatment, and reduce the risks associated with long-term opioid therapy, including opioid use disorder and overdose. The Guideline is not intended for patients who are in active cancer treatment, palliative care, or end-of-life care.</p>
</div></td>
        </tr>
        
        
        <tr>
            <th scope="row"><b>Usage: </b></th>
            <td style="padding-left: 4px;">Providers should be aware if patients are taking other prescription drugs or illicit drugs that might increase their risk of an overdose.</td>
        </tr>
        
        
        <tr>
            <th scope="row"><b>Copyright: </b></th>
            <td style="padding-left: 4px;"><div><p>© CDC 2016+.</p>
</div></td>
        </tr>
        
        
        
        
        
        

        
        <tr>
          <th scope="row"><b>Libraries: </b></th>
          <td style="padding-left: 4px;">
            <table class="grid-dict">
              
                <tr><td><a href="Library-OpioidCDSREC10PatientView.html">Library - Recommendation #10 Patient View - Urine Drug Testing</a></td></tr>
              
            </table>
          </td>
        </tr>
        

        
        <tr>
          <th scope="row"><b>Actions: </b></th>
          <td style="padding-left: 4px;">
            <table class="grid-dict">
              
                <tr>
                  <td>
                    <b>Order Urine Screening Annual Urine Screening Check:</b> Patient has not had a urine screening in the past 12 months<br/>
                    <b>When:</b> <i>Named Event:</i> patient-view<br/>
                    <b>If:</b> <i>Applicability:</i> Patient has not had a urine screening in the past 12 months <i>(Is Perform Drug Screen Recommendation Applicable?)</i><br/>
                    <b>Then:</b>
                    
                      <table class="grid-dict">
                        
                          <tr>
                            <td>
                              <b> :</b> Will perform urine screening<br/>
                              
                              
                              <b>Then:</b>
                              
                                
                                
                              
                            </td>
                          </tr>
                        
                          <tr>
                            <td>
                              <b> :</b> Not for chronic pain management. Snooze 3 months<br/>
                              
                              
                              <b>Then:</b>
                              
                                
                                
                              
                            </td>
                          </tr>
                        
                          <tr>
                            <td>
                              <b> :</b> N/A - see comment, snooze 3 months<br/>
                              
                              
                              <b>Then:</b>
                              
                                
                                
                              
                            </td>
                          </tr>
                        
                      </table>
                    
                  </td>
                </tr>
              
                <tr>
                  <td>
                    <b>1. Tested Positive for Cocaine, Opiates, or PCP:</b> Urine screening showed positive for cocaine, opiates or PCP<br/>
                    <b>When:</b> <i>Named Event:</i> patient-view<br/>
                    <b>If:</b> <i>Applicability:</i> Urine screening tested positive for cocaine, opiates or PCP <i>(Applicable Because of Positive Cocaine or PCP or Opiates)</i><br/>
                    <b>Then:</b>
                    
                      <table class="grid-dict">
                        
                          <tr>
                            <td>
                              <b> :</b> Will repeat urine drug screen more frequently<br/>
                              
                              
                              <b>Then:</b>
                              
                                
                                
                              
                            </td>
                          </tr>
                        
                          <tr>
                            <td>
                              <b> :</b> Will assess patient for substance abuse disorder<br/>
                              
                              
                              <b>Then:</b>
                              
                                
                                
                              
                            </td>
                          </tr>
                        
                          <tr>
                            <td>
                              <b> :</b> Will access CDS quality improvement and care coordination for prescribing opioids for chronic pain https://www.cdc.gov/drugoverdose/pdf/prescribing/CDC-DUIP-QualityImprovementAndCareCoordination-508.pdf<br/>
                              
                              
                              <b>Then:</b>
                              
                                
                                
                              
                            </td>
                          </tr>
                        
                      </table>
                    
                  </td>
                </tr>
              
            </table>
          </td>
        </tr>
        
    </table>
</div>
  </text>
  <contained>
    <Library>
      <id value="effective-data-requirements"/>
      <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 Common"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSCommon|2022.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library Routines"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSRoutines|2022.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library Rec10Common"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSREC10Common|2022.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library Routines"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSRoutines|2022.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library FHIRHelpers"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/Library/FHIRHelpers|4.0.1"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Encounter Diagnosis Condition Category"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-encounter-diagnosis-category"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Problem List Condition Category"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-problem-list-category"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set US Core Health Concern Condition Category"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-us-core-health-concern-category"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Limited life expectancy conditions"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/limited-life-expectancy-conditions"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Active Condition"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-clinical-status-active"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Therapies indicating end of life care"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/therapies-indicating-end-of-life-care"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Observation Category Laboratory"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/observation-category-laboratory"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Non-opioid drug urine screening"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/non-opioid-drug-urine-screening"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Cocaine Urine Tests"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/cocaine-urine-drug-screening-tests"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set PCP Urine Tests"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/phencyclidine-urine-drug-screening-tests"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display
                 value="Value set Conditions likely terminal for opioid prescribing"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/conditions-likely-terminal-for-opioid-prescribing"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Hospice Procedure Codes"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/hospice-procedure"/>
      </relatedArtifact>
      <parameter>
        <name value="Is Perform Drug Screen Recommendation Applicable?"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="boolean"/>
      </parameter>
      <parameter>
        <name value="Summary"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="string"/>
      </parameter>
      <parameter>
        <name value="Detail"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="string"/>
      </parameter>
      <parameter>
        <name value="Indicator"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="string"/>
      </parameter>
      <parameter>
        <name
              value="Applicable Because of Positive Cocaine or PCP or Opiates"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="boolean"/>
      </parameter>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Condition"/>
        <mustSupport value="category"/>
        <codeFilter>
          <path value="category"/>
          <valueSet
                    value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-encounter-diagnosis-category"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Condition"/>
        <mustSupport value="category"/>
        <codeFilter>
          <path value="category"/>
          <valueSet
                    value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-problem-list-category"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Condition"/>
        <mustSupport value="category"/>
        <codeFilter>
          <path value="category"/>
          <valueSet
                    value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-us-core-health-concern-category"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="ServiceRequest"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/ServiceRequest"/>
      </dataRequirement>
      <dataRequirement>
        <type value="ServiceRequest"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/ServiceRequest"/>
        <mustSupport value="status"/>
        <mustSupport value="intent"/>
        <mustSupport value="authoredOn"/>
        <mustSupport value="code"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mustSupport value="category"/>
        <codeFilter>
          <path value="category"/>
          <valueSet
                    value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/observation-category-laboratory"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mustSupport value="category"/>
        <mustSupport value="code"/>
        <codeFilter>
          <path value="category"/>
          <valueSet
                    value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/observation-category-laboratory"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mustSupport value="category"/>
        <mustSupport value="code"/>
        <codeFilter>
          <path value="category"/>
          <valueSet
                    value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/observation-category-laboratory"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mustSupport value="category"/>
        <mustSupport value="code"/>
        <codeFilter>
          <path value="category"/>
          <valueSet
                    value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/observation-category-laboratory"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Procedure"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Procedure"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/hospice-procedure"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="ServiceRequest"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/ServiceRequest"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="period"/>
        <mustSupport value="period.start"/>
        <mustSupport value="status"/>
        <mustSupport value="status.value"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mustSupport value="category"/>
        <mustSupport value="code"/>
        <codeFilter>
          <path value="category"/>
          <valueSet
                    value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/observation-category-laboratory"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mustSupport value="category"/>
        <mustSupport value="code"/>
        <codeFilter>
          <path value="category"/>
          <valueSet
                    value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/observation-category-laboratory"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mustSupport value="category"/>
        <mustSupport value="code"/>
        <codeFilter>
          <path value="category"/>
          <valueSet
                    value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/observation-category-laboratory"/>
        </codeFilter>
      </dataRequirement>
    </Library>
  </contained>
  <extension
             url="http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability">
    <valueCode value="shareable"/>
  </extension>
  <extension
             url="http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability">
    <valueCode value="computable"/>
  </extension>
  <extension
             url="http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability">
    <valueCode value="executable"/>
  </extension>
  <extension
             url="http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability">
    <valueCode value="publishable"/>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-softwaresystem">
    <valueReference>🔗 
      <reference value="Device/cqf-tooling"/>
    </valueReference>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSCommon"/>
    </extension>
    <extension url="name">
      <valueString value="Active Ambulatory Opioid Rx"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Active Ambulatory Opioid Rx&quot;:
    if Config.&quot;Can the implementing EHR support queries for past medications by date range?&quot; then
      (
        &quot;Get MedicationRequest Medication as Code&quot;(&quot;Get Active Ambulatory Medication Requests&quot;([MedicationRequest]))
      ) Rx
        where date from Rx.authoredOn 2 years or less on or before Today()
          and Rx.medication in &quot;Opioid analgesics with ambulatory misuse potential&quot;
    else
        List&lt;FHIR.MedicationRequest&gt;{}"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="0"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10PatientView"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions&quot;:
  Common.&quot;Active Ambulatory Opioid Rx&quot; AmbulatoryOpioidPrescription
    where Routines.&quot;Is Subacute or Chronic Pain Prescription?&quot;(AmbulatoryOpioidPrescription)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="1"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10PatientView"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential&quot;:
  exists (&quot;Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions&quot;)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="2"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSRoutines"/>
    </extension>
    <extension url="name">
      <valueString value="Patient Age Less Than 18"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Patient Age Less Than 18&quot;:
  if (Config.&quot;Age Less than 18 Years Is Enabled&quot;) then
    AgeInYearsAt(Today()) &lt; 18
  else
    false"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="3"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSRoutines"/>
    </extension>
    <extension url="name">
      <valueString value="Condition Positive for Sickle Cell"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Condition Positive for Sickle Cell&quot;:
      if (Config.&quot;Sickle Cell Check Enabled&quot;) then
        exists(
            Common.&quot;Positive Sickle Cell Condition&quot;
        )  else
        false"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="4"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSCommon"/>
    </extension>
    <extension url="name">
      <valueString value="US Core-Categorized Conditions"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// 3. Medications indicating end of life
    /* or exists (
      &quot;Medications Indicating End of Life&quot;
    ) */
define &quot;US Core-Categorized Conditions&quot;:
  [Condition: category in &quot;Encounter Diagnosis Condition Category&quot;]
    union [Condition: category in &quot;Problem List Condition Category&quot;]
    union [Condition: category in &quot;US Core Health Concern Condition Category&quot;]"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="5"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSRoutines"/>
    </extension>
    <extension url="name">
      <valueString value="Conditions Indicating End Of Life Present"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Conditions Indicating End Of Life Present&quot;:
  exists (
    Common.&quot;US Core-Categorized Conditions&quot; LLEC
      where LLEC.code in Common.&quot;Limited life expectancy conditions&quot;
        and LLEC.clinicalStatus in Common.&quot;Active Condition&quot;
  )"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="6"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSCommon"/>
    </extension>
    <extension url="name">
      <valueString value="Service Requests"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Service Requests&quot;:
   [ServiceRequest] SR
    return SR"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="7"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSRoutines"/>
    </extension>
    <extension url="name">
      <valueString value="Palliative Care Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="/*
**  Routine #1
**  Opioid Review Useful Routine
**
**  Definition              | Answer to Proceed   | Details                                      | Data (Terminology) Requirement
**  ------------------------------------------------------------------------------------------------------------------------------------
**  Age &lt; 18 years?         | No                  | Calculate age from date of birth; exclude    | Date of birth
**                          |                     | patients with age less than 18 years at the  |
**                          |                     | time of the prescription                     |
**  ------------------------------------------------------------------------------------------------------------------------------------
**  Evidence of             | No                  | Look for documented findings consistent      | Sickle cell disease conditions
**  sickle cell disease?    |                     | with those listed in the sickle cell         |
**                          |                     | value set                                    |
**  ------------------------------------------------------------------------------------------------------------------------------------
**  Limited life            | No                  | Look for documented findings consistent      | Limited life expectancy conditions
**  expectancy conditions   |                     | with those listed in the limited life        |
**  present?                |                     | expectancy value set (terminal illness, bad  |
**                          |                     | prognosis, pre-terminal)                     |
**  ------------------------------------------------------------------------------------------------------------------------------------
**  Order for therapies     | No                  | Look for patients with an existing order for | Therapies indicating end of life care
**  indicating end of life  |                     | therapies indicating end of life care        |
**  care in past 90 days?   |                     | written within past 90 days                  |
**  ------------------------------------------------------------------------------------------------------------------------------------
**  Active cancer           | No                  | See sub-routine 3                            | See sub-routine 3
**  treatment?              |                     |                                              |
**  ------------------------------------------------------------------------------------------------------------------------------------
**  Conditions Likely       | No                  | Look for patients with active conditions in  | Conditions likely terminal for opioid
**  Terminal for opioid     |                     | the value set end-of-life-conditions         | prescribing
**  prescribing present?    |                     |                                              |
**  ------------------------------------------------------------------------------------------------------------------------------------
**
*/
define &quot;Palliative Care Lookback Period&quot;:
  Interval[Today() - 90 days, Today()]"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="8"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSRoutines"/>
    </extension>
    <extension url="name">
      <valueString value="Order For Palliative Care In Past 90 Days"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Order For Palliative Care In Past 90 Days&quot;:
  exists (
    Common.&quot;Service Requests&quot; SR
    where SR.status in { 'active', 'completed'}
      and SR.intent in {'proposal', 'plan,', 'directive', 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'}
      and FHIRHelpers.ToDateTime(SR.authoredOn) during day of &quot;Palliative Care Lookback Period&quot;
      and SR.code in Common.&quot;Therapies indicating end of life care&quot;
  )"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="9"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSRoutines"/>
    </extension>
    <extension url="name">
      <valueString value="Is Active Cancer Treatment?"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Is Active Cancer Treatment?&quot;:
  if (Config.&quot;Active Cancer Treatment Encounters Condition Is Enabled&quot;) then
      &quot;Has Two or More Encounters with Cancer Diagnosis During Encounter Period&quot;
    else
      false"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="10"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSRoutines"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Conditions Including Cancer To Exclude Opioid Management Indicating End-Stage Disease Present"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Conditions Including Cancer To Exclude Opioid Management Indicating End-Stage Disease Present&quot;:
  if (Config.&quot;End-Stage Disease Criteria Enabled&quot;) then
    exists (
      Common.&quot;US Core-Categorized Conditions&quot; EOLC
        where EOLC.code in Common.&quot;Conditions likely terminal for opioid prescribing&quot;
          and EOLC.clinicalStatus in Common.&quot;Active Condition&quot;
    )
  else
    false"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="11"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSRoutines"/>
    </extension>
    <extension url="name">
      <valueString value="Is Opioid Review Useful?"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Is Opioid Review Useful?&quot;:
  not &quot;Patient Age Less Than 18&quot;
    and not &quot;Condition Positive for Sickle Cell&quot;
    and not &quot;Conditions Indicating End Of Life Present&quot;
    and not &quot;Order For Palliative Care In Past 90 Days&quot;
    and not &quot;Is Active Cancer Treatment?&quot;
    and not &quot;Conditions Including Cancer To Exclude Opioid Management Indicating End-Stage Disease Present&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="12"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Lookback Year"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Lookback Year&quot;:
  Interval[Today() - 12 months - 1 days, Today() - 1 day]"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="13"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Laboratory Observations"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Laboratory Observations&quot;:
  [Observation: &quot;category&quot; in Common.&quot;Observation Category Laboratory&quot;]"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="14"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Non-opioid Screenings"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Non-opioid Screenings&quot;:
  GetRelevantScreenings(&quot;Laboratory Observations&quot; LabObservations
    where (LabObservations.code in Common.&quot;Non-opioid drug urine screening&quot;)
  )"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="15"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Cocaine Screenings"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Cocaine Screenings&quot;:
  GetRelevantScreenings(&quot;Laboratory Observations&quot; LabObservations
    where (LabObservations.code in Common.&quot;Cocaine Urine Tests&quot;)
  )"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="16"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="PCP Screenings"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;PCP Screenings&quot;:
  GetRelevantScreenings(&quot;Laboratory Observations&quot; LabObservations
    where (LabObservations.code in Common.&quot;PCP Urine Tests&quot;)
  )"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="17"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Patient had Urine Screening in Last 12 Months"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Patient had Urine Screening in Last 12 Months&quot;:
  (
    exists (&quot;Non-opioid Screenings&quot;)
    or exists (&quot;Cocaine Screenings&quot;)
    or exists (&quot;PCP Screenings&quot;)
  )
  or
    if Config.&quot;Opiate Urine Screening Check Enabled&quot; then
      exists (&quot;Opiate Screenings&quot;)
    else
      false"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="18"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Inclusion Criteria"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Inclusion Criteria&quot;:
  Routines.&quot;Is Opioid Review Useful?&quot;
  and (not &quot;Patient had Urine Screening in Last 12 Months&quot;)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="19"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSCommon"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Conditions Indicating End of Life or With Limited Life Expectancy"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Conditions Indicating End of Life or With Limited Life Expectancy&quot;:
  (
    &quot;US Core-Categorized Conditions&quot; C
      where C.code in &quot;Conditions likely terminal for opioid prescribing&quot;
        and C.clinicalStatus in &quot;Active Condition&quot;
  )
  union
  (
    &quot;US Core-Categorized Conditions&quot; C
      where C.code in &quot;Limited life expectancy conditions&quot;
        and C.clinicalStatus in &quot;Active Condition&quot;
  )"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="20"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSCommon"/>
    </extension>
    <extension url="name">
      <valueString value="Admitted/Referred/Discharged to Hospice Care"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Admitted/Referred/Discharged to Hospice Care&quot;:
  (
    [Procedure: code in &quot;Hospice Procedure Codes&quot;] P
      where P.status.value in { 'in-progress', 'completed' }
  )
  union
  (
    &quot;Service Requests&quot; SR
      where SR.code in &quot;Hospice Procedure Codes&quot;
        and SR.status.value in { 'active', 'completed' }
  )
  union
  (
    if (Config.&quot;Hospice Findings Exclusion Enabled&quot;) then
      [Observation: code in &quot;Hospice Finding Codes&quot;] O
        where not (O.status.value in { 'unknown', 'entered-in-error', 'cancelled' })
    else
      {}
  )
  union
  (
    [Encounter] E
      where date from E.period.start 1 year or less on or before Today()
        and (
          if E.hospitalization.dischargeDisposition.coding is null
              or not exists (E.hospitalization.dischargeDisposition.coding)
            then false
          else E.hospitalization.dischargeDisposition in &quot;Hospice Disposition&quot;
        )
        and E.status.value in { 'planned', 'arrived', 'in-progress', 'finished', 'onleave' }
  )"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="21"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSCommon"/>
    </extension>
    <extension url="name">
      <valueString value="End of Life Assessment"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;End of Life Assessment&quot;:
    // 1. Conditions indicating end of life or with limited life expectancy
    exists (
      &quot;Conditions Indicating End of Life or With Limited Life Expectancy&quot;
    )
    // 2. Admitted/referred/discharged to hospice care
    or exists (
      &quot;Admitted/Referred/Discharged to Hospice Care&quot;
    )"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="22"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Exclusion Criteria"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Exclusion Criteria&quot;:
  Common.&quot;End of Life Assessment&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="23"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10PatientView"/>
    </extension>
    <extension url="name">
      <valueString value="Is Perform Drug Screen Recommendation Applicable?"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Is Perform Drug Screen Recommendation Applicable?&quot;:
  &quot;Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential&quot;
    and Rec10Common.&quot;Inclusion Criteria&quot;
    and not Rec10Common.&quot;Exclusion Criteria&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="24"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10PatientView"/>
    </extension>
    <extension url="name">
      <valueString value="Summary"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Summary&quot;:
  Rec10Common.&quot;Get Summary&quot; (&quot;Is Perform Drug Screen Recommendation Applicable?&quot;)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="25"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10PatientView"/>
    </extension>
    <extension url="name">
      <valueString value="Detail"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Detail&quot;:
  Rec10Common.&quot;Get Detail&quot; (&quot;Is Perform Drug Screen Recommendation Applicable?&quot;)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="26"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Indicator"/>
    </extension>
    <extension url="statement">
      <valueString value="define &quot;Indicator&quot;:
  'warning'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="27"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10PatientView"/>
    </extension>
    <extension url="name">
      <valueString value="Indicator"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Indicator&quot;:
  Rec10Common.&quot;Indicator&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="28"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Applicable Because of Positive Cocaine or PCP or Opiates"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Applicable Because of Positive Cocaine or PCP or Opiates&quot;:
  if exists (Common.&quot;Opioid Other Than Synthetic Ordered In Last 12 Months&quot;) then
    &quot;Has Positive Screening for Cocaine in Last 12 Months&quot;
    or &quot;Has Positive Screening for PCP in Last 12 Months&quot;
  else
    &quot;Has Positive Screening for Cocaine in Last 12 Months&quot;
      or &quot;Has Positive Screening for PCP in Last 12 Months&quot;
      or
        if Config.&quot;Opiate Urine Screening Check Enabled&quot; then
          &quot;Has Positive Screening for Opiates in Last 12 Months&quot;
        else false"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="29"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10PatientView"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Applicable Because of Positive Cocaine or PCP or Opiates"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Applicable Because of Positive Cocaine or PCP or Opiates&quot;:
  Rec10Common.&quot;Applicable Because of Positive Cocaine or PCP or Opiates&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="30"/>
    </extension>
  </extension>
  <extension
             url="http://fhir.org/guides/cdc/opioid-cds/StructureDefinition/effectiveDataRequirements" id="effective-data-requirements">
    <valueReference>
      <reference value="#effective-data-requirements"/>
    </valueReference>
  </extension>
  <url
       value="http://fhir.org/guides/cdc/opioid-cds/PlanDefinition/opioidcds-10-patient-view"/>
  <identifier>
    <use value="official"/>
    <value value="cdc-opioid-guidance"/>
  </identifier>
  <version value="2022.1.0"/>
  <name value="PlanDefinition_Recommendation_10_Patient_View"/>
  <title
         value="PlanDefinition - 2022 CDC Clinical Practice Guideline for Prescribing Opioids for Pain: Recommendation #10 (patient-view)"/>
  <type>
    <coding>
      <system
              value="http://terminology.hl7.org/CodeSystem/plan-definition-type"/>
      <code value="eca-rule"/>
      <display value="ECA Rule"/>
    </coding>
  </type>
  <status value="draft"/>
  <experimental value="true"/>
  <date value="2023-05-01"/>
  <publisher value="Centers for Disease Control and Prevention (CDC)"/>
  <contact>
    <telecom>
      <system value="url"/>
      <value value="https://www.cdc.gov"/>
    </telecom>
  </contact>
  <description
               value="When prescribing opioids for subacute or chronic pain, providers should use urine drug testing before starting opioid therapy and consider urine drug testing at least annually to assess for prescribed medications as well as other controlled prescription drugs and illicit drugs."/>
  <useContext>
    <code>
      <system
              value="http://terminology.hl7.org/CodeSystem/usage-context-type"/>
      <code value="focus"/>
      <display value="Clinical Focus"/>
    </code>
    <valueCodeableConcept>
      <coding>
        <system value="http://snomed.info/sct"/>
        <code value="182888003"/>
        <display value="Medication requested (situation)"/>
      </coding>
    </valueCodeableConcept>
  </useContext>
  <useContext>
    <code>
      <system
              value="http://terminology.hl7.org/CodeSystem/usage-context-type"/>
      <code value="focus"/>
      <display value="Clinical Focus"/>
    </code>
    <valueCodeableConcept>
      <coding>
        <system value="http://snomed.info/sct"/>
        <code value="82423001"/>
        <display value="Chronic pain (finding)"/>
      </coding>
    </valueCodeableConcept>
  </useContext>
  <purpose
           value="The 2022 CDC Clinical Practice Guideline for Prescribing Opioids for Pain is intended to improve communication between providers and patients about the risks and benefits of opioid therapy for chronic pain, improve the safety and effectiveness of pain treatment, and reduce the risks associated with long-term opioid therapy, including opioid use disorder and overdose. The Guideline is not intended for patients who are in active cancer treatment, palliative care, or end-of-life care."/>
  <usage
         value="Providers should be aware if patients are taking other prescription drugs or illicit drugs that might increase their risk of an overdose."/>
  <copyright value="© CDC 2016+."/>
  <topic>
    <text value="Opioid Prescribing"/>
  </topic>
  <author>
    <name value="Kensaku Kawamoto, MD, PhD, MHS"/>
  </author>
  <author>
    <name value="Bryn Rhodes"/>
  </author>
  <author>
    <name value="Floyd Eisenberg, MD, MPH"/>
  </author>
  <author>
    <name value="Robert McClure, MD, MPH"/>
  </author>
  <library
           value="http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSREC10PatientView"/>
  <action>
    <extension
               url="http://hl7.org/fhir/StructureDefinition/cqf-strengthOfRecommendation">
      <valueCodeableConcept>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/recommendation-strength"/>
          <code value="weak"/>
          <display value="Weak"/>
        </coding>
      </valueCodeableConcept>
    </extension>
    <extension
               url="http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence">
      <valueCodeableConcept>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/evidence-quality"/>
          <code value="very-low"/>
          <display value="Very Low quality"/>
        </coding>
      </valueCodeableConcept>
    </extension>
    <prefix value="Order Urine Screening"/>
    <title value="Annual Urine Screening Check"/>
    <description
                 value="Patient has not had a urine screening in the past 12 months"/>
    <trigger>
      <type value="named-event"/>
      <name value="patient-view"/>
    </trigger>
    <condition>
      <kind value="applicability"/>
      <expression>
        <description
                     value="Patient has not had a urine screening in the past 12 months"/>
        <language value="text/cql.identifier"/>
        <expression
                    value="Is Perform Drug Screen Recommendation Applicable?"/>
      </expression>
    </condition>
    <type>
      <coding>
        <system value="http://terminology.hl7.org/CodeSystem/action-type"/>
        <code value="create"/>
        <display value="Create"/>
      </coding>
    </type>
    <definitionCanonical
                         value="http://fhir.org/guides/cdc/opioid-cds/ActivityDefinition/opioidcds-urine-screening-request"/>
    <dynamicValue>
      <path value="action.description"/>
      <expression>
        <language value="text/cql.identifier"/>
        <expression value="Detail"/>
      </expression>
    </dynamicValue>
    <dynamicValue>
      <path value="action.title"/>
      <expression>
        <language value="text/cql.identifier"/>
        <expression value="Summary"/>
      </expression>
    </dynamicValue>
    <dynamicValue>
      <path value="action.extension"/>
      <expression>
        <language value="text/cql.identifier"/>
        <expression value="Indicator"/>
      </expression>
    </dynamicValue>
    <action>
      <description value="Will perform urine screening"/>
    </action>
    <action>
      <description value="Not for chronic pain management. Snooze 3 months"/>
    </action>
    <action>
      <description value="N/A - see comment, snooze 3 months"/>
    </action>
  </action>
  <action>
    <extension
               url="http://hl7.org/fhir/StructureDefinition/cqf-strengthOfRecommendation">
      <valueCodeableConcept>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/recommendation-strength"/>
          <code value="weak"/>
          <display value="Weak"/>
        </coding>
      </valueCodeableConcept>
    </extension>
    <extension
               url="http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence">
      <valueCodeableConcept>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/evidence-quality"/>
          <code value="very-low"/>
          <display value="Very Low quality"/>
        </coding>
      </valueCodeableConcept>
    </extension>
    <prefix value="1."/>
    <title value="Tested Positive for Cocaine, Opiates, or PCP"/>
    <description
                 value="Urine screening showed positive for cocaine, opiates or PCP"/>
    <trigger>
      <type value="named-event"/>
      <name value="patient-view"/>
    </trigger>
    <condition>
      <kind value="applicability"/>
      <expression>
        <description
                     value="Urine screening tested positive for cocaine, opiates or PCP"/>
        <language value="text/cql.identifier"/>
        <expression
                    value="Applicable Because of Positive Cocaine or PCP or Opiates"/>
      </expression>
    </condition>
    <type>
      <coding>
        <system value="http://terminology.hl7.org/CodeSystem/action-type"/>
        <code value="create"/>
        <display value="Create"/>
      </coding>
    </type>
    <definitionCanonical
                         value="http://fhir.org/guides/cdc/opioid-cds/ActivityDefinition/opioidcds-urine-screening-request"/>
    <dynamicValue>
      <path value="action.description"/>
      <expression>
        <language value="text/cql.identifier"/>
        <expression value="Detail"/>
      </expression>
    </dynamicValue>
    <dynamicValue>
      <path value="action.title"/>
      <expression>
        <language value="text/cql.identifier"/>
        <expression value="Summary"/>
      </expression>
    </dynamicValue>
    <dynamicValue>
      <path value="action.extension"/>
      <expression>
        <language value="text/cql.identifier"/>
        <expression value="Indicator"/>
      </expression>
    </dynamicValue>
    <action>
      <description value="Will repeat urine drug screen more frequently"/>
    </action>
    <action>
      <description value="Will assess patient for substance abuse disorder"/>
    </action>
    <action>
      <description
                   value="Will access CDS quality improvement and care coordination for prescribing opioids for chronic pain https://www.cdc.gov/drugoverdose/pdf/prescribing/CDC-DUIP-QualityImprovementAndCareCoordination-508.pdf"/>
    </action>
  </action>
</PlanDefinition>