Opioid Prescribing Support Implementation Guide
2016.4.0 - CI Build

Opioid Prescribing Support 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 2016.4.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/opioid-cds-r4/ and changes regularly. See the Directory of published versions

: PlanDefinition - CDC 2016 Opioid Prescribing Guideline Recommendation #7 - TTL Representation

Draft as of 2022-12-13

Raw ttl | Download

@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sct: <http://snomed.info/id/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

 a fhir:PlanDefinition ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "opioidcds-07"] ; # 
  fhir:meta [
    ( fhir:profile [
fhir:v "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-recommendationdefinition"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-recommendationdefinition>     ] [
fhir:v "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-publishableplandefinition"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-publishableplandefinition>     ] )
  ] ; # 
  fhir:text [
fhir:status [ fhir:v "extensions" ] ;
fhir:div "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n    <table class=\"grid dict\">\n        \n        <tr>\n            <th scope=\"row\"><b>Id: </b></th>\n            <td style=\"padding-left: 4px;\">opioidcds-07</td>\n        </tr>\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Url: </b></th>\n            <td style=\"padding-left: 4px;\"><a href=\"PlanDefinition-opioidcds-07.html\">PlanDefinition - CDC 2016 Opioid Prescribing Guideline Recommendation #7</a></td>\n        </tr>\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Version: </b></th>\n            <td style=\"padding-left: 4px;\">2016.4.0</td>\n        </tr>\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Identifier: </b></th>\n            <td style=\"padding-left: 4px;\">\n                \n                \n                <p style=\"margin-bottom: 5px;\">\n                    <b>value: </b> <span>cdc-opioid-guidance</span>\n                </p>\n                \n            </td>\n        </tr>\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Name: </b></th>\n            <td style=\"padding-left: 4px;\">CDC_opioid_07</td>\n        </tr>\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Title: </b></th>\n            <td style=\"padding-left: 4px;\">PlanDefinition - CDC 2016 Opioid Prescribing Guideline Recommendation #7</td>\n        </tr>\n        \n        \n        \n        <tr>\n            <th scope=\"row\"><b>Status: </b></th>\n            <td style=\"padding-left: 4px;\">draft</td>\n        </tr>\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Experimental: </b></th>\n            <td style=\"padding-left: 4px;\">true</td>\n        </tr>\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Type: </b></th>\n            <td style=\"padding-left: 4px;\">\n                \n                    \n                        \n                        <p style=\"margin-bottom: 5px;\">\n                            <b>system: </b> <span><a href=\"http://hl7.org/fhir/R4/codesystem-plan-definition-type.html\">http://terminology.hl7.org/CodeSystem/plan-definition-type</a></span>\n                        </p>\n                        \n                        \n                        <p style=\"margin-bottom: 5px;\">\n                            <b>code: </b> <span>eca-rule</span>\n                        </p>\n                        \n                        \n                        <p style=\"margin-bottom: 5px;\">\n                            <b>display: </b> <span>ECA Rule</span>\n                        </p>\n                        \n                    \n                \n                \n            </td>\n        </tr>\n        \n        \n        \n        <tr>\n            <th scope=\"row\"><b>Date: </b></th>\n            <td style=\"padding-left: 4px;\">2022-12-13</td>\n        </tr>\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Publisher: </b></th>\n            <td style=\"padding-left: 4px;\">Centers for Disease Control and Prevention (CDC)</td>\n        </tr>\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Description: </b></th>\n            <td style=\"padding-left: 4px;\">Clinicians should evaluate benefits and harms with patients within 1 to 4 weeks of starting opioid therapy for chronic pain or of dose escalation. Clinicians should evaluate benefits and harms of continued therapy with patients every 3 months or more frequently.</td>\n        </tr>\n        \n        \n            <tr>\n                <th scope=\"row\"><a name=\"effective-data-requirements\"> </a><b>Logic Definitions: </b></th>\n                <td style=\"padding-left: 4px;\">\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSREC07</td>\n                                \n                                \n                                    <td>Get Summary</td>\n                                \n                                \n                                    <td>0</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Get Summary&amp;quot;:\n  if &amp;quot;Is Recommendation Applicable?&amp;quot;\n    then 'Patients on opioid therapy should be evaluated for benefits and harms within 1 to 4 weeks of starting opioid therapy and every 3 months or more subsequently.'\n  else null</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSREC07</td>\n                                \n                                \n                                    <td>Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions</td>\n                                \n                                \n                                    <td>1</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions&amp;quot;:\n  ( Common.&amp;quot;Is Opioid Analgesic with Ambulatory Misuse Potential?&amp;quot;( ContextPrescriptions ) ) AmbulatoryOpioidPrescription\n    where Routines.&amp;quot;Is Chronic Pain Prescription?&amp;quot;( AmbulatoryOpioidPrescription )</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSREC07</td>\n                                \n                                \n                                    <td>Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential</td>\n                                \n                                \n                                    <td>2</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential&amp;quot;:\n  exists( &amp;quot;Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions&amp;quot; )</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSCommon</td>\n                                \n                                \n                                    <td>Patient Age Less Than 18</td>\n                                \n                                \n                                    <td>3</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Patient Age Less Than 18&amp;quot;:\n  if (Config.&amp;quot;Age Less than 18 Years Is Enabled&amp;quot;) then\n    AgeInYearsAt(Today()) &amp;lt; 18\n  else\n    false</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSCommon</td>\n                                \n                                \n                                    <td>US Core-Categorized Conditions</td>\n                                \n                                \n                                    <td>4</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">// 3. Medications indicating end of life\n    /* or exists (\n      &amp;quot;Medications Indicating End of Life&amp;quot;\n    ) */\ndefine &amp;quot;US Core-Categorized Conditions&amp;quot;:\n  [Condition: category in &amp;quot;Encounter Diagnosis Condition Category&amp;quot;]\n    union [Condition: category in &amp;quot;Problem List Condition Category&amp;quot;]\n    union [Condition: category in &amp;quot;US Core Health Concern Condition Category&amp;quot;]</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSRoutines</td>\n                                \n                                \n                                    <td>Conditions Indicating End Of Life Present</td>\n                                \n                                \n                                    <td>5</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">/* define &amp;quot;Patient Age Less Than 18&amp;quot;:\n  if (Config.&amp;quot;Age Less than 18 Years Is Enabled&amp;quot;) then\n    AgeInYearsAt(Today()) &amp;lt; 18\n  else\n    false */\ndefine &amp;quot;Conditions Indicating End Of Life Present&amp;quot;:\n  exists (\n    Common.&amp;quot;US Core-Categorized Conditions&amp;quot; LLEC\n      where LLEC.code in Common.&amp;quot;Limited life expectancy conditions&amp;quot;\n        and LLEC.clinicalStatus in Common.&amp;quot;Active Condition&amp;quot;\n  )</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSCommon</td>\n                                \n                                \n                                    <td>Service Requests</td>\n                                \n                                \n                                    <td>6</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Service Requests&amp;quot;:\n   [ServiceRequest] SR\n    return SR</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSRoutines</td>\n                                \n                                \n                                    <td>Palliative Care Lookback Period</td>\n                                \n                                \n                                    <td>7</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">/*\n**  Routine #1\n**  Opioid Review Useful Routine\n**\n**  Definition              | Answer to Proceed   | Details                                      | Data (Terminology) Requirement\n**  ------------------------------------------------------------------------------------------------------------------------------------\n**  Age &amp;lt; 18 years?         | No                  | Calculate age from date of birth; exclude    | Date of birth\n**                          |                     | patients with age less than 18 years at the  |\n**                          |                     | time of the prescription                     |\n**  ------------------------------------------------------------------------------------------------------------------------------------\n**  Limited life            | No                  | Look for documented findings consistent      | Limited life expectancy conditions\n**  expectancy conditions   |                     | with those listed in the limited life        |\n**  present?                |                     | expectancy value set (terminal illness, bad  |\n**                          |                     | prognosis, pre-terminal)                     |\n**  ------------------------------------------------------------------------------------------------------------------------------------\n**  Order for therapies     | No                  | Look for patients with an existing order for | Therapies indicating end of life care\n**  indicating end of life  |                     | therapies indicating end of life care        |\n**  care in past 90 days?   |                     | written within past 90 days                  |\n**  ------------------------------------------------------------------------------------------------------------------------------------\n**  Active cancer           | No                  | See sub-routine 3                            | See sub-routine 3\n**  treatment?              |                     |                                              |\n**  ------------------------------------------------------------------------------------------------------------------------------------\n**  Conditions Likely       | No                  | Look for patients with active conditions in  | Conditions likely terminal for opioid\n**  Terminal for opioid     |                     | the value set end-of-life-conditions         | prescribing\n**  prescribing present?    |                     |                                              |\n**  ------------------------------------------------------------------------------------------------------------------------------------\n**\n*/\ndefine &amp;quot;Palliative Care Lookback Period&amp;quot;:\n  Interval[Today() - 90 days, Today()]</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSRoutines</td>\n                                \n                                \n                                    <td>Order For Palliative Care In Past 90 Days</td>\n                                \n                                \n                                    <td>8</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Order For Palliative Care In Past 90 Days&amp;quot;:\n  exists (\n    Common.&amp;quot;Service Requests&amp;quot; SR\n    where SR.status in { 'active', 'completed'}\n      and SR.intent in {'proposal', 'plan,', 'directive', 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'}\n      and FHIRHelpers.ToDateTime(SR.authoredOn) during day of &amp;quot;Palliative Care Lookback Period&amp;quot;\n      and SR.code in Common.&amp;quot;Therapies indicating end of life care&amp;quot;\n  )</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSRoutines</td>\n                                \n                                \n                                    <td>Is Active Cancer Treatment?</td>\n                                \n                                \n                                    <td>9</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Is Active Cancer Treatment?&amp;quot;:\n  if (Config.&amp;quot;Active Cancer Treatment Encounters Condition Is Enabled&amp;quot;) then\n      &amp;quot;Has Two or More Encounters with Cancer Diagnosis During Encounter Period&amp;quot;\n    else\n      false</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSRoutines</td>\n                                \n                                \n                                    <td>Conditions Including Cancer To Exclude Opioid Management Indicating End-Stage Disease Present</td>\n                                \n                                \n                                    <td>10</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Conditions Including Cancer To Exclude Opioid Management Indicating End-Stage Disease Present&amp;quot;:\n  if (Config.&amp;quot;End-Stage Disease Criteria Enabled&amp;quot;) then\n    exists (\n      Common.&amp;quot;US Core-Categorized Conditions&amp;quot; EOLC\n        where EOLC.code in Common.&amp;quot;Conditions likely terminal for opioid prescribing&amp;quot;\n          and EOLC.clinicalStatus in Common.&amp;quot;Active Condition&amp;quot;\n    )\n  else\n    false</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSRoutines</td>\n                                \n                                \n                                    <td>Is Opioid Review Useful?</td>\n                                \n                                \n                                    <td>11</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Is Opioid Review Useful?&amp;quot;:\n  /* not &amp;quot;Patient Age Less Than 18&amp;quot; */\n    not &amp;quot;Conditions Indicating End Of Life Present&amp;quot;\n    and not &amp;quot;Order For Palliative Care In Past 90 Days&amp;quot;\n    and not &amp;quot;Is Active Cancer Treatment?&amp;quot;\n    and not &amp;quot;Conditions Including Cancer To Exclude Opioid Management Indicating End-Stage Disease Present&amp;quot;</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSREC07</td>\n                                \n                                \n                                    <td>Risk Assessment Interval</td>\n                                \n                                \n                                    <td>12</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Risk Assessment Interval&amp;quot;:\n  Interval[Today() - 91 days, Today() - 1 day]</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSREC07</td>\n                                \n                                \n                                    <td>Opioid Risk Assessment in Past 90 Days</td>\n                                \n                                \n                                    <td>13</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Opioid Risk Assessment in Past 90 Days&amp;quot;:\n  [Procedure: Common.&amp;quot;Opioid misuse assessment procedure&amp;quot;] riskAssessment\n    where start of (riskAssessment.performed as FHIR.Period) in day of &amp;quot;Risk Assessment Interval&amp;quot;</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSREC07</td>\n                                \n                                \n                                    <td>Previous 10 Days Interval</td>\n                                \n                                \n                                    <td>14</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Previous 10 Days Interval&amp;quot;:\n  Interval[Today() - 10 days, Today()]</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSREC07</td>\n                                \n                                \n                                    <td>Encounter Interval</td>\n                                \n                                \n                                    <td>15</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Encounter Interval&amp;quot;:\n  Interval[Today() - 12 months - 1 days, Today() - 1 day]</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSREC07</td>\n                                \n                                \n                                    <td>Prescribed Opioids for 7 of Past 10 Days with an Encounter</td>\n                                \n                                \n                                    <td>16</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Prescribed Opioids for 7 of Past 10 Days with an Encounter&amp;quot;:\n  Common.&amp;quot;Days on Opioids during Period&amp;quot;( &amp;quot;Previous 10 Days Interval&amp;quot; ) &amp;gt;= 7\n    and exists (\n      [Encounter: Common.&amp;quot;Office Visit&amp;quot;] AmbulatoryEncounter\n        where AmbulatoryEncounter.period during &amp;quot;Encounter Interval&amp;quot;\n    )</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSCommon</td>\n                                \n                                \n                                    <td>First Month</td>\n                                \n                                \n                                    <td>17</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;First Month&amp;quot;:\nInterval[Today() - 3 months, Today() - 2 months]</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSCommon</td>\n                                \n                                \n                                    <td>Second Month</td>\n                                \n                                \n                                    <td>18</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Second Month&amp;quot;:\nInterval[Today() - 2 months, Today() - 1 months]</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSCommon</td>\n                                \n                                \n                                    <td>Third Month</td>\n                                \n                                \n                                    <td>19</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Third Month&amp;quot;:\nInterval[Today() - 1 months, Today()]</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSCommon</td>\n                                \n                                \n                                    <td>Prescribed Opioids for 21 or more of 30 Days for each of the past 3 Months</td>\n                                \n                                \n                                    <td>20</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Prescribed Opioids for 21 or more of 30 Days for each of the past 3 Months&amp;quot;:\n  &amp;quot;Days on Opioids during Period&amp;quot;(&amp;quot;First Month&amp;quot;) &amp;gt;= 21\n    and &amp;quot;Days on Opioids during Period&amp;quot;(&amp;quot;Second Month&amp;quot;) &amp;gt;= 21\n    and &amp;quot;Days on Opioids during Period&amp;quot;(&amp;quot;Third Month&amp;quot;) &amp;gt;= 21</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSREC07</td>\n                                \n                                \n                                    <td>Inclusion Criteria</td>\n                                \n                                \n                                    <td>21</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Inclusion Criteria&amp;quot;:\n  &amp;quot;Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential&amp;quot;\n    and not Common.&amp;quot;Patient Age Less Than 18&amp;quot;  \n    and Routines.&amp;quot;Is Opioid Review Useful?&amp;quot;\n    and not exists ( &amp;quot;Opioid Risk Assessment in Past 90 Days&amp;quot; )\n    and (\n      &amp;quot;Prescribed Opioids for 7 of Past 10 Days with an Encounter&amp;quot;\n        or Common.&amp;quot;Prescribed Opioids for 21 or more of 30 Days for each of the past 3 Months&amp;quot;\n    )</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSCommon</td>\n                                \n                                \n                                    <td>Conditions Indicating End of Life or With Limited Life Expectancy</td>\n                                \n                                \n                                    <td>22</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Conditions Indicating End of Life or With Limited Life Expectancy&amp;quot;:\n  (\n    &amp;quot;US Core-Categorized Conditions&amp;quot; C\n      where C.code in &amp;quot;Conditions likely terminal for opioid prescribing&amp;quot;\n        and C.clinicalStatus in &amp;quot;Active Condition&amp;quot;\n  )\n  union\n  (\n    &amp;quot;US Core-Categorized Conditions&amp;quot; C\n      where C.code in &amp;quot;Limited life expectancy conditions&amp;quot;\n        and C.clinicalStatus in &amp;quot;Active Condition&amp;quot;\n  )</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSCommon</td>\n                                \n                                \n                                    <td>Admitted/Referred/Discharged to Hospice Care</td>\n                                \n                                \n                                    <td>23</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Admitted/Referred/Discharged to Hospice Care&amp;quot;:\n  (\n    [Procedure: code in &amp;quot;Hospice Procedure Codes&amp;quot;] P\n      where P.status.value in { 'in-progress', 'completed' }\n  )\n  union\n  (\n    &amp;quot;Service Requests&amp;quot; SR\n      where SR.code in &amp;quot;Hospice Procedure Codes&amp;quot;\n        and SR.status.value in { 'active', 'completed' }\n  )\n  union\n  (\n    if (Config.&amp;quot;Hospice Findings Exclusion Enabled&amp;quot;) then\n      [Observation: code in &amp;quot;Hospice Finding Codes&amp;quot;] O\n        where not (O.status.value in { 'unknown', 'entered-in-error', 'cancelled' })\n    else\n      {}\n  )\n  union\n  (\n    [Encounter] E\n      where date from E.period.start 1 year or less on or before Today()\n        and (\n          if E.hospitalization.dischargeDisposition.coding is null\n              or not exists (E.hospitalization.dischargeDisposition.coding)\n            then false\n          else E.hospitalization.dischargeDisposition in &amp;quot;Hospice Disposition&amp;quot;\n        )\n        and E.status.value in { 'planned', 'arrived', 'in-progress', 'finished', 'onleave' }\n  )</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSCommon</td>\n                                \n                                \n                                    <td>End of Life Assessment</td>\n                                \n                                \n                                    <td>24</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;End of Life Assessment&amp;quot;:\n    // 1. Conditions indicating end of life or with limited life expectancy\n    exists (\n      &amp;quot;Conditions Indicating End of Life or With Limited Life Expectancy&amp;quot;\n    )\n    // 2. Admitted/referred/discharged to hospice care\n    or exists (\n      &amp;quot;Admitted/Referred/Discharged to Hospice Care&amp;quot;\n    )</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSREC07</td>\n                                \n                                \n                                    <td>Exclusion Criteria</td>\n                                \n                                \n                                    <td>25</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Exclusion Criteria&amp;quot;:\n  Common.&amp;quot;End of Life Assessment&amp;quot;</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSREC07</td>\n                                \n                                \n                                    <td>Is Recommendation Applicable?</td>\n                                \n                                \n                                    <td>26</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Is Recommendation Applicable?&amp;quot;:\n  &amp;quot;Inclusion Criteria&amp;quot;\n    and not &amp;quot;Exclusion Criteria&amp;quot;</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSREC07</td>\n                                \n                                \n                                    <td>Get Detail</td>\n                                \n                                \n                                    <td>27</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Get Detail&amp;quot;:\n  if &amp;quot;Is Recommendation Applicable?&amp;quot;\n    then\n      if Common.&amp;quot;Prescribed Opioids for 21 or more of 30 Days for each of the past 3 Months&amp;quot;\n        then 'No evaluation for benefits and harms associated with opioid therapy has been performed for the patient in the past 3 months'\n      else 'No evaluation for benefits and harms has been performed for the patient starting opioid therapy'\n  else null</code></pre>\n                        \n                        <br/><br/>\n                    \n                        <table class=\"grid-dict\">\n                            <tr><th><b>Library Name</b></th><th><b>Name</b></th><th><b>sequence</b></th></tr>\n                            <tr>\n                                \n                                    <td>OpioidCDSREC07</td>\n                                \n                                \n                                    <td>Get Indicator</td>\n                                \n                                \n                                    <td>28</td>\n                                \n                            </tr>\n                        </table>\n                        \n                            <pre><code class=\"language-cql\">define &amp;quot;Get Indicator&amp;quot;:\n  if &amp;quot;Is Recommendation Applicable?&amp;quot;\n    then 'warning'\n  else null</code></pre>\n                        \n                        <br/><br/>\n                    \n                </td>\n            </tr>\n        \n        \n        <tr>\n          <th scope=\"row\"><b>Knowledge Capability: </b></th>\n          <td style=\"padding-left: 4px;\">\n            shareable computable executable publishable \n          </td>\n        </tr>\n        \n        \n        \n        <tr>\n            <th scope=\"row\"><b>Use Context: </b></th>\n            <td style=\"padding-left: 4px;\">\n                <table class=\"grid-dict\">\n                    <tr><th><b>code</b></th><th><b>value</b></th><th><b>display</b></th></tr>\n                    \n                      <tr>\n                        <td>focus</td>\n                        <td>182888003</td>\n                        <td>Medication requested (situation)</td>\n                      </tr>\n                    \n                      <tr>\n                        <td>focus</td>\n                        <td>82423001</td>\n                        <td>Chronic pain (finding)</td>\n                      </tr>\n                    \n                </table>\n            </td>\n        </tr>\n        \n        \n        \n        <tr>\n            <th scope=\"row\"><b>Purpose: </b></th>\n            <td style=\"padding-left: 4px;\"><div><p>CDC's Guideline for Prescribing Opioids for Chronic Pain is intended to improve communication between providers and patients about the risks and benefits of opioid therapy for chronic pain, improve the safety and effectiveness of pain treatment, and reduce the risks associated with long-term opioid therapy, including opioid use disorder and overdose. The Guideline is not intended for patients who are in active cancer treatment, palliative care, or end-of-life care.</p>\n</div></td>\n        </tr>\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Usage: </b></th>\n            <td style=\"padding-left: 4px;\">If benefits do not outweigh harms of continued opioid therapy, clinicians should optimize other therapies and work with patients to taper opioids to lower dosages or to taper and discontinue opioids.</td>\n        </tr>\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Copyright: </b></th>\n            <td style=\"padding-left: 4px;\"><div><p>© CDC 2016+.</p>\n</div></td>\n        </tr>\n        \n        \n        \n        \n        \n        \n        <tr>\n          <th scope=\"row\"><b>Related Artifacts: </b></th>\n          <td style=\"padding-left: 4px;\">\n            \n            <p><b>Documentation</b></p>\n            <ul>\n              \n                  <li>\n                    <a href=\"https://www.cdc.gov/mmwr/volumes/65/rr/rr6501e1.htm?CDC_AA_refVal=https%3A%2F%2Fwww.cdc.gov%2Fmmwr%2Fvolumes%2F65%2Frr%2Frr6501e1er.htm\"> CDC 2016 Guideline for prescribing opioids for chronic pain</a>\n                  </li>\n              \n                  <li>\n                    <a href=\"https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf\"> MME Conversion Tables</a>\n                  </li>\n              \n            </ul>\n            \n            \n            \n            \n            \n            \n            \n          </td>\n        </tr>\n        \n\n        \n        <tr>\n          <th scope=\"row\"><b>Libraries: </b></th>\n          <td style=\"padding-left: 4px;\">\n            <table class=\"grid-dict\">\n              \n                <tr><td><a href=\"Library-OpioidCDSREC07.html\">Library - Recommendation #7 - Opioid Therapy Risk Assessment</a></td></tr>\n              \n            </table>\n          </td>\n        </tr>\n        \n\n        \n        <tr>\n          <th scope=\"row\"><b>Actions: </b></th>\n          <td style=\"padding-left: 4px;\">\n            <table class=\"grid-dict\">\n              \n                <tr>\n                  <td>\n                    <b> Existing patient should be evaluated for risk of continued opioid therapy.:</b> Checking if the trigger prescription meets the inclusion criteria for recommendation #7 workflow.<br/>\n                    <b>When:</b> <i>Named Event:</i> order-sign<br/>\n                    <b>If:</b> <i>Applicability:</i> Check whether the existing patient, without an end of life condition or risk assessment in the past 90 days, has taken an opioid-with-abuse-potential for 7 of the past 10 days or 63 of the past 90 days. <i>(Is Recommendation Applicable?)</i><br/>\n                    <b>Then:</b>\n                    \n                      <table class=\"grid-dict\">\n                        \n                          <tr>\n                            <td>\n                              <b> :</b> Will schedule opioid misuse assessment<br/>\n                              \n                              \n                              <b>Then:</b>\n                              \n                                \n                                \n                              \n                            </td>\n                          </tr>\n                        \n                          <tr>\n                            <td>\n                              <b> :</b> Benefits outweigh risks, snooze 3 months<br/>\n                              \n                              \n                              <b>Then:</b>\n                              \n                                \n                                \n                              \n                            </td>\n                          </tr>\n                        \n                          <tr>\n                            <td>\n                              <b> :</b> N/A - see comment, snooze 3 months<br/>\n                              \n                              \n                              <b>Then:</b>\n                              \n                                \n                                \n                              \n                            </td>\n                          </tr>\n                        \n                      </table>\n                    \n                  </td>\n                </tr>\n              \n            </table>\n          </td>\n        </tr>\n        \n    </table>\n</div>"
  ] ; # 
  fhir:contained ( [
a fhir:Library ;
fhir:id [ fhir:v "effective-data-requirements" ] ;
fhir:status [ fhir:v "active" ] ;
fhir:type [
      ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/library-type"^^xsd:anyURI ] ;
fhir:code [ fhir:v "module-definition" ]       ] )     ] ;
    ( fhir:relatedArtifact [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Library Common" ] ;
fhir:resource [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSCommon|2016.4.0"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSCommon|2016.4.0>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Library FHIRHelpers" ] ;
fhir:resource [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/Library/FHIRHelpers|4.0.1"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/Library/FHIRHelpers|4.0.1>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Library Routines" ] ;
fhir:resource [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSRoutines|2016.4.0"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSRoutines|2016.4.0>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Opioid analgesics with ambulatory misuse potential" ] ;
fhir:resource [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-analgesics-with-ambulatory-misuse-potential"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-analgesics-with-ambulatory-misuse-potential>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Community" ] ;
fhir:resource [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/medicationrequest-category-community"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/medicationrequest-category-community>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Encounter Diagnosis Condition Category" ] ;
fhir:resource [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-encounter-diagnosis-category"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-encounter-diagnosis-category>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Problem List Condition Category" ] ;
fhir:resource [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-problem-list-category"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-problem-list-category>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set US Core Health Concern Condition Category" ] ;
fhir:resource [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-us-core-health-concern-category"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-us-core-health-concern-category>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Limited life expectancy conditions" ] ;
fhir:resource [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/limited-life-expectancy-conditions"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/limited-life-expectancy-conditions>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Active Condition" ] ;
fhir:resource [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-clinical-status-active"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-clinical-status-active>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Therapies indicating end of life care" ] ;
fhir:resource [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/therapies-indicating-end-of-life-care"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/therapies-indicating-end-of-life-care>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Opioid misuse assessment procedure" ] ;
fhir:resource [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-misuse-assessment-procedure"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-misuse-assessment-procedure>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Office Visit" ] ;
fhir:resource [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/office-visit"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/office-visit>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Conditions likely terminal for opioid prescribing" ] ;
fhir:resource [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/conditions-likely-terminal-for-opioid-prescribing"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/conditions-likely-terminal-for-opioid-prescribing>       ]     ] [
fhir:type [ fhir:v "depends-on" ] ;
fhir:display [ fhir:v "Value set Hospice Procedure Codes" ] ;
fhir:resource [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/hospice-procedure"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/hospice-procedure>       ]     ] ) ;
    ( fhir:parameter [
fhir:name [ fhir:v "ContextPrescriptions" ] ;
fhir:use [ fhir:v "in" ] ;
fhir:min [ fhir:v "0"^^xsd:integer ] ;
fhir:max [ fhir:v "*" ] ;
fhir:type [ fhir:v "MedicationRequest" ]     ] [
fhir:name [ fhir:v "Get Summary" ] ;
fhir:use [ fhir:v "out" ] ;
fhir:min [ fhir:v "0"^^xsd:integer ] ;
fhir:max [ fhir:v "1" ] ;
fhir:type [ fhir:v "string" ]     ] [
fhir:name [ fhir:v "Is Recommendation Applicable?" ] ;
fhir:use [ fhir:v "out" ] ;
fhir:min [ fhir:v "0"^^xsd:integer ] ;
fhir:max [ fhir:v "1" ] ;
fhir:type [ fhir:v "boolean" ]     ] [
fhir:name [ fhir:v "Get Detail" ] ;
fhir:use [ fhir:v "out" ] ;
fhir:min [ fhir:v "0"^^xsd:integer ] ;
fhir:max [ fhir:v "1" ] ;
fhir:type [ fhir:v "string" ]     ] [
fhir:name [ fhir:v "Get Indicator" ] ;
fhir:use [ fhir:v "out" ] ;
fhir:min [ fhir:v "0"^^xsd:integer ] ;
fhir:max [ fhir:v "1" ] ;
fhir:type [ fhir:v "string" ]     ] ) ;
    ( fhir:dataRequirement [
fhir:type [ fhir:v "Medication" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/StructureDefinition/Medication"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/Medication>       ] ) ;
      ( fhir:mustSupport [ fhir:v "id" ] ) ;
      ( fhir:codeFilter [
fhir:path [ fhir:v "id" ]       ] )     ] [
fhir:type [ fhir:v "Condition" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/StructureDefinition/Condition"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/Condition>       ] ) ;
      ( fhir:mustSupport [ fhir:v "category" ] ) ;
      ( fhir:codeFilter [
fhir:path [ fhir:v "category" ] ;
fhir:valueSet [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-encounter-diagnosis-category"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-encounter-diagnosis-category>         ]       ] )     ] [
fhir:type [ fhir:v "Condition" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/StructureDefinition/Condition"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/Condition>       ] ) ;
      ( fhir:mustSupport [ fhir:v "category" ] ) ;
      ( fhir:codeFilter [
fhir:path [ fhir:v "category" ] ;
fhir:valueSet [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-problem-list-category"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-problem-list-category>         ]       ] )     ] [
fhir:type [ fhir:v "Condition" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/StructureDefinition/Condition"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/Condition>       ] ) ;
      ( fhir:mustSupport [ fhir:v "category" ] ) ;
      ( fhir:codeFilter [
fhir:path [ fhir:v "category" ] ;
fhir:valueSet [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-us-core-health-concern-category"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-us-core-health-concern-category>         ]       ] )     ] [
fhir:type [ fhir:v "ServiceRequest" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/StructureDefinition/ServiceRequest"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/ServiceRequest>       ] )     ] [
fhir:type [ fhir:v "ServiceRequest" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/StructureDefinition/ServiceRequest"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/ServiceRequest>       ] ) ;
      ( fhir:mustSupport [ fhir:v "status" ] [ fhir:v "intent" ] [ fhir:v "authoredOn" ] [ fhir:v "code" ] )     ] [
fhir:type [ fhir:v "Procedure" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/StructureDefinition/Procedure"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/Procedure>       ] ) ;
      ( fhir:mustSupport [ fhir:v "code" ] [ fhir:v "performed" ] ) ;
      ( fhir:codeFilter [
fhir:path [ fhir:v "code" ] ;
fhir:valueSet [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-misuse-assessment-procedure"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-misuse-assessment-procedure>         ]       ] )     ] [
fhir:type [ fhir:v "MedicationRequest" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/StructureDefinition/MedicationRequest"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/MedicationRequest>       ] ) ;
      ( fhir:mustSupport [ fhir:v "medication" ] ) ;
      ( fhir:codeFilter [
fhir:path [ fhir:v "medication" ] ;
fhir:valueSet [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-analgesics-with-ambulatory-misuse-potential"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-analgesics-with-ambulatory-misuse-potential>         ]       ] )     ] [
fhir:type [ fhir:v "Encounter" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/Encounter>       ] ) ;
      ( fhir:mustSupport [ fhir:v "type" ] [ fhir:v "period" ] ) ;
      ( fhir:codeFilter [
fhir:path [ fhir:v "type" ] ;
fhir:valueSet [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/office-visit"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/office-visit>         ]       ] )     ] [
fhir:type [ fhir:v "Procedure" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/StructureDefinition/Procedure"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/Procedure>       ] ) ;
      ( fhir:mustSupport [ fhir:v "code" ] [ fhir:v "status" ] [ fhir:v "status.value" ] ) ;
      ( fhir:codeFilter [
fhir:path [ fhir:v "code" ] ;
fhir:valueSet [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ValueSet/hospice-procedure"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ValueSet/hospice-procedure>         ]       ] )     ] [
fhir:type [ fhir:v "ServiceRequest" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/StructureDefinition/ServiceRequest"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/ServiceRequest>       ] ) ;
      ( fhir:mustSupport [ fhir:v "code" ] [ fhir:v "status" ] [ fhir:v "status.value" ] )     ] [
fhir:type [ fhir:v "Encounter" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/Encounter>       ] ) ;
      ( fhir:mustSupport [ fhir:v "period" ] [ fhir:v "period.start" ] [ fhir:v "status" ] [ fhir:v "status.value" ] )     ] )
  ] ) ; # 
  fhir:extension ( [
fhir:url [ fhir:v "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability"^^xsd:anyURI ] ;
fhir:value [ fhir:v "shareable" ]
  ] [
fhir:url [ fhir:v "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability"^^xsd:anyURI ] ;
fhir:value [ fhir:v "computable" ]
  ] [
fhir:url [ fhir:v "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability"^^xsd:anyURI ] ;
fhir:value [ fhir:v "executable" ]
  ] [
fhir:url [ fhir:v "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability"^^xsd:anyURI ] ;
fhir:value [ fhir:v "publishable" ]
  ] [
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-softwaresystem"^^xsd:anyURI ] ;
fhir:value [
a fhir:Reference ;
fhir:reference [ fhir:v "Device/cqf-tooling" ]     ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSREC07" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Get Summary" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Get Summary\":\n  if \"Is Recommendation Applicable?\"\n    then 'Patients on opioid therapy should be evaluated for benefits and harms within 1 to 4 weeks of starting opioid therapy and every 3 months or more subsequently.'\n  else null" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "0"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSREC07" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions\":\n  ( Common.\"Is Opioid Analgesic with Ambulatory Misuse Potential?\"( ContextPrescriptions ) ) AmbulatoryOpioidPrescription\n    where Routines.\"Is Chronic Pain Prescription?\"( AmbulatoryOpioidPrescription )" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "1"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSREC07" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential\":\n  exists( \"Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions\" )" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "2"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSCommon" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Patient Age Less Than 18" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Patient Age Less Than 18\":\n  if (Config.\"Age Less than 18 Years Is Enabled\") then\n    AgeInYearsAt(Today()) < 18\n  else\n    false" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "3"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSCommon" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "US Core-Categorized Conditions" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "// 3. Medications indicating end of life\n    /* or exists (\n      \"Medications Indicating End of Life\"\n    ) */\ndefine \"US Core-Categorized Conditions\":\n  [Condition: category in \"Encounter Diagnosis Condition Category\"]\n    union [Condition: category in \"Problem List Condition Category\"]\n    union [Condition: category in \"US Core Health Concern Condition Category\"]" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "4"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSRoutines" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Conditions Indicating End Of Life Present" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/* define \"Patient Age Less Than 18\":\n  if (Config.\"Age Less than 18 Years Is Enabled\") then\n    AgeInYearsAt(Today()) < 18\n  else\n    false */\ndefine \"Conditions Indicating End Of Life Present\":\n  exists (\n    Common.\"US Core-Categorized Conditions\" LLEC\n      where LLEC.code in Common.\"Limited life expectancy conditions\"\n        and LLEC.clinicalStatus in Common.\"Active Condition\"\n  )" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "5"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSCommon" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Service Requests" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Service Requests\":\n   [ServiceRequest] SR\n    return SR" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "6"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSRoutines" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Palliative Care Lookback Period" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "/*\n**  Routine #1\n**  Opioid Review Useful Routine\n**\n**  Definition              | Answer to Proceed   | Details                                      | Data (Terminology) Requirement\n**  ------------------------------------------------------------------------------------------------------------------------------------\n**  Age < 18 years?         | No                  | Calculate age from date of birth; exclude    | Date of birth\n**                          |                     | patients with age less than 18 years at the  |\n**                          |                     | time of the prescription                     |\n**  ------------------------------------------------------------------------------------------------------------------------------------\n**  Limited life            | No                  | Look for documented findings consistent      | Limited life expectancy conditions\n**  expectancy conditions   |                     | with those listed in the limited life        |\n**  present?                |                     | expectancy value set (terminal illness, bad  |\n**                          |                     | prognosis, pre-terminal)                     |\n**  ------------------------------------------------------------------------------------------------------------------------------------\n**  Order for therapies     | No                  | Look for patients with an existing order for | Therapies indicating end of life care\n**  indicating end of life  |                     | therapies indicating end of life care        |\n**  care in past 90 days?   |                     | written within past 90 days                  |\n**  ------------------------------------------------------------------------------------------------------------------------------------\n**  Active cancer           | No                  | See sub-routine 3                            | See sub-routine 3\n**  treatment?              |                     |                                              |\n**  ------------------------------------------------------------------------------------------------------------------------------------\n**  Conditions Likely       | No                  | Look for patients with active conditions in  | Conditions likely terminal for opioid\n**  Terminal for opioid     |                     | the value set end-of-life-conditions         | prescribing\n**  prescribing present?    |                     |                                              |\n**  ------------------------------------------------------------------------------------------------------------------------------------\n**\n*/\ndefine \"Palliative Care Lookback Period\":\n  Interval[Today() - 90 days, Today()]" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "7"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSRoutines" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Order For Palliative Care In Past 90 Days" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Order For Palliative Care In Past 90 Days\":\n  exists (\n    Common.\"Service Requests\" SR\n    where SR.status in { 'active', 'completed'}\n      and SR.intent in {'proposal', 'plan,', 'directive', 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'}\n      and FHIRHelpers.ToDateTime(SR.authoredOn) during day of \"Palliative Care Lookback Period\"\n      and SR.code in Common.\"Therapies indicating end of life care\"\n  )" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "8"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSRoutines" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Is Active Cancer Treatment?" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Is Active Cancer Treatment?\":\n  if (Config.\"Active Cancer Treatment Encounters Condition Is Enabled\") then\n      \"Has Two or More Encounters with Cancer Diagnosis During Encounter Period\"\n    else\n      false" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "9"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSRoutines" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Conditions Including Cancer To Exclude Opioid Management Indicating End-Stage Disease Present" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Conditions Including Cancer To Exclude Opioid Management Indicating End-Stage Disease Present\":\n  if (Config.\"End-Stage Disease Criteria Enabled\") then\n    exists (\n      Common.\"US Core-Categorized Conditions\" EOLC\n        where EOLC.code in Common.\"Conditions likely terminal for opioid prescribing\"\n          and EOLC.clinicalStatus in Common.\"Active Condition\"\n    )\n  else\n    false" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "10"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSRoutines" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Is Opioid Review Useful?" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Is Opioid Review Useful?\":\n  /* not \"Patient Age Less Than 18\" */\n    not \"Conditions Indicating End Of Life Present\"\n    and not \"Order For Palliative Care In Past 90 Days\"\n    and not \"Is Active Cancer Treatment?\"\n    and not \"Conditions Including Cancer To Exclude Opioid Management Indicating End-Stage Disease Present\"" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "11"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSREC07" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Risk Assessment Interval" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Risk Assessment Interval\":\n  Interval[Today() - 91 days, Today() - 1 day]" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "12"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSREC07" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Opioid Risk Assessment in Past 90 Days" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Opioid Risk Assessment in Past 90 Days\":\n  [Procedure: Common.\"Opioid misuse assessment procedure\"] riskAssessment\n    where start of (riskAssessment.performed as FHIR.Period) in day of \"Risk Assessment Interval\"" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "13"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSREC07" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Previous 10 Days Interval" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Previous 10 Days Interval\":\n  Interval[Today() - 10 days, Today()]" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "14"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSREC07" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Encounter Interval" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Encounter Interval\":\n  Interval[Today() - 12 months - 1 days, Today() - 1 day]" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "15"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSREC07" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Prescribed Opioids for 7 of Past 10 Days with an Encounter" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Prescribed Opioids for 7 of Past 10 Days with an Encounter\":\n  Common.\"Days on Opioids during Period\"( \"Previous 10 Days Interval\" ) >= 7\n    and exists (\n      [Encounter: Common.\"Office Visit\"] AmbulatoryEncounter\n        where AmbulatoryEncounter.period during \"Encounter Interval\"\n    )" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "16"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSCommon" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "First Month" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"First Month\":\nInterval[Today() - 3 months, Today() - 2 months]" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "17"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSCommon" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Second Month" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Second Month\":\nInterval[Today() - 2 months, Today() - 1 months]" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "18"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSCommon" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Third Month" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Third Month\":\nInterval[Today() - 1 months, Today()]" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "19"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSCommon" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Prescribed Opioids for 21 or more of 30 Days for each of the past 3 Months" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Prescribed Opioids for 21 or more of 30 Days for each of the past 3 Months\":\n  \"Days on Opioids during Period\"(\"First Month\") >= 21\n    and \"Days on Opioids during Period\"(\"Second Month\") >= 21\n    and \"Days on Opioids during Period\"(\"Third Month\") >= 21" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "20"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSREC07" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Inclusion Criteria" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Inclusion Criteria\":\n  \"Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential\"\n    and not Common.\"Patient Age Less Than 18\"  \n    and Routines.\"Is Opioid Review Useful?\"\n    and not exists ( \"Opioid Risk Assessment in Past 90 Days\" )\n    and (\n      \"Prescribed Opioids for 7 of Past 10 Days with an Encounter\"\n        or Common.\"Prescribed Opioids for 21 or more of 30 Days for each of the past 3 Months\"\n    )" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "21"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSCommon" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Conditions Indicating End of Life or With Limited Life Expectancy" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Conditions Indicating End of Life or With Limited Life Expectancy\":\n  (\n    \"US Core-Categorized Conditions\" C\n      where C.code in \"Conditions likely terminal for opioid prescribing\"\n        and C.clinicalStatus in \"Active Condition\"\n  )\n  union\n  (\n    \"US Core-Categorized Conditions\" C\n      where C.code in \"Limited life expectancy conditions\"\n        and C.clinicalStatus in \"Active Condition\"\n  )" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "22"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSCommon" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Admitted/Referred/Discharged to Hospice Care" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Admitted/Referred/Discharged to Hospice Care\":\n  (\n    [Procedure: code in \"Hospice Procedure Codes\"] P\n      where P.status.value in { 'in-progress', 'completed' }\n  )\n  union\n  (\n    \"Service Requests\" SR\n      where SR.code in \"Hospice Procedure Codes\"\n        and SR.status.value in { 'active', 'completed' }\n  )\n  union\n  (\n    if (Config.\"Hospice Findings Exclusion Enabled\") then\n      [Observation: code in \"Hospice Finding Codes\"] O\n        where not (O.status.value in { 'unknown', 'entered-in-error', 'cancelled' })\n    else\n      {}\n  )\n  union\n  (\n    [Encounter] E\n      where date from E.period.start 1 year or less on or before Today()\n        and (\n          if E.hospitalization.dischargeDisposition.coding is null\n              or not exists (E.hospitalization.dischargeDisposition.coding)\n            then false\n          else E.hospitalization.dischargeDisposition in \"Hospice Disposition\"\n        )\n        and E.status.value in { 'planned', 'arrived', 'in-progress', 'finished', 'onleave' }\n  )" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "23"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSCommon" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "End of Life Assessment" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"End of Life Assessment\":\n    // 1. Conditions indicating end of life or with limited life expectancy\n    exists (\n      \"Conditions Indicating End of Life or With Limited Life Expectancy\"\n    )\n    // 2. Admitted/referred/discharged to hospice care\n    or exists (\n      \"Admitted/Referred/Discharged to Hospice Care\"\n    )" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "24"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSREC07" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Exclusion Criteria" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Exclusion Criteria\":\n  Common.\"End of Life Assessment\"" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "25"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSREC07" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Is Recommendation Applicable?" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Is Recommendation Applicable?\":\n  \"Inclusion Criteria\"\n    and not \"Exclusion Criteria\"" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "26"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSREC07" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Get Detail" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Get Detail\":\n  if \"Is Recommendation Applicable?\"\n    then\n      if Common.\"Prescribed Opioids for 21 or more of 30 Days for each of the past 3 Months\"\n        then 'No evaluation for benefits and harms associated with opioid therapy has been performed for the patient in the past 3 months'\n      else 'No evaluation for benefits and harms has been performed for the patient starting opioid therapy'\n  else null" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "27"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
    ( fhir:extension [
fhir:url [ fhir:v "libraryName"^^xsd:anyURI ] ;
fhir:value [ fhir:v "OpioidCDSREC07" ]     ] [
fhir:url [ fhir:v "name"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Get Indicator" ]     ] [
fhir:url [ fhir:v "statement"^^xsd:anyURI ] ;
fhir:value [ fhir:v "define \"Get Indicator\":\n  if \"Is Recommendation Applicable?\"\n    then 'warning'\n  else null" ]     ] [
fhir:url [ fhir:v "displaySequence"^^xsd:anyURI ] ;
fhir:value [ fhir:v "28"^^xsd:integer ]     ] ) ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"^^xsd:anyURI ]
  ] [
fhir:id [ fhir:v "effective-data-requirements" ] ;
fhir:url [ fhir:v "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-effectiveDataRequirements"^^xsd:anyURI ] ;
fhir:value [
a fhir:Reference ;
fhir:reference [ fhir:v "#effective-data-requirements" ]     ]
  ] ) ; # 
  fhir:url [ fhir:v "http://fhir.org/guides/cdc/opioid-cds/PlanDefinition/opioidcds-07"^^xsd:anyURI] ; # 
  fhir:identifier ( [
fhir:use [ fhir:v "official" ] ;
fhir:value [ fhir:v "cdc-opioid-guidance" ]
  ] ) ; # 
  fhir:version [ fhir:v "2016.4.0"] ; # 
  fhir:name [ fhir:v "CDC_opioid_07"] ; # 
  fhir:title [ fhir:v "PlanDefinition - CDC 2016 Opioid Prescribing Guideline Recommendation #7"] ; # 
  fhir:type [
    ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/plan-definition-type"^^xsd:anyURI ] ;
fhir:code [ fhir:v "eca-rule" ] ;
fhir:display [ fhir:v "ECA Rule" ]     ] )
  ] ; # 
  fhir:status [ fhir:v "draft"] ; # 
  fhir:experimental [ fhir:v "true"^^xsd:boolean] ; # 
  fhir:date [ fhir:v "2022-12-13"^^xsd:date] ; # 
  fhir:publisher [ fhir:v "Centers for Disease Control and Prevention (CDC)"] ; # 
  fhir:contact ( [
    ( fhir:telecom [
fhir:system [ fhir:v "url" ] ;
fhir:value [ fhir:v "https://www.cdc.gov" ]     ] )
  ] ) ; # 
  fhir:description [ fhir:v "Clinicians should evaluate benefits and harms with patients within 1 to 4 weeks of starting opioid therapy for chronic pain or of dose escalation. Clinicians should evaluate benefits and harms of continued therapy with patients every 3 months or more frequently."] ; # 
  fhir:useContext ( [
fhir:code [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/usage-context-type"^^xsd:anyURI ] ;
fhir:code [ fhir:v "focus" ] ;
fhir:display [ fhir:v "Clinical Focus" ]     ] ;
fhir:value [
a fhir:CodeableConcept ;
      ( fhir:coding [
a sct:182888003 ;
fhir:system [ fhir:v "http://snomed.info/sct"^^xsd:anyURI ] ;
fhir:code [ fhir:v "182888003" ] ;
fhir:display [ fhir:v "Medication requested (situation)" ]       ] )     ]
  ] [
fhir:code [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/usage-context-type"^^xsd:anyURI ] ;
fhir:code [ fhir:v "focus" ] ;
fhir:display [ fhir:v "Clinical Focus" ]     ] ;
fhir:value [
a fhir:CodeableConcept ;
      ( fhir:coding [
a sct:82423001 ;
fhir:system [ fhir:v "http://snomed.info/sct"^^xsd:anyURI ] ;
fhir:code [ fhir:v "82423001" ] ;
fhir:display [ fhir:v "Chronic pain (finding)" ]       ] )     ]
  ] ) ; # 
  fhir:purpose [ fhir:v "CDC's Guideline for Prescribing Opioids for Chronic Pain is intended to improve communication between providers and patients about the risks and benefits of opioid therapy for chronic pain, improve the safety and effectiveness of pain treatment, and reduce the risks associated with long-term opioid therapy, including opioid use disorder and overdose. The Guideline is not intended for patients who are in active cancer treatment, palliative care, or end-of-life care."] ; # 
  fhir:usage [ fhir:v "If benefits do not outweigh harms of continued opioid therapy, clinicians should optimize other therapies and work with patients to taper opioids to lower dosages or to taper and discontinue opioids."] ; # 
  fhir:copyright [ fhir:v "© CDC 2016+."] ; # 
  fhir:topic ( [
fhir:text [ fhir:v "Opioid Prescribing" ]
  ] ) ; # 
  fhir:author ( [
fhir:name [ fhir:v "Kensaku Kawamoto, MD, PhD, MHS" ]
  ] [
fhir:name [ fhir:v "Bryn Rhodes" ]
  ] [
fhir:name [ fhir:v "Floyd Eisenberg, MD, MPH" ]
  ] [
fhir:name [ fhir:v "Robert McClure, MD, MPH" ]
  ] ) ; # 
  fhir:relatedArtifact ( [
fhir:type [ fhir:v "documentation" ] ;
fhir:display [ fhir:v "CDC 2016 Guideline for prescribing opioids for chronic pain" ] ;
fhir:url [ fhir:v "https://www.cdc.gov/mmwr/volumes/65/rr/rr6501e1.htm?CDC_AA_refVal=https%3A%2F%2Fwww.cdc.gov%2Fmmwr%2Fvolumes%2F65%2Frr%2Frr6501e1er.htm"^^xsd:anyURI ] ;
fhir:document [
fhir:url [ fhir:v "https://www.cdc.gov/mmwr/volumes/65/rr/rr6501e1.htm?CDC_AA_refVal=https%3A%2F%2Fwww.cdc.gov%2Fmmwr%2Fvolumes%2F65%2Frr%2Frr6501e1er.htm"^^xsd:anyURI ]     ]
  ] [
fhir:type [ fhir:v "documentation" ] ;
fhir:display [ fhir:v "MME Conversion Tables" ] ;
fhir:url [ fhir:v "https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf"^^xsd:anyURI ] ;
fhir:document [
fhir:url [ fhir:v "https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf"^^xsd:anyURI ]     ]
  ] ) ; # 
  fhir:library ( [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSREC07"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSREC07>
  ] ) ; # 
  fhir:action ( [
fhir:title [ fhir:v "Existing patient should be evaluated for risk of continued opioid therapy." ] ;
fhir:description [ fhir:v "Checking if the trigger prescription meets the inclusion criteria for recommendation #7 workflow." ] ;
    ( fhir:documentation [
fhir:type [ fhir:v "documentation" ] ;
fhir:document [
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-strengthOfRecommendation"^^xsd:anyURI ] ;
fhir:value [
a fhir:CodeableConcept ;
            ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/recommendation-strength"^^xsd:anyURI ] ;
fhir:code [ fhir:v "strong" ] ;
fhir:display [ fhir:v "Strong" ]             ] )           ]         ] [
fhir:url [ fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence"^^xsd:anyURI ] ;
fhir:value [
a fhir:CodeableConcept ;
            ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/evidence-quality"^^xsd:anyURI ] ;
fhir:code [ fhir:v "very-low" ] ;
fhir:display [ fhir:v "Very Low quality" ]             ] )           ]         ] )       ]     ] ) ;
    ( fhir:trigger [
fhir:type [ fhir:v "named-event" ] ;
fhir:name [ fhir:v "order-sign" ]     ] ) ;
    ( fhir:condition [
fhir:kind [ fhir:v "applicability" ] ;
fhir:expression [
fhir:description [ fhir:v "Check whether the existing patient, without an end of life condition or risk assessment in the past 90 days, has taken an opioid-with-abuse-potential for 7 of the past 10 days or 63 of the past 90 days." ] ;
fhir:language [ fhir:v "text/cql.identifier" ] ;
fhir:expression [ fhir:v "Is Recommendation Applicable?" ]       ]     ] ) ;
fhir:type [
      ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/action-type"^^xsd:anyURI ] ;
fhir:code [ fhir:v "create" ] ;
fhir:display [ fhir:v "Create" ]       ] )     ] ;
fhir:groupingBehavior [ fhir:v "visual-group" ] ;
fhir:selectionBehavior [ fhir:v "any" ] ;
fhir:definition [
fhir:v "http://fhir.org/guides/cdc/opioid-cds/ActivityDefinition/opioidcds-risk-assessment-request"^^xsd:anyURI ;
fhir:link <http://fhir.org/guides/cdc/opioid-cds/ActivityDefinition/opioidcds-risk-assessment-request>     ] ;
    ( fhir:dynamicValue [
fhir:path [ fhir:v "action.title" ] ;
fhir:expression [
fhir:language [ fhir:v "text/cql.identifier" ] ;
fhir:expression [ fhir:v "Get Summary" ]       ]     ] [
fhir:path [ fhir:v "action.description" ] ;
fhir:expression [
fhir:language [ fhir:v "text/cql.identifier" ] ;
fhir:expression [ fhir:v "Get Detail" ]       ]     ] [
fhir:path [ fhir:v "activity.extension" ] ;
fhir:expression [
fhir:language [ fhir:v "text/cql.identifier" ] ;
fhir:expression [ fhir:v "Get Indicator" ]       ]     ] ) ;
    ( fhir:action [
fhir:description [ fhir:v "Will schedule opioid misuse assessment" ]     ] [
fhir:description [ fhir:v "Benefits outweigh risks, snooze 3 months" ]     ] [
fhir:description [ fhir:v "N/A - see comment, snooze 3 months" ]     ] )
  ] ) . #