This is Snapshot #3 for FHIR R5, released to support Connectathon 32. For a full list of available versions, see the Directory of published versions.
Clinical Decision Support Work Group | Maturity Level: N/A | Standards Status: Informative | Compartments: Not linked to any defined compartments |
This is the narrative for the resource. See also the XML, JSON or Turtle format. This example conforms to the profile Library.
Author | Kensaku Kawamoto, MD, PhD, MHS |
Author | Bryn Rhodes |
Author | Floyd Eisenberg, MD, MPH |
Author | Robert McClure, MD, MPH |
Documentation | CDC guideline for prescribing opioids for chronic pain | |
Depends On | http://example.org/fhir/Library/opioidcds-common | |
Documentation | MME Conversion Tables |
|
Type: MedicationRequest | |
Filter | Value |
status | One of these codes: [not stated] active: active |
category | One of these codes: MedicationRequest Category Codes outpatient: Outpatient |
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>
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.