opioidcds-10-patient-view
type: PlanDefinition
node role: treeRoot
resource.id:
  value: opioidcds-10-patient-view
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-10-patient-view Url: Recommendation #10 - Urine Drug Testing (patient-view) Version: 2022.1.0 Identifier: value: cdc-opioid-guidance Identifier: value: urn:oid:2.16.840.1.114222.34.11 Name: PlanDefinition_Recommendation_10_Patient_View Title: Recommendation #10 - Urine Drug Testing (patient-view) 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 prescribing opioids for subacute or chronic pain, clinicians should consider the benefits and risks of toxicology testing to assess for prescribed medications as well as other prescribed and nonprescribed controlled substances. Logic Definitions: Library Name Name sequence OpioidCDSCommonConfig Can the implementing EHR support queries for past medications by date range? 0 // Subroutine 2 - Past Medications define "Can the implementing EHR support queries for past medications by date range?": true Library Name Name sequence OpioidCDSCommon Active Ambulatory Opioid Rx 1 define "Active Ambulatory Opioid Rx": if Config."Can the implementing EHR support queries for past medications by date range?" then ( "Get MedicationRequest Medication as Code"("Get Active Ambulatory Medication Requests"([MedicationRequest])) ) Rx where date from Rx.authoredOn 2 years or less on or before Today() and Rx.medication in "Opioid analgesics with ambulatory misuse potential" else List<FHIR.MedicationRequest>{} Library Name Name sequence OpioidCDSREC10PatientView Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions 2 define "Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions": Common."Active Ambulatory Opioid Rx" AmbulatoryOpioidPrescription where Routines."Is Subacute or Chronic Pain Prescription?"(AmbulatoryOpioidPrescription) Library Name Name sequence OpioidCDSREC10PatientView Patient Is Being Prescribed Opio…
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 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: 2
    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: 3
    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: 4
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Library Rec10Common
    related artifact.resource:
      value: http://fhir.org/guides/cdc/opioid-cds/Library/OpioidCDSREC10Common|2022.1.0
      link: 2022.1
      link: .0
  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 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: 7
    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: 8
    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: 9
    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: 10
    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: 11
    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: 12
    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: 13
    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: 14
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Value set All Drug Urine Screening
    related artifact.resource:
      value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/all-urine-drug-screening-tests
      link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/all-urine-drug-screening-tests
  library.related artifact:
    index: 15
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Value set Limited life expectancy conditions
    related artifact.resource:
      value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/limited-life-expectancy-conditions
      link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/limited-life-expectancy-conditions
  library.related artifact:
    index: 16
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Value set Hospice Finding Codes
    related artifact.resource:
      value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/hospice-finding
      link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/hospice-finding
  library.related artifact:
    index: 17
    related artifact.type:
      value: depends-on
    related artifact.display:
      value: Value set Hospice Disposition
    related artifact.resource:
      value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/hospice-disposition
      link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/hospice-disposition
  library.related artifact:
    index: 18
    related artifact.type:
      value: depends-on

value: Value set Amphetamine Urine Tests

index: 19
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set Amphetamine Medications
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/amphetamines-class-medications
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/amphetamines-class-medications

index: 20
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set Barbiturate Urine Tests
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/barbiturate-urine-drug-screening-tests
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/barbiturate-urine-drug-screening-tests

index: 21
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set Barbiturate Medications
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/barbiturate-medications
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/barbiturate-medications

index: 22
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set Benzodiazepine Urine Tests
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/benzodiazepine-urine-drug-screening-tests
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/benzodiazepine-urine-drug-screening-tests

index: 23
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set Benzodiazepine medications
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/benzodiazepine-medications
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/benzodiazepine-medications

index: 24
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set Buprenorphine Urine Tests
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/buprenorphine-urine-drug-screening-tests
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/buprenorphine-urine-drug-screening-tests

index: 25
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set Buprenorphine Medications
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/buprenorphine-medications
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/buprenorphine-medications

index: 26
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set Cannabinoid Urine Tests
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/cannabinoid-urine-drug-screening-tests
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/cannabinoid-urine-drug-screening-tests

index: 27
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set Cocaine Urine Tests
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/cocaine-urine-drug-screening-tests
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/cocaine-urine-drug-screening-tests

index: 28
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set Fentanyl Urine Tests
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/fentanyl-type-urine-drug-screening-tests
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/fentanyl-type-urine-drug-screening-tests

index: 29
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set Fentanyl Medications
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/fentanyl-type-medications
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/fentanyl-type-medications

index: 30
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set Heroin Urine Tests
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/heroin-urine-drug-screening-tests
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/heroin-urine-drug-screening-tests

index: 31
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set Methadone Urine Tests
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/methadone-urine-drug-screening-tests
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/methadone-urine-drug-screening-tests

index: 32
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set Methadone Medications
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/methadone-medications
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/methadone-medications

index: 33
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set General Opiate Urine Tests
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/general-opiate-urine-drug-screening-tests
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/general-opiate-urine-drug-screening-tests

index: 34
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set Opiate Medications
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/non-synthetic-opioid-medications
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/non-synthetic-opioid-medications

index: 35
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set Oxycodone Urine Tests
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/oxycodone-urine-drug-screening-tests
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/oxycodone-urine-drug-screening-tests

index: 36
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set Oxycodone Medications
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/oxycodone-medications
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/oxycodone-medications

index: 37
related artifact.type:
  value: depends-on
related artifact.display:
  value: Value set PCP Urine Tests
related artifact.resource:
  value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/phencyclidine-urine-drug-screening-tests
  link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/phencyclidine-urine-drug-screening-tests

index: 0
parameter definition.name:
  value: Is Perform Drug Screen Recommendation Applicable?
parameter definition.use:
  value: out
parameter definition.min:
  value: 0
parameter definition.max:
  value: 1
parameter definition.type:
  value: boolean

index: 1
parameter definition.name:
  value: Applicable Because of Unexpected Results
parameter definition.use:
  value: out
parameter definition.min:
  value: 0
parameter definition.max:
  value: 1
parameter definition.type:
  value: boolean

index: 2
parameter definition.name:
  value: Detail
parameter definition.use:
  value: out
parameter definition.min:
  value: 0
parameter definition.max:
  value: 1
parameter definition.type:
  value: string

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

index: 1
data requirement.type:
  value: MedicationRequest
data requirement.profile:
  value: http://hl7.org/fhir/StructureDefinition/MedicationRequest
  index: 0
  link: http://hl7.org/fhir/StructureDefinition/MedicationRequest
data requirement.must support:
  value: authoredOn
  index: 0
data requirement.must support:
  value: medication
  index: 1
data requirement.must support:
  value: medication.reference
  index: 2
data requirement.must support:
  value: id
  index: 3
data requirement.must support:
  value: status
  index: 4
data requirement.must support:
  value: intent
  index: 5
data requirement.must support:
  value: category
  index: 6
data requirement.must support:
  value: subject
  index: 7
data requirement.must support:
  value: recorder
  index: 8
data requirement.must support:
  value: dosageInstruction
  index: 9
data requirement.must support:
  value: dispenseRequest
  index: 10
data requirement.must support:
  value: status.value
  index: 11
data requirement.must support:
  value: timing
  index: 12
data requirement.must support:
  value: timing.event
  index: 13
data requirement.must support:
  value: timing.repeat
  index: 14
data requirement.must support:
  value: timing.repeat.bounds
  index: 15
data requirement.must support:
  value: medication.text
  index: 16
data requirement.must support:
  value: medication.coding
  index: 17

index: 2
data requirement.type:
  value: MedicationRequest
data requirement.profile:
  value: http://hl7.org/fhir/StructureDefinition/MedicationRequest
  index: 0
  link: http://hl7.org/fhir/StructureDefinition/MedicationRequest
data requirement.must support:
  value: category
  index: 0
data requirement.must support:
  value: status
  index: 1
data requirement.must support:
  value: intent
  index: 2
data requirement.must support:
  value: medication
  index: 3
data requirement.must support:
  value: medication.reference
  index: 4
data requirement.must support:
  value: id
  index: 5
data requirement.must support:
  value: subject
  index: 6
data requirement.must support:
  value: authoredOn
  index: 7
data requirement.must support:
  value: recorder
  index: 8
data requirement.must support:
  value: dosageInstruction
  index: 9
data requirement.must support:
  value: dispenseRequest
  index: 10
data requirement.must support:
  value: status.value
  index: 11
data requirement.must support:
  value: timing
  index: 12
data requirement.must support:
  value: timing.event
  index: 13
data requirement.must support:
  value: timing.repeat
  index: 14
data requirement.must support:
  value: timing.repeat.bounds
  index: 15
data requirement.must support:
  value: medication.text
  index: 16
data requirement.must support:
  value: medication.coding
  index: 17
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/medicationrequest-category-community
    link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/medicationrequest-category-community

index: 3
data requirement.type:
  value: Patient
data requirement.profile:
  value: http://hl7.org/fhir/StructureDefinition/Patient
  index: 0
  link: http://hl7.org/fhir/StructureDefinition/Patient

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.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: 5
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: 6
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: 7
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
data requirement.must support:
  value: hospitalization
  index: 3
data requirement.must support:
  value: hospitalization.dischargeDisposition
  index: 4
data requirement.must support:
  value: hospitalization.dischargeDisposition.coding
  index: 5
data requirement.must support:
  value: status
  index: 6
data requirement.must support:
  value: status.value
  index: 7

index: 8
data requirement.type:
  value: Observation
data requirement.profile:
  value: http://hl7.org/fhir/StructureDefinition/Observation
  index: 0
  link: http://hl7.org/fhir/StructureDefinition/Observation
data requirement.must support:
  value: code
  index: 0
data requirement.must support:
  value: status
  index: 1
data requirement.must support:
  value: status.value
  index: 2
data requirement.must support:
  value: effective
  index: 3
data requirement.must support:
  value: code.coding
  index: 4
data requirement.must support:
  value: value
  index: 5
data requirement.code filter:
  index: 0
  data requirement.code filter.path:
    value: code
  data requirement.code filter.value set:
    value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/hospice-finding
    link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/hospice-finding

index: 9
data requirement.type:
  value: Observation
data requirement.profile:
  value: http://hl7.org/fhir/StructureDefinition/Observation
  index: 0
  link: http://hl7.org/fhir/StructureDefinition/Observation
data requirement.must support:
  value: code
  index: 0
data requirement.must support:
  value: effective
  index: 1
data requirement.must support:
  value: status
  index: 2
data requirement.must support:
  value: code.coding
  index: 3
data requirement.must support:
  value: value
  index: 4
data requirement.code filter:
  index: 0
  data requirement.code filter.path:
    value: code
  data requirement.code filter.value set:
    value: http://fhir.org/guides/cdc/opioid-cds/ValueSet/all-urine-drug-screening-tests
    link: http://fhir.org/guides/cdc/opioid-cds/ValueSet/all-urine-drug-screening-tests

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: OpioidCDSCommonConfig
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Can the implementing EHR support queries for past medications by date range?
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Subroutine 2 - Past Medications define "Can the implementing EHR support queries for past medications by date range?": true
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: OpioidCDSCommon
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Active Ambulatory Opioid Rx
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Active Ambulatory Opioid Rx": if Config."Can the implementing EHR support queries for past medications by date range?" then ( "Get MedicationRequest Medication as Code"("Get Active Ambulatory Medication Requests"([MedicationRequest])) ) Rx where date from Rx.authoredOn 2 years or less on or before Today() and Rx.medication in "Opioid analgesics with ambulatory misuse potential" else List<FHIR.MedicationRequest>{}
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: OpioidCDSREC10PatientView
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions": Common."Active Ambulatory Opioid Rx" AmbulatoryOpioidPrescription where Routines."Is Subacute or Chronic Pain Prescription?"(AmbulatoryOpioidPrescription)
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: OpioidCDSREC10PatientView
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential": exists ("Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions")
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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: OpioidCDSCommonConfig
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Use Alternative UDS Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Use Alternative UDS Lookback Period": 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: OpioidCDSCommonConfig
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Alternative UDS Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Alternative UDS Lookback Period": Interval[Today() - 6 months - 1 days, Today()]
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: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: All Opioid or Non-opioid UDS in Alternative Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "All Opioid or Non-opioid UDS in Alternative Lookback Period": ( [Observation: Common."All Drug Urine Screening"] Lab where date from Lab.effective in day of Config."Alternative UDS Lookback Period" and not ( Lab.status in { 'unknown', 'entered-in-error', 'cancelled' } ) ) X sort by date from effective desc
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: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: UDS Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Constants define "UDS Lookback Period": Interval[Today() - 12 months - 1 days, Today()]
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: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: All Opioid or Non-opioid UDS in Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "All Opioid or Non-opioid UDS in Lookback Period": ( [Observation: Common."All Drug Urine Screening"] Lab where date from Lab.effective in day of "UDS Lookback Period" and not ( Lab.status in { 'unknown', 'entered-in-error', 'cancelled' } ) ) X sort by date from effective desc
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: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Inclusion Criteria For UDS Recommendation
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: /* @description: Determines whether the general inclusion criteria is met for the patient and whether they had a UDS performed in the past year */ define "Inclusion Criteria For UDS Recommendation": Routines."CDC 2022 Guideline General Inclusion Criteria" and not exists ( if Config."Use Alternative UDS Lookback Period" then "All Opioid or Non-opioid UDS in Alternative Lookback Period" else "All Opioid or Non-opioid UDS in Lookback Period" )
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: OpioidCDSCommon
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Conditions Indicating End of Life or With Limited Life Expectancy
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Conditions Indicating End of Life or With Limited Life Expectancy": ( "US Core-Categorized Conditions" C where C.code in "Conditions likely terminal for opioid prescribing" and C.clinicalStatus in "Active Condition" ) union ( "US Core-Categorized Conditions" C where C.code in "Limited life expectancy conditions" and C.clinicalStatus in "Active Condition" )
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: OpioidCDSCommonConfig
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Hospice Findings Exclusion Enabled
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // OpioidCDSCommon define "Hospice Findings Exclusion Enabled": false
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: Admitted/Referred/Discharged to Hospice Care
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Admitted/Referred/Discharged to Hospice Care": ( if (Config."Hospice Findings Exclusion Enabled") then [Observation: code in "Hospice Finding Codes"] O where not (O.status.value in { 'unknown', 'entered-in-error', 'cancelled' }) else {} ) union ( [Encounter] E where date from E.period.start 1 year or less on or before Today() and ( if E.hospitalization.dischargeDisposition.coding is null or not exists (E.hospitalization.dischargeDisposition.coding) then false else E.hospitalization.dischargeDisposition in "Hospice Disposition" ) and E.status.value in { 'planned', 'arrived', 'in-progress', 'finished', 'onleave' } )
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: OpioidCDSCommon
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: End of Life Assessment
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "End of Life Assessment": // 1. Conditions indicating end of life or with limited life expectancy exists ( "Conditions Indicating End of Life or With Limited Life Expectancy" ) // 2. Admitted/referred/discharged to hospice care or exists ( "Admitted/Referred/Discharged to Hospice Care" )
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: OpioidCDSREC10Common
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": Common."End of Life Assessment"
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.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10PatientView
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Is Perform Drug Screen Recommendation Applicable?
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Is Perform Drug Screen Recommendation Applicable?": "Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential" and Rec10Common."Inclusion Criteria For UDS Recommendation" and not Rec10Common."Exclusion Criteria"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 34
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 39
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Amphetamine Simple Identifier
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Amphetamine Simple Identifier": 'Amphetamine'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 35
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 40
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Amphetamine Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Amphetamines define "Amphetamine Screenings In Lookback Period": "All Opioid or Non-opioid UDS in Lookback Period" Lab where Lab.code in Common."Amphetamine Urine Tests"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 36
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 41
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Positive Amphetamine Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Positive Amphetamine Screenings In Lookback Period": GetPositiveLabsInLookbackPeriod("Amphetamine Screenings In Lookback Period", true)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 37
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 42
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Negative Amphetamine Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Negative Amphetamine Screenings In Lookback Period": GetNegativeLabsInLookbackPeriod("Amphetamine Screenings In Lookback Period", true)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 38
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 43
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Rx Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Rx Lookback Period": Interval[Today() - 12 months - 31 days, Today()]
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 39
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 44
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Normalize Rx In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Normalize Rx In Lookback Period": Common."Get MedicationRequest Medication as Code"( [MedicationRequest: category in Common."Community"] Rx where Rx.status in { 'active', 'completed', 'stopped' } and Rx.intent = 'order' and Common."GetDateFromMedicationRequest"(Rx) in day of "Rx Lookback Period" )
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 40
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 45
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Amphetamine Rx In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Amphetamine Rx In Lookback Period": "Normalize Rx In Lookback Period" Rx where Rx.medication in Common."Amphetamine Medications"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 41
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 46
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Barbiturate Simple Identifier
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Barbiturate Simple Identifier": 'Barbiturate'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 42
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 47
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Barbiturate Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Barbiturates define "Barbiturate Screenings In Lookback Period": "All Opioid or Non-opioid UDS in Lookback Period" Lab where Lab.code in Common."Barbiturate Urine Tests"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 43
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 48
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Positive Barbiturate Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Positive Barbiturate Screenings In Lookback Period": GetPositiveLabsInLookbackPeriod("Barbiturate Screenings In Lookback Period", true)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 44
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 49
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Negative Barbiturate Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Negative Barbiturate Screenings In Lookback Period": GetNegativeLabsInLookbackPeriod("Barbiturate Screenings In Lookback Period", true)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 45
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 50
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Barbiturate Rx In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Barbiturate Rx In Lookback Period": "Normalize Rx In Lookback Period" Rx where Rx.medication in Common."Barbiturate Medications"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 46
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 51
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Benzodiazepine Simple Identifier
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Benzodiazepine Simple Identifier": 'Benzodiazepine'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 47
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 52
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Benzodiazepine Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Benzodiazepines define "Benzodiazepine Screenings In Lookback Period": "All Opioid or Non-opioid UDS in Lookback Period" Lab where Lab.code in Common."Benzodiazepine Urine Tests"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 48
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 53
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Positive Benzodiazepine Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Positive Benzodiazepine Screenings In Lookback Period": GetPositiveLabsInLookbackPeriod("Benzodiazepine Screenings In Lookback Period", true)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 49
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 54
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Negative Benzodiazepine Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Negative Benzodiazepine Screenings In Lookback Period": GetNegativeLabsInLookbackPeriod("Benzodiazepine Screenings In Lookback Period", true)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 50
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 55
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Benzodiazepine Rx In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Benzodiazepine Rx In Lookback Period": "Normalize Rx In Lookback Period" Rx where Rx.medication in Common."Benzodiazepine medications"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 51
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 56
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Buprenorphine Simple Identifier
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Buprenorphine Simple Identifier": 'Buprenorphine'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 52
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 57
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Buprenorphine Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Buprenorphine define "Buprenorphine Screenings In Lookback Period": "All Opioid or Non-opioid UDS in Lookback Period" Lab where Lab.code in Common."Buprenorphine Urine Tests"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 53
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 58
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Positive Buprenorphine Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Positive Buprenorphine Screenings In Lookback Period": GetPositiveLabsInLookbackPeriod("Buprenorphine Screenings In Lookback Period", true)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 54
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 59
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Negative Buprenorphine Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Negative Buprenorphine Screenings In Lookback Period": GetNegativeLabsInLookbackPeriod("Buprenorphine Screenings In Lookback Period", true)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 55
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 60
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Buprenorphine Rx In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Buprenorphine Rx In Lookback Period": "Normalize Rx In Lookback Period" Rx where Rx.medication in Common."Buprenorphine Medications"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 56
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 61
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Cannabinoid Simple Identifier
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Cannabinoid Simple Identifier": 'Cannabinoid'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 57
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 62
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: Cannabinoid Urine Screening Check Enabled
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Cannabinoid Urine Screening Check Enabled": false
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 58
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 63
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Cannabinoid Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Cannabinoids define "Cannabinoid Screenings In Lookback Period": if Config."Cannabinoid Urine Screening Check Enabled" then ( "All Opioid or Non-opioid UDS in Lookback Period" Lab where Lab.code in Common."Cannabinoid Urine Tests" ) else null
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 59
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 64
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Positive Cannabinoid Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Positive Cannabinoid Screenings In Lookback Period": GetPositiveLabsInLookbackPeriod("Cannabinoid Screenings In Lookback Period", Config."Cannabinoid Urine Screening Check Enabled")
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 60
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 65
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Negative Cannabinoid Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Negative Cannabinoid Screenings In Lookback Period": GetNegativeLabsInLookbackPeriod("Cannabinoid Screenings In Lookback Period", Config."Cannabinoid Urine Screening Check Enabled")
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 61
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 66
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Cocaine Simple Identifier
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Cocaine Simple Identifier": 'Cocaine'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 62
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 67
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Cocaine Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Cocaine define "Cocaine Screenings In Lookback Period": "All Opioid or Non-opioid UDS in Lookback Period" Lab where Lab.code in Common."Cocaine Urine Tests"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 63
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 68
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Positive Cocaine Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Positive Cocaine Screenings In Lookback Period": GetPositiveLabsInLookbackPeriod("Cocaine Screenings In Lookback Period", true)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 64
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 69
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Negative Cocaine Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Negative Cocaine Screenings In Lookback Period": GetNegativeLabsInLookbackPeriod("Cocaine Screenings In Lookback Period", true)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 65
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 70
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Fentanyl Simple Identifier
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Fentanyl Simple Identifier": 'Fentanyl'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 66
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 71
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: Opiate Urine Screening Check Enabled
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Recommendation 10 define "Opiate Urine Screening Check Enabled": true
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 67
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 72
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Fentanyl Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Fentanyl define "Fentanyl Screenings In Lookback Period": if Config."Opiate Urine Screening Check Enabled" then ( "All Opioid or Non-opioid UDS in Lookback Period" AllLabs where AllLabs.code in Common."Fentanyl Urine Tests" ) else null
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 68
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 73
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Positive Fentanyl Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Positive Fentanyl Screenings In Lookback Period": GetPositiveLabsInLookbackPeriod("Fentanyl Screenings In Lookback Period", Config."Opiate Urine Screening Check Enabled")
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 69
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 74
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Negative Fentanyl Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Negative Fentanyl Screenings In Lookback Period": GetNegativeLabsInLookbackPeriod("Fentanyl Screenings In Lookback Period", Config."Opiate Urine Screening Check Enabled")
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 70
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 75
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Fentanyl Rx In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Fentanyl Rx In Lookback Period": "Normalize Rx In Lookback Period" Rx where Rx.medication in Common."Fentanyl Medications"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 71
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 76
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Heroin Simple Identifier
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Heroin Simple Identifier": 'Heroin (6-AM)'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 72
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 77
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Heroin Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Heroin define "Heroin Screenings In Lookback Period": "All Opioid or Non-opioid UDS in Lookback Period" Lab where Lab.code in Common."Heroin Urine Tests"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 73
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 78
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Positive Heroin Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Positive Heroin Screenings In Lookback Period": GetPositiveLabsInLookbackPeriod("Heroin Screenings In Lookback Period", true)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 74
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 79
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Negative Heroin Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Negative Heroin Screenings In Lookback Period": GetNegativeLabsInLookbackPeriod("Heroin Screenings In Lookback Period", true)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 75
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 80
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Methadone Simple Identifier
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Methadone Simple Identifier": 'Methadone'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 76
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 81
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Methadone Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Methadone define "Methadone Screenings In Lookback Period": "All Opioid or Non-opioid UDS in Lookback Period" Lab where Lab.code in Common."Methadone Urine Tests"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 77
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 82
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Positive Methadone Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Positive Methadone Screenings In Lookback Period": GetPositiveLabsInLookbackPeriod("Methadone Screenings In Lookback Period", true)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 78
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 83
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Negative Methadone Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Negative Methadone Screenings In Lookback Period": GetNegativeLabsInLookbackPeriod("Methadone Screenings In Lookback Period", true)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 79
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 84
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Methadone Rx In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Methadone Rx In Lookback Period": "Normalize Rx In Lookback Period" Rx where Rx.medication in Common."Methadone Medications"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 80
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 85
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Opiate Simple Identifier
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Opiate Simple Identifier": 'Opiate'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 81
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 86
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Opiate Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Opiates define "Opiate Screenings In Lookback Period": if Config."Opiate Urine Screening Check Enabled" then ( "All Opioid or Non-opioid UDS in Lookback Period" Lab where Lab.code in Common."General Opiate Urine Tests" ) else null
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 82
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 87
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Positive Opiate Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Positive Opiate Screenings In Lookback Period": GetPositiveLabsInLookbackPeriod("Opiate Screenings In Lookback Period", Config."Opiate Urine Screening Check Enabled")
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 83
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 88
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Negative Opiate Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Negative Opiate Screenings In Lookback Period": GetNegativeLabsInLookbackPeriod("Opiate Screenings In Lookback Period", Config."Opiate Urine Screening Check Enabled")
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 84
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 89
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Opiate Rx In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Opiate Rx In Lookback Period": "Normalize Rx In Lookback Period" Rx where Rx.medication in Common."Opiate Medications"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 85
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 90
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Oxycodone Simple Identifier
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Oxycodone Simple Identifier": 'Oxycodone'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 86
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 91
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Oxycodone Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Oxycodone define "Oxycodone Screenings In Lookback Period": if Config."Opiate Urine Screening Check Enabled" then ( "All Opioid or Non-opioid UDS in Lookback Period" Lab where Lab.code in Common."Oxycodone Urine Tests" ) else null
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 87
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 92
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Positive Oxycodone Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Positive Oxycodone Screenings In Lookback Period": GetPositiveLabsInLookbackPeriod("Oxycodone Screenings In Lookback Period", Config."Opiate Urine Screening Check Enabled")
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 88
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 93
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Negative Oxycodone Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Negative Oxycodone Screenings In Lookback Period": GetNegativeLabsInLookbackPeriod("Oxycodone Screenings In Lookback Period", Config."Opiate Urine Screening Check Enabled")
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 89
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 94
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Oxycodone Rx In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Oxycodone Rx In Lookback Period": "Normalize Rx In Lookback Period" Rx where Rx.medication in Common."Oxycodone Medications"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 90
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 95
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: PCP Simple Identifier
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "PCP Simple Identifier": 'Phencyclidine (PCP)'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 91
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 96
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: PCP Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // PCP define "PCP Screenings In Lookback Period": "All Opioid or Non-opioid UDS in Lookback Period" AllLabs where AllLabs.code in Common."PCP Urine Tests"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 92
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 97
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Positive PCP Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Positive PCP Screenings In Lookback Period": GetPositiveLabsInLookbackPeriod("PCP Screenings In Lookback Period", true)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 93
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 98
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Negative PCP Screenings In Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Negative PCP Screenings In Lookback Period": GetNegativeLabsInLookbackPeriod("PCP Screenings In Lookback Period", true)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 94
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 99
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Unexpected Details
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Details Logic define "Unexpected Details": { CreateDetailWithPossibleUnexpectedNegative( "Amphetamine Simple Identifier", "Positive Amphetamine Screenings In Lookback Period", "Negative Amphetamine Screenings In Lookback Period", "Amphetamine Rx In Lookback Period" ), CreateDetailWithPossibleUnexpectedNegative( "Barbiturate Simple Identifier", "Positive Barbiturate Screenings In Lookback Period", "Negative Barbiturate Screenings In Lookback Period", "Barbiturate Rx In Lookback Period" ), CreateDetailWithPossibleUnexpectedNegative( "Benzodiazepine Simple Identifier", "Positive Benzodiazepine Screenings In Lookback Period", "Negative Benzodiazepine Screenings In Lookback Period", "Benzodiazepine Rx In Lookback Period" ), CreateDetailWithPossibleUnexpectedNegative( "Buprenorphine Simple Identifier", "Positive Buprenorphine Screenings In Lookback Period", "Negative Buprenorphine Screenings In Lookback Period", "Buprenorphine Rx In Lookback Period" ), CreateDetailWithoutPossibleUnexpectedNegative( "Cannabinoid Simple Identifier", "Positive Cannabinoid Screenings In Lookback Period", "Negative Cannabinoid Screenings In Lookback Period" ), CreateDetailWithoutPossibleUnexpectedNegative( "Cocaine Simple Identifier", "Positive Cocaine Screenings In Lookback Period", "Negative Cocaine Screenings In Lookback Period" ), CreateDetailWithPossibleUnexpectedNegative( "Fentanyl Simple Identifier", "Positive Fentanyl Screenings In Lookback Period", "Negative Fentanyl Screenings In Lookback Period", "Fentanyl Rx In Lookback Period" ), CreateDetailWithoutPossibleUnexpectedNegative( "Heroin Simple Identifier", "Positive Heroin Screenings In Lookback Period", "Negative Heroin Screenings In Lookback Period" ), CreateDetailWithPossibleUnexpectedNegative( "Methadone Simple Identifier", "Positive Methadone Screenings In Lookback Period", "Negative Methadone Screenings In Lookback Period", "Methadone Rx In Lookback Period" ), CreateDetailWithPossibleUnexpectedNegative( "Opiate Simple Identi…
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 95
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 100
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Remove Substances Without Positive or Negative Results
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Remove Substances Without Positive or Negative Results": "Unexpected Details" Details where (Details.posDates is not null and Length(Details.posDates) != 0) or (Details.negDates is not null and Length(Details.negDates) != 0)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 96
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 101
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Inclusion Criteria For Unexpected Results
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Inclusion Criteria For Unexpected Results": Routines."CDC 2022 Guideline General Inclusion Criteria" and AnyTrue( "Remove Substances Without Positive or Negative Results" Details return (exists Details.unexpectedPosDetails) or (exists Details.unexpectedNegDetails) )
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 97
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 102
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10PatientView
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Applicable Because of Unexpected Results
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Applicable Because of Unexpected Results": "Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential" and Rec10Common."Inclusion Criteria For Unexpected Results" and not Rec10Common."Exclusion Criteria"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 98
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 103
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: Style Header
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Style Header": ' \r\n .alert-body {\r\n width: 670px;\r\n font-family: segoe-ui, sans-serif;\r\n background-color: #FEFFF1;\r\n }\r\n\r\n .details-table {\r\n border-collapse:collapse;\r\n border-style: ridge;\r\n background-color: #FEFFF1;\r\n padding: 2px;\r\n }\r\n\r\n .details-caption {\r\n border-style: ridge;\r\n border-bottom: none;\r\n background-color: #FEFFF1;\r\n padding: 2px;\r\n }\r\n\r\n .details-table-header {\r\n border-style: ridge;\r\n padding: 5px;\r\n }\r\n\r\n .details-table-cell {\r\n border-style: ridge;\r\n padding: 5px;\r\n }\r\n\r\n .details-table-footer-cell {\r\n border-style: ridge;\r\n padding: 5px;\r\n font-size: small;\r\n }\r\n\r\n .details-table-cell-unexpected {\r\n border-style: ridge;\r\n padding: 5px;\r\n color: red;\r\n font-weight: bold;\r\n }\r\n\r\n .more-text {\r\n position: relative;\r\n margin-bottom: 2em;\r\n }\r\n \r\n .more {\r\n display:none;\r\n }\r\n\r\n .show-more:checked + .more {\r\n display:block;\r\n }\r\n<\/style>'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 99
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 104
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Unexpected Div Start
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Unexpected Div Start": ' Patient may have unexpected urine toxicology test results<\/strong> in the past year.<\/p><\/div>'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 100
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 105
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Table Start
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Table Start": ' Urine Toxicology Results<\/caption> Substance<\/th>'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 101
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 106
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: All Lab Dates in Lookback Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Helpers define "All Lab Dates in Lookback Period": ( "All Opioid or Non-opioid UDS in Lookback Period" Lab return date from Lab.effective ) X sort desc
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 102
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 107
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Table Headers
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Table Headers": "All Lab Dates in Lookback Period" LabDate return ' ' & ToString(LabDate) & '<\/th>'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 103
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 108
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Generate Table Rows
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Generate Table Rows": "Remove Substances Without Positive or Negative Results" BOT let row: ToString(IndexOf("Remove Substances Without Positive or Negative Results", BOT) + 1) return ' ' + GetExpectedColumn(BOT.ingredient) + Combine( "All Lab Dates in Lookback Period" LabDate let col: ToString(IndexOf("All Lab Dates in Lookback Period", LabDate) + 2) return all ( if BOT.unexpectedPosDetails.date contains LabDate then GetUnexpectedColumn('pos', row & ':' & col) else if BOT.unexpectedNegDetails.udsDate contains LabDate then GetUnexpectedColumn('neg', row & ':' & col) else if BOT.posDates contains LabDate then GetExpectedColumn('pos*') else if BOT.negDates contains LabDate then GetExpectedColumn('neg*') else GetExpectedColumn('n/a') ) ) + '<\/tr>'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 104
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 109
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Generate Footer Rows
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Generate Footer Rows": "Remove Substances Without Positive or Negative Results" BOT let row: ToString(IndexOf("Remove Substances Without Positive or Negative Results", BOT) + 1), colspan: Length("All Lab Dates in Lookback Period") + 1 return Combine( "All Lab Dates in Lookback Period" LabDate let col: ToString(IndexOf("All Lab Dates in Lookback Period", LabDate) + 2) return all ( if BOT.unexpectedPosDetails.date contains LabDate then Coalesce( BOT.unexpectedPosDetails PosDetail where PosDetail.date same day as LabDate return ' ' & GetFooterColumn(colspan, row & ':' & col & ' - Possible unexpected substance found: ' & PosDetail.udsDetail) & '<\/tr>' ) else if BOT.unexpectedNegDetails.udsDate contains LabDate then Coalesce( BOT.unexpectedNegDetails NegDetail where NegDetail.udsDate same day as LabDate return ' ' & GetFooterColumn(colspan, row + ':' & col & ' - Possible unexpected negative result found: prescribed ' & NegDetail.rxDetail & ' on ' & ToString(NegDetail.rxDate)) & '<\/tr>' ) else '' ) )
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 105
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 110
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Table End
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Table End": '<\/table><\/div>'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 106
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 111
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Details Table
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Details Table": "Table Start" & Combine("Table Headers") & ' ' & Combine("Generate Table Rows") & ' ' & ' ' & Combine("Generate Footer Rows") & '<\/tfoot>' & "Table End"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 107
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 112
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Expected Result Footnote
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Expected Result Footnote": ' * - These are expected results based on an analysis of the patient\'s medication list 30 days prior to the corresponding lab results.<\/div>'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 108
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 113
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Details More Info
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Details More Info": ' \r\n Note on false positives and unexpected negative results...<\/p>\r\n Show more\r\n \r\n An unexpectedly negative test may be due to time since last dose, diversion, intermittent use, aberrant drug use behavior, or other factors, including a false negative result. Clinicians should interpret this result in the context of the overall treatment plan.<\/p>\r\n\r\n Positive results may be a false positives or could represent occasional use or possible substance use disorder.<br\/><br\/>For a review regarding interpreting possible false positive urine toxicology results, see http:\/\/pubmed.ncbi.nlm.nih.gov\/24986836<\/a>. It is unknown if the findings reported in this article can be extrapolated to other laboratory analyzers that were not used in the referenced studies.<br\/><br\/>For guidance regarding evaluating and addressing unexpected toxicology tests results, see Recommendation 10 of the 22 CDC Clinical Practice Guideiline<\/a>.<\/p><\/div>\r\n<\/div>'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 109
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 114
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Div End
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Div End": '<\/div>'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 110
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 115
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Get HTML Details
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // HTML Generation define "Get HTML Details": Common."Style Header" & "Unexpected Div Start" & "Details Table" & "Expected Result Footnote" & "Details More Info" & "Div End"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 111
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 116
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10PatientView
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: Detail
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define "Detail": Rec10Common."Get HTML Details"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 112
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 117
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: 113
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 118
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: 114
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 119
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 Active Ambulatory Medication Requests
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function "Get Active Ambulatory Medication Requests" (value List<MedicationRequest>) returns List<MedicationRequest>: value Rx where Rx.status.value = 'active' and Rx.category in "Community"
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 115
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 120
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: 116
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 121
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: 117
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 122
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: 118
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 123
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 Subacute or Chronic Pain Prescription?
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // End of Active Cancer Treatment Routine /* ** Routine #4 ** For Subacute or Chronic Pain Routine ** ** Definition | Answer to Proceed | Details | Data (Terminology) Requirement ** ----------------------------------------------------------------------------------------------------------------------------------- ** Order for opioid analgesic | Yes | Order for opioid analgesics with ambulatory | Opioid analgesics with ** with expected supply | | misuse potential with a supply duration of >= | ambulatory misuse potential ** duration >= 28 days | | 28 days | ** | | | ** | | - Subacute definition = order for opioid | ** | | analgesics with ambulatory misuse | ** | | potential with a supply duration of one to | ** | | two months. | ** | | - Chronic pain definition = order for opioid | ** | | analgesics with ambulatory misuse | ** | | potential with a supply duration of >= two | ** | | months. | ** ----------------------------------------------------------------------------------------------------------------------------------- ** */ define function "Is Subacute or Chronic Pain Prescription?"(prescription FHIR.MedicationRequest): "Is Subacute or Chronic Pain Using Expected Supply Duration"(prescription) or "Is Subacute or Chronic Pain Using Validity Period"(prescription)
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 119
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 124
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 Subacute or Chronic Pain Using Expected Supply Duration
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function "Is Subacute or Chronic Pain Using Expected Supply Duration"(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: 120
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 125
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: 121
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 126
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 Subacute or Chronic Pain Using Validity Period
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function "Is Subacute or Chronic Pain Using Validity Period"(prescription FHIR.MedicationRequest): ( prescription.dispenseRequest is not null and prescription.dispenseRequest.validityPeriod is not null and ( days between prescription.dispenseRequest.validityPeriod.start and prescription.dispenseRequest.validityPeriod.end >= 28 ) )
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 122
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 127
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 instant): value.value
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 123
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 128
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 ObservationStatus): value.value
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 124
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 129
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: CreateDetailWithPossibleUnexpectedNegative
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function CreateDetailWithPossibleUnexpectedNegative(TheSubstance String, ThePosLabs List<Observation>, TheNegLabs List<Observation>, TheMeds List<MedicationRequest>): { ingredient: TheSubstance, posDates: ( ThePosLabs PosLab return date from PosLab.effective ), negDates: ( TheNegLabs NegLab return date from NegLab.effective ), unexpectedPosDetails: ( ThePosLabs PosLab where not exists ( TheMeds Rx where Common.GetDateFromMedicationRequest(Rx) in day of Interval[ date from PosLab.effective - 31 days, date from PosLab.effective - 1 days ] ) return { date: date from PosLab.effective, udsDetail: if exists(PosLab.code.coding) then PosLab.code.coding[0].display else 'Unable to determine a detailed identifier' } ), unexpectedNegDetails: ( from TheNegLabs NegLab, ( if exists(TheMeds) then TheMeds else { null as MedicationRequest } ) Rx let medDate: Common.GetDateFromMedicationRequest(Rx) where medDate in day of Interval[date from NegLab.effective - 31 days, date from NegLab.effective - 1 days] return { udsDate: date from NegLab.effective, udsDetail: if exists (NegLab.code.coding) then NegLab.code.coding[0].display else 'Unable to determine a detailed identifier', rxDate: medDate, rxDetail: if Rx.medication.text is not null then Rx.medication.text else if exists (Rx.medication.coding) and Rx.medication.coding[0].display is not null then Rx.medication.coding[0].display else 'Unable to determine a detailed identifier' } ) }
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 125
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 130
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: GetDateFromMedicationRequest
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function "GetDateFromMedicationRequest"(med FHIR.MedicationRequest): if med is null then null else if med.authoredOn is not null then date from med.authoredOn else Max( med.dosageInstruction DI return Coalesce( // If there are timing events, take the latest. Max(DI.timing.event E return date from E), // Otherwise, if there's a Period, use its start. if DI.timing.repeat is not null and DI.timing.repeat.bounds is FHIR.Period then date from start of FHIRHelpers.ToInterval(DI.timing.repeat.bounds as FHIR.Period) else null ) )
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 126
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 131
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: ToInterval
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function ToInterval(period FHIR.Period): if period is null then null else if period."start" is null then Interval(period."start".value, period."end".value] else Interval[period."start".value, period."end".value]
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 127
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 132
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: GetPositiveLabsInLookbackPeriod
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function GetPositiveLabsInLookbackPeriod(Labs List<FHIR.Observation>, Enabled Boolean): if Enabled then Labs Lab where StartsWith(Lower(Lab.value as FHIR.string), 'pos') else {}
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 128
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 133
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: GetNegativeLabsInLookbackPeriod
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function GetNegativeLabsInLookbackPeriod(Labs List<FHIR.Observation>, Enabled Boolean): if Enabled then Labs Lab where StartsWith(Lower(Lab.value as FHIR.string), 'neg') else {}
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 129
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 134
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 MedicationRequestStatus): value.value
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 130
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 135
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 MedicationRequestIntent): value.value
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 131
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 136
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: CreateDetailWithoutPossibleUnexpectedNegative
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function CreateDetailWithoutPossibleUnexpectedNegative(TheSubstance String, ThePosLabs List<Observation>, TheNegLabs List<Observation>): { ingredient: TheSubstance, posDates: ( ThePosLabs PosLab return date from PosLab.effective ), negDates: ( TheNegLabs NegLab return date from NegLab.effective ), unexpectedPosDetails: ( ThePosLabs PosLab return { date: date from PosLab.effective, udsDetail: if exists (PosLab.code.coding) then PosLab.code.coding[0].display else 'Unable to determine a detailed identifier' } ), unexpectedNegDetails: { null as Tuple{ udsDate System.Date, udsDetail System.String, rxDate System.Date, rxDetail System.String } } }
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 132
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 137
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: GetExpectedColumn
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function GetExpectedColumn(Content String): ' ' & Content & '<\/td>'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 133
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 138
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: GetUnexpectedColumn
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: // Functions define function GetUnexpectedColumn(Result String, Superscript String): ' ' & Result & '' & Superscript & '<\/sup><\/td>'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 134
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 139
element.extension:
  index: 0
  extension.url:
    value: libraryName
  extension.value string:
    value: OpioidCDSREC10Common
element.extension:
  index: 1
  extension.url:
    value: name
  extension.value string:
    value: GetFooterColumn
element.extension:
  index: 2
  extension.url:
    value: statement
  extension.value string:
    value: define function GetFooterColumn(colspan Integer, message String): ' ' & message & '<\/td>'
element.extension:
  index: 3
  extension.url:
    value: displaySequence
  extension.value integer:
    value: 135
extension.url:
  value: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition

index: 140
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: 141
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.11

value: 2022.1.0

value: PlanDefinition_Recommendation_10_Patient_View

value: Recommendation #10 - Urine Drug Testing (patient-view)

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 prescribing opioids for subacute or chronic pain, clinicians should consider the benefits and risks of toxicology testing to assess for prescribed medications as well as other prescribed and nonprescribed controlled substances.

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/82423001
    index: 0
    coding.system:
      value: http://snomed.info/sct
    coding.code:
      value: 82423001
    coding.display:
      value: Chronic pain (finding)

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.text:
    value: Subacute pain

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: Before starting opioids and periodically (at least annually) during opioid therapy, clinicians should consider the benefits and risks of toxicology testing to assess for prescribed opioids and other prescription and nonprescription controlled substances that increase risk for overdose when combined with opioids, including nonprescribed and illicit opioids and benzodiazepines.

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/pdfs/rr7103a1-H.pdf
related artifact.document:
  attachment.content type:
    value: application/pdf
  attachment.language:
    value: en-US
  attachment.url:
    value: https://www.cdc.gov/mmwr/volumes/71/rr/pdfs/rr7103a1-H.pdf

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

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: weak
      coding.display:
        value: Weak
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.prefix:
  value: 1.
plan definition.action.title:
  value: Consider the Benefits and Risks of Conducting a Urine Toxicology Screen
plan definition.action.description:
  value: Consider the benefits and risks of toxicology testing to assess for prescribed medications as well as other prescribed and nonprescribed controlled substances. For guidance regarding utilizing toxicology tests when prescribing opioids, see [Recommendation 10 of the 2022 CDC Clinical Practice Guideline](https://www.cdc.gov/mmwr/volumes/71/rr/rr7103a1.htm#:~:text=evidence%20type%3A%204).-,Implementation%20Considerations,-Toxicology%20testing%20should).
plan definition.action.priority:
  value: urgent
plan definition.action.trigger:
  index: 0
  trigger definition.type:
    value: named-event
  trigger definition.name:
    value: patient-view
plan definition.action.condition:
  index: 0
  plan definition.action.condition.kind:
    value: applicability
  plan definition.action.condition.expression:
    expression.description:
      value: Patient has not had a urine screening in the past 12 months
    expression.language:
      value: text/cql.identifier
    expression.expression:
      value: Is Perform Drug Screen Recommendation Applicable?
plan definition.action.type:
  codeable concept.coding:
    index: 0
    coding.system:
      value: http://terminology.hl7.org/CodeSystem/action-type
    coding.code:
      value: create
    coding.display:
      value: Create
plan definition.action.definition canonical:
  value: http://fhir.org/guides/cdc/opioid-cds/ActivityDefinition/opioidcds-urine-screening-request
  link: http://fhir.org/guides/cdc/opioid-cds/ActivityDefinition/opioidcds-urine-screening-request
plan definition.action.action:
  index: 0
  plan definition.action.description:
    value: Document - Ordered toxicology screen
plan definition.action.action:
  index: 1
  plan definition.action.description:
    value: Document - Risks outweigh benefits
plan definition.action.action:
  index: 2
  plan definition.action.description:
    value: Snooze* - N/A see comment, snooze 3 months

index: 1
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: weak
      coding.display:
        value: Weak
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.prefix:
  value: 2.
plan definition.action.title:
  value: Patient May Have Unexpected Toxicology Test Results
plan definition.action.description:
  value: Patient may have unexpected urine toxicology test results in the past year
plan definition.action.priority:
  value: urgent
plan definition.action.trigger:
  index: 0
  trigger definition.type:
    value: named-event
  trigger definition.name:
    value: patient-view
plan definition.action.condition:
  index: 0
  plan definition.action.condition.kind:
    value: applicability
  plan definition.action.condition.expression:
    expression.description:
      value: Urine screening tested positive for cocaine, opiates or PCP
    expression.language:
      value: text/cql.identifier
    expression.expression:
      value: Applicable Because of Unexpected Results
plan definition.action.dynamic value:
  index: 0
  plan definition.action.dynamic value.path:
    value: action.description
  plan definition.action.dynamic value.expression:
    expression.language:
      value: text/cql.identifier
    expression.expression:
      value: Detail
plan definition.action.action:
  index: 0
  plan definition.action.description:
    value: Document - Will repeat urine drug screen more frequently
plan definition.action.action:
  index: 1
  plan definition.action.description:
    value: Will consult with patient regarding possible unexpected test results
plan definition.action.action:
  index: 2
  plan definition.action.description:
    value: Document - Will assess patient for substance use disorder
plan definition.action.action:
  index: 3
  plan definition.action.description:
    value: Snooze* - Patient's test results were expected, snooze for 3 months
plan definition.action.action:
  index: 4
  plan definition.action.description:
    value: Snooze* - N/A snooze for 3 months