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

: Recommendation #10 - Urine Drug Testing (order-sign) - XML Representation

Draft as of 2025-04-24

Raw xml | Download


<PlanDefinition xmlns="http://hl7.org/fhir">
  <id value="opioidcds-10-order-sign"/>
  <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-order-sign</td>
        </tr>
        
        
        <tr>
            <th scope="row"><b>Url: </b></th>
            <td style="padding-left: 4px;"><a href="PlanDefinition-opioidcds-10-order-sign.html">Recommendation #10 - Urine Drug Testing (order-sign)</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_Order_Sign</td>
        </tr>
        
        
        <tr>
            <th scope="row"><b>Title: </b></th>
            <td style="padding-left: 4px;">Recommendation #10 - Urine Drug Testing (order-sign)</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://terminology.hl7.org/6.5.0/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;">2025-04-24</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, clinicians should consider the benefits and risks of toxicology testing to assess for prescribed medications as well as other prescribed and nonprescribed controlled substances.</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>OpioidCDSREC10OrderSign</td>
                                
                                
                                    <td>Subacute or Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions</td>
                                
                                
                                    <td>0</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Subacute or Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions&quot;:
  ( Common.&quot;Is Opioid Analgesic with Ambulatory Misuse Potential?&quot;( ContextPrescriptions ) ) 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>OpioidCDSREC10OrderSign</td>
                                
                                
                                    <td>Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential</td>
                                
                                
                                    <td>1</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;Subacute or 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>2</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>3</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>OpioidCDSRoutines</td>
                                
                                
                                    <td>Is Active Cancer Treatment?</td>
                                
                                
                                    <td>4</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;
      or &quot;Has Active Cancer Diagnosis on Problem List&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 Likely Terminal for Opioid Prescribing</td>
                                
                                
                                    <td>5</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Conditions Likely Terminal for Opioid Prescribing&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>6</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;Is Active Cancer Treatment?&quot;
    and not &quot;Conditions Likely Terminal for Opioid Prescribing&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>Inclusion Criteria For UDS Recommendation</td>
                                
                                
                                    <td>7</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">/*
@description: Determines whether an opioid review is appropriate for the patient and whether they had a UDS performed in the past year
*/
define &quot;Inclusion Criteria For UDS Recommendation&quot;:
  Routines.&quot;Is Opioid Review Useful?&quot;
    and not exists (
      if Config.&quot;Use Alternative UDS Lookback Period&quot;
        then &quot;All Opioid or Non-opioid UDS in Alternative Lookback Period&quot;
      else &quot;All Opioid or Non-opioid UDS in Lookback Period&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>OpioidCDSREC10OrderSign</td>
                                
                                
                                    <td>Is Perform Drug Screen Recommendation Applicable?</td>
                                
                                
                                    <td>8</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 For UDS Recommendation&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>Amphetamine Simple Identifier</td>
                                
                                
                                    <td>9</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Amphetamine Simple Identifier&quot;: 'Amphetamine'</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>UDS Lookback Period</td>
                                
                                
                                    <td>10</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// Constants

define &quot;UDS Lookback Period&quot;:
  Interval[Today() - 12 months - 1 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>OpioidCDSREC10Common</td>
                                
                                
                                    <td>All Opioid or Non-opioid UDS in Lookback Period</td>
                                
                                
                                    <td>11</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;All Opioid or Non-opioid UDS in Lookback Period&quot;:
  (
    [Observation: Common.&quot;All Drug Urine Screening&quot;] Lab
      where date from Lab.effective in day of &quot;UDS Lookback Period&quot;
        and not (
          Lab.status in { 'unknown', 'entered-in-error', 'cancelled' }
        )
  ) X sort by date from effective desc</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>Amphetamine Screenings In Lookback Period</td>
                                
                                
                                    <td>12</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// Amphetamines
define &quot;Amphetamine Screenings In Lookback Period&quot;:
  &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
    where Lab.code in Common.&quot;Amphetamine 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>Positive Amphetamine Screenings In Lookback Period</td>
                                
                                
                                    <td>13</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Positive Amphetamine Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Amphetamine Screenings In Lookback Period&quot;, true)</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>Negative Amphetamine Screenings In Lookback Period</td>
                                
                                
                                    <td>14</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Negative Amphetamine Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Amphetamine Screenings In Lookback Period&quot;, true)</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>Rx Lookback Period</td>
                                
                                
                                    <td>15</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Rx Lookback Period&quot;:
  Interval[Today() - 12 months - 31 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>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Normalize Rx In Lookback Period</td>
                                
                                
                                    <td>16</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Normalize Rx In Lookback Period&quot;:
  Common.&quot;Get MedicationRequest Medication as Code&quot;(
    [MedicationRequest: category in Common.&quot;Community&quot;] Rx
      where Rx.status in { 'active', 'completed', 'stopped' }
        and Rx.intent = 'order'
        and Common.&quot;GetDateFromMedicationRequest&quot;(Rx) in day of &quot;Rx Lookback Period&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>Amphetamine Rx In Lookback Period</td>
                                
                                
                                    <td>17</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Amphetamine Rx In Lookback Period&quot;:
  &quot;Normalize Rx In Lookback Period&quot; Rx
      where Rx.medication in Common.&quot;Amphetamine Medications&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>Barbiturate Simple Identifier</td>
                                
                                
                                    <td>18</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Barbiturate Simple Identifier&quot;: 'Barbiturate'</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>Barbiturate Screenings In Lookback Period</td>
                                
                                
                                    <td>19</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// Barbiturates
define &quot;Barbiturate Screenings In Lookback Period&quot;:
  &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
    where Lab.code in Common.&quot;Barbiturate 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>Positive Barbiturate Screenings In Lookback Period</td>
                                
                                
                                    <td>20</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Positive Barbiturate Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Barbiturate Screenings In Lookback Period&quot;, true)</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>Negative Barbiturate Screenings In Lookback Period</td>
                                
                                
                                    <td>21</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Negative Barbiturate Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Barbiturate Screenings In Lookback Period&quot;, true)</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>Barbiturate Rx In Lookback Period</td>
                                
                                
                                    <td>22</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Barbiturate Rx In Lookback Period&quot;:
  &quot;Normalize Rx In Lookback Period&quot; Rx
      where Rx.medication in Common.&quot;Barbiturate Medications&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>Benzodiazepine Simple Identifier</td>
                                
                                
                                    <td>23</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Benzodiazepine Simple Identifier&quot;: 'Benzodiazepine'</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>Benzodiazepine Screenings In Lookback Period</td>
                                
                                
                                    <td>24</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// Benzodiazepines
define &quot;Benzodiazepine Screenings In Lookback Period&quot;:
  &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
    where Lab.code in Common.&quot;Benzodiazepine 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>Positive Benzodiazepine Screenings In Lookback Period</td>
                                
                                
                                    <td>25</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Positive Benzodiazepine Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Benzodiazepine Screenings In Lookback Period&quot;, true)</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>Negative Benzodiazepine Screenings In Lookback Period</td>
                                
                                
                                    <td>26</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Negative Benzodiazepine Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Benzodiazepine Screenings In Lookback Period&quot;, true)</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>Benzodiazepine Rx In Lookback Period</td>
                                
                                
                                    <td>27</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Benzodiazepine Rx In Lookback Period&quot;:
  &quot;Normalize Rx In Lookback Period&quot; Rx
    where Rx.medication in Common.&quot;Benzodiazepine medications&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>Buprenorphine Simple Identifier</td>
                                
                                
                                    <td>28</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Buprenorphine Simple Identifier&quot;: 'Buprenorphine'</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>Buprenorphine Screenings In Lookback Period</td>
                                
                                
                                    <td>29</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// Buprenorphine
define &quot;Buprenorphine Screenings In Lookback Period&quot;:
  &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
    where Lab.code in Common.&quot;Buprenorphine 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>Positive Buprenorphine Screenings In Lookback Period</td>
                                
                                
                                    <td>30</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Positive Buprenorphine Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Buprenorphine Screenings In Lookback Period&quot;, true)</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>Negative Buprenorphine Screenings In Lookback Period</td>
                                
                                
                                    <td>31</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Negative Buprenorphine Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Buprenorphine Screenings In Lookback Period&quot;, true)</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>Buprenorphine Rx In Lookback Period</td>
                                
                                
                                    <td>32</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Buprenorphine Rx In Lookback Period&quot;:
  &quot;Normalize Rx In Lookback Period&quot; Rx
    where Rx.medication in Common.&quot;Buprenorphine Medications&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>Cannabinoid Simple Identifier</td>
                                
                                
                                    <td>33</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Cannabinoid Simple Identifier&quot;: 'Cannabinoid'</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>Cannabinoid Screenings In Lookback Period</td>
                                
                                
                                    <td>34</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// Cannabinoids
define &quot;Cannabinoid Screenings In Lookback Period&quot;:
  if Config.&quot;Cannabinoid Urine Screening Check Enabled&quot;
    then (
      &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
        where Lab.code in Common.&quot;Cannabinoid Urine Tests&quot;
    ) else null</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>OpioidCDSCommonConfig</td>
                                
                                
                                    <td>Cannabinoid Urine Screening Check Enabled</td>
                                
                                
                                    <td>35</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Cannabinoid Urine Screening Check Enabled&quot;:
  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>Positive Cannabinoid Screenings In Lookback Period</td>
                                
                                
                                    <td>36</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Positive Cannabinoid Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Cannabinoid Screenings In Lookback Period&quot;, Config.&quot;Cannabinoid Urine Screening Check Enabled&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>Negative Cannabinoid Screenings In Lookback Period</td>
                                
                                
                                    <td>37</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Negative Cannabinoid Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Cannabinoid Screenings In Lookback Period&quot;, Config.&quot;Cannabinoid Urine Screening Check Enabled&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 Simple Identifier</td>
                                
                                
                                    <td>38</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Cocaine Simple Identifier&quot;: 'Cocaine'</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 In Lookback Period</td>
                                
                                
                                    <td>39</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// Cocaine
define &quot;Cocaine Screenings In Lookback Period&quot;:
  &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
    where Lab.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>Positive Cocaine Screenings In Lookback Period</td>
                                
                                
                                    <td>40</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Positive Cocaine Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Cocaine Screenings In Lookback Period&quot;, true)</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>Negative Cocaine Screenings In Lookback Period</td>
                                
                                
                                    <td>41</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Negative Cocaine Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Cocaine Screenings In Lookback Period&quot;, true)</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>Fentanyl Simple Identifier</td>
                                
                                
                                    <td>42</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Fentanyl Simple Identifier&quot;: 'Fentanyl'</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>Fentanyl Screenings In Lookback Period</td>
                                
                                
                                    <td>43</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// Fentanyl
define &quot;Fentanyl Screenings In Lookback Period&quot;:
  if Config.&quot;Opiate Urine Screening Check Enabled&quot;
  then (
    &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; AllLabs
      where AllLabs.code in Common.&quot;Fentanyl Urine Tests&quot;
  ) else null</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>OpioidCDSCommonConfig</td>
                                
                                
                                    <td>Opiate Urine Screening Check Enabled</td>
                                
                                
                                    <td>44</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// Recommendation 10
define &quot;Opiate Urine Screening Check Enabled&quot;:
  true</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>Positive Fentanyl Screenings In Lookback Period</td>
                                
                                
                                    <td>45</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Positive Fentanyl Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Fentanyl Screenings In Lookback Period&quot;, Config.&quot;Opiate Urine Screening Check Enabled&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>Negative Fentanyl Screenings In Lookback Period</td>
                                
                                
                                    <td>46</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Negative Fentanyl Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Fentanyl Screenings In Lookback Period&quot;, Config.&quot;Opiate Urine Screening Check Enabled&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>Fentanyl Rx In Lookback Period</td>
                                
                                
                                    <td>47</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Fentanyl Rx In Lookback Period&quot;:
  &quot;Normalize Rx In Lookback Period&quot; Rx
    where Rx.medication in Common.&quot;Fentanyl Medications&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>Heroin Simple Identifier</td>
                                
                                
                                    <td>48</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Heroin Simple Identifier&quot;: 'Heroin (6-AM)'</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>Heroin Screenings In Lookback Period</td>
                                
                                
                                    <td>49</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// Heroin
define &quot;Heroin Screenings In Lookback Period&quot;:
  &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
    where Lab.code in Common.&quot;Heroin 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>Positive Heroin Screenings In Lookback Period</td>
                                
                                
                                    <td>50</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Positive Heroin Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Heroin Screenings In Lookback Period&quot;, true)</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>Negative Heroin Screenings In Lookback Period</td>
                                
                                
                                    <td>51</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Negative Heroin Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Heroin Screenings In Lookback Period&quot;, true)</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>Methadone Simple Identifier</td>
                                
                                
                                    <td>52</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Methadone Simple Identifier&quot;: 'Methadone'</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>Methadone Screenings In Lookback Period</td>
                                
                                
                                    <td>53</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// Methadone
define &quot;Methadone Screenings In Lookback Period&quot;:
  &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
    where Lab.code in Common.&quot;Methadone 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>Positive Methadone Screenings In Lookback Period</td>
                                
                                
                                    <td>54</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Positive Methadone Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Methadone Screenings In Lookback Period&quot;, true)</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>Negative Methadone Screenings In Lookback Period</td>
                                
                                
                                    <td>55</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Negative Methadone Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Methadone Screenings In Lookback Period&quot;, true)</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>Methadone Rx In Lookback Period</td>
                                
                                
                                    <td>56</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Methadone Rx In Lookback Period&quot;:
  &quot;Normalize Rx In Lookback Period&quot; Rx
    where Rx.medication in Common.&quot;Methadone Medications&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>Opiate Simple Identifier</td>
                                
                                
                                    <td>57</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Opiate Simple Identifier&quot;: 'Opiate'</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>Opiate Screenings In Lookback Period</td>
                                
                                
                                    <td>58</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// Opiates
define &quot;Opiate Screenings In Lookback Period&quot;:
  if Config.&quot;Opiate Urine Screening Check Enabled&quot;
    then (
      &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
        where Lab.code in Common.&quot;General Opiate Urine Tests&quot;
    ) else null</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>Positive Opiate Screenings In Lookback Period</td>
                                
                                
                                    <td>59</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Positive Opiate Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Opiate Screenings In Lookback Period&quot;, Config.&quot;Opiate Urine Screening Check Enabled&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>Negative Opiate Screenings In Lookback Period</td>
                                
                                
                                    <td>60</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Negative Opiate Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Opiate Screenings In Lookback Period&quot;, Config.&quot;Opiate Urine Screening Check Enabled&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>Opiate Rx In Lookback Period</td>
                                
                                
                                    <td>61</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Opiate Rx In Lookback Period&quot;:
  &quot;Normalize Rx In Lookback Period&quot; Rx
    where Rx.medication in Common.&quot;Opiate Medications&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>Oxycodone Simple Identifier</td>
                                
                                
                                    <td>62</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Oxycodone Simple Identifier&quot;: 'Oxycodone'</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>Oxycodone Screenings In Lookback Period</td>
                                
                                
                                    <td>63</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// Oxycodone
define &quot;Oxycodone Screenings In Lookback Period&quot;:
  if Config.&quot;Opiate Urine Screening Check Enabled&quot;
    then (
      &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
        where Lab.code in Common.&quot;Oxycodone Urine Tests&quot;
    ) else null</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>Positive Oxycodone Screenings In Lookback Period</td>
                                
                                
                                    <td>64</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Positive Oxycodone Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Oxycodone Screenings In Lookback Period&quot;, Config.&quot;Opiate Urine Screening Check Enabled&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>Negative Oxycodone Screenings In Lookback Period</td>
                                
                                
                                    <td>65</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Negative Oxycodone Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Oxycodone Screenings In Lookback Period&quot;, Config.&quot;Opiate Urine Screening Check Enabled&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>Oxycodone Rx In Lookback Period</td>
                                
                                
                                    <td>66</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Oxycodone Rx In Lookback Period&quot;:
  &quot;Normalize Rx In Lookback Period&quot; Rx
    where Rx.medication in Common.&quot;Oxycodone Medications&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 Simple Identifier</td>
                                
                                
                                    <td>67</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;PCP Simple Identifier&quot;: 'Phencyclidine (PCP)'</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 In Lookback Period</td>
                                
                                
                                    <td>68</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// PCP
define &quot;PCP Screenings In Lookback Period&quot;:
  &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; AllLabs
    where AllLabs.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>Positive PCP Screenings In Lookback Period</td>
                                
                                
                                    <td>69</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Positive PCP Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;PCP Screenings In Lookback Period&quot;, true)</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>Negative PCP Screenings In Lookback Period</td>
                                
                                
                                    <td>70</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Negative PCP Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;PCP Screenings In Lookback Period&quot;, true)</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>Unexpected Details</td>
                                
                                
                                    <td>71</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// Details Logic

define &quot;Unexpected Details&quot;:
  {
    CreateDetailWithPossibleUnexpectedNegative(
      &quot;Amphetamine Simple Identifier&quot;, &quot;Positive Amphetamine Screenings In Lookback Period&quot;, 
      &quot;Negative Amphetamine Screenings In Lookback Period&quot;, &quot;Amphetamine Rx In Lookback Period&quot;
    ),
    CreateDetailWithPossibleUnexpectedNegative(
      &quot;Barbiturate Simple Identifier&quot;, &quot;Positive Barbiturate Screenings In Lookback Period&quot;, 
      &quot;Negative Barbiturate Screenings In Lookback Period&quot;, &quot;Barbiturate Rx In Lookback Period&quot;
    ),
    CreateDetailWithPossibleUnexpectedNegative(
      &quot;Benzodiazepine Simple Identifier&quot;, &quot;Positive Benzodiazepine Screenings In Lookback Period&quot;, 
      &quot;Negative Benzodiazepine Screenings In Lookback Period&quot;, &quot;Benzodiazepine Rx In Lookback Period&quot;
    ),
    CreateDetailWithPossibleUnexpectedNegative(
      &quot;Buprenorphine Simple Identifier&quot;, &quot;Positive Buprenorphine Screenings In Lookback Period&quot;, 
      &quot;Negative Buprenorphine Screenings In Lookback Period&quot;, &quot;Buprenorphine Rx In Lookback Period&quot;
    ),
    CreateDetailWithoutPossibleUnexpectedNegative(
      &quot;Cannabinoid Simple Identifier&quot;, &quot;Positive Cannabinoid Screenings In Lookback Period&quot;, 
      &quot;Negative Cannabinoid Screenings In Lookback Period&quot;
    ),
    CreateDetailWithoutPossibleUnexpectedNegative(
      &quot;Cocaine Simple Identifier&quot;, &quot;Positive Cocaine Screenings In Lookback Period&quot;, 
      &quot;Negative Cocaine Screenings In Lookback Period&quot;
    ),
    CreateDetailWithPossibleUnexpectedNegative(
      &quot;Fentanyl Simple Identifier&quot;, &quot;Positive Fentanyl Screenings In Lookback Period&quot;, 
      &quot;Negative Fentanyl Screenings In Lookback Period&quot;, &quot;Fentanyl Rx In Lookback Period&quot;
    ),
    CreateDetailWithoutPossibleUnexpectedNegative(
      &quot;Heroin Simple Identifier&quot;, &quot;Positive Heroin Screenings In Lookback Period&quot;, 
      &quot;Negative Heroin Screenings In Lookback Period&quot;
    ),
    CreateDetailWithPossibleUnexpectedNegative(
      &quot;Methadone Simple Identifier&quot;, &quot;Positive Methadone Screenings In Lookback Period&quot;, 
      &quot;Negative Methadone Screenings In Lookback Period&quot;, &quot;Methadone Rx In Lookback Period&quot;
    ),
    CreateDetailWithPossibleUnexpectedNegative(
      &quot;Opiate Simple Identifier&quot;, &quot;Positive Opiate Screenings In Lookback Period&quot;, 
      &quot;Negative Opiate Screenings In Lookback Period&quot;, &quot;Opiate Rx In Lookback Period&quot;
    ),
    CreateDetailWithPossibleUnexpectedNegative(
      &quot;Oxycodone Simple Identifier&quot;, &quot;Positive Oxycodone Screenings In Lookback Period&quot;, 
      &quot;Negative Oxycodone Screenings In Lookback Period&quot;, &quot;Oxycodone Rx In Lookback Period&quot;
    ),
    CreateDetailWithoutPossibleUnexpectedNegative(
      &quot;PCP Simple Identifier&quot;, &quot;Positive PCP Screenings In Lookback Period&quot;, 
      &quot;Negative PCP Screenings In Lookback Period&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>Remove Substances Without Positive or Negative Results</td>
                                
                                
                                    <td>72</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Remove Substances Without Positive or Negative Results&quot;:
  &quot;Unexpected Details&quot; Details
    where (Details.posDates is not null and Length(Details.posDates) != 0)
      or (Details.negDates is not null and Length(Details.negDates) != 0)</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 For Unexpected Results</td>
                                
                                
                                    <td>73</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Inclusion Criteria For Unexpected Results&quot;:
  Routines.&quot;Is Opioid Review Useful?&quot;
  and AnyTrue(
    &quot;Remove Substances Without Positive or Negative Results&quot; Details
      return (exists Details.unexpectedPosDetails) or (exists Details.unexpectedNegDetails)
  )</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>OpioidCDSREC10OrderSign</td>
                                
                                
                                    <td>Applicable Because of Unexpected Results</td>
                                
                                
                                    <td>74</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Applicable Because of Unexpected Results&quot;:
  &quot;Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential&quot;
    and Rec10Common.&quot;Inclusion Criteria For Unexpected Results&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>Style Header</td>
                                
                                
                                    <td>75</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Style Header&quot;:
  '&lt;style&gt;\r\n  .alert-body {\r\n    width: 670px;\r\n    font-family: segoe-ui, sans-serif;\r\n    background-color: #FEFFF1;\r\n  }\r\n\r\n  .details-table {\r\n    border-collapse:collapse;\r\n    border-style: ridge;\r\n    background-color: #FEFFF1;\r\n    padding: 2px;\r\n  }\r\n\r\n  .details-caption {\r\n    border-style: ridge;\r\n    border-bottom: none;\r\n    background-color: #FEFFF1;\r\n    padding: 2px;\r\n  }\r\n\r\n  .details-table-header {\r\n    border-style: ridge;\r\n    padding: 5px;\r\n  }\r\n\r\n  .details-table-cell {\r\n    border-style: ridge;\r\n    padding: 5px;\r\n  }\r\n\r\n  .details-table-footer-cell {\r\n    border-style: ridge;\r\n    padding: 5px;\r\n    font-size: small;\r\n  }\r\n\r\n  .details-table-cell-unexpected {\r\n    border-style: ridge;\r\n    padding: 5px;\r\n    color: red;\r\n    font-weight: bold;\r\n  }\r\n\r\n  .more-text {\r\n    position: relative;\r\n    margin-bottom: 2em;\r\n  }\r\n  \r\n  .more {\r\n    display:none;\r\n  }\r\n\r\n  .show-more:checked + .more {\r\n    display:block;\r\n  }\r\n&lt;\/style&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>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Unexpected Div Start</td>
                                
                                
                                    <td>76</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Unexpected Div Start&quot;:
  '&lt;div class=\&quot;alert-body\&quot;&gt;&lt;div&gt;&lt;p&gt;Patient may have &lt;strong&gt;unexpected urine toxicology test results&lt;\/strong&gt; in the past year.&lt;\/p&gt;&lt;\/div&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>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Table Start</td>
                                
                                
                                    <td>77</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Table Start&quot;:
  '&lt;div&gt;&lt;table class=\&quot;details-table\&quot;&gt;&lt;caption class=\&quot;details-caption\&quot;&gt;Urine Toxicology Results&lt;\/caption&gt;&lt;tr&gt;&lt;th class=\&quot;details-table-header\&quot;&gt;Substance&lt;\/th&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>OpioidCDSREC10Common</td>
                                
                                
                                    <td>All Lab Dates in Lookback Period</td>
                                
                                
                                    <td>78</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// Helpers  

define &quot;All Lab Dates in Lookback Period&quot;:
  (
    &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
      return date from Lab.effective
  ) X sort desc</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>Table Headers</td>
                                
                                
                                    <td>79</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Table Headers&quot;:
  &quot;All Lab Dates in Lookback Period&quot; LabDate
    return '&lt;th class=\&quot;details-table-header\&quot;&gt;' &amp; ToString(LabDate) &amp; '&lt;\/th&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>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Generate Table Rows</td>
                                
                                
                                    <td>80</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Generate Table Rows&quot;:
  &quot;Remove Substances Without Positive or Negative Results&quot; BOT
    let row: ToString(IndexOf(&quot;Remove Substances Without Positive or Negative Results&quot;, BOT) + 1)
    return '&lt;tr&gt;' + GetExpectedColumn(BOT.ingredient) + Combine(
      &quot;All Lab Dates in Lookback Period&quot; LabDate
        let col: ToString(IndexOf(&quot;All Lab Dates in Lookback Period&quot;, LabDate) + 2)
        return all (
          if BOT.unexpectedPosDetails.date contains LabDate
            then GetUnexpectedColumn('pos', row &amp; ':' &amp; col)
          else if BOT.unexpectedNegDetails.udsDate contains LabDate
            then GetUnexpectedColumn('neg', row &amp; ':' &amp; col)
          else if BOT.posDates contains LabDate
            then GetExpectedColumn('pos*')
          else if BOT.negDates contains LabDate
            then GetExpectedColumn('neg*')
          else GetExpectedColumn('n/a')
        )
    ) + '&lt;\/tr&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>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Generate Footer Rows</td>
                                
                                
                                    <td>81</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Generate Footer Rows&quot;:
  &quot;Remove Substances Without Positive or Negative Results&quot; BOT
      let row: ToString(IndexOf(&quot;Remove Substances Without Positive or Negative Results&quot;, BOT) + 1),
      colspan: Length(&quot;All Lab Dates in Lookback Period&quot;) + 1
      return Combine(
          &quot;All Lab Dates in Lookback Period&quot; LabDate
            let col: ToString(IndexOf(&quot;All Lab Dates in Lookback Period&quot;, LabDate) + 2)
            return all (
              if BOT.unexpectedPosDetails.date contains LabDate
                then Coalesce(
                  BOT.unexpectedPosDetails PosDetail
                    where PosDetail.date same day as LabDate
                      return '&lt;tr&gt;' &amp; GetFooterColumn(colspan, row &amp; ':' &amp; col &amp; ' - Possible unexpected substance found: ' &amp; PosDetail.udsDetail) &amp; '&lt;\/tr&gt;'
                )
              else if BOT.unexpectedNegDetails.udsDate contains LabDate
                then Coalesce(
                  BOT.unexpectedNegDetails NegDetail
                    where NegDetail.udsDate same day as LabDate
                      return '&lt;tr&gt;' &amp; GetFooterColumn(colspan, row + ':' &amp; col &amp; ' - Possible unexpected negative result found: prescribed ' &amp; NegDetail.rxDetail &amp; ' on ' &amp; ToString(NegDetail.rxDate)) &amp; '&lt;\/tr&gt;'
                )
              else ''
            )
      )</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>Table End</td>
                                
                                
                                    <td>82</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Table End&quot;:
  '&lt;\/table&gt;&lt;\/div&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>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Details Table</td>
                                
                                
                                    <td>83</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Details Table&quot;: 
  &quot;Table Start&quot; &amp; Combine(&quot;Table Headers&quot;) 
    &amp; '&lt;tbody&gt;' &amp; Combine(&quot;Generate Table Rows&quot;) &amp; '&lt;/tbody&gt;' 
    &amp; '&lt;tfoot&gt;' &amp; Combine(&quot;Generate Footer Rows&quot;) &amp; '&lt;\/tfoot&gt;' 
  &amp; &quot;Table End&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>Expected Result Footnote</td>
                                
                                
                                    <td>84</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Expected Result Footnote&quot;:
  '&lt;div&gt;* - These are expected results based on an analysis of the patient\'s medication list 30 days prior to the corresponding lab results.&lt;\/div&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>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Details More Info</td>
                                
                                
                                    <td>85</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Details More Info&quot;:
  '&lt;div id=\&quot;box\&quot;&gt;\r\n  &lt;p&gt;Note on false positives and unexpected negative results...&lt;\/p&gt;\r\n  &lt;input type=\&quot;checkbox\&quot; class=\&quot;show-more\&quot;&gt; Show more\r\n  &lt;div class=\&quot;more\&quot;&gt;\r\n  &lt;p&gt;An unexpectedly negative test may be due to time since last dose, diversion, intermittent use, aberrant drug use behavior, or other factors, including a false negative result. Clinicians should interpret this result in the context of the overall treatment plan.&lt;\/p&gt;\r\n\r\n  &lt;p&gt;Positive results may be a false positives or could represent occasional use or possible substance use disorder.&lt;br\/&gt;&lt;br\/&gt;For a review regarding interpreting possible false positive urine toxicology results, see &lt;a target=\&quot;_blank\&quot; href=\&quot;https:\/\/pubmed.ncbi.nlm.nih.gov\/24986836\&quot;&gt;http:\/\/pubmed.ncbi.nlm.nih.gov\/24986836&lt;\/a&gt;. It is unknown if the findings reported in this article can be extrapolated to other laboratory analyzers that were not used in the referenced studies.&lt;br\/&gt;&lt;br\/&gt;For guidance regarding evaluating and addressing unexpected toxicology tests results, see &lt;a target=\&quot;_blank\&quot; href=\&quot;https:\/\/www.cdc.gov\/mmwr\/volumes\/71\/rr\/rr7103a1.htm#Recommendation10\&quot;&gt;Recommendation 10 of the 22 CDC Clinical Practice Guideiline&lt;\/a&gt;.&lt;\/p&gt;&lt;\/div&gt;\r\n&lt;\/div&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>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Div End</td>
                                
                                
                                    <td>86</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Div End&quot;: '&lt;\/div&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>OpioidCDSREC10Common</td>
                                
                                
                                    <td>Get HTML Details</td>
                                
                                
                                    <td>87</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// HTML Generation

define &quot;Get HTML Details&quot;:
  Common.&quot;Style Header&quot; &amp; &quot;Unexpected Div Start&quot; &amp; &quot;Details Table&quot; &amp; &quot;Expected Result Footnote&quot; &amp; &quot;Details More Info&quot; &amp; &quot;Div End&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>OpioidCDSREC10OrderSign</td>
                                
                                
                                    <td>Detail</td>
                                
                                
                                    <td>88</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define &quot;Detail&quot;:
  Rec10Common.&quot;Get HTML Details&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>Is Opioid Analgesic with Ambulatory Misuse Potential?</td>
                                
                                
                                    <td>89</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define function &quot;Is Opioid Analgesic with Ambulatory Misuse Potential?&quot;(value List&lt;MedicationRequest&gt;):
  (&quot;Get MedicationRequest Medication as Code&quot;(value)) Rx
    where Rx.medication in &quot;Opioid analgesics with ambulatory misuse potential&quot; 
      and Rx.category in &quot;Community&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>Get MedicationRequest Medication as Code</td>
                                
                                
                                    <td>90</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define function &quot;Get MedicationRequest Medication as Code&quot;(value List&lt;MedicationRequest&gt;):
  value Rx
    let Med: 
      if Rx.medication is Reference then singleton from (
        [Medication] M
          where M.id = (Last(Split((Rx.medication as FHIR.Reference).reference, '/')))
      ) else null
    return 
      MedicationRequest {
        id: Rx.id,
        status: Rx.status,
        intent: Rx.intent,
        category: Rx.category,
        medication: if Rx.medication is Reference then Med.code else Rx.medication as CodeableConcept,
        subject: Rx.subject,
        authoredOn: Rx.authoredOn,
        recorder: Rx.recorder,
        dosageInstruction: Rx.dosageInstruction,
        dispenseRequest: Rx.dispenseRequest
      }</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>FHIRHelpers</td>
                                
                                
                                    <td>ToConcept</td>
                                
                                
                                    <td>91</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define function ToConcept(concept FHIR.CodeableConcept):
    if concept is null then
        null
    else
        System.Concept {
            codes: concept.coding C return ToCode(C),
            display: concept.text.value
        }</code></pre>
                        
                        <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 Subacute or Chronic Pain Prescription?</td>
                                
                                
                                    <td>92</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">// End of Active Cancer Treatment Routine

/*
**  Routine #4
**  For Subacute or Chronic Pain Routine
**
**  Definition                  | Answer to Proceed   | Details                                        | Data (Terminology) Requirement
**  -----------------------------------------------------------------------------------------------------------------------------------
**  Order for opioid analgesic  | Yes                 | Order for opioid analgesics with ambulatory    | Opioid analgesics with
**  with expected supply        |                     | misuse potential with a supply duration of &gt;=  | ambulatory misuse potential
**  duration &gt;= 28 days         |                     | 28 days                                        |
**                              |                     |                                                |
**                              |                     | - Subacute definition = order for opioid       |
**                              |                     |   analgesics with ambulatory misuse            |
**                              |                     |   potential with a supply duration of one to   |
**                              |                     |   two months.                                  |
**                              |                     | - Chronic pain definition = order for opioid   |
**                              |                     |   analgesics with ambulatory misuse            |
**                              |                     |   potential with a supply duration of &gt;= two   |
**                              |                     |   months.                                      |
**  -----------------------------------------------------------------------------------------------------------------------------------
**
*/

define function &quot;Is Subacute or Chronic Pain Prescription?&quot;(prescription FHIR.MedicationRequest):
  &quot;Is Subacute or Chronic Pain Using Expected Supply Duration&quot;(prescription)
    or &quot;Is Subacute or Chronic Pain Using Validity Period&quot;(prescription)</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 Subacute or Chronic Pain Using Expected Supply Duration</td>
                                
                                
                                    <td>93</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define function &quot;Is Subacute or Chronic Pain Using Expected Supply Duration&quot;(prescription FHIR.MedicationRequest):
  (
    prescription.dispenseRequest is not null
      and prescription.dispenseRequest.expectedSupplyDuration is not null
      and (
        Common.GetDurationInDays(prescription.dispenseRequest.expectedSupplyDuration) &gt;= 28 days 
      )
  )</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>GetDurationInDays</td>
                                
                                
                                    <td>94</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define function GetDurationInDays(value FHIR.Duration):
  if value is null then null
  else
    case
      when value.code.value ~ 'a' then System.Quantity{ value: value.value.value * 365.0, unit: 'days' }
      when value.code.value ~ 'mo' then System.Quantity{ value: value.value.value * 30.0, unit: 'days' }
      when value.code.value ~ 'wk' then System.Quantity{ value: value.value.value * 7.0, unit: 'days' }
      when value.code.value ~ 'd' then System.Quantity{ value: value.value.value, unit: 'days' }
      when value.code.value ~ 'h' then System.Quantity{ value: value.value.value / 24.0, unit: 'days' }
      when value.code.value ~ 'min' then System.Quantity{ value: value.value.value / 60.0 / 24.0, unit: 'days' }
      when value.code.value ~ 's' then System.Quantity{ value: value.value.value / 60.0 / 60.0 / 24.0, unit: 'days' }
      when value.code.value ~ 'ms' then System.Quantity{ value: value.value.value / 60.0 / 60.0 / 24.0 / 1000.0, unit: 'days' }
      when value.code.value is null then Message(1000, true, 'Undefined', 'Error', 'Duration unit code is null')
      else Message(1000, true, 'Undefined', 'Error', 'Unsupported duration unit code: ' + value.code.value)
end</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 Subacute or Chronic Pain Using Validity Period</td>
                                
                                
                                    <td>95</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define function &quot;Is Subacute or Chronic Pain Using Validity Period&quot;(prescription FHIR.MedicationRequest):
  (
    prescription.dispenseRequest is not null
      and prescription.dispenseRequest.validityPeriod is not null
      and (
        days between prescription.dispenseRequest.validityPeriod.start and prescription.dispenseRequest.validityPeriod.end &gt;= 28 
      )
  )</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>FHIRHelpers</td>
                                
                                
                                    <td>ToDateTime</td>
                                
                                
                                    <td>96</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define function ToDateTime(value dateTime): value.value</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>CreateDetailWithPossibleUnexpectedNegative</td>
                                
                                
                                    <td>97</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define function CreateDetailWithPossibleUnexpectedNegative(TheSubstance String, ThePosLabs List&lt;Observation&gt;, TheNegLabs List&lt;Observation&gt;, TheMeds List&lt;MedicationRequest&gt;):
  {
    ingredient: TheSubstance,
    posDates: (
      ThePosLabs PosLab
        return date from PosLab.effective
    ),
    negDates: (
      TheNegLabs NegLab
        return date from NegLab.effective
    ),
    unexpectedPosDetails: (
      ThePosLabs PosLab
        where not exists (
          TheMeds Rx
            where Common.GetDateFromMedicationRequest(Rx)
              in day of Interval[
                date from PosLab.effective - 31 days,
                date from PosLab.effective - 1 days
              ]
        )
        return {
          date: date from PosLab.effective,
          udsDetail:
            if exists(PosLab.code.coding)
              then PosLab.code.coding[0].display
              else 'Unable to determine a detailed identifier'
        }
    ),
    unexpectedNegDetails: (
      from TheNegLabs NegLab,
        ( if exists(TheMeds) then TheMeds else { null as MedicationRequest } ) Rx
        let medDate: Common.GetDateFromMedicationRequest(Rx)
          where medDate in day of Interval[date from NegLab.effective - 31 days, date from NegLab.effective - 1 days]
          return {
            udsDate: date from NegLab.effective,
            udsDetail: if exists (NegLab.code.coding) then NegLab.code.coding[0].display else 'Unable to determine a detailed identifier',
            rxDate: medDate,
            rxDetail: 
              if Rx.medication.text is not null then Rx.medication.text
              else if exists (Rx.medication.coding) and Rx.medication.coding[0].display is not null then Rx.medication.coding[0].display 
              else 'Unable to determine a detailed identifier'
          }
    )
  }</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>GetDateFromMedicationRequest</td>
                                
                                
                                    <td>98</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define function &quot;GetDateFromMedicationRequest&quot;(med FHIR.MedicationRequest):
  if med is null then
    null
  else if med.authoredOn is not null then
    date from med.authoredOn
  else
    Max(
      med.dosageInstruction DI
        return Coalesce(
          // If there are timing events, take the latest.
          Max(DI.timing.event E return date from E),
          // Otherwise, if there's a Period, use its start.
          if DI.timing.repeat is not null
             and DI.timing.repeat.bounds is FHIR.Period
          then
            date from start of FHIRHelpers.ToInterval(DI.timing.repeat.bounds as FHIR.Period)
          else
            null
        )
    )</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>GetPositiveLabsInLookbackPeriod</td>
                                
                                
                                    <td>99</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define function GetPositiveLabsInLookbackPeriod(Labs List&lt;FHIR.Observation&gt;, Enabled Boolean):
  if Enabled
    then Labs Lab
     where StartsWith(Lower(Lab.value as FHIR.string), 'pos')
  else {}</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>FHIRHelpers</td>
                                
                                
                                    <td>ToString</td>
                                
                                
                                    <td>100</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define function ToString(value ObservationStatus): value.value</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>GetNegativeLabsInLookbackPeriod</td>
                                
                                
                                    <td>101</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define function GetNegativeLabsInLookbackPeriod(Labs List&lt;FHIR.Observation&gt;, Enabled Boolean):
  if Enabled
    then Labs Lab
     where StartsWith(Lower(Lab.value as FHIR.string), 'neg')
  else {}</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>CreateDetailWithoutPossibleUnexpectedNegative</td>
                                
                                
                                    <td>102</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define function CreateDetailWithoutPossibleUnexpectedNegative(TheSubstance String, ThePosLabs List&lt;Observation&gt;, TheNegLabs List&lt;Observation&gt;):
  {
    ingredient: TheSubstance,
    posDates: (
      ThePosLabs PosLab
        return date from PosLab.effective
    ),
    negDates: (
      TheNegLabs NegLab
        return date from NegLab.effective
    ),
    unexpectedPosDetails: (
      ThePosLabs PosLab
        return {
          date: date from PosLab.effective,
          udsDetail: if exists (PosLab.code.coding) then PosLab.code.coding[0].display else 'Unable to determine a detailed identifier'
        }
    ),
    unexpectedNegDetails: {
      null as Tuple{ udsDate System.Date, udsDetail System.String, rxDate System.Date, rxDetail System.String }
    }
  }</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>GetExpectedColumn</td>
                                
                                
                                    <td>103</td>
                                
                            </tr>
                        </table>
                        
                            <pre style="max-width: 990px;"><code class="language-cql">define function GetExpectedColumn(Content String):
  '&lt;td class=\&quot;details-table-cell\&quot;&gt;' &amp; Content &amp; '&lt;\/td&gt;'</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>
                    
                      <tr>
                        <td>focus</td>
                        <td/>
                        <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 clinicians and patients about the benefits and risks of pain treatments, including opioid therapy; improve the effectiveness and safety of pain treatment; mitigate pain; improve function and quality of life for patients with pain; and reduce risks associated with opioid pain therapy, including opioid use disorder, overdose, and death. The recommendations do not apply to pain related to sickle cell disease or cancer or to patients receiving palliative or end-of-life care.</p>
</div></td>
        </tr>
        
        
        <tr>
            <th scope="row"><b>Usage: </b></th>
            <td style="padding-left: 4px;">Before starting opioids and periodically (at least annually) during opioid therapy, clinicians should consider the benefits and risks of toxicology testing to assess for prescribed opioids and other prescription and nonprescription controlled substances that increase risk for overdose when combined with opioids, including nonprescribed and illicit opioids and benzodiazepines.</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>Related Artifacts: </b></th>
          <td style="padding-left: 4px;">
            
            <p><b>Documentation</b></p>
            <ul>
              
                  <li>
                    <a href="https://www.cdc.gov/mmwr/volumes/71/rr/pdfs/rr7103a1-H.pdf"> 2022 CDC Clinical Practice Guideline for Prescribing Opioids for Pain</a>
                  </li>
              
            </ul>
            
            
            
            
            
            
            
          </td>
        </tr>
        

        
        <tr>
          <th scope="row"><b>Libraries: </b></th>
          <td style="padding-left: 4px;">
            <table class="grid-dict">
              
                <tr><td><a href="Library-OpioidCDSREC10OrderSign.html">Library - Recommendation #10 - 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> Consider the Benefits and Risks of Conducting a Urine Toxicology Screen:</b> Consider the benefits and risks of toxicology testing to assess for prescribed medications as well as other prescribed and nonprescribed controlled substances.

For guidance regarding utilizing toxicology tests when prescribing opioids, see [Recommendation 10 of the 2022 CDC Clinical Practice Guideline](https://www.cdc.gov/mmwr/volumes/71/rr/rr7103a1.htm#Recommendation10).<br/>
                    <b>When:</b> <i>Named Event:</i> order-sign<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> <br/>
                              
                              
                              <b>Then:</b>
                              
                                
                                
                              
                            </td>
                          </tr>
                        
                          <tr>
                            <td>
                              <b> :</b> <br/>
                              
                              
                              <b>Then:</b>
                              
                                
                                
                              
                            </td>
                          </tr>
                        
                          <tr>
                            <td>
                              <b> :</b> <br/>
                              
                              
                              <b>Then:</b>
                              
                                
                                
                              
                            </td>
                          </tr>
                        
                          <tr>
                            <td>
                              <b> :</b> <br/>
                              
                              
                              <b>Then:</b>
                              
                                
                                
                              
                            </td>
                          </tr>
                        
                      </table>
                    
                  </td>
                </tr>
              
                <tr>
                  <td>
                    <b> Patient May Have Unexpected Toxicology Test Results:</b> Patient may have unexpected urine toxicology test results in the past year<br/>
                    <b>When:</b> <i>Named Event:</i> order-sign<br/>
                    <b>If:</b> <i>Applicability:</i> Patient may have unexpected urine toxicology test results in the past year <i>(Applicable Because of Unexpected Results)</i><br/>
                    <b>Then:</b>
                    
                      <table class="grid-dict">
                        
                          <tr>
                            <td>
                              <b> :</b> <br/>
                              
                              
                              <b>Then:</b>
                              
                                
                                
                              
                            </td>
                          </tr>
                        
                          <tr>
                            <td>
                              <b> :</b> <br/>
                              
                              
                              <b>Then:</b>
                              
                                
                                
                              
                            </td>
                          </tr>
                        
                          <tr>
                            <td>
                              <b> :</b> <br/>
                              
                              
                              <b>Then:</b>
                              
                                
                                
                              
                            </td>
                          </tr>
                        
                      </table>
                    
                  </td>
                </tr>
              
            </table>
          </td>
        </tr>
        
    </table>
</div>
  </text>
  <contained>
    <Library>
      <id value="effective-data-requirements"/>
      <name value="EffectiveDataRequirements"/>
      <status value="active"/>
      <type>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/library-type"/>
          <code value="module-definition"/>
        </coding>
      </type>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library Common"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSCommon|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="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 Config"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSCommonConfig|2022.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display
                 value="Value set Opioid analgesics with ambulatory misuse potential"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-analgesics-with-ambulatory-misuse-potential"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Community"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/medicationrequest-category-community"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set All Drug Urine Screening"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/all-urine-drug-screening-tests"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Amphetamine Urine Tests"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/amphetamine-urine-drug-screening-tests"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Amphetamine Medications"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/amphetamines-class-medications"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Barbiturate Urine Tests"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/barbiturate-urine-drug-screening-tests"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Barbiturate Medications"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/barbiturate-medications"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Benzodiazepine Urine Tests"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/benzodiazepine-urine-drug-screening-tests"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Benzodiazepine medications"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/benzodiazepine-medications"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Buprenorphine Urine Tests"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/buprenorphine-urine-drug-screening-tests"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Buprenorphine Medications"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/buprenorphine-medications"/>
      </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 Fentanyl Medications"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/fentanyl-type-medications"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Heroin Urine Tests"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/heroin-urine-drug-screening-tests"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Methadone Urine Tests"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/methadone-urine-drug-screening-tests"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Methadone Medications"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/methadone-medications"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Opiate Medications"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/non-synthetic-opioid-medications"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Oxycodone Medications"/>
        <resource
                  value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/oxycodone-medications"/>
      </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>
      <parameter>
        <name value="ContextPrescriptions"/>
        <use value="in"/>
        <min value="0"/>
        <max value="*"/>
        <type value="MedicationRequest"/>
      </parameter>
      <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="Applicable Because of Unexpected Results"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="boolean"/>
      </parameter>
      <parameter>
        <name value="Detail"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="string"/>
      </parameter>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mustSupport value="code"/>
        <mustSupport value="effective"/>
        <mustSupport value="status"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/all-urine-drug-screening-tests"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="MedicationRequest"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/MedicationRequest"/>
        <mustSupport value="category"/>
        <mustSupport value="status"/>
        <mustSupport value="intent"/>
        <mustSupport value="id"/>
        <mustSupport value="subject"/>
        <mustSupport value="authoredOn"/>
        <mustSupport value="recorder"/>
        <mustSupport value="dosageInstruction"/>
        <mustSupport value="dispenseRequest"/>
        <mustSupport value="medication"/>
        <codeFilter>
          <path value="category"/>
          <valueSet
                    value="http://fhir.org/guides/cdc/opioid-cds/ValueSet/medicationrequest-category-community"/>
        </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/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10OrderSign"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Subacute or Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Subacute or Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions&quot;:
  ( Common.&quot;Is Opioid Analgesic with Ambulatory Misuse Potential?&quot;( ContextPrescriptions ) ) AmbulatoryOpioidPrescription
    where Routines.&quot;Is Subacute or Chronic Pain Prescription?&quot;( AmbulatoryOpioidPrescription )"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="0"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10OrderSign"/>
    </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;Subacute or Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions&quot; )"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="1"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-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="2"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-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="3"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-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;
      or &quot;Has Active Cancer Diagnosis on Problem List&quot;
  else false"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="4"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSRoutines"/>
    </extension>
    <extension url="name">
      <valueString value="Conditions Likely Terminal for Opioid Prescribing"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Conditions Likely Terminal for Opioid Prescribing&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="5"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-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;Is Active Cancer Treatment?&quot;
    and not &quot;Conditions Likely Terminal for Opioid Prescribing&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="6"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Inclusion Criteria For UDS Recommendation"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="/*
@description: Determines whether an opioid review is appropriate for the patient and whether they had a UDS performed in the past year
*/
define &quot;Inclusion Criteria For UDS Recommendation&quot;:
  Routines.&quot;Is Opioid Review Useful?&quot;
    and not exists (
      if Config.&quot;Use Alternative UDS Lookback Period&quot;
        then &quot;All Opioid or Non-opioid UDS in Alternative Lookback Period&quot;
      else &quot;All Opioid or Non-opioid UDS in Lookback Period&quot;
    )"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="7"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10OrderSign"/>
    </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 For UDS Recommendation&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="8"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Amphetamine Simple Identifier"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Amphetamine Simple Identifier&quot;: 'Amphetamine'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="9"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="UDS Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// Constants

define &quot;UDS Lookback Period&quot;:
  Interval[Today() - 12 months - 1 days, Today()]"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="10"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="All Opioid or Non-opioid UDS in Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;All Opioid or Non-opioid UDS in Lookback Period&quot;:
  (
    [Observation: Common.&quot;All Drug Urine Screening&quot;] Lab
      where date from Lab.effective in day of &quot;UDS Lookback Period&quot;
        and not (
          Lab.status in { 'unknown', 'entered-in-error', 'cancelled' }
        )
  ) X sort by date from effective desc"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="11"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Amphetamine Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// Amphetamines
define &quot;Amphetamine Screenings In Lookback Period&quot;:
  &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
    where Lab.code in Common.&quot;Amphetamine Urine Tests&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="12"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Positive Amphetamine Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Positive Amphetamine Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Amphetamine Screenings In Lookback Period&quot;, true)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="13"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Negative Amphetamine Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Negative Amphetamine Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Amphetamine Screenings In Lookback Period&quot;, true)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="14"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Rx Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Rx Lookback Period&quot;:
  Interval[Today() - 12 months - 31 days, Today()]"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="15"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Normalize Rx In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Normalize Rx In Lookback Period&quot;:
  Common.&quot;Get MedicationRequest Medication as Code&quot;(
    [MedicationRequest: category in Common.&quot;Community&quot;] Rx
      where Rx.status in { 'active', 'completed', 'stopped' }
        and Rx.intent = 'order'
        and Common.&quot;GetDateFromMedicationRequest&quot;(Rx) in day of &quot;Rx Lookback Period&quot;
  )"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="16"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Amphetamine Rx In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Amphetamine Rx In Lookback Period&quot;:
  &quot;Normalize Rx In Lookback Period&quot; Rx
      where Rx.medication in Common.&quot;Amphetamine Medications&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="17"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Barbiturate Simple Identifier"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Barbiturate Simple Identifier&quot;: 'Barbiturate'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="18"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Barbiturate Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// Barbiturates
define &quot;Barbiturate Screenings In Lookback Period&quot;:
  &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
    where Lab.code in Common.&quot;Barbiturate Urine Tests&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="19"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Positive Barbiturate Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Positive Barbiturate Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Barbiturate Screenings In Lookback Period&quot;, true)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="20"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Negative Barbiturate Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Negative Barbiturate Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Barbiturate Screenings In Lookback Period&quot;, true)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="21"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Barbiturate Rx In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Barbiturate Rx In Lookback Period&quot;:
  &quot;Normalize Rx In Lookback Period&quot; Rx
      where Rx.medication in Common.&quot;Barbiturate Medications&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="22"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Benzodiazepine Simple Identifier"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Benzodiazepine Simple Identifier&quot;: 'Benzodiazepine'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="23"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Benzodiazepine Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// Benzodiazepines
define &quot;Benzodiazepine Screenings In Lookback Period&quot;:
  &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
    where Lab.code in Common.&quot;Benzodiazepine Urine Tests&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="24"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Positive Benzodiazepine Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Positive Benzodiazepine Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Benzodiazepine Screenings In Lookback Period&quot;, true)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="25"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Negative Benzodiazepine Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Negative Benzodiazepine Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Benzodiazepine Screenings In Lookback Period&quot;, true)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="26"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Benzodiazepine Rx In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Benzodiazepine Rx In Lookback Period&quot;:
  &quot;Normalize Rx In Lookback Period&quot; Rx
    where Rx.medication in Common.&quot;Benzodiazepine medications&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="27"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Buprenorphine Simple Identifier"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Buprenorphine Simple Identifier&quot;: 'Buprenorphine'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="28"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Buprenorphine Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// Buprenorphine
define &quot;Buprenorphine Screenings In Lookback Period&quot;:
  &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
    where Lab.code in Common.&quot;Buprenorphine Urine Tests&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="29"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Positive Buprenorphine Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Positive Buprenorphine Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Buprenorphine Screenings In Lookback Period&quot;, true)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="30"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Negative Buprenorphine Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Negative Buprenorphine Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Buprenorphine Screenings In Lookback Period&quot;, true)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="31"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Buprenorphine Rx In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Buprenorphine Rx In Lookback Period&quot;:
  &quot;Normalize Rx In Lookback Period&quot; Rx
    where Rx.medication in Common.&quot;Buprenorphine Medications&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="32"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Cannabinoid Simple Identifier"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Cannabinoid Simple Identifier&quot;: 'Cannabinoid'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="33"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Cannabinoid Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// Cannabinoids
define &quot;Cannabinoid Screenings In Lookback Period&quot;:
  if Config.&quot;Cannabinoid Urine Screening Check Enabled&quot;
    then (
      &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
        where Lab.code in Common.&quot;Cannabinoid Urine Tests&quot;
    ) else null"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="34"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSCommonConfig"/>
    </extension>
    <extension url="name">
      <valueString value="Cannabinoid Urine Screening Check Enabled"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Cannabinoid Urine Screening Check Enabled&quot;:
  false"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="35"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Positive Cannabinoid Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Positive Cannabinoid Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Cannabinoid Screenings In Lookback Period&quot;, Config.&quot;Cannabinoid Urine Screening Check Enabled&quot;)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="36"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Negative Cannabinoid Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Negative Cannabinoid Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Cannabinoid Screenings In Lookback Period&quot;, Config.&quot;Cannabinoid Urine Screening Check Enabled&quot;)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="37"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Cocaine Simple Identifier"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Cocaine Simple Identifier&quot;: 'Cocaine'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="38"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Cocaine Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// Cocaine
define &quot;Cocaine Screenings In Lookback Period&quot;:
  &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
    where Lab.code in Common.&quot;Cocaine Urine Tests&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="39"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Positive Cocaine Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Positive Cocaine Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Cocaine Screenings In Lookback Period&quot;, true)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="40"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Negative Cocaine Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Negative Cocaine Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Cocaine Screenings In Lookback Period&quot;, true)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="41"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Fentanyl Simple Identifier"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Fentanyl Simple Identifier&quot;: 'Fentanyl'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="42"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Fentanyl Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// Fentanyl
define &quot;Fentanyl Screenings In Lookback Period&quot;:
  if Config.&quot;Opiate Urine Screening Check Enabled&quot;
  then (
    &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; AllLabs
      where AllLabs.code in Common.&quot;Fentanyl Urine Tests&quot;
  ) else null"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="43"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSCommonConfig"/>
    </extension>
    <extension url="name">
      <valueString value="Opiate Urine Screening Check Enabled"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// Recommendation 10
define &quot;Opiate Urine Screening Check Enabled&quot;:
  true"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="44"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Positive Fentanyl Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Positive Fentanyl Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Fentanyl Screenings In Lookback Period&quot;, Config.&quot;Opiate Urine Screening Check Enabled&quot;)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="45"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Negative Fentanyl Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Negative Fentanyl Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Fentanyl Screenings In Lookback Period&quot;, Config.&quot;Opiate Urine Screening Check Enabled&quot;)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="46"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Fentanyl Rx In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Fentanyl Rx In Lookback Period&quot;:
  &quot;Normalize Rx In Lookback Period&quot; Rx
    where Rx.medication in Common.&quot;Fentanyl Medications&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="47"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Heroin Simple Identifier"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Heroin Simple Identifier&quot;: 'Heroin (6-AM)'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="48"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Heroin Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// Heroin
define &quot;Heroin Screenings In Lookback Period&quot;:
  &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
    where Lab.code in Common.&quot;Heroin Urine Tests&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="49"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Positive Heroin Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Positive Heroin Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Heroin Screenings In Lookback Period&quot;, true)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="50"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Negative Heroin Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Negative Heroin Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Heroin Screenings In Lookback Period&quot;, true)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="51"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Methadone Simple Identifier"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Methadone Simple Identifier&quot;: 'Methadone'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="52"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Methadone Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// Methadone
define &quot;Methadone Screenings In Lookback Period&quot;:
  &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
    where Lab.code in Common.&quot;Methadone Urine Tests&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="53"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Positive Methadone Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Positive Methadone Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Methadone Screenings In Lookback Period&quot;, true)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="54"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Negative Methadone Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Negative Methadone Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Methadone Screenings In Lookback Period&quot;, true)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="55"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Methadone Rx In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Methadone Rx In Lookback Period&quot;:
  &quot;Normalize Rx In Lookback Period&quot; Rx
    where Rx.medication in Common.&quot;Methadone Medications&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="56"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Opiate Simple Identifier"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Opiate Simple Identifier&quot;: 'Opiate'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="57"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Opiate Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// Opiates
define &quot;Opiate Screenings In Lookback Period&quot;:
  if Config.&quot;Opiate Urine Screening Check Enabled&quot;
    then (
      &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
        where Lab.code in Common.&quot;General Opiate Urine Tests&quot;
    ) else null"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="58"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Positive Opiate Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Positive Opiate Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Opiate Screenings In Lookback Period&quot;, Config.&quot;Opiate Urine Screening Check Enabled&quot;)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="59"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Negative Opiate Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Negative Opiate Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Opiate Screenings In Lookback Period&quot;, Config.&quot;Opiate Urine Screening Check Enabled&quot;)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="60"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Opiate Rx In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Opiate Rx In Lookback Period&quot;:
  &quot;Normalize Rx In Lookback Period&quot; Rx
    where Rx.medication in Common.&quot;Opiate Medications&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="61"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Oxycodone Simple Identifier"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Oxycodone Simple Identifier&quot;: 'Oxycodone'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="62"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Oxycodone Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// Oxycodone
define &quot;Oxycodone Screenings In Lookback Period&quot;:
  if Config.&quot;Opiate Urine Screening Check Enabled&quot;
    then (
      &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
        where Lab.code in Common.&quot;Oxycodone Urine Tests&quot;
    ) else null"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="63"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Positive Oxycodone Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Positive Oxycodone Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;Oxycodone Screenings In Lookback Period&quot;, Config.&quot;Opiate Urine Screening Check Enabled&quot;)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="64"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Negative Oxycodone Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Negative Oxycodone Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;Oxycodone Screenings In Lookback Period&quot;, Config.&quot;Opiate Urine Screening Check Enabled&quot;)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="65"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Oxycodone Rx In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Oxycodone Rx In Lookback Period&quot;:
  &quot;Normalize Rx In Lookback Period&quot; Rx
    where Rx.medication in Common.&quot;Oxycodone Medications&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="66"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="PCP Simple Identifier"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;PCP Simple Identifier&quot;: 'Phencyclidine (PCP)'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="67"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="PCP Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// PCP
define &quot;PCP Screenings In Lookback Period&quot;:
  &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; AllLabs
    where AllLabs.code in Common.&quot;PCP Urine Tests&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="68"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Positive PCP Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Positive PCP Screenings In Lookback Period&quot;:
  GetPositiveLabsInLookbackPeriod(&quot;PCP Screenings In Lookback Period&quot;, true)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="69"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Negative PCP Screenings In Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Negative PCP Screenings In Lookback Period&quot;:
  GetNegativeLabsInLookbackPeriod(&quot;PCP Screenings In Lookback Period&quot;, true)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="70"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Unexpected Details"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// Details Logic

define &quot;Unexpected Details&quot;:
  {
    CreateDetailWithPossibleUnexpectedNegative(
      &quot;Amphetamine Simple Identifier&quot;, &quot;Positive Amphetamine Screenings In Lookback Period&quot;, 
      &quot;Negative Amphetamine Screenings In Lookback Period&quot;, &quot;Amphetamine Rx In Lookback Period&quot;
    ),
    CreateDetailWithPossibleUnexpectedNegative(
      &quot;Barbiturate Simple Identifier&quot;, &quot;Positive Barbiturate Screenings In Lookback Period&quot;, 
      &quot;Negative Barbiturate Screenings In Lookback Period&quot;, &quot;Barbiturate Rx In Lookback Period&quot;
    ),
    CreateDetailWithPossibleUnexpectedNegative(
      &quot;Benzodiazepine Simple Identifier&quot;, &quot;Positive Benzodiazepine Screenings In Lookback Period&quot;, 
      &quot;Negative Benzodiazepine Screenings In Lookback Period&quot;, &quot;Benzodiazepine Rx In Lookback Period&quot;
    ),
    CreateDetailWithPossibleUnexpectedNegative(
      &quot;Buprenorphine Simple Identifier&quot;, &quot;Positive Buprenorphine Screenings In Lookback Period&quot;, 
      &quot;Negative Buprenorphine Screenings In Lookback Period&quot;, &quot;Buprenorphine Rx In Lookback Period&quot;
    ),
    CreateDetailWithoutPossibleUnexpectedNegative(
      &quot;Cannabinoid Simple Identifier&quot;, &quot;Positive Cannabinoid Screenings In Lookback Period&quot;, 
      &quot;Negative Cannabinoid Screenings In Lookback Period&quot;
    ),
    CreateDetailWithoutPossibleUnexpectedNegative(
      &quot;Cocaine Simple Identifier&quot;, &quot;Positive Cocaine Screenings In Lookback Period&quot;, 
      &quot;Negative Cocaine Screenings In Lookback Period&quot;
    ),
    CreateDetailWithPossibleUnexpectedNegative(
      &quot;Fentanyl Simple Identifier&quot;, &quot;Positive Fentanyl Screenings In Lookback Period&quot;, 
      &quot;Negative Fentanyl Screenings In Lookback Period&quot;, &quot;Fentanyl Rx In Lookback Period&quot;
    ),
    CreateDetailWithoutPossibleUnexpectedNegative(
      &quot;Heroin Simple Identifier&quot;, &quot;Positive Heroin Screenings In Lookback Period&quot;, 
      &quot;Negative Heroin Screenings In Lookback Period&quot;
    ),
    CreateDetailWithPossibleUnexpectedNegative(
      &quot;Methadone Simple Identifier&quot;, &quot;Positive Methadone Screenings In Lookback Period&quot;, 
      &quot;Negative Methadone Screenings In Lookback Period&quot;, &quot;Methadone Rx In Lookback Period&quot;
    ),
    CreateDetailWithPossibleUnexpectedNegative(
      &quot;Opiate Simple Identifier&quot;, &quot;Positive Opiate Screenings In Lookback Period&quot;, 
      &quot;Negative Opiate Screenings In Lookback Period&quot;, &quot;Opiate Rx In Lookback Period&quot;
    ),
    CreateDetailWithPossibleUnexpectedNegative(
      &quot;Oxycodone Simple Identifier&quot;, &quot;Positive Oxycodone Screenings In Lookback Period&quot;, 
      &quot;Negative Oxycodone Screenings In Lookback Period&quot;, &quot;Oxycodone Rx In Lookback Period&quot;
    ),
    CreateDetailWithoutPossibleUnexpectedNegative(
      &quot;PCP Simple Identifier&quot;, &quot;Positive PCP Screenings In Lookback Period&quot;, 
      &quot;Negative PCP Screenings In Lookback Period&quot;
    )
  }"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="71"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Remove Substances Without Positive or Negative Results"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Remove Substances Without Positive or Negative Results&quot;:
  &quot;Unexpected Details&quot; Details
    where (Details.posDates is not null and Length(Details.posDates) != 0)
      or (Details.negDates is not null and Length(Details.negDates) != 0)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="72"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Inclusion Criteria For Unexpected Results"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Inclusion Criteria For Unexpected Results&quot;:
  Routines.&quot;Is Opioid Review Useful?&quot;
  and AnyTrue(
    &quot;Remove Substances Without Positive or Negative Results&quot; Details
      return (exists Details.unexpectedPosDetails) or (exists Details.unexpectedNegDetails)
  )"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="73"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10OrderSign"/>
    </extension>
    <extension url="name">
      <valueString value="Applicable Because of Unexpected Results"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Applicable Because of Unexpected Results&quot;:
  &quot;Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential&quot;
    and Rec10Common.&quot;Inclusion Criteria For Unexpected Results&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="74"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSCommon"/>
    </extension>
    <extension url="name">
      <valueString value="Style Header"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Style Header&quot;:
  '&lt;style&gt;\r\n  .alert-body {\r\n    width: 670px;\r\n    font-family: segoe-ui, sans-serif;\r\n    background-color: #FEFFF1;\r\n  }\r\n\r\n  .details-table {\r\n    border-collapse:collapse;\r\n    border-style: ridge;\r\n    background-color: #FEFFF1;\r\n    padding: 2px;\r\n  }\r\n\r\n  .details-caption {\r\n    border-style: ridge;\r\n    border-bottom: none;\r\n    background-color: #FEFFF1;\r\n    padding: 2px;\r\n  }\r\n\r\n  .details-table-header {\r\n    border-style: ridge;\r\n    padding: 5px;\r\n  }\r\n\r\n  .details-table-cell {\r\n    border-style: ridge;\r\n    padding: 5px;\r\n  }\r\n\r\n  .details-table-footer-cell {\r\n    border-style: ridge;\r\n    padding: 5px;\r\n    font-size: small;\r\n  }\r\n\r\n  .details-table-cell-unexpected {\r\n    border-style: ridge;\r\n    padding: 5px;\r\n    color: red;\r\n    font-weight: bold;\r\n  }\r\n\r\n  .more-text {\r\n    position: relative;\r\n    margin-bottom: 2em;\r\n  }\r\n  \r\n  .more {\r\n    display:none;\r\n  }\r\n\r\n  .show-more:checked + .more {\r\n    display:block;\r\n  }\r\n&lt;\/style&gt;'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="75"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Unexpected Div Start"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Unexpected Div Start&quot;:
  '&lt;div class=\&quot;alert-body\&quot;&gt;&lt;div&gt;&lt;p&gt;Patient may have &lt;strong&gt;unexpected urine toxicology test results&lt;\/strong&gt; in the past year.&lt;\/p&gt;&lt;\/div&gt;'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="76"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Table Start"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Table Start&quot;:
  '&lt;div&gt;&lt;table class=\&quot;details-table\&quot;&gt;&lt;caption class=\&quot;details-caption\&quot;&gt;Urine Toxicology Results&lt;\/caption&gt;&lt;tr&gt;&lt;th class=\&quot;details-table-header\&quot;&gt;Substance&lt;\/th&gt;'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="77"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="All Lab Dates in Lookback Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// Helpers  

define &quot;All Lab Dates in Lookback Period&quot;:
  (
    &quot;All Opioid or Non-opioid UDS in Lookback Period&quot; Lab
      return date from Lab.effective
  ) X sort desc"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="78"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Table Headers"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Table Headers&quot;:
  &quot;All Lab Dates in Lookback Period&quot; LabDate
    return '&lt;th class=\&quot;details-table-header\&quot;&gt;' &amp; ToString(LabDate) &amp; '&lt;\/th&gt;'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="79"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Generate Table Rows"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Generate Table Rows&quot;:
  &quot;Remove Substances Without Positive or Negative Results&quot; BOT
    let row: ToString(IndexOf(&quot;Remove Substances Without Positive or Negative Results&quot;, BOT) + 1)
    return '&lt;tr&gt;' + GetExpectedColumn(BOT.ingredient) + Combine(
      &quot;All Lab Dates in Lookback Period&quot; LabDate
        let col: ToString(IndexOf(&quot;All Lab Dates in Lookback Period&quot;, LabDate) + 2)
        return all (
          if BOT.unexpectedPosDetails.date contains LabDate
            then GetUnexpectedColumn('pos', row &amp; ':' &amp; col)
          else if BOT.unexpectedNegDetails.udsDate contains LabDate
            then GetUnexpectedColumn('neg', row &amp; ':' &amp; col)
          else if BOT.posDates contains LabDate
            then GetExpectedColumn('pos*')
          else if BOT.negDates contains LabDate
            then GetExpectedColumn('neg*')
          else GetExpectedColumn('n/a')
        )
    ) + '&lt;\/tr&gt;'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="80"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Generate Footer Rows"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Generate Footer Rows&quot;:
  &quot;Remove Substances Without Positive or Negative Results&quot; BOT
      let row: ToString(IndexOf(&quot;Remove Substances Without Positive or Negative Results&quot;, BOT) + 1),
      colspan: Length(&quot;All Lab Dates in Lookback Period&quot;) + 1
      return Combine(
          &quot;All Lab Dates in Lookback Period&quot; LabDate
            let col: ToString(IndexOf(&quot;All Lab Dates in Lookback Period&quot;, LabDate) + 2)
            return all (
              if BOT.unexpectedPosDetails.date contains LabDate
                then Coalesce(
                  BOT.unexpectedPosDetails PosDetail
                    where PosDetail.date same day as LabDate
                      return '&lt;tr&gt;' &amp; GetFooterColumn(colspan, row &amp; ':' &amp; col &amp; ' - Possible unexpected substance found: ' &amp; PosDetail.udsDetail) &amp; '&lt;\/tr&gt;'
                )
              else if BOT.unexpectedNegDetails.udsDate contains LabDate
                then Coalesce(
                  BOT.unexpectedNegDetails NegDetail
                    where NegDetail.udsDate same day as LabDate
                      return '&lt;tr&gt;' &amp; GetFooterColumn(colspan, row + ':' &amp; col &amp; ' - Possible unexpected negative result found: prescribed ' &amp; NegDetail.rxDetail &amp; ' on ' &amp; ToString(NegDetail.rxDate)) &amp; '&lt;\/tr&gt;'
                )
              else ''
            )
      )"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="81"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Table End"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Table End&quot;:
  '&lt;\/table&gt;&lt;\/div&gt;'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="82"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Details Table"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Details Table&quot;: 
  &quot;Table Start&quot; &amp; Combine(&quot;Table Headers&quot;) 
    &amp; '&lt;tbody&gt;' &amp; Combine(&quot;Generate Table Rows&quot;) &amp; '&lt;/tbody&gt;' 
    &amp; '&lt;tfoot&gt;' &amp; Combine(&quot;Generate Footer Rows&quot;) &amp; '&lt;\/tfoot&gt;' 
  &amp; &quot;Table End&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="83"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Expected Result Footnote"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Expected Result Footnote&quot;:
  '&lt;div&gt;* - These are expected results based on an analysis of the patient\'s medication list 30 days prior to the corresponding lab results.&lt;\/div&gt;'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="84"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Details More Info"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Details More Info&quot;:
  '&lt;div id=\&quot;box\&quot;&gt;\r\n  &lt;p&gt;Note on false positives and unexpected negative results...&lt;\/p&gt;\r\n  &lt;input type=\&quot;checkbox\&quot; class=\&quot;show-more\&quot;&gt; Show more\r\n  &lt;div class=\&quot;more\&quot;&gt;\r\n  &lt;p&gt;An unexpectedly negative test may be due to time since last dose, diversion, intermittent use, aberrant drug use behavior, or other factors, including a false negative result. Clinicians should interpret this result in the context of the overall treatment plan.&lt;\/p&gt;\r\n\r\n  &lt;p&gt;Positive results may be a false positives or could represent occasional use or possible substance use disorder.&lt;br\/&gt;&lt;br\/&gt;For a review regarding interpreting possible false positive urine toxicology results, see &lt;a target=\&quot;_blank\&quot; href=\&quot;https:\/\/pubmed.ncbi.nlm.nih.gov\/24986836\&quot;&gt;http:\/\/pubmed.ncbi.nlm.nih.gov\/24986836&lt;\/a&gt;. It is unknown if the findings reported in this article can be extrapolated to other laboratory analyzers that were not used in the referenced studies.&lt;br\/&gt;&lt;br\/&gt;For guidance regarding evaluating and addressing unexpected toxicology tests results, see &lt;a target=\&quot;_blank\&quot; href=\&quot;https:\/\/www.cdc.gov\/mmwr\/volumes\/71\/rr\/rr7103a1.htm#Recommendation10\&quot;&gt;Recommendation 10 of the 22 CDC Clinical Practice Guideiline&lt;\/a&gt;.&lt;\/p&gt;&lt;\/div&gt;\r\n&lt;\/div&gt;'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="85"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Div End"/>
    </extension>
    <extension url="statement">
      <valueString value="define &quot;Div End&quot;: '&lt;\/div&gt;'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="86"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="Get HTML Details"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// HTML Generation

define &quot;Get HTML Details&quot;:
  Common.&quot;Style Header&quot; &amp; &quot;Unexpected Div Start&quot; &amp; &quot;Details Table&quot; &amp; &quot;Expected Result Footnote&quot; &amp; &quot;Details More Info&quot; &amp; &quot;Div End&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="87"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10OrderSign"/>
    </extension>
    <extension url="name">
      <valueString value="Detail"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Detail&quot;:
  Rec10Common.&quot;Get HTML Details&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="88"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSCommon"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Is Opioid Analgesic with Ambulatory Misuse Potential?"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define function &quot;Is Opioid Analgesic with Ambulatory Misuse Potential?&quot;(value List&lt;MedicationRequest&gt;):
  (&quot;Get MedicationRequest Medication as Code&quot;(value)) Rx
    where Rx.medication in &quot;Opioid analgesics with ambulatory misuse potential&quot; 
      and Rx.category in &quot;Community&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="89"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSCommon"/>
    </extension>
    <extension url="name">
      <valueString value="Get MedicationRequest Medication as Code"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define function &quot;Get MedicationRequest Medication as Code&quot;(value List&lt;MedicationRequest&gt;):
  value Rx
    let Med: 
      if Rx.medication is Reference then singleton from (
        [Medication] M
          where M.id = (Last(Split((Rx.medication as FHIR.Reference).reference, '/')))
      ) else null
    return 
      MedicationRequest {
        id: Rx.id,
        status: Rx.status,
        intent: Rx.intent,
        category: Rx.category,
        medication: if Rx.medication is Reference then Med.code else Rx.medication as CodeableConcept,
        subject: Rx.subject,
        authoredOn: Rx.authoredOn,
        recorder: Rx.recorder,
        dosageInstruction: Rx.dosageInstruction,
        dispenseRequest: Rx.dispenseRequest
      }"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="90"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="FHIRHelpers"/>
    </extension>
    <extension url="name">
      <valueString value="ToConcept"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define function ToConcept(concept FHIR.CodeableConcept):
    if concept is null then
        null
    else
        System.Concept {
            codes: concept.coding C return ToCode(C),
            display: concept.text.value
        }"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="91"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSRoutines"/>
    </extension>
    <extension url="name">
      <valueString value="Is Subacute or Chronic Pain Prescription?"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="// End of Active Cancer Treatment Routine

/*
**  Routine #4
**  For Subacute or Chronic Pain Routine
**
**  Definition                  | Answer to Proceed   | Details                                        | Data (Terminology) Requirement
**  -----------------------------------------------------------------------------------------------------------------------------------
**  Order for opioid analgesic  | Yes                 | Order for opioid analgesics with ambulatory    | Opioid analgesics with
**  with expected supply        |                     | misuse potential with a supply duration of &gt;=  | ambulatory misuse potential
**  duration &gt;= 28 days         |                     | 28 days                                        |
**                              |                     |                                                |
**                              |                     | - Subacute definition = order for opioid       |
**                              |                     |   analgesics with ambulatory misuse            |
**                              |                     |   potential with a supply duration of one to   |
**                              |                     |   two months.                                  |
**                              |                     | - Chronic pain definition = order for opioid   |
**                              |                     |   analgesics with ambulatory misuse            |
**                              |                     |   potential with a supply duration of &gt;= two   |
**                              |                     |   months.                                      |
**  -----------------------------------------------------------------------------------------------------------------------------------
**
*/

define function &quot;Is Subacute or Chronic Pain Prescription?&quot;(prescription FHIR.MedicationRequest):
  &quot;Is Subacute or Chronic Pain Using Expected Supply Duration&quot;(prescription)
    or &quot;Is Subacute or Chronic Pain Using Validity Period&quot;(prescription)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="92"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSRoutines"/>
    </extension>
    <extension url="name">
      <valueString
                   value="Is Subacute or Chronic Pain Using Expected Supply Duration"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define function &quot;Is Subacute or Chronic Pain Using Expected Supply Duration&quot;(prescription FHIR.MedicationRequest):
  (
    prescription.dispenseRequest is not null
      and prescription.dispenseRequest.expectedSupplyDuration is not null
      and (
        Common.GetDurationInDays(prescription.dispenseRequest.expectedSupplyDuration) &gt;= 28 days 
      )
  )"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="93"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSCommon"/>
    </extension>
    <extension url="name">
      <valueString value="GetDurationInDays"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define function GetDurationInDays(value FHIR.Duration):
  if value is null then null
  else
    case
      when value.code.value ~ 'a' then System.Quantity{ value: value.value.value * 365.0, unit: 'days' }
      when value.code.value ~ 'mo' then System.Quantity{ value: value.value.value * 30.0, unit: 'days' }
      when value.code.value ~ 'wk' then System.Quantity{ value: value.value.value * 7.0, unit: 'days' }
      when value.code.value ~ 'd' then System.Quantity{ value: value.value.value, unit: 'days' }
      when value.code.value ~ 'h' then System.Quantity{ value: value.value.value / 24.0, unit: 'days' }
      when value.code.value ~ 'min' then System.Quantity{ value: value.value.value / 60.0 / 24.0, unit: 'days' }
      when value.code.value ~ 's' then System.Quantity{ value: value.value.value / 60.0 / 60.0 / 24.0, unit: 'days' }
      when value.code.value ~ 'ms' then System.Quantity{ value: value.value.value / 60.0 / 60.0 / 24.0 / 1000.0, unit: 'days' }
      when value.code.value is null then Message(1000, true, 'Undefined', 'Error', 'Duration unit code is null')
      else Message(1000, true, 'Undefined', 'Error', 'Unsupported duration unit code: ' + value.code.value)
end"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="94"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSRoutines"/>
    </extension>
    <extension url="name">
      <valueString value="Is Subacute or Chronic Pain Using Validity Period"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define function &quot;Is Subacute or Chronic Pain Using Validity Period&quot;(prescription FHIR.MedicationRequest):
  (
    prescription.dispenseRequest is not null
      and prescription.dispenseRequest.validityPeriod is not null
      and (
        days between prescription.dispenseRequest.validityPeriod.start and prescription.dispenseRequest.validityPeriod.end &gt;= 28 
      )
  )"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="95"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="FHIRHelpers"/>
    </extension>
    <extension url="name">
      <valueString value="ToDateTime"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define function ToDateTime(value dateTime): value.value"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="96"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="CreateDetailWithPossibleUnexpectedNegative"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define function CreateDetailWithPossibleUnexpectedNegative(TheSubstance String, ThePosLabs List&lt;Observation&gt;, TheNegLabs List&lt;Observation&gt;, TheMeds List&lt;MedicationRequest&gt;):
  {
    ingredient: TheSubstance,
    posDates: (
      ThePosLabs PosLab
        return date from PosLab.effective
    ),
    negDates: (
      TheNegLabs NegLab
        return date from NegLab.effective
    ),
    unexpectedPosDetails: (
      ThePosLabs PosLab
        where not exists (
          TheMeds Rx
            where Common.GetDateFromMedicationRequest(Rx)
              in day of Interval[
                date from PosLab.effective - 31 days,
                date from PosLab.effective - 1 days
              ]
        )
        return {
          date: date from PosLab.effective,
          udsDetail:
            if exists(PosLab.code.coding)
              then PosLab.code.coding[0].display
              else 'Unable to determine a detailed identifier'
        }
    ),
    unexpectedNegDetails: (
      from TheNegLabs NegLab,
        ( if exists(TheMeds) then TheMeds else { null as MedicationRequest } ) Rx
        let medDate: Common.GetDateFromMedicationRequest(Rx)
          where medDate in day of Interval[date from NegLab.effective - 31 days, date from NegLab.effective - 1 days]
          return {
            udsDate: date from NegLab.effective,
            udsDetail: if exists (NegLab.code.coding) then NegLab.code.coding[0].display else 'Unable to determine a detailed identifier',
            rxDate: medDate,
            rxDetail: 
              if Rx.medication.text is not null then Rx.medication.text
              else if exists (Rx.medication.coding) and Rx.medication.coding[0].display is not null then Rx.medication.coding[0].display 
              else 'Unable to determine a detailed identifier'
          }
    )
  }"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="97"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSCommon"/>
    </extension>
    <extension url="name">
      <valueString value="GetDateFromMedicationRequest"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define function &quot;GetDateFromMedicationRequest&quot;(med FHIR.MedicationRequest):
  if med is null then
    null
  else if med.authoredOn is not null then
    date from med.authoredOn
  else
    Max(
      med.dosageInstruction DI
        return Coalesce(
          // If there are timing events, take the latest.
          Max(DI.timing.event E return date from E),
          // Otherwise, if there's a Period, use its start.
          if DI.timing.repeat is not null
             and DI.timing.repeat.bounds is FHIR.Period
          then
            date from start of FHIRHelpers.ToInterval(DI.timing.repeat.bounds as FHIR.Period)
          else
            null
        )
    )"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="98"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="GetPositiveLabsInLookbackPeriod"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define function GetPositiveLabsInLookbackPeriod(Labs List&lt;FHIR.Observation&gt;, Enabled Boolean):
  if Enabled
    then Labs Lab
     where StartsWith(Lower(Lab.value as FHIR.string), 'pos')
  else {}"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="99"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="FHIRHelpers"/>
    </extension>
    <extension url="name">
      <valueString value="ToString"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define function ToString(value ObservationStatus): value.value"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="100"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="GetNegativeLabsInLookbackPeriod"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define function GetNegativeLabsInLookbackPeriod(Labs List&lt;FHIR.Observation&gt;, Enabled Boolean):
  if Enabled
    then Labs Lab
     where StartsWith(Lower(Lab.value as FHIR.string), 'neg')
  else {}"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="101"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="CreateDetailWithoutPossibleUnexpectedNegative"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define function CreateDetailWithoutPossibleUnexpectedNegative(TheSubstance String, ThePosLabs List&lt;Observation&gt;, TheNegLabs List&lt;Observation&gt;):
  {
    ingredient: TheSubstance,
    posDates: (
      ThePosLabs PosLab
        return date from PosLab.effective
    ),
    negDates: (
      TheNegLabs NegLab
        return date from NegLab.effective
    ),
    unexpectedPosDetails: (
      ThePosLabs PosLab
        return {
          date: date from PosLab.effective,
          udsDetail: if exists (PosLab.code.coding) then PosLab.code.coding[0].display else 'Unable to determine a detailed identifier'
        }
    ),
    unexpectedNegDetails: {
      null as Tuple{ udsDate System.Date, udsDetail System.String, rxDate System.Date, rxDetail System.String }
    }
  }"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="102"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="OpioidCDSREC10Common"/>
    </extension>
    <extension url="name">
      <valueString value="GetExpectedColumn"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define function GetExpectedColumn(Content String):
  '&lt;td class=\&quot;details-table-cell\&quot;&gt;' &amp; Content &amp; '&lt;\/td&gt;'"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="103"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements" id="effective-data-requirements">
    <valueCanonical value="#effective-data-requirements"/>
  </extension>
  <url
       value="http://fhir.org/guides/cdc/opioid-cds/PlanDefinition/opioidcds-10-order-sign"/>
  <identifier>
    <use value="official"/>
    <value value="cdc-opioid-guidance"/>
  </identifier>
  <version value="2022.1.0"/>
  <name value="PlanDefinition_Recommendation_10_Order_Sign"/>
  <title value="Recommendation #10 - Urine Drug Testing (order-sign)"/>
  <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="2025-04-24"/>
  <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, clinicians should consider the benefits and risks of toxicology testing to assess for prescribed medications as well as other prescribed and nonprescribed controlled substances."/>
  <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>
  <useContext>
    <code>
      <system
              value="http://terminology.hl7.org/CodeSystem/usage-context-type"/>
      <code value="focus"/>
      <display value="Clinical Focus"/>
    </code>
    <valueCodeableConcept>
      <text value="Subacute pain"/>
    </valueCodeableConcept>
  </useContext>
  <purpose
           value="The 2022 CDC Clinical Practice Guideline for Prescribing Opioids for Pain is intended to improve communication between clinicians and patients about the benefits and risks of pain treatments, including opioid therapy; improve the effectiveness and safety of pain treatment; mitigate pain; improve function and quality of life for patients with pain; and reduce risks associated with opioid pain therapy, including opioid use disorder, overdose, and death. The recommendations do not apply to pain related to sickle cell disease or cancer or to patients receiving palliative or end-of-life care."/>
  <usage
         value="Before starting opioids and periodically (at least annually) during opioid therapy, clinicians should consider the benefits and risks of toxicology testing to assess for prescribed opioids and other prescription and nonprescription controlled substances that increase risk for overdose when combined with opioids, including nonprescribed and illicit opioids and benzodiazepines."/>
  <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>
  <relatedArtifact>
    <type value="documentation"/>
    <display
             value="2022 CDC Clinical Practice Guideline for Prescribing Opioids for Pain"/>
    <url value="https://www.cdc.gov/mmwr/volumes/71/rr/pdfs/rr7103a1-H.pdf"/>
    <document>
      <contentType value="application/pdf"/>
      <language value="en-US"/>
      <url
           value="https://www.cdc.gov/mmwr/volumes/71/rr/pdfs/rr7103a1-H.pdf"/>
    </document>
  </relatedArtifact>
  <library
           value="http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSREC10OrderSign"/>
  <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>
    <title
           value="Consider the Benefits and Risks of Conducting a Urine Toxicology Screen"/>
    <description
                 value="Consider the benefits and risks of toxicology testing to assess for prescribed medications as well as other prescribed and nonprescribed controlled substances.

For guidance regarding utilizing toxicology tests when prescribing opioids, see [Recommendation 10 of the 2022 CDC Clinical Practice Guideline](https://www.cdc.gov/mmwr/volumes/71/rr/rr7103a1.htm#Recommendation10)."/>
    <priority value="urgent"/>
    <trigger>
      <type value="named-event"/>
      <name value="order-sign"/>
    </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>
    <action>
      <reason>
        <coding>
          <system
                  value="http://fhir.org/guides/cdc/opioid-cds/CodeSystem/opioidcds-overrideReasons"/>
          <code value="UToxAccepted"/>
          <display value="Action Taken"/>
        </coding>
        <text value="Document - Ordered toxicology screen"/>
      </reason>
    </action>
    <action>
      <reason>
        <coding>
          <system
                  value="http://fhir.org/guides/cdc/opioid-cds/CodeSystem/opioidcds-overrideReasons"/>
          <code value="UToxNA"/>
          <display value="Alert not appropriate"/>
        </coding>
        <text value="Document - Risks outweigh benefits"/>
      </reason>
    </action>
    <action>
      <reason>
        <coding>
          <system
                  value="http://fhir.org/guides/cdc/opioid-cds/CodeSystem/opioidcds-overrideReasons"/>
          <code value="UToxPDeclined"/>
          <display value="Action not taken"/>
        </coding>
        <text value="Snooze - N/A see comment, snooze 3 months"/>
      </reason>
    </action>
    <action>
      <reason>
        <coding>
          <system
                  value="http://fhir.org/guides/cdc/opioid-cds/CodeSystem/opioidcds-overrideReasons"/>
          <code value="UToxWrongProvider"/>
          <display value="Wrong clinician"/>
        </coding>
        <text value="Snooze - N/A see comment, snooze 1 year"/>
      </reason>
    </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>
    <title value="Patient May Have Unexpected Toxicology Test Results"/>
    <description
                 value="Patient may have unexpected urine toxicology test results in the past year"/>
    <priority value="urgent"/>
    <trigger>
      <type value="named-event"/>
      <name value="order-sign"/>
    </trigger>
    <condition>
      <kind value="applicability"/>
      <expression>
        <description
                     value="Patient may have unexpected urine toxicology test results in the past year"/>
        <language value="text/cql.identifier"/>
        <expression value="Applicable Because of Unexpected Results"/>
      </expression>
    </condition>
    <dynamicValue>
      <path value="action.description"/>
      <expression>
        <language value="text/cql.identifier"/>
        <expression value="Detail"/>
      </expression>
    </dynamicValue>
    <action>
      <reason>
        <coding>
          <system
                  value="http://fhir.org/guides/cdc/opioid-cds/CodeSystem/opioidcds-overrideReasons"/>
          <code value="UnExptResultAccepted"/>
          <display value="Action Taken"/>
        </coding>
        <text
              value="Document - Will repeat urine drug screen more frequently"/>
      </reason>
    </action>
    <action>
      <reason>
        <coding>
          <system
                  value="http://fhir.org/guides/cdc/opioid-cds/CodeSystem/opioidcds-overrideReasons"/>
          <code value="UnExptResultNA"/>
          <display value="Alert not appropriate"/>
        </coding>
        <text
              value="The suggestion provided by the service has been declined"/>
      </reason>
    </action>
    <action>
      <reason>
        <coding>
          <system
                  value="http://fhir.org/guides/cdc/opioid-cds/CodeSystem/opioidcds-overrideReasons"/>
          <code value="UnExptResultWrongProvider"/>
          <display value="Wrong clinician"/>
        </coding>
        <text value="Snooze* - N/A snooze for 1 year"/>
      </reason>
    </action>
  </action>
</PlanDefinition>