OpioidCDSRoutines
type: Library
node role: treeRoot
id:
  v: OpioidCDSRoutines
text:
  status:
    v: extensions
  div:
    v: Id: OpioidCDSRoutines Url: Library - OpioidCDS Routines Version: 2022.1.0 Name: OpioidCDSRoutines Title: Library - OpioidCDS Routines Status: active Experimental: false Type: system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library Date: 2026-03-18 16:23:26+1100 Publisher: CDC / Security Risk Solutions, Inc. (SRS) Copyright: Centers for Disease Control and Prevention (CDC) Related Artifacts: Dependencies http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1 FHIR Helpersversion: null4.0.1) Library - OpioidCDS Commonversion: null2022.1.0) Library - OpioidCDS Common Configurationversion: null2022.1.0) Parameters: Name Type Min Max In/Out Patient Patient 0 1 Out Palliative Care Lookback Period Period 0 1 Out Patient Age Less Than 18 boolean 0 1 Out Condition Positive for Sickle Cell boolean 0 1 Out Encounter Period Period 0 1 Out Encounters with Cancer Diagnosis During Encounter Period Encounter 0 * Out Number of Encounters with Cancer Diagnosis During Encounter Period integer 0 1 Out Has Two or More Encounters with Cancer Diagnosis During Encounter Period boolean 0 1 Out Has Active Cancer Diagnosis on Problem List boolean 0 1 Out Is Active Cancer Treatment? boolean 0 1 Out Conditions Likely Terminal for Opioid Prescribing boolean 0 1 Out CDC 2022 Guideline General Inclusion Criteria boolean 0 1 Out Prescription/Dispense Inclusion Period Period 0 1 Out Report Inclusion Period Period 0 1 Out Opioid RX with Ambulatory Abuse Potential In Past 90 Days MedicationRequest 0 * Out Has Opioid RX with Ambulatory Abuse Potential In Past 90 Days boolean 0 1 Out Opioid Dispense with Ambulatory Abuse Potential In Past 90 Days MedicationDispense 0 * Out Has Opioid Dispense with Ambulatory Abuse Potential In Past 90 Days boolean 0 1 Out Is Opioid Naive? boolean 0 1 Out Data Requirements: Type Profile MS Code Filter Patient http://hl7.org/fhir/StructureDefinition/Patient Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;;; MedicationDispense htt…
contained: Parameters
  id:
    v: options
  parameter:
    name:
      v: translatorVersion
    value: String
      v: 3.25.0
  parameter:
    name:
      v: option
    value: String
      v: EnableAnnotations
  parameter:
    name:
      v: option
    value: String
      v: EnableLocators
  parameter:
    name:
      v: option
    value: String
      v: DisableListDemotion
  parameter:
    name:
      v: option
    value: String
      v: DisableListPromotion
  parameter:
    name:
      v: format
    value: String
      v: JSON
  parameter:
    name:
      v: format
    value: String
      v: XML
  parameter:
    name:
      v: analyzeDataRequirements
    value: Boolean
      v: false
  parameter:
    name:
      v: collapseDataRequirements
    value: Boolean
      v: true
  parameter:
    name:
      v: compatibilityLevel
    value: String
      v: 1.5
  parameter:
    name:
      v: enableCqlOnly
    value: Boolean
      v: false
  parameter:
    name:
      v: errorLevel
    value: String
      v: Info
  parameter:
    name:
      v: signatureLevel
    value: String
      v: Overloads
  parameter:
    name:
      v: validateUnits
    value: Boolean
      v: true
  parameter:
    name:
      v: verifyOnly
    value: Boolean
      v: false
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/cqf-cqlOptions
    l: cqf-cqlOptions
  value: Reference
    l: options
    reference:
      v: #options
extension:
  url:
    v: http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-softwaresystem
    l: crmi-softwaresystem
  value: Reference
    l: cqf-tooling
    reference:
      v: Device/cqf-tooling
url:
  v: http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSRoutines
  l: OpioidCDSRoutines
version:
  v: 2022.1.0
name:
  v: OpioidCDSRoutines
title:
  v: Library - OpioidCDS Routines
status:
  v: active
experimental:
  v: false
type:
  coding:
    system:
      v: http://terminology.hl7.org/CodeSystem/library-type
      l: library-type
    code:
      v: logic-library
date:
  v: 2026-03-18T16:23:26+11:00
publisher:
  v: CDC / Security Risk Solutions, Inc. (SRS)
contact:
  telecom:
    system:
      v: url
    value:
      v: https://www.securityrisksolutions.com
copyright:
  v: Centers for Disease Control and Prevention (CDC)
related artifact:
  type:
    v: depends-on
  display:
    v: FHIR model information
  resource:
    v: http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1
    l: http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo
related artifact:
  type:
    v: depends-on
  display:
    v: Library FHIRHelpers
  resource:
    v: http://fhir.org/guides/cdc/opioid-cds/Library/FHIRHelpers|4.0.1
    l: http://fhir.org/guides/cdc/opioid-cds/Library/FHIRHelpers
related artifact:
  type:
    v: depends-on
  display:
    v: Library Common
  resource:
    v: http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSCommon|2022.1.0
    l: http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSCommon
related artifact:
  type:
    v: depends-on
  display:
    v: Library Config
  resource:
    v: http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSCommonConfig|2022.1.0
    l: http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSCommonConfig
parameter:
  name:
    v: Patient
  use:
    v: out
  min:
    v: 0
  max:
    v: 1
  type:
    v: Patient
parameter:
  name:
    v: Palliative Care Lookback Period
  use:
    v: out
  min:
    v: 0
  max:
    v: 1
  type:
    v: Period
parameter:
  name:
    v: Patient Age Less Than 18
  use:
    v: out
  min:
    v: 0
  max:
    v: 1
  type:
    v: boolean

name:
  v: Condition Positive for Sickle Cell
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Encounter Period
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: Period

name:
  v: Encounters with Cancer Diagnosis During Encounter Period
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Encounter

name:
  v: Number of Encounters with Cancer Diagnosis During Encounter Period
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: integer

name:
  v: Has Two or More Encounters with Cancer Diagnosis During Encounter Period
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Has Active Cancer Diagnosis on Problem List
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Is Active Cancer Treatment?
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Conditions Likely Terminal for Opioid Prescribing
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: CDC 2022 Guideline General Inclusion Criteria
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Prescription/Dispense Inclusion Period
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: Period

name:
  v: Report Inclusion Period
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: Period

name:
  v: Opioid RX with Ambulatory Abuse Potential In Past 90 Days
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: MedicationRequest

name:
  v: Has Opioid RX with Ambulatory Abuse Potential In Past 90 Days
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Opioid Dispense with Ambulatory Abuse Potential In Past 90 Days
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: MedicationDispense

name:
  v: Has Opioid Dispense with Ambulatory Abuse Potential In Past 90 Days
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Is Opioid Naive?
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

type:
  v: Patient
profile:
  v: http://hl7.org/fhir/StructureDefinition/Patient
  l: Patient

type:
  v: Encounter
profile:
  v: http://hl7.org/fhir/StructureDefinition/Encounter
  l: Encounter
must support:
  v: period
must support:
  v: period.start
must support:
  v: id

type:
  v: MedicationDispense
profile:
  v: http://hl7.org/fhir/StructureDefinition/MedicationDispense
  l: MedicationDispense
must support:
  v: medication
must support:
  v: whenHandedOver
must support:
  v: status
code filter:
  path:
    v: medication
  value set:
    v: http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-analgesics-with-ambulatory-misuse-potential
    l: opioid-analgesics-with-ambulatory-misuse-potential

type:
  v: MedicationDispense
profile:
  v: http://hl7.org/fhir/StructureDefinition/MedicationDispense
  l: MedicationDispense
must support:
  v: medication.reference
must support:
  v: whenHandedOver
must support:
  v: status

type:
  v: Medication
profile:
  v: http://hl7.org/fhir/StructureDefinition/Medication
  l: Medication
must support:
  v: id
must support:
  v: code

content type:
  v: text/cql

content type:
  v: application/elm+xml

content type:
  v: application/elm+json