OpioidCDSRoutines
type: Library
node role: treeRoot
id:
  v: OpioidCDSRoutines
text:
  status:
    v: generated
  div: Id: library-OpioidCDSRoutines Type: logic-library Version: 2022.1.0 Status: active Related: type: depends-on Resource: http://fhir.org/guides/cdc/opioid-cds/Library/FHIRHelpers type: depends-on Resource: http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSCommon type: depends-on Resource: http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSCommonConfig Data Requirements: type: Condition code filter: path: category valueset: http://hl7.org/fhir/us/core/ValueSet/us-core-condition-category type: ServiceRequest code filter: path: code valueset: http://fhir.org/guides/cdc/opioid-cds/ValueSet/therapies-indicating-end-of-life-care type: Encounter code filter: path: type valueset: http://fhir.org/guides/cdc/opioid-cds/ValueSet/office-visit type: Condition code filter: path: category valueset: http://hl7.org/fhir/us/core/ValueSet/us-core-condition-category type: PractitionerRole type: Condition code filter: path: category valueset: http://hl7.org/fhir/us/core/ValueSet/us-core-condition-category type: MedicationDispense code filter: path: medication valueset: http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-analgesics-with-ambulatory-misuse-potential Content: type: text/cql library OpioidCDSRoutines version '2022.1.0' using FHIR version '4.0.1' include FHIRHelpers version '4.0.1' called FHIRHelpers include OpioidCDSCommon version '2022.1.0' called Common include OpioidCDSCommonConfig version '2022.1.0' called Config context Patient /* ** Routine #1 ** Opioid Review Useful Routine ** ** Definition | Answer to Proceed | Details | Data (Terminology) Requirement ** ------------------------------------------------------------------------------------------------------------------------------------ ** Age < 18 years? | No | Calculate age from date of birth; exclude | Date of birth ** | | patients with age less than 18 years at the | ** | | time of the prescription | ** --------------------------------------------------------------------------------------------------------…
contained: Parameters
  id:
    v: options
  parameter:
    name:
      v: translatorVersion
    value: string
      v: 3.22.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: XML
  parameter:
    name:
      v: format
    value: string
      v: JSON
  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
  value: Reference
    reference:
      v: #options
extension:
  url:
    v: http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-softwaresystem
  value: Reference
    link: http://fhir.org/guides/cdc/opioid-cds/Device/cqf-tooling
    reference:
      v: Device/cqf-tooling
url:
  v: http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSRoutines
version:
  v: 2022.1.0
name:
  v: OpioidCDSRoutines
title:
  v: Library - OpioidCDS Routines
status:
  v: active
experimental:
  v: true
type:
  coding:
    system:
      v: http://terminology.hl7.org/CodeSystem/library-type
    code:
      v: logic-library
date:
  v: 2025-08-14T14:21:53+00:00
publisher:
  v: Centers for Disease Control and Prevention (CDC)
contact:
  telecom:
    system:
      v: url
    value:
      v: https://www.cdc.gov
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
    link: 4.0
    link: .1
related artifact:
  type:
    v: depends-on
  display:
    v: Library FHIRHelpers
  resource:
    v: http://fhir.org/guides/cdc/opioid-cds/Library/FHIRHelpers|4.0.1
    link: 4.0
    link: .1
related artifact:
  type:
    v: depends-on
  display:
    v: Library Common
  resource:
    v: http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSCommon|2022.1.0
    link: 2022.1
    link: .0
related artifact:
  type:
    v: depends-on
  display:
    v: Library Config
  resource:
    v: http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSCommonConfig|2022.1.0
    link: 2022.1
    link: .0
related artifact:
  type:
    v: depends-on
  display:
    v: Value set Encounter Diagnosis Condition Category
  resource:
    v: http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-encounter-diagnosis-category
    link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-encounter-diagnosis-category
related artifact:
  type:
    v: depends-on
  display:
    v: Value set CDC malignant cancer conditions
  resource:
    v: http://fhir.org/guides/cdc/opioid-cds/ValueSet/cdc-malignant-cancer-conditions
    link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/cdc-malignant-cancer-conditions
related artifact:
  type:
    v: depends-on
  display:
    v: Value set Problem List Condition Category
  resource:
    v: http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-problem-list-category
    link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-problem-list-category
related artifact:
  type:
    v: depends-on
  display:
    v: Value set Opioid analgesics with ambulatory misuse potential
  resource:
    v: http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-analgesics-with-ambulatory-misuse-potential
    link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-analgesics-with-ambulatory-misuse-potential
parameter:
  name:
    v: Patient
  use:
    v: out
  min:
    v: 0

v: 1

v: Patient

name:
  v: Palliative Care Lookback Period
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: Period

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: Is Opioid Review Useful?
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
  link: http://hl7.org/fhir/StructureDefinition/Patient

type:
  v: Condition
profile:
  v: http://hl7.org/fhir/StructureDefinition/Condition
  link: http://hl7.org/fhir/StructureDefinition/Condition
must support:
  v: category
must support:
  v: code
must support:
  v: encounter
must support:
  v: encounter.reference
code filter:
  path:
    v: category
  value set:
    v: http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-encounter-diagnosis-category
    link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-encounter-diagnosis-category

type:
  v: Condition
profile:
  v: http://hl7.org/fhir/StructureDefinition/Condition
  link: http://hl7.org/fhir/StructureDefinition/Condition
must support:
  v: category
must support:
  v: code
must support:
  v: clinicalStatus
must support:
  v: clinicalStatus.coding
code filter:
  path:
    v: category
  value set:
    v: http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-problem-list-category
    link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-problem-list-category

type:
  v: Encounter
profile:
  v: http://hl7.org/fhir/StructureDefinition/Encounter
  link: http://hl7.org/fhir/StructureDefinition/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
  link: http://hl7.org/fhir/StructureDefinition/MedicationDispense
must support:
  v: medication
code filter:
  path:
    v: medication
  value set:
    v: http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-analgesics-with-ambulatory-misuse-potential
    link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/opioid-analgesics-with-ambulatory-misuse-potential

content type:
  v: text/cql

content type:
  v: application/elm+xml

content type:
  v: application/elm+json