Release 4 FHIR CI-Build

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

Library-opioidcds-recommendation-05

Example Library/opioidcds-recommendation-05 (Narrative)

Maturity Level : N/A
Responsible Owner: Clinical Decision Support Work Group 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 Narrative: Library opioidcds-recommendation-05

id : opioidcds-recommendation-05 identifier : OpioidCDS_REC_05 (OFFICIAL)

Participants

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'})
Author Kensaku Kawamoto, MD, PhD, MHS
Author Bryn Rhodes
Author Floyd Eisenberg, MD, MPH
Author Robert McClure, MD, MPH

Related Artifacts

date : 25/03/2018 1:49:09 PM publisher : Centers jurisdiction : United States of America (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United States of America'}) usage : This library is to notify the prescriber/user whether the current prescription exceeds the recommended MME. copyright : © CDC 2016+.
Documentation CDC guideline for Disease Control and Prevention (CDC) description : Opioid Decision Support Logic prescribing opioids for use in implementing CDC Opioid Prescribing Guidelines. chronic pain useContext : ,
Depends On http://example.org/fhir/Library/opioidcds-common purpose : This library works in concert with the OMTK logic library to provide decision support for Morphine Milligram Equivalence calculations and dynamic value resolution.
Documentation MME Conversion Tables
topic : Opioid Prescribing (Details )

Data Requirements

relatedArtifact : , , dataRequirement : content :
author Type : , , , MedicationRequest
Filter Value
status One of these codes: [not stated]: active (active)
category One 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>

 

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.