Release 4 5

This page is part of the FHIR Specification (v4.0.1: R4 (v5.0.0: R5 - Mixed Normative and STU ) ). This is the current published version in it's permanent home (it will always be available at this URL). The current version which supercedes this version is 5.0.0 . For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4

Library-opioidcds-recommendation-05

Example Library/opioidcds-recommendation-05 (Narrative)

Clinical Decision Support Work Group Maturity Level : N/A Standards Status : Informative Compartments : Not linked to any No defined compartments

This is the narrative for the resource. See also the XML , JSON or Turtle format. This example conforms to the profile Library .


Generated Narrative with Details id : opioidcds-recommendation-05 identifier : OpioidCDS_REC_05 (OFFICIAL) version : 0.1.0 title : Opioid CDS Logic for recommendation #5 status : active experimental : false type : Logic Library (Details : {http://terminology.hl7.org/CodeSystem/library-type code 'logic-library' = 'Logic Library', given as 'Logic Library'}) date : 25/03/2018 1:49:09 PM publisher : Centers for Disease Control and Prevention (CDC) description : Opioid Decision Support Logic for use in implementing CDC Opioid Prescribing Guidelines. useContext : , jurisdiction : United States of America (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United States of America'}) purpose : This library works in concert with the OMTK logic library to provide decision support for Morphine Milligram Equivalence calculations and dynamic value resolution. usage : This library is to notify the prescriber/user whether the current prescription exceeds the recommended MME. copyright : © CDC 2016+. topic : Opioid Prescribing (Details ) author : , , , relatedArtifact : , , dataRequirement :

Participants

AuthorKensaku Kawamoto, MD, PhD, MHS
AuthorBryn Rhodes
AuthorFloyd Eisenberg, MD, MPH
AuthorRobert McClure, MD, MPH

Related Artifacts

DocumentationCDC guideline for prescribing opioids for chronic pain

https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420 ()

Depends Onhttp://example.org/fhir/Library/opioidcds-common
DocumentationMME Conversion Tables

https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf ()

Data Requirements

Type: MedicationRequest
FilterValue
statusOne of these codes: [not stated] active: active
categoryOne of these codes: MedicationRequest Category Codes outpatient: Outpatient

Contents

application/elm+xml

<?xml version="1.0" encoding="UTF-8"?>
<library xmlns="urn:hl7-org:elm:r1" xmlns:t="urn:hl7-org:elm-types:r1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:fhir="http://hl7.org/fhir" xmlns:qdm43="urn:healthit-gov:qdm:v4_3" xmlns:qdm53="urn:healthit-gov:qdm:v5_3" xmlns:a="urn:hl7-org:cql-annotations:r1">
   <identifier id="OpioidCDS_STU4" version="0.1.0"/>
   <schemaIdentifier id="urn:hl7-org:elm" version="r1"/>
   <usings>
      <def localIdentifier="System" uri="urn:hl7-org:elm-types:r1"/>
      <def localIdentifier="FHIR" uri="http://hl7.org/fhir" version="3.2.0"/>
   </usings>
   <includes>
      <def localIdentifier="MMECommon" path="OpioidCDS_STU4_Common" version="0.1.0"/>
   </includes>
   <parameters>
      <def name="UserID" accessLevel="Public">
         <parameterTypeSpecifier name="t:String" xsi:type="NamedTypeSpecifier"/>
      </def>
      <def name="ContextPrescriptions" accessLevel="Public">
         <parameterTypeSpecifier xsi:type="ListTypeSpecifier">
            <elementType name="fhir:MedicationRequest" xsi:type="NamedTypeSpecifier"/>
         </parameterTypeSpecifier>
      </def>
   </parameters>
   <statements>
      <def name="Patient" context="Patient">
         <expression xsi:type="SingletonFrom">
            <operand dataType="fhir:Patient" xsi:type="Retrieve"/>
         </expression>
      </def>
      <def name="Get Active Prescriptions" context="Patient" accessLevel="Public">
         <expression xsi:type="Query">
            <source alias="activeRx">
               <expression dataType="fhir:MedicationRequest" xsi:type="Retrieve"/>
            </source>
            <where xsi:type="And">
               <operand xsi:type="Equal">
                  <operand path="value" xsi:type="Property">
                     <source path="status" scope="activeRx" xsi:type="Property"/>
                  </operand>
                  <operand valueType="t:String" value="active" xsi:type="Literal"/>
               </operand>
               <operand xsi:type="Equal">
                  <operand path="value" xsi:type="Property">
                     <source path="code" xsi:type="Property">
                        <source xsi:type="Indexer">
                           <operand xsi:type="Flatten">
                              <operand xsi:type="Query">
                                 <source alias="$this">
                                    <expression path="category" scope="activeRx" xsi:type="Property"/>
                                 </source>
                                 <where xsi:type="Not">
                                    <operand xsi:type="IsNull">
                                       <operand path="coding" xsi:type="Property">
                                          <source name="$this" xsi:type="AliasRef"/>
                                       </operand>
                                    </operand>
                                 </where>
                                 <return>
                                    <expression path="coding" xsi:type="Property">
                                       <source name="$this" xsi:type="AliasRef"/>
                                    </expression>
                                 </return>
                              </operand>
                           </operand>
                           <operand valueType="t:Integer" value="0" xsi:type="Literal"/>
                        </source>
                     </source>
                  </operand>
                  <operand valueType="t:String" value="outpatient" xsi:type="Literal"/>
               </operand>
            </where>
         </expression>
      </def>
      <def name="Total MME" context="Patient" accessLevel="Public">
         <expression name="TotalMME" libraryName="MMECommon" xsi:type="FunctionRef">
            <operand xsi:type="Union">
               <operand name="ContextPrescriptions" xsi:type="ParameterRef"/>
               <operand name="Get Active Prescriptions" xsi:type="ExpressionRef"/>
            </operand>
         </expression>
      </def>
      <def name="Is MME 50 Or More?" context="Patient" accessLevel="Public">
         <expression xsi:type="GreaterOrEqual">
            <operand name="Total MME" xsi:type="ExpressionRef"/>
            <operand value="50" unit="mg/d" xsi:type="Quantity"/>
         </expression>
      </def>
      <def name="Get Indicator" context="Patient" accessLevel="Public">
         <expression valueType="t:String" value="warning" xsi:type="Literal"/>
      </def>
      <def name="Get Summary" context="Patient" accessLevel="Public">
         <expression xsi:type="Concatenate">
            <operand valueType="t:String" value="High risk for opioid overdose - " xsi:type="Literal"/>
            <operand xsi:type="Case">
               <caseItem>
                  <when xsi:type="GreaterOrEqual">
                     <operand path="value" xsi:type="Property">
                        <source name="Total MME" xsi:type="ExpressionRef"/>
                     </operand>
                     <operand xsi:type="ToDecimal">
                        <operand valueType="t:Integer" value="90" xsi:type="Literal"/>
                     </operand>
                  </when>
                  <then valueType="t:String" value="taper now" xsi:type="Literal"/>
               </caseItem>
               <else valueType="t:String" value="consider tapering" xsi:type="Literal"/>
            </operand>
         </expression>
      </def>
      <def name="Get Detail" context="Patient" accessLevel="Public">
         <expression xsi:type="Concatenate">
            <operand xsi:type="Concatenate">
               <operand valueType="t:String" value="Total morphine milligram equivalent (MME) is " xsi:type="Literal"/>
               <operand xsi:type="ToString">
                  <operand name="Total MME" xsi:type="ExpressionRef"/>
               </operand>
            </operand>
            <operand valueType="t:String" value=". Taper to less than 50." xsi:type="Literal"/>
         </expression>
      </def>
   </statements>
</library>

content
:


 

Other examples that reference this example: PlanDefinition/OpioidCDSRecommendation5  

Usage note: every effort has been made to ensure that the examples are correct and useful, but they are not a normative part of the specification.