OMTKLogic
type: Library
node role: treeRoot
id:
  v: OMTKLogic
text:
  status:
    v: generated
  div: Generated Narrative: Library OMTKLogic Participants Author Kensaku Kawamoto, MD, PhD, MHS Author Bryn Rhodes Author Floyd Eisenberg, MD, MPH Author Robert McClure, MD, MPH Related Artifacts Documentation CDC guideline for prescribing opioids for chronic pain 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 Documentation MME Conversion Tables https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf Depends On Code System RxNorm RxNorm Contents text/cql library OMTKLogic version '0.0.0' /* This is a "stub" version of the OMTKLogic library that has no dependencies on the OMTK data. It provides a workable version of the logic suitable for example usage. For the full version of this library, see the CDC Opioid Prescribing Support Implementation Guide. */ codesystem RxNorm: 'http://www.nlm.nih.gov/research/umls/rxnorm' /* Normalizes the input units to UCUM units Note guidance for UCUM presentation of medication units from SNOMED here: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjU3vLpicPTAhWFMGMKHRpOBUAQFggiMAA&url=https%3A%2F%2Fconfluence.ihtsdotools.org%2Fdownload%2Fattachments%2F17859188%2FExpressing%2520Units%2520of%2520Measure%2520for%2520Medicinal%2520Products.doc%3Fapi%3Dv2&usg=AFQjCNE5sboicqvJDUyXJ2im8VzBpgHE8A The values listed here are the only ones currently present in the OMTK data Based on the HL7 UCUM subset here: http://download.hl7.de/documents/ucum/ucumdata.html */ define function ToUCUM(unit String): case unit when 'MG' then 'mg' when 'MG/ACTUAT' then 'mg/{actuat}' when 'MG/HR' then 'mg/h' when 'MG/ML' then 'mg/mL' else 'Error: unknown{' + unit + '}' end /* Calculates daily frequency given frequency within a period */ define function ToDaily(frequency Integer, period System.Quantity): case period.unit when 'h' then frequency * (24.0 / period.value) when 'min' then frequency * (24.0 / period.value) * 60 when '…
url:
  v: http://cqframework.org/cpg-example-opioids/Library/OMTKLogic
version:
  v: 1.0.0
name:
  v: OMTKLogic
title:
  v: OMTK Logic
status:
  v: active
experimental:
  v: true
type:
  coding:
    system:
      v: http://terminology.hl7.org/CodeSystem/library-type
    code:
      v: logic-library
    display:
      v: Logic Library
date:
  v: 2025-03-04T15:46:21+00:00
publisher:
  v: HL7 International - Clinical Decision Support WG
contact:
  name:
    v: HL7 International - Clinical Decision Support WG
  telecom:
    system:
      v: url
    value:
      v: http://www.hl7.org/Special/committees/dss/index.cfm
description:
  v: Opioid Management Terminology Knowledge Base Logic for use in implementing CDC Opioid Prescribing Guidelines.
use context:
  code:
    system:
      v: http://terminology.hl7.org/CodeSystem/usage-context-type
    code:
      v: focus
    display:
      v: Clinical Focus
  value: CodeableConcept
    coding: http://snomed.info/id/182888003
      system:
        v: http://snomed.info/sct
      code:
        v: 182888003
      display:
        v: Medication requested (situation)
use context:
  code:
    system:
      v: http://terminology.hl7.org/CodeSystem/usage-context-type
    code:
      v: focus
    display:
      v: Clinical Focus
  value: CodeableConcept
    coding: http://snomed.info/id/82423001
      system:
        v: http://snomed.info/sct
      code:
        v: 82423001
      display:
        v: Chronic pain (finding)
jurisdiction:
  coding:
    system:
      v: http://unstats.un.org/unsd/methods/m49/m49.htm
    code:
      v: 001
    display:
      v: World
purpose:
  v: This library normalizes units to UCUM units, identifies the conversion factor for the given ingredient, identifies the non-surgical opioid ingredients and their strengths that make up a drug identified by the given rxNormCode, calculates daily dose for a specific ingredient based on the ingredient strength, dose form, dose quantity, and daily frequency, calculates daily frequency given frequency within a period, and calculates the Morphine Milligram Equivalency (MME) for a given prescription.
usage:
  v: This is a "stub" version of the OMTKLogic library that has no dependencies on the OMTK data. It provides a workable version of the logic suitable for example usage. For the full version of this library, see the CDC Opioid Prescribing Support Implementation Guide.
copyright:
  v: CDC 2016+
topic:
  text:
    v: Opioid Prescribing
author:
  name:
    v: Kensaku Kawamoto, MD, PhD, MHS
author:
  name:
    v: Bryn Rhodes
author:
  name:
    v: Floyd Eisenberg, MD, MPH
author:
  name:
    v: Robert McClure, MD, MPH
related artifact:
  type:
    v: documentation
  display:
    v: CDC guideline for prescribing opioids for chronic pain
  url:
    v: https://www.cdc.gov/mmwr/volumes/65/rr/rr6501e1.htm
  document:
    url:
      v: https://www.cdc.gov/mmwr/volumes/65/rr/rr6501e1.htm
related artifact:
  type:
    v: documentation
  display:
    v: MME Conversion Tables
  url:
    v: https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf
  document:
    url:
      v: https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf
related artifact:
  type:
    v: depends-on
  display:
    v: Code System RxNorm
  resource:
    v: http://www.nlm.nih.gov/research/umls/rxnorm
    link: http://www.nlm.nih.gov/research/umls/rxnorm
content:
  content type:
    v: text/cql
content:
  content type:
    v: application/elm+xml