opioidcds-06
type: PlanDefinition
node role: treeRoot
resource.id:
  value: opioidcds-06
resource.meta:
  meta.profile:
    value: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-recommendationdefinition
    index: 0
    link: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-recommendationdefinition
  meta.profile:
    value: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-publishableplandefinition
    index: 1
    link: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-publishableplandefinition
domain resource.text:
  narrative.status:
    value: extensions
  narrative.div: Id: opioidcds-06 Url: Recommendation #6 - Prescribe Lowest Effective Dose and Duration Version: 2022.1.0 Identifier: value: cdc-opioid-guidance Identifier: value: urn:oid:2.16.840.1.114222.34.5 Name: PlanDefinition_Recommendation_06_Order_Sign Title: Recommendation #6 - Prescribe Lowest Effective Dose and Duration Status: active Experimental: false Type: system: http://terminology.hl7.org/CodeSystem/plan-definition-type code: eca-rule display: ECA Rule Date: 2025-08-06 Publisher: CDC / Security Risk Solutions, Inc. (SRS) Description: When opioids are needed for acute pain, clinicians should prescribe no greater quantity than needed for the expected duration of pain severe enough to require opioids. Logic Definitions: Library Name Name sequence OpioidCDSREC06 Acute Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions 0 define "Acute Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions": ( Common."Is Opioid Analgesic with Ambulatory Misuse Potential?"( ContextPrescriptions ) ) AmbulatoryOpioidPrescription where Routines."Is Acute Pain Prescription?"( AmbulatoryOpioidPrescription ) and Routines."Acute Pain Prescription Greater Than 7 Days?"(AmbulatoryOpioidPrescription) Library Name Name sequence OpioidCDSREC06 Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential for Acute Pain 1 define "Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential for Acute Pain": exists( "Acute Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions" ) Library Name Name sequence OpioidCDSCommonConfig Age Less than 18 Years Is Enabled 2 // CDC 2022 General Inclusion Criteria define "Age Less than 18 Years Is Enabled": true Library Name Name sequence OpioidCDSRoutines Patient Age Less Than 18 3 define "Patient Age Less Than 18": if (Config."Age Less than 18 Years Is Enabled") then AgeInYearsAt(Today()) < 18 else false Library Name Name sequence OpioidCDSCommonConfig Sickle Cell Check Enabled 4 // Sick…
domain resource.contained: Library
  index: 0
  resource.id:
    value: effective-data-requirements
  library.name:
    value: EffectiveDataRequirements
  library.status:
    value: active
  library.type:
    codeable concept.coding:
      index: 0
      coding.system:
        value: http://terminology.hl7.org/CodeSystem/library-type
      coding.code:
        value: module-definition
  library.related artifact:
    index: 0
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Library Common
    related artifact.resource:
      value: http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSCommon|2022.1.0
      link: 2022.1
      link: .0
  library.related artifact:
    index: 1
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Library FHIRHelpers
    related artifact.resource:
      value: http://fhir.org/guides/cdc/opioid-cds/Library/FHIRHelpers|4.0.1
      link: 4.0
      link: .1
  library.related artifact:
    index: 2
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Library Routines
    related artifact.resource:
      value: http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSRoutines|2022.1.0
      link: 2022.1
      link: .0
  library.related artifact:
    index: 3
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Library Config
    related artifact.resource:
      value: http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSCommonConfig|2022.1.0
      link: 2022.1
      link: .0
  library.related artifact:
    index: 4
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Value set Opioid analgesics with ambulatory misuse potential
    related artifact.resource:
      value: 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
  library.related artifact:
    index: 5
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Value set Community
    related artifact.resource:
      value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/medicationrequest-category-community
      link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/medicationrequest-category-community
  library.related artifact:
    index: 6
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Value set Encounter Diagnosis Condition Category
    related artifact.resource:
      value: 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
  library.related artifact:
    index: 7
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Value set Problem List Condition Category
    related artifact.resource:
      value: 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
  library.related artifact:
    index: 8
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Value set US Core Health Concern Condition Category
    related artifact.resource:
      value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-us-core-health-concern-category
      link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-us-core-health-concern-category
  library.related artifact:
    index: 9
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Value set Sickle Cell Diseases
    related artifact.resource:
      value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/sickle-cell-diseases
      link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/sickle-cell-diseases
  library.related artifact:
    index: 10
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Value set Active Condition
    related artifact.resource:
      value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-clinical-status-active
      link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-clinical-status-active
  library.related artifact:
    index: 11
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Value set CDC malignant cancer conditions
    related artifact.resource:
      value: 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
  library.related artifact:
    index: 12
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Value set Conditions likely terminal for opioid prescribing
    related artifact.resource:
      value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/conditions-likely-terminal-for-opioid-prescribing
      link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/conditions-likely-terminal-for-opioid-prescribing
  library.related artifact:
    index: 13
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Value set Extended release opioid with ambulatory misuse potential
    related artifact.resource:
      value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/extended-release-opioid-with-ambulatory-misuse-potential
      link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/extended-release-opioid-with-ambulatory-misuse-potential
  library.parameter:
    index: 0
    parameter definition.name:
      value: ContextPrescriptions
    parameter definition.use:
      value: in
    parameter definition.min:
      value: 0
    parameter definition.max:
      value: *
    parameter definition.type:
      value: MedicationRequest
  library.parameter:
    index: 1
    parameter definition.name:
      value: Is Recommendation Applicable?
    parameter definition.use:
      value: out
    parameter definition.min:
      value: 0
    parameter definition.max:
      value: 1
    parameter definition.type:
      value: boolean
  library.data requirement:
    index: 0
    data requirement.type:
      value: Medication
    data requirement.profile:
      value: http://hl7.org/fhir/StructureDefinition/Medication
      index: 0
      link: http://hl7.org/fhir/StructureDefinition/Medication
    data requirement.must support:
      value: id
      index: 0
    data requirement.must support:
      value: code
      index: 1
  library.data requirement:
    index: 1

value: Patient

value: http://hl7.org/fhir/StructureDefinition/Patient
index: 0
link: http://hl7.org/fhir/StructureDefinition/Patient

index: 2
data requirement.type:
  value: Condition
data requirement.profile:
  value: http://hl7.org/fhir/StructureDefinition/Condition
  index: 0
  link: http://hl7.org/fhir/StructureDefinition/Condition
data requirement.must support:
  value: category
  index: 0
data requirement.must support:
  value: code
  index: 1
data requirement.must support:
  value: clinicalStatus
  index: 2
data requirement.code filter:
  index: 0
  data requirement.code filter.path:
    value: category
  data requirement.code filter.value set:
    value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-us-core-health-concern-category
    link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/condition-us-core-health-concern-category

index: 3
data requirement.type:
  value: Condition
data requirement.profile:
  value: http://hl7.org/fhir/StructureDefinition/Condition
  index: 0
  link: http://hl7.org/fhir/StructureDefinition/Condition
data requirement.must support:
  value: category
  index: 0
data requirement.must support:
  value: code
  index: 1
data requirement.must support:
  value: clinicalStatus
  index: 2
data requirement.must support:
  value: encounter
  index: 3
data requirement.must support:
  value: encounter.reference
  index: 4
data requirement.code filter:
  index: 0
  data requirement.code filter.path:
    value: category
  data requirement.code filter.value set:
    value: 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

index: 4
data requirement.type:
  value: Condition
data requirement.profile:
  value: http://hl7.org/fhir/StructureDefinition/Condition
  index: 0
  link: http://hl7.org/fhir/StructureDefinition/Condition
data requirement.must support:
  value: category
  index: 0
data requirement.must support:
  value: code
  index: 1
data requirement.must support:
  value: clinicalStatus
  index: 2
data requirement.must support:
  value: clinicalStatus.coding
  index: 3
data requirement.code filter:
  index: 0
  data requirement.code filter.path:
    value: category
  data requirement.code filter.value set:
    value: 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

index: 5
data requirement.type:
  value: Encounter
data requirement.profile:
  value: http://hl7.org/fhir/StructureDefinition/Encounter
  index: 0
  link: http://hl7.org/fhir/StructureDefinition/Encounter
data requirement.must support:
  value: period
  index: 0
data requirement.must support:
  value: period.start
  index: 1
data requirement.must support:
  value: id
  index: 2

index: 0
extension.url:
  value: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability
extension.value code:
  value: shareable

index: 1
extension.url:
  value: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability
extension.value code:
  value: computable

index: 2
extension.url:
  value: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability
extension.value code:
  value: executable

index: 3
extension.url:
  value: http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-knowledgeCapability
extension.value code:
  value: publishable

index: 4
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC06
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Acute Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Acute Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions": ( Common."Is Opioid Analgesic with Ambulatory Misuse Potential?"( ContextPrescriptions ) ) AmbulatoryOpioidPrescription where Routines."Is Acute Pain Prescription?"( AmbulatoryOpioidPrescription ) and Routines."Acute Pain Prescription Greater Than 7 Days?"(AmbulatoryOpioidPrescription)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 0
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 5
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC06
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential for Acute Pain
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential for Acute Pain": exists( "Acute Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions" )
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 1
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 6
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSCommonConfig
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Age Less than 18 Years Is Enabled
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // CDC 2022 General Inclusion Criteria define "Age Less than 18 Years Is Enabled": true
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 2
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 7
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSRoutines
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Patient Age Less Than 18
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Patient Age Less Than 18": if (Config."Age Less than 18 Years Is Enabled") then AgeInYearsAt(Today()) < 18 else false
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 3
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 8
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSCommonConfig
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Sickle Cell Check Enabled
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Sickle Cell define "Sickle Cell Check Enabled": true
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 4
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 9
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSCommonConfig
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Sickle Cell Assumed Active
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Sickle Cell Assumed Active": true
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 5
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 10
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSCommon
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: US Core-Categorized Conditions
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // 3. Medications indicating end of life /* or exists ( "Medications Indicating End of Life" ) */ define "US Core-Categorized Conditions": [Condition: category in "Encounter Diagnosis Condition Category"] union [Condition: category in "Problem List Condition Category"] union [Condition: category in "US Core Health Concern Condition Category"]
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 6
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 11
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSCommon
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Positive Sickle Cell Condition
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Positive Sickle Cell Condition": if Config."Sickle Cell Check Enabled" and not Config."Sickle Cell Assumed Active" then ( "US Core-Categorized Conditions" C where C.code in "Sickle Cell Diseases" and C.clinicalStatus in "Active Condition" ) else if Config."Sickle Cell Check Enabled" and Config."Sickle Cell Assumed Active" then ( "US Core-Categorized Conditions" C where C.code in "Sickle Cell Diseases" ) else null
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 7
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 12
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSRoutines
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Condition Positive for Sickle Cell
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Condition Positive for Sickle Cell": if (Config."Sickle Cell Check Enabled") then exists( Common."Positive Sickle Cell Condition" ) else false
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 8
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 13
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSCommonConfig
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Active Cancer Treatment Encounters Condition Is Enabled
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Active Cancer Treatment define "Active Cancer Treatment Encounters Condition Is Enabled": true
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 9
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 14
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSRoutines
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Encounter Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // End of Opioid Naive Routine /* ** Routine #3 ** Active Cancer Treatment Routine ** ** Definition | Answer to Proceed | Details | Data (Terminology) Requirement ** --------------------------------------------------------------------------------------------------------------------------------- ** Two office visits within the | No | Look for a minimum of two distinct | Office Visit ** past 12 months | | encounters within 12 months of the date | ** | | of the current visit for which each of the | ** | | following is true: | ** | | - the encounter diagnosis (primary or | ** | | secondary or co-morbidity diagnosis) | ** | | is listed in the CDC Malignant Cancer | ** | | Conditions value set | ** --------------------------------------------------------------------------------------------------------------------------------- ** Office visits with an | No | The encounter is performed by an | Oncology specialty ** oncology specialist | | oncologist as defined in the oncology | designations (NUCC) ** present | | specialty designations using the | ** | | National Uniform Claim Committee | ** | | (NUCC) classifications | ** --------------------------------------------------------------------------------------------------------------------------------- ** Office visits including CDC | No | The encounter diagnosis (primary or | CDC malignant cancer ** malignant cancer | | secondary or co-morbidity diagnosis) | conditions ** condition | | is listed in the CDC Malignant Cancer | ** | | Conditions value set | ** ---------------------------------------------------------------------------------------------------------------------------------- ** */ define "Encounter Period": Interval[Today() - 12 months, Today())
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 10
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 15
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSCommon
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: USCore Encounter Cancer Diagnoses
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "USCore Encounter Cancer Diagnoses": [Condition: category in "Encounter Diagnosis Condition Category"] CancerDiagnoses where CancerDiagnoses.code in "CDC malignant cancer conditions"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 11
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 16
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSRoutines
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Encounters with Cancer Diagnosis During Encounter Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // encounter-diagnosis, problem-list and health-concern Conditions // define "US Core-Categorized Cancer Diagnoses": // Common."US Core-Categorized Conditions" C // where C.code in Common."CDC malignant cancer conditions" // define "Encounters with Cancer Diagnosis During Encounter Period": // [Encounter] Encounter // with "US Core-Categorized Cancer Diagnoses" CancerDiagnosis // such that date from Encounter.period."start".value in day of "Encounter Period" // and EndsWith(CancerDiagnosis.encounter.reference, Encounter.id) define "Encounters with Cancer Diagnosis During Encounter Period": [Encounter] Encounters where date from Encounters.period."start" in day of "Encounter Period" and exists ( Common."USCore Encounter Cancer Diagnoses" CancerDiagnoses where EndsWith(CancerDiagnoses.encounter.reference, Encounters.id) )
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 12
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 17
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSRoutines
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Number of Encounters with Cancer Diagnosis During Encounter Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Number of Encounters with Cancer Diagnosis During Encounter Period": Count ("Encounters with Cancer Diagnosis During Encounter Period")
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 13
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 18
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSRoutines
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Has Two or More Encounters with Cancer Diagnosis During Encounter Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Has Two or More Encounters with Cancer Diagnosis During Encounter Period": "Number of Encounters with Cancer Diagnosis During Encounter Period" >= 2
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 14
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 19
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSCommon
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: USCore Problem List Cancer Diagnoses
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "USCore Problem List Cancer Diagnoses": [Condition: category in "Problem List Condition Category"] CancerDiagnoses where CancerDiagnoses.code in "CDC malignant cancer conditions"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 15
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 20
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSRoutines
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Has Active Cancer Diagnosis on Problem List
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Has Active Cancer Diagnosis on Problem List": exists ( Common."USCore Problem List Cancer Diagnoses" CancerDiagnoses where CancerDiagnoses.category in Common."Problem List Condition Category" and exists( CancerDiagnoses.clinicalStatus.coding ClinicalStatus where ClinicalStatus.code ~ 'active' ) )
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 16
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 21
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSRoutines
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Is Active Cancer Treatment?
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Is Active Cancer Treatment?": if (Config."Active Cancer Treatment Encounters Condition Is Enabled") then "Has Two or More Encounters with Cancer Diagnosis During Encounter Period" or "Has Active Cancer Diagnosis on Problem List" else false
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 17
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 22
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSCommonConfig
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: End-Stage Disease Criteria Enabled
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // CDC 2022 General Inclusion Criteria define "End-Stage Disease Criteria Enabled": true
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 18
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 23
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSRoutines
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Conditions Likely Terminal for Opioid Prescribing
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Conditions Likely Terminal for Opioid Prescribing": if (Config."End-Stage Disease Criteria Enabled") then exists ( Common."US Core-Categorized Conditions" EOLC where EOLC.code in Common."Conditions likely terminal for opioid prescribing" // and EOLC.clinicalStatus in Common."Active Condition" ) else false
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 19
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 24
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSRoutines
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: CDC 2022 Guideline General Inclusion Criteria
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "CDC 2022 Guideline General Inclusion Criteria": not "Patient Age Less Than 18" and not "Condition Positive for Sickle Cell" and not "Is Active Cancer Treatment?" and not "Conditions Likely Terminal for Opioid Prescribing"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 20
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 25
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC06
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Order is for Long-Acting Opioid
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Order is for Long-Acting Opioid": exists ( "Acute Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions" AmbulatoryOpioidPrescription where AmbulatoryOpioidPrescription.medication in Common."Extended release opioid with ambulatory misuse potential" or Common.GetDurationInDays( AmbulatoryOpioidPrescription.dispenseRequest.expectedSupplyDuration ) > 7 days )
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 21
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 26
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC06
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Inclusion Criteria
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Inclusion Criteria": "Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential for Acute Pain" and Routines."CDC 2022 Guideline General Inclusion Criteria" and "Order is for Long-Acting Opioid"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 22
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 27
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC06
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Exclusion Criteria
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Exclusion Criteria": false
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 23
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 28
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC06
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Is Recommendation Applicable?
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Is Recommendation Applicable?": "Inclusion Criteria" and not "Exclusion Criteria"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 24
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 29
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSCommon
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Is Opioid Analgesic with Ambulatory Misuse Potential?
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function "Is Opioid Analgesic with Ambulatory Misuse Potential?"(value List<MedicationRequest>): ("Get MedicationRequest Medication as Code"(value)) Rx where Rx.medication in "Opioid analgesics with ambulatory misuse potential" and Rx.category in "Community"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 25
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 30
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSCommon
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Get MedicationRequest Medication as Code
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function "Get MedicationRequest Medication as Code"(value List<MedicationRequest>): value Rx let Med: if Rx.medication is Reference then singleton from ( [Medication] M where M.id = (Last(Split((Rx.medication as FHIR.Reference).reference, '/'))) ) else null return MedicationRequest { id: Rx.id, status: Rx.status, intent: Rx.intent, category: Rx.category, medication: if Rx.medication is Reference then Med.code else Rx.medication as CodeableConcept, subject: Rx.subject, authoredOn: Rx.authoredOn, recorder: Rx.recorder, dosageInstruction: Rx.dosageInstruction, dispenseRequest: Rx.dispenseRequest }
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 26
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 31
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: FHIRHelpers
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: ToString
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function ToString(value string): value.value
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 27
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 32
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: FHIRHelpers
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: ToConcept
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function ToConcept(concept FHIR.CodeableConcept): if concept is null then null else System.Concept { codes: concept.coding C return ToCode(C), display: concept.text.value }
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 28
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 33
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: FHIRHelpers
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: ToCode
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function ToCode(coding FHIR.Coding): if coding is null then null else System.Code { code: coding.code.value, system: coding.system.value, version: coding.version.value, display: coding.display.value }
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 29
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 34
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSRoutines
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Is Acute Pain Prescription?
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // End of For Subacute or Chronic Pain Routine /* ** Routine #5 ** For Acute Pain Routine ** ** Definition | Answer to Proceed | Details | Data (Terminology) Requirement ** ----------------------------------------------------------------------------------------------------------------------------------- ** Order for opioid analgesics | Yes | Look for an existing prescription (order) for | Opioid analgesics with ** with ambulatory misuse | | opioid analgesics with ambulatory abuse | ambulatory misuse potential ** potential of duration < 28 | | potential of duration < 28 days | ** days | | | ** ----------------------------------------------------------------------------------------------------------------------------------- ** */ // should allow DateTime precision, but not working in the Ruler specifically define function "Is Acute Pain Prescription?"(prescription FHIR.MedicationRequest): prescription.dispenseRequest is not null and prescription.dispenseRequest.expectedSupplyDuration is not null and Common.GetDurationInDays( prescription.dispenseRequest.expectedSupplyDuration ) < 28 days
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 30
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 35
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSCommon
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: GetDurationInDays
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function GetDurationInDays(value FHIR.Duration): if value is null then null else case when value.code.value ~ 'a' then System.Quantity{ value: value.value.value * 365.0, unit: 'days' } when value.code.value ~ 'mo' then System.Quantity{ value: value.value.value * 30.0, unit: 'days' } when value.code.value ~ 'wk' then System.Quantity{ value: value.value.value * 7.0, unit: 'days' } when value.code.value ~ 'd' then System.Quantity{ value: value.value.value, unit: 'days' } when value.code.value ~ 'h' then System.Quantity{ value: value.value.value / 24.0, unit: 'days' } when value.code.value ~ 'min' then System.Quantity{ value: value.value.value / 60.0 / 24.0, unit: 'days' } when value.code.value ~ 's' then System.Quantity{ value: value.value.value / 60.0 / 60.0 / 24.0, unit: 'days' } when value.code.value ~ 'ms' then System.Quantity{ value: value.value.value / 60.0 / 60.0 / 24.0 / 1000.0, unit: 'days' } when value.code.value is null then Message(1000, true, 'Undefined', 'Error', 'Duration unit code is null') else Message(1000, true, 'Undefined', 'Error', 'Unsupported duration unit code: ' + value.code.value) end
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 31
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 36
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSRoutines
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Acute Pain Prescription Greater Than 7 Days?
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // should allow DateTime precision, but not working in the Ruler specifically define function "Acute Pain Prescription Greater Than 7 Days?"(prescription FHIR.MedicationRequest): prescription.dispenseRequest is not null and prescription.dispenseRequest.expectedSupplyDuration is not null and Common.GetDurationInDays( prescription.dispenseRequest.expectedSupplyDuration ) > 7 days and Common.GetDurationInDays( prescription.dispenseRequest.expectedSupplyDuration ) < 28 days
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 32
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 37
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: FHIRHelpers
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: ToDateTime
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function ToDateTime(value dateTime): value.value
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 33
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 38
element.id:
  value: effective-data-requirements
extension.url:
  value: http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements
extension.value canonical:
  value: #effective-data-requirements

index: 39
extension.url:
  value: http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-softwaresystem
extension.value reference:
  link: http://fhir.org/guides/cdc/opioid-cds/Device/cqf-tooling
  reference.reference:
    value: Device/cqf-tooling

index: 0
identifier.use:
  value: official
identifier.value:
  value: cdc-opioid-guidance

index: 1
identifier.system:
  value: urn:ietf:rfc:3986
identifier.value:
  value: urn:oid:2.16.840.1.114222.34.5

value: 2022.1.0

value: PlanDefinition_Recommendation_06_Order_Sign

value: Recommendation #6 - Prescribe Lowest Effective Dose and Duration

codeable concept.coding:
  index: 0
  coding.system:
    value: http://terminology.hl7.org/CodeSystem/plan-definition-type
  coding.code:
    value: eca-rule
  coding.display:
    value: ECA Rule

value: active

value: false

value: 2025-08-06

value: CDC / Security Risk Solutions, Inc. (SRS)

index: 0
contact detail.telecom:
  index: 0
  contact point.system:
    value: url
  contact point.value:
    value: https://www.securityrisksolutions.com

value: When opioids are needed for acute pain, clinicians should prescribe no greater quantity than needed for the expected duration of pain severe enough to require opioids.

index: 0
usage context.code:
  coding.system:
    value: http://terminology.hl7.org/CodeSystem/usage-context-type
  coding.code:
    value: focus
  coding.display:
    value: Clinical Focus
usage context.value codeable concept:
  codeable concept.coding: http://snomed.info/id/182888003
    index: 0
    coding.system:
      value: http://snomed.info/sct
    coding.code:
      value: 182888003
    coding.display:
      value: Medication requested (situation)

index: 1
usage context.code:
  coding.system:
    value: http://terminology.hl7.org/CodeSystem/usage-context-type
  coding.code:
    value: focus
  coding.display:
    value: Clinical Focus
usage context.value codeable concept:
  codeable concept.coding: http://snomed.info/id/274663001
    index: 0
    coding.system:
      value: http://snomed.info/sct
    coding.code:
      value: 274663001
    coding.display:
      value: Acute pain (finding)

value: The 2022 CDC Clinical Practice Guideline for Prescribing Opioids for Pain is intended to improve communication between clinicians and patients about the benefits and risks of pain treatments, including opioid therapy; improve the effectiveness and safety of pain treatment; mitigate pain; improve function and quality of life for patients with pain; and reduce risks associated with opioid pain therapy, including opioid use disorder, overdose, and death. The recommendations do not apply to pain related to sickle cell disease or cancer or to patients receiving palliative or end-of-life care.

value: When the diagnosis and severity of acute pain warrant use of opioids, clinicians should prescribe no greater quantity than needed for the expected duration of pain severe enough to require opioids. For many common causes of nontraumatic, nonsurgical pain, when opioids are needed, a few days or less are often sufficient, and shorter courses can minimize the need to taper opioids to prevent withdrawal symptoms at the end of a course of opioids. However, durations should be individualized to the patient's clinical circumstances.

value: © CDC 2016+.

index: 0
codeable concept.text:
  value: Opioid Prescribing

index: 0
contact detail.name:
  value: Kensaku Kawamoto, MD, PhD, MHS

index: 1
contact detail.name:
  value: Bryn Rhodes

index: 2
contact detail.name:
  value: Floyd Eisenberg, MD, MPH

index: 3
contact detail.name:
  value: Robert McClure, MD, MPH

index: 0
related artifact.type:
  value: documentation
related artifact.display:
  value: 2022 CDC Clinical Practice Guideline for Prescribing Opioids for Pain
related artifact.url:
  value: https://www.cdc.gov/mmwr/volumes/71/rr/rr7103a1.htm
related artifact.document:
  attachment.url:
    value: https://www.cdc.gov/mmwr/volumes/71/rr/rr7103a1.htm

value: http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSREC06
index: 0
link: http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSREC06

index: 0
element.extension:
  index: 0
  extension.url:
    value: http://hl7.org/fhir/StructureDefinition/cqf-strengthOfRecommendation
  extension.value codeable concept:
    codeable concept.coding:
      index: 0
      coding.system:
        value: http://terminology.hl7.org/CodeSystem/recommendation-strength
      coding.code:
        value: strong
      coding.display:
        value: Strong
element.extension:
  index: 1
  extension.url:
    value: http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence
  extension.value codeable concept:
    codeable concept.coding:
      index: 0
      coding.system:
        value: http://terminology.hl7.org/CodeSystem/evidence-quality
      coding.code:
        value: very-low
      coding.display:
        value: Very low quality
plan definition.action.title:
  value: When Treating Acute Pain, Prescribe No More Opioids Than Needed
plan definition.action.description:
  value: Please verify that the opioid order quantity and duration are no more than needed for the expected duration of pain severe enough to require opioids. For guidance regarding prescribing opioids for acute pain, see [Recommendation 6 of the 2022 CDC Clinical Practice Guideline](https://www.cdc.gov/mmwr/volumes/71/rr/rr7103a1.htm#Recommendation6).
plan definition.action.priority:
  value: urgent
plan definition.action.trigger:
  index: 0
  trigger definition.type:
    value: named-event
  trigger definition.name:
    value: order-sign
plan definition.action.condition:
  index: 0
  plan definition.action.condition.kind:
    value: applicability
  plan definition.action.condition.expression:
    expression.description:
      value: Check whether the current order is for an opioid with ambulatory misuse potential for acute pain with an intended duration of more than 7 days and if the 2022 CDC guideline general inclusion criteria is met
    expression.language:
      value: text/cql.identifier
    expression.expression:
      value: Is Recommendation Applicable?
plan definition.action.grouping behavior:
  value: visual-group
plan definition.action.selection behavior:
  value: any
plan definition.action.action:
  index: 0
  plan definition.action.description:
    value: Document - Will adjust opioid order
plan definition.action.action:
  index: 1
  plan definition.action.description:
    value: Snooze* - Benefits of opioid therapy duration outweigh risks, snooze 3 months
plan definition.action.action:
  index: 2
  plan definition.action.description:
    value: Snooze* - N/A see comment, snooze 3 months