FHIR © HL7.org  |  FHIRsmith 4.0.1  |  Server Home  |  XIG Home  |  XIG Stats  | 

FHIR IG analytics

Packagehl7.fhir.uv.pddi
Resource TypePlanDefinition
IdPlanDefinition-digoxin-cyclosporine-cds-select.json
FHIR VersionR4
Sourcehttps://build.fhir.org/ig/HL7/PDDI-CDS/PlanDefinition-digoxin-cyclosporine-cds-select.html
URLhttp://hl7.org/fhir/uv/pddi/PlanDefinition/digoxin-cyclosporine-cds-select
Version1.0.0
Statusactive
Date2026-06-17T14:03:14+00:00
NameDigoxinCyclosporineOrderSelectRecommendation
TitleDigoxin Cyclosporine Order Select Recommendation
Realmuv
Authorityhl7
DescriptionDrug-drug interaction recommendation for use on order select of a digoxin or cyclosporine

Resources that use this resource

No resources found


Resources that this resource uses

No resources found


Narrative

Note: links and images are rebased to the (stated) source

Metadata
Title Digoxin Cyclosporine Order Select Recommendation
Version 1.0.0
Experimental true
Jurisdiction 001 from http://unstats.un.org/unsd/methods/m49/m49.htm
Topic Digoxin Cyclosporine Order Selection
Steward (Publisher) HL7 International / Clinical Decision Support
Description

Drug-drug interaction recommendation for use on order select of a digoxin or cyclosporine

Type ECA Rule
PlanDefinition Action
Trigger Type Named Event
Trigger Name order-select
Condition Kind: Applicability
Logic Definition: Inclusion Criteria
PlanDefinition Sub-Action
Title Potential Drug-Drug Interaction between digoxin (product) and cyclosporine (product)
Description Increased risk of digoxin toxicity. Assess risk and take action if necessary. Digoxin toxicity is potentially serious. The clinical consequences may include anorexia, nausea, vomiting, visual changes, and cardiac arrhythmias. The mechanism of this interaction appears to be mediated through P-glycoprotein inhibition by cyclosporine. P-glycoprotein is a major transporter for digoxin efflux. unknown. unknown.
Dynamic Value Path: action.title
Logic Definition: Get Base Summary
Dynamic Value Path: action.description
Logic Definition: Get Base Detail
Dynamic Value Path: activity.extension
Logic Definition: Get Base Indicator
PlanDefinition Sub-Action (Parent Action Title: Potential Drug-Drug Interaction between digoxin (product) and cyclosporine (product))
Title Consultation
Description Request communication with digoxin prescriber
Condition Kind: Applicability
Logic Definition: Is Context medication digoxin
Type create from http://terminology.hl7.org/CodeSystem/action-type
Definition ActivityDefinition AD201
PlanDefinition Sub-Action (Parent Action Title: Potential Drug-Drug Interaction between digoxin (product) and cyclosporine (product))
Title Consultation
Description Request communication with cyclosporine prescriber
Condition Kind: Applicability
Logic Definition: Is Context medication cyclosporine
Type create from http://terminology.hl7.org/CodeSystem/action-type
Definition ActivityDefinition AD202
PlanDefinition Sub-Action (Parent Action Title: Potential Drug-Drug Interaction between digoxin (product) and cyclosporine (product))
Title Cancel digoxin
Description Discontinue digoxin order
Condition Kind: Applicability
Logic Definition: Is Context medication digoxin
Type remove from http://terminology.hl7.org/CodeSystem/action-type
PlanDefinition Sub-Action (Parent Action Title: Potential Drug-Drug Interaction between digoxin (product) and cyclosporine (product))
Title Cancel cyclosporine
Description Discontinue cyclosporine order
Condition Kind: Applicability
Logic Definition: Is Context medication cyclosporine
Type remove from http://terminology.hl7.org/CodeSystem/action-type
PlanDefinition Sub-Action (Parent Action Title: Potential Drug-Drug Interaction between digoxin (product) and cyclosporine (product))
Title Digoxin Level
Description Order digoxin trough within 24 hours from initiation
Condition Kind: Applicability
Logic Definition: Is new order for digoxin
Type create from http://terminology.hl7.org/CodeSystem/action-type
Definition ActivityDefinition AD203
PlanDefinition Sub-Action
Title Patient does (not) have digoxin level within 30 days that is below 0.9 ng/mL (SI: 1.2 nmol/L)
Description (Digoxin: level and date). For patients with a reliable plasma digoxin concentration in normal range, it is reasonable to anticipate an increase in plasma concentrations after the initiation of cyclosporine. Following initiation, close monitoring and adjusting the digoxin dose as needed is recommended. Initiating cyclosporine is expected to increase digoxin levels. For patients without a reliable plasma digoxin concentration in normal range, use only if benefits outweight risks. Extreme caution and close monitoring is necessary.
Condition Kind: Applicability
Logic Definition: Is digoxin in prefetch
Dynamic Value Path: action.title
Logic Definition: Get Card 2 Summary
Dynamic Value Path: action.description
Logic Definition: Get Card 2 Detail
Dynamic Value Path: activity.extension
Logic Definition: Get Card 2 Indicator
PlanDefinition Sub-Action (Parent Action Title: Patient does (not) have digoxin level within 30 days that is below 0.9 ng/mL (SI: 1.2 nmol/L))
Title Digoxin Level
Description Order digoxin trough within 24 hours from the initiation of cyclosporine
Type create from http://terminology.hl7.org/CodeSystem/action-type
Definition ActivityDefinition AD203
PlanDefinition Sub-Action (Parent Action Title: Patient does (not) have digoxin level within 30 days that is below 0.9 ng/mL (SI: 1.2 nmol/L))
Title New Digoxin
Description Preemptively reduce digoxin dose with new order
Condition Kind: Applicability
Logic Definition: Need to reduce Digoxin dose
Type create from http://terminology.hl7.org/CodeSystem/action-type
Definition ActivityDefinition AD204
PlanDefinition Sub-Action
Title Within 100 days, the patient has had electrolyte and serum creatinine levels checked, and they are not on a potassium sparing or loop diuretic.
Description (Potassium: level and date) (Magnesium: level and date) (Calcium: level and date) (Serum creatinine: level and date) Hypokalemia, hypomagnesemia, and hypercalcemia may potentiate digoxin toxicity. 50-70% of digoxin is excreted unchanged in the urine. Changing renal function may increase serum concentrations and risk of toxicity.
Dynamic Value Path: action.title
Logic Definition: Get Card 3 Summary
Dynamic Value Path: action.description
Logic Definition: Get Card 3 Detail
Dynamic Value Path: activity.extension
Logic Definition: Get Card 3 Indicator
PlanDefinition Sub-Action (Parent Action Title: Within 100 days, the patient has had electrolyte and serum creatinine levels checked, and they are not on a potassium sparing or loop diuretic.)
Title Serum Creatinine
Description Order for serum creatinine
Type create from http://terminology.hl7.org/CodeSystem/action-type
Definition ActivityDefinition AD205
PlanDefinition Sub-Action (Parent Action Title: Within 100 days, the patient has had electrolyte and serum creatinine levels checked, and they are not on a potassium sparing or loop diuretic.)
Title Electrolyte Panel
Description Order for electrolyte panel
Type create from http://terminology.hl7.org/CodeSystem/action-type
Definition ActivityDefinition AD206
PlanDefinition Logic
Primary Library Digoxin-cyclosporine CDS Logic
Dependency Description: FHIR model information
Resource: http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1
Canonical URL: http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1
Dependency Description: Library FHIRHelpers
Resource: http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1
Canonical URL: http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1
Dependency Description: Library FHIRCommon
Resource: http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0
Canonical URL: http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0
Dependency Description: Library Common
Resource: Potential Drug-Durg Interaction (PDDI) Clinical Decision Support (CDS) Common Logic version: 1.0.0
Canonical URL: http://hl7.org/fhir/uv/pddi/Library/PDDICDSCommon|1.0.0
Dependency Description: Value set Digoxin
Resource: Digoxin Medications Value Set
Canonical URL: http://hl7.org/fhir/uv/pddi/ValueSet/valueset-digoxin
Dependency Description: Value set Cyclosporine
Resource: Cyclosporine Medications Value Set
Canonical URL: http://hl7.org/fhir/uv/pddi/ValueSet/valueset-cyclosporine
Dependency Description: Value set Digoxin LOINC
Resource: LOINC Codes for Digoxin Concentration
Canonical URL: http://hl7.org/fhir/uv/pddi/ValueSet/valueset-digoxin-LOINC
Dependency Description: Value set Aldosterone Antagonists
Resource: Aldosterone Antagonists Drug Value Set
Canonical URL: http://hl7.org/fhir/uv/pddi/ValueSet/valueset-AAS
Dependency Description: Value set Loop Diuretics
Resource: Loop Diuretic Drug Value Set
Canonical URL: http://hl7.org/fhir/uv/pddi/ValueSet/valueset-LOOPDIURETIC
Dependency Description: Value set Potassium LOINC
Resource: LOINC Codes for Serum Potassium
Canonical URL: http://hl7.org/fhir/uv/pddi/ValueSet/valueset-potassium-LOINC
Dependency Description: Value set Magnesium LOINC
Resource: LOINC Codes for Serum Potassium
Canonical URL: http://hl7.org/fhir/uv/pddi/ValueSet/valueset-magnesium-LOINC
Dependency Description: Value set Calcium LOINC
Resource: LOINC Codes for Serum Calcium
Canonical URL: http://hl7.org/fhir/uv/pddi/ValueSet/valueset-calcium-LOINC
Dependency Description: Value set Renal LOINC
Resource: LOINC Codes for Renal Function
Canonical URL: http://hl7.org/fhir/uv/pddi/ValueSet/valueset-renal-LOINC
Parameter
Name Use Card. Type Documentation
ContextPrescriptions In 0..* MedicationRequest
Get Base Indicator Out 0..1 string
Get Card 2 Summary Out 0..1 string
Inclusion Criteria Out 0..1 boolean
Get Card 3 Summary Out 0..1 string
Is Context medication cyclosporine Out 0..1 boolean
Get Card 2 Detail Out 0..1 string
Is digoxin in prefetch Out 0..1 boolean
Is new order for digoxin Out 0..1 boolean
Get Card 3 Detail Out 0..1 string
Get Card 3 Indicator Out 0..1 string
Get Base Detail Out 0..1 string
Need to reduce Digoxin dose Out 0..1 boolean
Is Context medication digoxin Out 0..1 boolean
Get Card 2 Indicator Out 0..1 string
Get Base Summary Out 0..1 string
PlanDefinition Logic Data Requirements
Data Requirement Type: Patient
Profile(s): Patient
Data Requirement Type: MedicationRequest
Profile(s): MedicationRequest
Must Support Elements: medication, authoredOn
Code Filter(s):
Path: medication
ValueSet: Digoxin Medications Value Set
Data Requirement Type: MedicationRequest
Profile(s): MedicationRequest
Must Support Elements: medication, authoredOn
Code Filter(s):
Path: medication
ValueSet: Cyclosporine Medications Value Set
Data Requirement Type: MedicationRequest
Profile(s): MedicationRequest
Must Support Elements: medication, authoredOn
Code Filter(s):
Path: medication
ValueSet: Aldosterone Antagonists Drug Value Set
Data Requirement Type: MedicationRequest
Profile(s): MedicationRequest
Must Support Elements: medication, authoredOn
Code Filter(s):
Path: medication
ValueSet: Loop Diuretic Drug Value Set
Data Requirement Type: MedicationRequest
Profile(s): MedicationRequest
Must Support Elements: medication.reference, medication, authoredOn
Data Requirement Type: Medication
Profile(s): Medication
Must Support Elements: id, code
Data Requirement Type: MedicationAdministration
Profile(s): MedicationAdministration
Must Support Elements: medication, effective
Code Filter(s):
Path: medication
ValueSet: Digoxin Medications Value Set
Data Requirement Type: MedicationAdministration
Profile(s): MedicationAdministration
Must Support Elements: medication, effective
Code Filter(s):
Path: medication
ValueSet: Cyclosporine Medications Value Set
Data Requirement Type: MedicationAdministration
Profile(s): MedicationAdministration
Must Support Elements: medication, effective
Code Filter(s):
Path: medication
ValueSet: Aldosterone Antagonists Drug Value Set
Data Requirement Type: MedicationAdministration
Profile(s): MedicationAdministration
Must Support Elements: medication, effective
Code Filter(s):
Path: medication
ValueSet: Loop Diuretic Drug Value Set
Data Requirement Type: MedicationAdministration
Profile(s): MedicationAdministration
Must Support Elements: medication.reference, effective, medication
Data Requirement Type: MedicationDispense
Profile(s): MedicationDispense
Must Support Elements: medication, whenHandedOver
Code Filter(s):
Path: medication
ValueSet: Digoxin Medications Value Set
Data Requirement Type: MedicationDispense
Profile(s): MedicationDispense
Must Support Elements: medication, whenHandedOver
Code Filter(s):
Path: medication
ValueSet: Cyclosporine Medications Value Set
Data Requirement Type: MedicationDispense
Profile(s): MedicationDispense
Must Support Elements: medication, whenHandedOver
Code Filter(s):
Path: medication
ValueSet: Aldosterone Antagonists Drug Value Set
Data Requirement Type: MedicationDispense
Profile(s): MedicationDispense
Must Support Elements: medication, whenHandedOver
Code Filter(s):
Path: medication
ValueSet: Loop Diuretic Drug Value Set
Data Requirement Type: MedicationDispense
Profile(s): MedicationDispense
Must Support Elements: medication.reference, whenHandedOver, medication
Data Requirement Type: MedicationStatement
Profile(s): MedicationStatement
Must Support Elements: medication, effective
Code Filter(s):
Path: medication
ValueSet: Digoxin Medications Value Set
Data Requirement Type: MedicationStatement
Profile(s): MedicationStatement
Must Support Elements: medication, effective
Code Filter(s):
Path: medication
ValueSet: Cyclosporine Medications Value Set
Data Requirement Type: MedicationStatement
Profile(s): MedicationStatement
Must Support Elements: medication, effective
Code Filter(s):
Path: medication
ValueSet: Aldosterone Antagonists Drug Value Set
Data Requirement Type: MedicationStatement
Profile(s): MedicationStatement
Must Support Elements: medication, effective
Code Filter(s):
Path: medication
ValueSet: Loop Diuretic Drug Value Set
Data Requirement Type: MedicationStatement
Profile(s): MedicationStatement
Must Support Elements: medication.reference, effective, medication
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: code, effective, value
Code Filter(s):
Path: code
ValueSet: LOINC Codes for Serum Potassium
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: code, effective, value
Code Filter(s):
Path: code
ValueSet: LOINC Codes for Serum Potassium
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: code, effective, value
Code Filter(s):
Path: code
ValueSet: LOINC Codes for Serum Calcium
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: code, effective, value
Code Filter(s):
Path: code
ValueSet: LOINC Codes for Digoxin Concentration
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: code, effective, value
Code Filter(s):
Path: code
ValueSet: LOINC Codes for Renal Function
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Digoxin Prescription":
  ContextPrescriptions P
    where P.medication in "Digoxin"
    return P.medication as CodeableConcept
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Is Context medication digoxin":
  exists ("Digoxin Prescription")
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Digoxin Rx":
    (
      [MedicationRequest: "Digoxin"] MR
        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
        return MR.medication as CodeableConcept
    )
    union (
      [MedicationAdministration: "Digoxin"] MA
        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MA.medication as CodeableConcept
    )
    union (
      [MedicationDispense: "Digoxin"] MD
        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
        return MD.medication as CodeableConcept
    )
    union (
      [MedicationStatement: "Digoxin"] MS
        where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MS.medication as CodeableConcept
    )
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Is digoxin in prefetch":
  exists ("Digoxin Rx")
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Is continuation order for digoxin":
  "Is Context medication digoxin"
      and "Is digoxin in prefetch"
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Cyclosporine Prescription":
  ContextPrescriptions P
    where P.medication in "Cyclosporine"
    return P.medication as CodeableConcept
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Is Context medication cyclosporine":
  exists ("Cyclosporine Prescription")
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Cyclosporine Rx":
    (
      [MedicationRequest: "Cyclosporine"] MR
        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
        return MR.medication as CodeableConcept
    )
    union (
      [MedicationAdministration: "Cyclosporine"] MA
        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MA.medication as CodeableConcept
    )
    union (
      [MedicationDispense: "Cyclosporine"] MD
        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
        return MD.medication as CodeableConcept
    )
    union (
      [MedicationStatement: "Cyclosporine"] MS
        where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MS.medication as CodeableConcept
    )
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Is cyclosporine in prefetch":
  exists ("Cyclosporine Rx")
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Is continuation order for cyclosporine":
  "Is Context medication cyclosporine"
      and "Is cyclosporine in prefetch"
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Normal Digoxin Observation":
	Last (
    [Observation: "Digoxin LOINC"] O
      where O.effective.toInterval() during Interval[Today() - 30 days, null]
        and O.value < 0.9 'ng/mL'
      sort by start of effective.toInterval()
  )
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Is there a normal digoxin level in prefetch":
  "Normal Digoxin Observation" is not null
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Aldosterone Antagonists Rx":
    (
      [MedicationRequest: "Aldosterone Antagonists"] MR
        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
        return MR.medication as CodeableConcept
    )
    union (
      [MedicationAdministration: "Aldosterone Antagonists"] MA
        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MA.medication as CodeableConcept
    )
    union (
      [MedicationDispense: "Aldosterone Antagonists"] MD
        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
        return MD.medication as CodeableConcept
    )
    union (
      [MedicationStatement: "Aldosterone Antagonists"] MS
        where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MS.medication as CodeableConcept
    )
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Loop Diuretics Rx":
    (
      [MedicationRequest: "Loop Diuretics"] MR
        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
        return MR.medication as CodeableConcept
    )
    union (
      [MedicationAdministration: "Loop Diuretics"] MA
        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MA.medication as CodeableConcept
    )
    union (
      [MedicationDispense: "Loop Diuretics"] MD
        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
        return MD.medication as CodeableConcept
    )
    union (
      [MedicationStatement: "Loop Diuretics"] MS
        where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MS.medication as CodeableConcept
    )
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Are diuretics in prefetch":
  exists ("Aldosterone Antagonists Rx")
    or exists("Loop Diuretics Rx")
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Normal Potassium Observation":
  Last (
    [Observation: "Potassium LOINC"] O
      where O.effective.toInterval() during Interval[Today() - 365 days, null]
        and O.value > 3.5 'meq/L'
        and O.value < 5.0 'meq/L'
      sort by start of effective.toInterval()
  )
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Normal Magnesium Observation":
  Last (
    [Observation: "Magnesium LOINC"] O
      where O.effective.toInterval() during Interval[Today() - 365 days, null]
        and O.value > 0.7 'mmol/L'
        and O.value < 1.1 'mmol/L'
      sort by start of effective.toInterval()
  )
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Normal Calcium Observation":
  Last (
    [Observation: "Calcium LOINC"] O
      where O.effective.toInterval() during Interval[Today() - 365 days, null]
        and O.value > 8.5 'mg/dL'
        and O.value < 10.2 'mg/dL'
      sort by start of effective.toInterval()
  )
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Is there a normal electrolyte observation in prefetch":
  "Normal Potassium Observation" is not null
  and "Normal Magnesium Observation" is not null
  and "Normal Calcium Observation" is not null
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Normal Renal Observation":
  Last (
    [Observation: "Renal LOINC"] O
      where O.effective.toInterval() during Interval[Today() - 365 days, null]
        and O.value > 0.6 'mg/dL'
        and O.value < 1.2 'mg/dL'
      sort by start of effective.toInterval()
  )
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Is there a normal renal observation in prefetch":
  "Normal Renal Observation" is not null
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Is there a normal electrolyte and renal observation in prefetch":
  "Is there a normal electrolyte observation in prefetch"
    and "Is there a normal renal observation in prefetch"
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Are diuretics or abnormal electrolyte or abnormal renal observations in prefetch":
  "Are diuretics in prefetch"
    or not "Is there a normal electrolyte and renal observation in prefetch"
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Get Base Indicator":
  if "Is continuation order for digoxin"
    or "Is continuation order for cyclosporine"
    then if "Is there a normal digoxin level in prefetch"
        then if "Are diuretics or abnormal electrolyte or abnormal renal observations in prefetch"
            then 'warning'
          else 'info'
      else 'warning'
  else 'warning'
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Get Card 2 Summary":
  if "Is there a normal digoxin level in prefetch"
    then 'Patient has digoxin level within 30 days that is below 0.9 ng/mL (SI: 1.2 nmol/L)'
  else 'Patient does not have digoxin level on record within the last 30 days. '
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
/*
**
** Digoxin Cyclosporine CDS Recommendation
**
*/

define "Inclusion Criteria":
  (
    "Is Context medication cyclosporine"
      and "Is digoxin in prefetch"
  )
  or (
    "Is Context medication digoxin"
      and "Is cyclosporine in prefetch"
  )
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Get Card 3 Summary":
  if "Is there a normal electrolyte and renal observation in prefetch"
    then 'Within 100 days, the patient has had electrolyte and serum creatinine levels checked, and they are not on a potassium sparing or loop diuretic.'
  else 'Within 100 days, the patient has not had an electrolyte panel. The patient does have serum creatinine level and is not on a potassium sparing or loop diuretic.'
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Get Card 2 Detail":
  if "Is there a normal digoxin level in prefetch"
    then '(Digoxin: '
    + Common.GetLevelAndDate("Normal Digoxin Observation")
    + '). \nFor patients with a reliable plasma digoxin concentration in normal range, it is reasonable to anticipate an increase in plasma concentrations after the initiation of cyclosporine. Following initiation, close monitoring and adjusting the digoxin dose as needed is recommended'
  else 'Initiating cyclosporine is expected to increase digoxin levels. For patients without a reliable plasma digoxin concentration in normal range, use only if benefits outweight risks. Extreme caution and close monitoring is necessary.'
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Is new order for digoxin":
  "Is Context medication digoxin"
      and not "Is digoxin in prefetch"
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Get Card 3 Detail":
  if "Is there a normal electrolyte and renal observation in prefetch"
    then '(Potassium: '
    + Common.GetLevelAndDate("Normal Potassium Observation")
    + ')\n (Magnesium: '
    + Common.GetLevelAndDate("Normal Magnesium Observation")
    + ')\n (Calcium: '
    + Common.GetLevelAndDate("Normal Calcium Observation")
    + ')\n'
  else ''
  + '(Serum creatinine: '
  + Common.GetLevelAndDate("Normal Renal Observation")
  + ')\n Hypokalemia, hypomagnesemia, and hypercalcemia may potentiate digoxin toxicity. 50-70% of digoxin is excreted unchanged in the urine. Changing renal function may increase serum concentrations and risk of toxicity.'
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
// Card 3
define "Get Card 3 Indicator":
  if "Is there a normal electrolyte and renal observation in prefetch"
    then 'info'
  else 'warning'
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Get Base Detail":
  'Increased risk of digoxin toxicity. Assess risk and take action if necessary. \nDigoxin toxicity is potentially serious. The clinical consequences may include anorexia, nausea, vomiting, visual changes, and cardiac arrhythmias. \nThe mechanism of this interaction appears to be mediated through P-glycoprotein inhibition by cyclosporine. P-glycoprotein is a major transporter for digoxin efflux. \nunknown. \nunknown.'
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Need to reduce Digoxin dose":
  "Is Context medication cyclosporine"
    or not "Is there a normal digoxin level in prefetch"
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
define "Is new order for cyclosporine":
  "Is Context medication cyclosporine"
      and not "Is cyclosporine in prefetch"
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
// Card 2
define "Get Card 2 Indicator":
  if "Is new order for cyclosporine"
    then if "Is there a normal digoxin level in prefetch"
      then 'warning'
    else 'critical'
  else if "Is there a normal digoxin level in prefetch"
      then 'info'
    else 'warning'
Logic Definition Library Name: DigoxinCyclosporineCDSLogic
// Card 1: Base
define "Get Base Summary":
  'Potential Drug-Drug Interaction between digoxin ('
    + (
      if "Is Context medication digoxin"
        then Common.GetDrugNames("Digoxin Prescription")
      else Common.GetDrugNames("Digoxin Rx")
    )
    + ') and cyclosporine ('
    + (
      if "Is Context medication cyclosporine"
        then Common.GetDrugNames("Cyclosporine Prescription")
      else Common.GetDrugNames("Cyclosporine Rx")
    )
    + ')'
Logic Definition Library Name: FHIRCommon
/*
@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
@comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range types
to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible
representations for timing-valued elements in FHIR, allowing this function to be used across any resource.

The input can be provided as a dateTime, Period, Timing, instant, string, Age, or Range.
The intent of this function is to provide a clear and concise mechanism to treat single
elements that have multiple possible representations as intervals so that logic doesn't have to account
for the variability. More complex calculations (such as medication request period or dispense period
calculation) need specific guidance and consideration. That guidance may make use of this function, but
the focus of this function is on single element calculations where the semantics are unambiguous.
If the input is a dateTime, the result a DateTime Interval beginning and ending on that dateTime.
If the input is a Period, the result is a DateTime Interval.
If the input is a Timing, an error is raised indicating a single interval cannot be computed from a Timing.
If the input is an instant, the result is a DateTime Interval beginning and ending on that instant.
If the input is a string, an error is raised indicating a single interval cannot be computed from a string.
If the input is an Age, the result is a DateTime Interval beginning when the patient was the given Age,
and ending immediately prior to when the patient was the given Age plus one year.
If the input is a Range, the result is a DateTime Interval beginning when the patient was the Age given
by the low end of the Range, and ending immediately prior to when the patient was the Age given by the
high end of the Range plus one year.

NOTE: Due to the
complexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used
with a Timing or String.
*/
define fluent function toInterval(choice Choice<FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range>):
  case
    when choice is FHIR.dateTime then
      Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]
    when choice is FHIR.Period then
      FHIRHelpers.ToInterval(choice as FHIR.Period)
    when choice is FHIR.instant then
      Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]
    when choice is FHIR.Age then
      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),
        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)
    when choice is FHIR.Range then
      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),
        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)
    when choice is FHIR.Timing then
      Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported')
    when choice is FHIR.string then
      Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')
    else
      null as Interval<DateTime>
  end
Logic Definition Library Name: FHIRHelpers
/*
@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.
*/
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
        }
Logic Definition Library Name: FHIRHelpers
/*
@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.
*/
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
        }
Logic Definition Library Name: FHIRHelpers
define function ToString(value string): value.value
Logic Definition Library Name: FHIRHelpers
define function ToDateTime(value dateTime): value.value
Logic Definition Library Name: FHIRHelpers
/*
@description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)
value to a CQL DateTime Interval
@comment: If the start value of the given period is unspecified, the starting
boundary of the resulting interval will be open (meaning the start of the interval
is unknown, as opposed to interpreted as the beginning of time).
*/
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]
Logic Definition Library Name: FHIRHelpers
define function ToDateTime(value instant): value.value
Logic Definition Library Name: FHIRHelpers
define function ToDate(value date): value.value
Logic Definition Library Name: FHIRHelpers
/*
@description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity) 
value to a CQL Quantity
@comment: If the given quantity has a comparator specified, a runtime error is raised. If the given quantity
has a system other than UCUM (i.e. `http://unitsofmeasure.org`) or CQL calendar units (i.e. `http://hl7.org/fhirpath/CodeSystem/calendar-units`)
an error is raised. For UCUM to calendar units, the `ToCalendarUnit` function is used.
@seealso: ToCalendarUnit
*/
define function ToQuantity(quantity FHIR.Quantity):
    case
        when quantity is null then null
        when quantity.value is null then null
        when quantity.comparator is not null then
            Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')
        when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'
              or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then
            System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }
        else
            Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' & quantity.unit.value & ' (' & quantity.system.value & '|' & quantity.code.value & ')')
    end
Logic Definition Library Name: FHIRHelpers
/*
@description: Converts a UCUM definite duration unit to a CQL calendar duration
unit using conversions specified in the [quantities](https://cql.hl7.org/02-authorsguide.html#quantities) 
topic of the CQL specification.
@comment: Note that for durations above days (or weeks), the conversion is understood to be approximate
*/
define function ToCalendarUnit(unit System.String):
    case unit
        when 'ms' then 'millisecond'
        when 's' then 'second'
        when 'min' then 'minute'
        when 'h' then 'hour'
        when 'd' then 'day'
        when 'wk' then 'week'
        when 'mo' then 'month'
        when 'a' then 'year'
        else unit
    end
Logic Definition Library Name: PDDICDSCommon
define function GetLevelAndDate(observation Observation):
  if observation is not null
    then ToString(ToQuantity(observation.value as Quantity))
      + ' and ' 
      + ToString(observation.effective.value)
  else 'NA'
Logic Definition Library Name: PDDICDSCommon
define function ToQuantity(quantity FHIR.Quantity):
  System.Quantity { value: quantity.value.value, unit: quantity.unit.value }
Logic Definition Library Name: PDDICDSCommon
define function GetDrugNames(codes List<FHIR.CodeableConcept>):
  Combine(
    flatten(
      codes C
        return C.coding coding
          return ToCode(coding).display
    )
    ,', '
  )
Logic Definition Library Name: PDDICDSCommon
define function ToCode(coding FHIR.Coding):
  System.Code {
    code: coding.code.value,
    system: coding.system.value,
    version: coding.version.value,
    display: coding.display.value
  }
Generated using version 0.5.6-cibuild of the sample-content-ig Liquid templates

Source1

{
  "resourceType": "PlanDefinition",
  "id": "digoxin-cyclosporine-cds-select",
  "text": {
    "status": "extensions",
    "div": "<!-- snip (see above) -->"
  },
  "contained": [
    {
      "resourceType": "Library",
      "id": "effective-data-requirements",
      "extension": [
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Digoxin Prescription"
            },
            {
              "url": "statement",
              "valueString": "define \"Digoxin Prescription\":\n  ContextPrescriptions P\n    where P.medication in \"Digoxin\"\n    return P.medication as CodeableConcept"
            },
            {
              "url": "displaySequence",
              "valueInteger": 0
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Is Context medication digoxin"
            },
            {
              "url": "statement",
              "valueString": "define \"Is Context medication digoxin\":\n  exists (\"Digoxin Prescription\")"
            },
            {
              "url": "displaySequence",
              "valueInteger": 1
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Digoxin Rx"
            },
            {
              "url": "statement",
              "valueString": "define \"Digoxin Rx\":\n    (\n      [MedicationRequest: \"Digoxin\"] MR\n        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]\n        return MR.medication as CodeableConcept\n    )\n    union (\n      [MedicationAdministration: \"Digoxin\"] MA\n        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]\n        return MA.medication as CodeableConcept\n    )\n    union (\n      [MedicationDispense: \"Digoxin\"] MD\n        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]\n        return MD.medication as CodeableConcept\n    )\n    union (\n      [MedicationStatement: \"Digoxin\"] MS\n        where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]\n        return MS.medication as CodeableConcept\n    )"
            },
            {
              "url": "displaySequence",
              "valueInteger": 2
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Is digoxin in prefetch"
            },
            {
              "url": "statement",
              "valueString": "define \"Is digoxin in prefetch\":\n  exists (\"Digoxin Rx\")"
            },
            {
              "url": "displaySequence",
              "valueInteger": 3
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Is continuation order for digoxin"
            },
            {
              "url": "statement",
              "valueString": "define \"Is continuation order for digoxin\":\n  \"Is Context medication digoxin\"\n      and \"Is digoxin in prefetch\""
            },
            {
              "url": "displaySequence",
              "valueInteger": 4
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Cyclosporine Prescription"
            },
            {
              "url": "statement",
              "valueString": "define \"Cyclosporine Prescription\":\n  ContextPrescriptions P\n    where P.medication in \"Cyclosporine\"\n    return P.medication as CodeableConcept"
            },
            {
              "url": "displaySequence",
              "valueInteger": 5
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Is Context medication cyclosporine"
            },
            {
              "url": "statement",
              "valueString": "define \"Is Context medication cyclosporine\":\n  exists (\"Cyclosporine Prescription\")"
            },
            {
              "url": "displaySequence",
              "valueInteger": 6
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Cyclosporine Rx"
            },
            {
              "url": "statement",
              "valueString": "define \"Cyclosporine Rx\":\n    (\n      [MedicationRequest: \"Cyclosporine\"] MR\n        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]\n        return MR.medication as CodeableConcept\n    )\n    union (\n      [MedicationAdministration: \"Cyclosporine\"] MA\n        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]\n        return MA.medication as CodeableConcept\n    )\n    union (\n      [MedicationDispense: \"Cyclosporine\"] MD\n        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]\n        return MD.medication as CodeableConcept\n    )\n    union (\n      [MedicationStatement: \"Cyclosporine\"] MS\n        where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]\n        return MS.medication as CodeableConcept\n    )"
            },
            {
              "url": "displaySequence",
              "valueInteger": 7
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Is cyclosporine in prefetch"
            },
            {
              "url": "statement",
              "valueString": "define \"Is cyclosporine in prefetch\":\n  exists (\"Cyclosporine Rx\")"
            },
            {
              "url": "displaySequence",
              "valueInteger": 8
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Is continuation order for cyclosporine"
            },
            {
              "url": "statement",
              "valueString": "define \"Is continuation order for cyclosporine\":\n  \"Is Context medication cyclosporine\"\n      and \"Is cyclosporine in prefetch\""
            },
            {
              "url": "displaySequence",
              "valueInteger": 9
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Normal Digoxin Observation"
            },
            {
              "url": "statement",
              "valueString": "define \"Normal Digoxin Observation\":\n\tLast (\n    [Observation: \"Digoxin LOINC\"] O\n      where O.effective.toInterval() during Interval[Today() - 30 days, null]\n        and O.value < 0.9 'ng/mL'\n      sort by start of effective.toInterval()\n  )"
            },
            {
              "url": "displaySequence",
              "valueInteger": 10
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Is there a normal digoxin level in prefetch"
            },
            {
              "url": "statement",
              "valueString": "define \"Is there a normal digoxin level in prefetch\":\n  \"Normal Digoxin Observation\" is not null"
            },
            {
              "url": "displaySequence",
              "valueInteger": 11
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Aldosterone Antagonists Rx"
            },
            {
              "url": "statement",
              "valueString": "define \"Aldosterone Antagonists Rx\":\n    (\n      [MedicationRequest: \"Aldosterone Antagonists\"] MR\n        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]\n        return MR.medication as CodeableConcept\n    )\n    union (\n      [MedicationAdministration: \"Aldosterone Antagonists\"] MA\n        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]\n        return MA.medication as CodeableConcept\n    )\n    union (\n      [MedicationDispense: \"Aldosterone Antagonists\"] MD\n        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]\n        return MD.medication as CodeableConcept\n    )\n    union (\n      [MedicationStatement: \"Aldosterone Antagonists\"] MS\n        where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]\n        return MS.medication as CodeableConcept\n    )"
            },
            {
              "url": "displaySequence",
              "valueInteger": 12
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Loop Diuretics Rx"
            },
            {
              "url": "statement",
              "valueString": "define \"Loop Diuretics Rx\":\n    (\n      [MedicationRequest: \"Loop Diuretics\"] MR\n        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]\n        return MR.medication as CodeableConcept\n    )\n    union (\n      [MedicationAdministration: \"Loop Diuretics\"] MA\n        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]\n        return MA.medication as CodeableConcept\n    )\n    union (\n      [MedicationDispense: \"Loop Diuretics\"] MD\n        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]\n        return MD.medication as CodeableConcept\n    )\n    union (\n      [MedicationStatement: \"Loop Diuretics\"] MS\n        where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]\n        return MS.medication as CodeableConcept\n    )"
            },
            {
              "url": "displaySequence",
              "valueInteger": 13
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Are diuretics in prefetch"
            },
            {
              "url": "statement",
              "valueString": "define \"Are diuretics in prefetch\":\n  exists (\"Aldosterone Antagonists Rx\")\n    or exists(\"Loop Diuretics Rx\")"
            },
            {
              "url": "displaySequence",
              "valueInteger": 14
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Normal Potassium Observation"
            },
            {
              "url": "statement",
              "valueString": "define \"Normal Potassium Observation\":\n  Last (\n    [Observation: \"Potassium LOINC\"] O\n      where O.effective.toInterval() during Interval[Today() - 365 days, null]\n        and O.value > 3.5 'meq/L'\n        and O.value < 5.0 'meq/L'\n      sort by start of effective.toInterval()\n  )"
            },
            {
              "url": "displaySequence",
              "valueInteger": 15
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Normal Magnesium Observation"
            },
            {
              "url": "statement",
              "valueString": "define \"Normal Magnesium Observation\":\n  Last (\n    [Observation: \"Magnesium LOINC\"] O\n      where O.effective.toInterval() during Interval[Today() - 365 days, null]\n        and O.value > 0.7 'mmol/L'\n        and O.value < 1.1 'mmol/L'\n      sort by start of effective.toInterval()\n  )"
            },
            {
              "url": "displaySequence",
              "valueInteger": 16
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Normal Calcium Observation"
            },
            {
              "url": "statement",
              "valueString": "define \"Normal Calcium Observation\":\n  Last (\n    [Observation: \"Calcium LOINC\"] O\n      where O.effective.toInterval() during Interval[Today() - 365 days, null]\n        and O.value > 8.5 'mg/dL'\n        and O.value < 10.2 'mg/dL'\n      sort by start of effective.toInterval()\n  )"
            },
            {
              "url": "displaySequence",
              "valueInteger": 17
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Is there a normal electrolyte observation in prefetch"
            },
            {
              "url": "statement",
              "valueString": "define \"Is there a normal electrolyte observation in prefetch\":\n  \"Normal Potassium Observation\" is not null\n  and \"Normal Magnesium Observation\" is not null\n  and \"Normal Calcium Observation\" is not null"
            },
            {
              "url": "displaySequence",
              "valueInteger": 18
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Normal Renal Observation"
            },
            {
              "url": "statement",
              "valueString": "define \"Normal Renal Observation\":\n  Last (\n    [Observation: \"Renal LOINC\"] O\n      where O.effective.toInterval() during Interval[Today() - 365 days, null]\n        and O.value > 0.6 'mg/dL'\n        and O.value < 1.2 'mg/dL'\n      sort by start of effective.toInterval()\n  )"
            },
            {
              "url": "displaySequence",
              "valueInteger": 19
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Is there a normal renal observation in prefetch"
            },
            {
              "url": "statement",
              "valueString": "define \"Is there a normal renal observation in prefetch\":\n  \"Normal Renal Observation\" is not null"
            },
            {
              "url": "displaySequence",
              "valueInteger": 20
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Is there a normal electrolyte and renal observation in prefetch"
            },
            {
              "url": "statement",
              "valueString": "define \"Is there a normal electrolyte and renal observation in prefetch\":\n  \"Is there a normal electrolyte observation in prefetch\"\n    and \"Is there a normal renal observation in prefetch\""
            },
            {
              "url": "displaySequence",
              "valueInteger": 21
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Are diuretics or abnormal electrolyte or abnormal renal observations in prefetch"
            },
            {
              "url": "statement",
              "valueString": "define \"Are diuretics or abnormal electrolyte or abnormal renal observations in prefetch\":\n  \"Are diuretics in prefetch\"\n    or not \"Is there a normal electrolyte and renal observation in prefetch\""
            },
            {
              "url": "displaySequence",
              "valueInteger": 22
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Get Base Indicator"
            },
            {
              "url": "statement",
              "valueString": "define \"Get Base Indicator\":\n  if \"Is continuation order for digoxin\"\n    or \"Is continuation order for cyclosporine\"\n    then if \"Is there a normal digoxin level in prefetch\"\n        then if \"Are diuretics or abnormal electrolyte or abnormal renal observations in prefetch\"\n            then 'warning'\n          else 'info'\n      else 'warning'\n  else 'warning'"
            },
            {
              "url": "displaySequence",
              "valueInteger": 23
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Get Card 2 Summary"
            },
            {
              "url": "statement",
              "valueString": "define \"Get Card 2 Summary\":\n  if \"Is there a normal digoxin level in prefetch\"\n    then 'Patient has digoxin level within 30 days that is below 0.9 ng/mL (SI: 1.2 nmol/L)'\n  else 'Patient does not have digoxin level on record within the last 30 days. '"
            },
            {
              "url": "displaySequence",
              "valueInteger": 24
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Inclusion Criteria"
            },
            {
              "url": "statement",
              "valueString": "/*\n**\n** Digoxin Cyclosporine CDS Recommendation\n**\n*/\n\ndefine \"Inclusion Criteria\":\n  (\n    \"Is Context medication cyclosporine\"\n      and \"Is digoxin in prefetch\"\n  )\n  or (\n    \"Is Context medication digoxin\"\n      and \"Is cyclosporine in prefetch\"\n  )"
            },
            {
              "url": "displaySequence",
              "valueInteger": 25
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Get Card 3 Summary"
            },
            {
              "url": "statement",
              "valueString": "define \"Get Card 3 Summary\":\n  if \"Is there a normal electrolyte and renal observation in prefetch\"\n    then 'Within 100 days, the patient has had electrolyte and serum creatinine levels checked, and they are not on a potassium sparing or loop diuretic.'\n  else 'Within 100 days, the patient has not had an electrolyte panel. The patient does have serum creatinine level and is not on a potassium sparing or loop diuretic.'"
            },
            {
              "url": "displaySequence",
              "valueInteger": 26
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Get Card 2 Detail"
            },
            {
              "url": "statement",
              "valueString": "define \"Get Card 2 Detail\":\n  if \"Is there a normal digoxin level in prefetch\"\n    then '(Digoxin: '\n    + Common.GetLevelAndDate(\"Normal Digoxin Observation\")\n    + '). \\nFor patients with a reliable plasma digoxin concentration in normal range, it is reasonable to anticipate an increase in plasma concentrations after the initiation of cyclosporine. Following initiation, close monitoring and adjusting the digoxin dose as needed is recommended'\n  else 'Initiating cyclosporine is expected to increase digoxin levels. For patients without a reliable plasma digoxin concentration in normal range, use only if benefits outweight risks. Extreme caution and close monitoring is necessary.'"
            },
            {
              "url": "displaySequence",
              "valueInteger": 27
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Is new order for digoxin"
            },
            {
              "url": "statement",
              "valueString": "define \"Is new order for digoxin\":\n  \"Is Context medication digoxin\"\n      and not \"Is digoxin in prefetch\""
            },
            {
              "url": "displaySequence",
              "valueInteger": 28
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Get Card 3 Detail"
            },
            {
              "url": "statement",
              "valueString": "define \"Get Card 3 Detail\":\n  if \"Is there a normal electrolyte and renal observation in prefetch\"\n    then '(Potassium: '\n    + Common.GetLevelAndDate(\"Normal Potassium Observation\")\n    + ')\\n (Magnesium: '\n    + Common.GetLevelAndDate(\"Normal Magnesium Observation\")\n    + ')\\n (Calcium: '\n    + Common.GetLevelAndDate(\"Normal Calcium Observation\")\n    + ')\\n'\n  else ''\n  + '(Serum creatinine: '\n  + Common.GetLevelAndDate(\"Normal Renal Observation\")\n  + ')\\n Hypokalemia, hypomagnesemia, and hypercalcemia may potentiate digoxin toxicity. 50-70% of digoxin is excreted unchanged in the urine. Changing renal function may increase serum concentrations and risk of toxicity.'"
            },
            {
              "url": "displaySequence",
              "valueInteger": 29
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Get Card 3 Indicator"
            },
            {
              "url": "statement",
              "valueString": "// Card 3\ndefine \"Get Card 3 Indicator\":\n  if \"Is there a normal electrolyte and renal observation in prefetch\"\n    then 'info'\n  else 'warning'"
            },
            {
              "url": "displaySequence",
              "valueInteger": 30
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Get Base Detail"
            },
            {
              "url": "statement",
              "valueString": "define \"Get Base Detail\":\n  'Increased risk of digoxin toxicity. Assess risk and take action if necessary. \\nDigoxin toxicity is potentially serious. The clinical consequences may include anorexia, nausea, vomiting, visual changes, and cardiac arrhythmias. \\nThe mechanism of this interaction appears to be mediated through P-glycoprotein inhibition by cyclosporine. P-glycoprotein is a major transporter for digoxin efflux. \\nunknown. \\nunknown.'"
            },
            {
              "url": "displaySequence",
              "valueInteger": 31
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Need to reduce Digoxin dose"
            },
            {
              "url": "statement",
              "valueString": "define \"Need to reduce Digoxin dose\":\n  \"Is Context medication cyclosporine\"\n    or not \"Is there a normal digoxin level in prefetch\""
            },
            {
              "url": "displaySequence",
              "valueInteger": 32
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Is new order for cyclosporine"
            },
            {
              "url": "statement",
              "valueString": "define \"Is new order for cyclosporine\":\n  \"Is Context medication cyclosporine\"\n      and not \"Is cyclosporine in prefetch\""
            },
            {
              "url": "displaySequence",
              "valueInteger": 33
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Get Card 2 Indicator"
            },
            {
              "url": "statement",
              "valueString": "// Card 2\ndefine \"Get Card 2 Indicator\":\n  if \"Is new order for cyclosporine\"\n    then if \"Is there a normal digoxin level in prefetch\"\n      then 'warning'\n    else 'critical'\n  else if \"Is there a normal digoxin level in prefetch\"\n      then 'info'\n    else 'warning'"
            },
            {
              "url": "displaySequence",
              "valueInteger": 34
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "DigoxinCyclosporineCDSLogic"
            },
            {
              "url": "name",
              "valueString": "Get Base Summary"
            },
            {
              "url": "statement",
              "valueString": "// Card 1: Base\ndefine \"Get Base Summary\":\n  'Potential Drug-Drug Interaction between digoxin ('\n    + (\n      if \"Is Context medication digoxin\"\n        then Common.GetDrugNames(\"Digoxin Prescription\")\n      else Common.GetDrugNames(\"Digoxin Rx\")\n    )\n    + ') and cyclosporine ('\n    + (\n      if \"Is Context medication cyclosporine\"\n        then Common.GetDrugNames(\"Cyclosporine Prescription\")\n      else Common.GetDrugNames(\"Cyclosporine Rx\")\n    )\n    + ')'"
            },
            {
              "url": "displaySequence",
              "valueInteger": 35
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "FHIRHelpers"
            },
            {
              "url": "name",
              "valueString": "ToConcept"
            },
            {
              "url": "statement",
              "valueString": "/*\n@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.\n*/\ndefine function ToConcept(concept FHIR.CodeableConcept):\n    if concept is null then\n        null\n    else\n        System.Concept {\n            codes: concept.coding C return ToCode(C),\n            display: concept.text.value\n        }"
            },
            {
              "url": "displaySequence",
              "valueInteger": 36
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "FHIRHelpers"
            },
            {
              "url": "name",
              "valueString": "ToCode"
            },
            {
              "url": "statement",
              "valueString": "/*\n@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.\n*/\ndefine function ToCode(coding FHIR.Coding):\n    if coding is null then\n        null\n    else\n        System.Code {\n          code: coding.code.value,\n          system: coding.system.value,\n          version: coding.version.value,\n          display: coding.display.value\n        }"
            },
            {
              "url": "displaySequence",
              "valueInteger": 37
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "FHIRHelpers"
            },
            {
              "url": "name",
              "valueString": "ToString"
            },
            {
              "url": "statement",
              "valueString": "define function ToString(value string): value.value"
            },
            {
              "url": "displaySequence",
              "valueInteger": 38
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "FHIRCommon"
            },
            {
              "url": "name",
              "valueString": "toInterval"
            },
            {
              "url": "statement",
              "valueString": "/*\n@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval\n@comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range types\nto an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible\nrepresentations for timing-valued elements in FHIR, allowing this function to be used across any resource.\n\nThe input can be provided as a dateTime, Period, Timing, instant, string, Age, or Range.\nThe intent of this function is to provide a clear and concise mechanism to treat single\nelements that have multiple possible representations as intervals so that logic doesn't have to account\nfor the variability. More complex calculations (such as medication request period or dispense period\ncalculation) need specific guidance and consideration. That guidance may make use of this function, but\nthe focus of this function is on single element calculations where the semantics are unambiguous.\nIf the input is a dateTime, the result a DateTime Interval beginning and ending on that dateTime.\nIf the input is a Period, the result is a DateTime Interval.\nIf the input is a Timing, an error is raised indicating a single interval cannot be computed from a Timing.\nIf the input is an instant, the result is a DateTime Interval beginning and ending on that instant.\nIf the input is a string, an error is raised indicating a single interval cannot be computed from a string.\nIf the input is an Age, the result is a DateTime Interval beginning when the patient was the given Age,\nand ending immediately prior to when the patient was the given Age plus one year.\nIf the input is a Range, the result is a DateTime Interval beginning when the patient was the Age given\nby the low end of the Range, and ending immediately prior to when the patient was the Age given by the\nhigh end of the Range plus one year.\n\nNOTE: Due to the\ncomplexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used\nwith a Timing or String.\n*/\ndefine fluent function toInterval(choice Choice<FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range>):\n  case\n    when choice is FHIR.dateTime then\n      Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]\n    when choice is FHIR.Period then\n      FHIRHelpers.ToInterval(choice as FHIR.Period)\n    when choice is FHIR.instant then\n      Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]\n    when choice is FHIR.Age then\n      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),\n        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)\n    when choice is FHIR.Range then\n      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),\n        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)\n    when choice is FHIR.Timing then\n      Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported')\n    when choice is FHIR.string then\n      Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')\n    else\n      null as Interval<DateTime>\n  end"
            },
            {
              "url": "displaySequence",
              "valueInteger": 39
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "FHIRHelpers"
            },
            {
              "url": "name",
              "valueString": "ToDateTime"
            },
            {
              "url": "statement",
              "valueString": "define function ToDateTime(value dateTime): value.value"
            },
            {
              "url": "displaySequence",
              "valueInteger": 40
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "FHIRHelpers"
            },
            {
              "url": "name",
              "valueString": "ToInterval"
            },
            {
              "url": "statement",
              "valueString": "/*\n@description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)\nvalue to a CQL DateTime Interval\n@comment: If the start value of the given period is unspecified, the starting\nboundary of the resulting interval will be open (meaning the start of the interval\nis unknown, as opposed to interpreted as the beginning of time).\n*/\ndefine function ToInterval(period FHIR.Period):\n    if period is null then\n        null\n    else\n        if period.\"start\" is null then\n            Interval(period.\"start\".value, period.\"end\".value]\n        else\n            Interval[period.\"start\".value, period.\"end\".value]"
            },
            {
              "url": "displaySequence",
              "valueInteger": 41
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "FHIRHelpers"
            },
            {
              "url": "name",
              "valueString": "ToDateTime"
            },
            {
              "url": "statement",
              "valueString": "define function ToDateTime(value instant): value.value"
            },
            {
              "url": "displaySequence",
              "valueInteger": 42
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "FHIRHelpers"
            },
            {
              "url": "name",
              "valueString": "ToDate"
            },
            {
              "url": "statement",
              "valueString": "define function ToDate(value date): value.value"
            },
            {
              "url": "displaySequence",
              "valueInteger": 43
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "FHIRHelpers"
            },
            {
              "url": "name",
              "valueString": "ToQuantity"
            },
            {
              "url": "statement",
              "valueString": "/*\n@description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity) \nvalue to a CQL Quantity\n@comment: If the given quantity has a comparator specified, a runtime error is raised. If the given quantity\nhas a system other than UCUM (i.e. `http://unitsofmeasure.org`) or CQL calendar units (i.e. `http://hl7.org/fhirpath/CodeSystem/calendar-units`)\nan error is raised. For UCUM to calendar units, the `ToCalendarUnit` function is used.\n@seealso: ToCalendarUnit\n*/\ndefine function ToQuantity(quantity FHIR.Quantity):\n    case\n        when quantity is null then null\n        when quantity.value is null then null\n        when quantity.comparator is not null then\n            Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')\n        when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'\n              or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then\n            System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }\n        else\n            Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' & quantity.unit.value & ' (' & quantity.system.value & '|' & quantity.code.value & ')')\n    end"
            },
            {
              "url": "displaySequence",
              "valueInteger": 44
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "FHIRHelpers"
            },
            {
              "url": "name",
              "valueString": "ToCalendarUnit"
            },
            {
              "url": "statement",
              "valueString": "/*\n@description: Converts a UCUM definite duration unit to a CQL calendar duration\nunit using conversions specified in the [quantities](https://cql.hl7.org/02-authorsguide.html#quantities) \ntopic of the CQL specification.\n@comment: Note that for durations above days (or weeks), the conversion is understood to be approximate\n*/\ndefine function ToCalendarUnit(unit System.String):\n    case unit\n        when 'ms' then 'millisecond'\n        when 's' then 'second'\n        when 'min' then 'minute'\n        when 'h' then 'hour'\n        when 'd' then 'day'\n        when 'wk' then 'week'\n        when 'mo' then 'month'\n        when 'a' then 'year'\n        else unit\n    end"
            },
            {
              "url": "displaySequence",
              "valueInteger": 45
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "PDDICDSCommon"
            },
            {
              "url": "name",
              "valueString": "GetLevelAndDate"
            },
            {
              "url": "statement",
              "valueString": "define function GetLevelAndDate(observation Observation):\n  if observation is not null\n    then ToString(ToQuantity(observation.value as Quantity))\n      + ' and ' \n      + ToString(observation.effective.value)\n  else 'NA'"
            },
            {
              "url": "displaySequence",
              "valueInteger": 46
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "PDDICDSCommon"
            },
            {
              "url": "name",
              "valueString": "ToQuantity"
            },
            {
              "url": "statement",
              "valueString": "define function ToQuantity(quantity FHIR.Quantity):\n  System.Quantity { value: quantity.value.value, unit: quantity.unit.value }"
            },
            {
              "url": "displaySequence",
              "valueInteger": 47
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "PDDICDSCommon"
            },
            {
              "url": "name",
              "valueString": "GetDrugNames"
            },
            {
              "url": "statement",
              "valueString": "define function GetDrugNames(codes List<FHIR.CodeableConcept>):\n  Combine(\n    flatten(\n      codes C\n        return C.coding coding\n          return ToCode(coding).display\n    )\n    ,', '\n  )"
            },
            {
              "url": "displaySequence",
              "valueInteger": 48
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        },
        {
          "extension": [
            {
              "url": "libraryName",
              "valueString": "PDDICDSCommon"
            },
            {
              "url": "name",
              "valueString": "ToCode"
            },
            {
              "url": "statement",
              "valueString": "define function ToCode(coding FHIR.Coding):\n  System.Code {\n    code: coding.code.value,\n    system: coding.system.value,\n    version: coding.version.value,\n    display: coding.display.value\n  }"
            },
            {
              "url": "displaySequence",
              "valueInteger": 49
            }
          ],
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
        }
      ],
      "name": "EffectiveDataRequirements",
      "status": "active",
      "type": {
        "coding": [
          {
            "system": "http://terminology.hl7.org/CodeSystem/library-type",
            "code": "module-definition"
          }
        ]
      },
      "relatedArtifact": [
        {
          "type": "depends-on",
          "display": "FHIR model information",
          "resource": "http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1"
        },
        {
          "type": "depends-on",
          "display": "Library FHIRHelpers",
          "resource": "http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1"
        },
        {
          "type": "depends-on",
          "display": "Library FHIRCommon",
          "resource": "http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0"
        },
        {
          "type": "depends-on",
          "display": "Library Common",
          "resource": "http://hl7.org/fhir/uv/pddi/Library/PDDICDSCommon|1.0.0"
        },
        {
          "type": "depends-on",
          "display": "Value set Digoxin",
          "resource": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-digoxin"
        },
        {
          "type": "depends-on",
          "display": "Value set Cyclosporine",
          "resource": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-cyclosporine"
        },
        {
          "type": "depends-on",
          "display": "Value set Digoxin LOINC",
          "resource": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-digoxin-LOINC"
        },
        {
          "type": "depends-on",
          "display": "Value set Aldosterone Antagonists",
          "resource": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-AAS"
        },
        {
          "type": "depends-on",
          "display": "Value set Loop Diuretics",
          "resource": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-LOOPDIURETIC"
        },
        {
          "type": "depends-on",
          "display": "Value set Potassium LOINC",
          "resource": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-potassium-LOINC"
        },
        {
          "type": "depends-on",
          "display": "Value set Magnesium LOINC",
          "resource": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-magnesium-LOINC"
        },
        {
          "type": "depends-on",
          "display": "Value set Calcium LOINC",
          "resource": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-calcium-LOINC"
        },
        {
          "type": "depends-on",
          "display": "Value set Renal LOINC",
          "resource": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-renal-LOINC"
        }
      ],
      "parameter": [
        {
          "name": "ContextPrescriptions",
          "use": "in",
          "min": 0,
          "max": "*",
          "type": "MedicationRequest"
        },
        {
          "name": "Get Base Indicator",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "string"
        },
        {
          "name": "Get Card 2 Summary",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "string"
        },
        {
          "name": "Inclusion Criteria",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "boolean"
        },
        {
          "name": "Get Card 3 Summary",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "string"
        },
        {
          "name": "Is Context medication cyclosporine",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "boolean"
        },
        {
          "name": "Get Card 2 Detail",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "string"
        },
        {
          "name": "Is digoxin in prefetch",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "boolean"
        },
        {
          "name": "Is new order for digoxin",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "boolean"
        },
        {
          "name": "Get Card 3 Detail",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "string"
        },
        {
          "name": "Get Card 3 Indicator",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "string"
        },
        {
          "name": "Get Base Detail",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "string"
        },
        {
          "name": "Need to reduce Digoxin dose",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "boolean"
        },
        {
          "name": "Is Context medication digoxin",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "boolean"
        },
        {
          "name": "Get Card 2 Indicator",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "string"
        },
        {
          "name": "Get Base Summary",
          "use": "out",
          "min": 0,
          "max": "1",
          "type": "string"
        }
      ],
      "dataRequirement": [
        {
          "type": "Patient",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/Patient"
          ]
        },
        {
          "type": "MedicationRequest",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationRequest"
          ],
          "mustSupport": [
            "medication",
            "authoredOn"
          ],
          "codeFilter": [
            {
              "path": "medication",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-digoxin"
            }
          ]
        },
        {
          "type": "MedicationRequest",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationRequest"
          ],
          "mustSupport": [
            "medication",
            "authoredOn"
          ],
          "codeFilter": [
            {
              "path": "medication",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-cyclosporine"
            }
          ]
        },
        {
          "type": "MedicationRequest",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationRequest"
          ],
          "mustSupport": [
            "medication",
            "authoredOn"
          ],
          "codeFilter": [
            {
              "path": "medication",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-AAS"
            }
          ]
        },
        {
          "type": "MedicationRequest",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationRequest"
          ],
          "mustSupport": [
            "medication",
            "authoredOn"
          ],
          "codeFilter": [
            {
              "path": "medication",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-LOOPDIURETIC"
            }
          ]
        },
        {
          "type": "MedicationRequest",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationRequest"
          ],
          "mustSupport": [
            "medication.reference",
            "medication",
            "authoredOn"
          ]
        },
        {
          "type": "Medication",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/Medication"
          ],
          "mustSupport": [
            "id",
            "code"
          ]
        },
        {
          "type": "MedicationAdministration",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationAdministration"
          ],
          "mustSupport": [
            "medication",
            "effective"
          ],
          "codeFilter": [
            {
              "path": "medication",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-digoxin"
            }
          ]
        },
        {
          "type": "MedicationAdministration",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationAdministration"
          ],
          "mustSupport": [
            "medication",
            "effective"
          ],
          "codeFilter": [
            {
              "path": "medication",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-cyclosporine"
            }
          ]
        },
        {
          "type": "MedicationAdministration",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationAdministration"
          ],
          "mustSupport": [
            "medication",
            "effective"
          ],
          "codeFilter": [
            {
              "path": "medication",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-AAS"
            }
          ]
        },
        {
          "type": "MedicationAdministration",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationAdministration"
          ],
          "mustSupport": [
            "medication",
            "effective"
          ],
          "codeFilter": [
            {
              "path": "medication",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-LOOPDIURETIC"
            }
          ]
        },
        {
          "type": "MedicationAdministration",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationAdministration"
          ],
          "mustSupport": [
            "medication.reference",
            "effective",
            "medication"
          ]
        },
        {
          "type": "MedicationDispense",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationDispense"
          ],
          "mustSupport": [
            "medication",
            "whenHandedOver"
          ],
          "codeFilter": [
            {
              "path": "medication",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-digoxin"
            }
          ]
        },
        {
          "type": "MedicationDispense",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationDispense"
          ],
          "mustSupport": [
            "medication",
            "whenHandedOver"
          ],
          "codeFilter": [
            {
              "path": "medication",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-cyclosporine"
            }
          ]
        },
        {
          "type": "MedicationDispense",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationDispense"
          ],
          "mustSupport": [
            "medication",
            "whenHandedOver"
          ],
          "codeFilter": [
            {
              "path": "medication",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-AAS"
            }
          ]
        },
        {
          "type": "MedicationDispense",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationDispense"
          ],
          "mustSupport": [
            "medication",
            "whenHandedOver"
          ],
          "codeFilter": [
            {
              "path": "medication",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-LOOPDIURETIC"
            }
          ]
        },
        {
          "type": "MedicationDispense",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationDispense"
          ],
          "mustSupport": [
            "medication.reference",
            "whenHandedOver",
            "medication"
          ]
        },
        {
          "type": "MedicationStatement",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationStatement"
          ],
          "mustSupport": [
            "medication",
            "effective"
          ],
          "codeFilter": [
            {
              "path": "medication",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-digoxin"
            }
          ]
        },
        {
          "type": "MedicationStatement",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationStatement"
          ],
          "mustSupport": [
            "medication",
            "effective"
          ],
          "codeFilter": [
            {
              "path": "medication",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-cyclosporine"
            }
          ]
        },
        {
          "type": "MedicationStatement",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationStatement"
          ],
          "mustSupport": [
            "medication",
            "effective"
          ],
          "codeFilter": [
            {
              "path": "medication",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-AAS"
            }
          ]
        },
        {
          "type": "MedicationStatement",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationStatement"
          ],
          "mustSupport": [
            "medication",
            "effective"
          ],
          "codeFilter": [
            {
              "path": "medication",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-LOOPDIURETIC"
            }
          ]
        },
        {
          "type": "MedicationStatement",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/MedicationStatement"
          ],
          "mustSupport": [
            "medication.reference",
            "effective",
            "medication"
          ]
        },
        {
          "type": "Observation",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/Observation"
          ],
          "mustSupport": [
            "code",
            "effective",
            "value"
          ],
          "codeFilter": [
            {
              "path": "code",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-potassium-LOINC"
            }
          ]
        },
        {
          "type": "Observation",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/Observation"
          ],
          "mustSupport": [
            "code",
            "effective",
            "value"
          ],
          "codeFilter": [
            {
              "path": "code",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-magnesium-LOINC"
            }
          ]
        },
        {
          "type": "Observation",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/Observation"
          ],
          "mustSupport": [
            "code",
            "effective",
            "value"
          ],
          "codeFilter": [
            {
              "path": "code",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-calcium-LOINC"
            }
          ]
        },
        {
          "type": "Observation",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/Observation"
          ],
          "mustSupport": [
            "code",
            "effective",
            "value"
          ],
          "codeFilter": [
            {
              "path": "code",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-digoxin-LOINC"
            }
          ]
        },
        {
          "type": "Observation",
          "profile": [
            "http://hl7.org/fhir/StructureDefinition/Observation"
          ],
          "mustSupport": [
            "code",
            "effective",
            "value"
          ],
          "codeFilter": [
            {
              "path": "code",
              "valueSet": "http://hl7.org/fhir/uv/pddi/ValueSet/valueset-renal-LOINC"
            }
          ]
        }
      ]
    }
  ],
  "extension": [
    {
      "extension": [
        {
          "url": "code",
          "valueString": "cache-for-order-sign-filtering"
        },
        {
          "url": "type",
          "valueString": "boolean"
        },
        {
          "url": "name",
          "valueString": "Cache Info for Order Sign Filtering"
        },
        {
          "url": "description",
          "valueString": "Cache information about this CDS call so that additional filtering of card responses can be done when the service is called using an order-sign CDS Hook request. Currently, this only supports filtering out cards that were triggered by the same knowledge artifact when the physician reference display, encounter id, and patient id match between the order-select and order-sign requests. Filtering will happen if both this configuration option is set to 'true' and  order-sign requests set filter-out-repeated-alerts to 'true'."
        }
      ],
      "url": "http://hl7.org/fhir/uv/pddi/StructureDefinition/pddi-cds-configuration-options"
    },
    {
      "extension": [
        {
          "url": "code",
          "valueString": "alert-non-serious"
        },
        {
          "url": "type",
          "valueString": "boolean"
        },
        {
          "url": "name",
          "valueString": "Alert for non-serious potential drug-drug interactions"
        },
        {
          "url": "description",
          "valueString": "Serious potential drug-drug interactions could result in death; requires hospitalization or extension of hospital stay; results in persistent or significant disability or incapacity; is life-threatening (see https://www.w3.org/2019/05/pddi/index.html). If set to True, this configuration option tells the CDS service to alerts for potential drug-drug interactions that do not meet this criterion."
        }
      ],
      "url": "http://hl7.org/fhir/uv/pddi/StructureDefinition/pddi-cds-configuration-options"
    },
    {
      "extension": [
        {
          "url": "code",
          "valueString": "show-evidence-support"
        },
        {
          "url": "type",
          "valueString": "boolean"
        },
        {
          "url": "name",
          "valueString": "Show evidence support"
        },
        {
          "url": "description",
          "valueString": "If this options is set to True, CDS response cards will provide more complete information about the evidence that supports the potential drug-drug interaction alert."
        }
      ],
      "url": "http://hl7.org/fhir/uv/pddi/StructureDefinition/pddi-cds-configuration-options"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
      "valueCode": "cds"
    },
    {
      "url": "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements",
      "valueCanonical": "#effective-data-requirements"
    }
  ],
  "url": "http://hl7.org/fhir/uv/pddi/PlanDefinition/digoxin-cyclosporine-cds-select",
  "version": "1.0.0",
  "name": "DigoxinCyclosporineOrderSelectRecommendation",
  "title": "Digoxin Cyclosporine Order Select Recommendation",
  "type": {
    "coding": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/plan-definition-type",
        "code": "eca-rule",
        "display": "ECA Rule"
      }
    ]
  },
  "status": "active",
  "experimental": true,
  "date": "2026-06-17T14:03:14+00:00",
  "publisher": "HL7 International / Clinical Decision Support",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://www.hl7.org/Special/committees/dss"
        }
      ]
    }
  ],
  "description": "Drug-drug interaction recommendation for use on order select of a digoxin or cyclosporine",
  "jurisdiction": [
    {
      "coding": [
        {
          "system": "http://unstats.un.org/unsd/methods/m49/m49.htm",
          "code": "001"
        }
      ]
    }
  ],
  "topic": [
    {
      "text": "Digoxin Cyclosporine Order Selection"
    }
  ],
  "relatedArtifact": [
    {
      "type": "documentation",
      "display": "Potential Drug-Drug Interaction Clinical Decision Support",
      "url": "http://hl7.org/fhir/uv/pddi/STU1/",
      "document": {
        "url": "http://hl7.org/fhir/uv/pddi/STU1/"
      }
    }
  ],
  "library": [
    "http://hl7.org/fhir/uv/pddi/Library/DigoxinCyclosporineCDSLogic"
  ],
  "action": [
    {
      "trigger": [
        {
          "type": "named-event",
          "name": "order-select"
        }
      ],
      "condition": [
        {
          "kind": "applicability",
          "expression": {
            "language": "text/cql-identifier",
            "expression": "Inclusion Criteria"
          }
        }
      ],
      "action": [
        {
          "title": "Potential Drug-Drug Interaction between digoxin (product) and cyclosporine (product)",
          "description": "Increased risk of digoxin toxicity. Assess risk and take action if necessary. \nDigoxin toxicity is potentially serious. The clinical consequences may include anorexia, nausea, vomiting, visual changes, and cardiac arrhythmias. \nThe mechanism of this interaction appears to be mediated through P-glycoprotein inhibition by cyclosporine. P-glycoprotein is a major transporter for digoxin efflux. \nunknown. \nunknown.",
          "dynamicValue": [
            {
              "path": "action.title",
              "expression": {
                "language": "text/cql-identifier",
                "expression": "Get Base Summary"
              }
            },
            {
              "path": "action.description",
              "expression": {
                "language": "text/cql-identifier",
                "expression": "Get Base Detail"
              }
            },
            {
              "path": "activity.extension",
              "expression": {
                "language": "text/cql-identifier",
                "expression": "Get Base Indicator"
              }
            }
          ],
          "action": [
            {
              "title": "Consultation",
              "description": "Request communication with digoxin prescriber",
              "condition": [
                {
                  "kind": "applicability",
                  "expression": {
                    "language": "text/cql-identifier",
                    "expression": "Is Context medication digoxin"
                  }
                }
              ],
              "type": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/action-type",
                    "code": "create"
                  }
                ]
              },
              "definitionCanonical": "http://hl7.org/fhir/uv/pddi/ActivityDefinition/ad201"
            },
            {
              "title": "Consultation",
              "description": "Request communication with cyclosporine prescriber",
              "condition": [
                {
                  "kind": "applicability",
                  "expression": {
                    "language": "text/cql-identifier",
                    "expression": "Is Context medication cyclosporine"
                  }
                }
              ],
              "type": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/action-type",
                    "code": "create"
                  }
                ]
              },
              "definitionCanonical": "http://hl7.org/fhir/uv/pddi/ActivityDefinition/ad202"
            },
            {
              "title": "Cancel digoxin",
              "description": "Discontinue digoxin order",
              "condition": [
                {
                  "kind": "applicability",
                  "expression": {
                    "language": "text/cql-identifier",
                    "expression": "Is Context medication digoxin"
                  }
                }
              ],
              "type": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/action-type",
                    "code": "remove"
                  }
                ]
              }
            },
            {
              "title": "Cancel cyclosporine",
              "description": "Discontinue cyclosporine order",
              "condition": [
                {
                  "kind": "applicability",
                  "expression": {
                    "language": "text/cql-identifier",
                    "expression": "Is Context medication cyclosporine"
                  }
                }
              ],
              "type": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/action-type",
                    "code": "remove"
                  }
                ]
              }
            },
            {
              "title": "Digoxin Level",
              "description": "Order digoxin trough within 24 hours from initiation",
              "condition": [
                {
                  "kind": "applicability",
                  "expression": {
                    "language": "text/cql-identifier",
                    "expression": "Is new order for digoxin"
                  }
                }
              ],
              "type": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/action-type",
                    "code": "create"
                  }
                ]
              },
              "definitionCanonical": "http://hl7.org/fhir/uv/pddi/ActivityDefinition/ad203"
            }
          ]
        },
        {
          "title": "Patient does (not) have digoxin level within 30 days that is below 0.9 ng/mL (SI: 1.2 nmol/L)",
          "description": "(Digoxin: level and date). \nFor patients with a reliable plasma digoxin concentration in normal range, it is reasonable to anticipate an increase in plasma concentrations after the initiation of cyclosporine. Following initiation, close monitoring and adjusting the digoxin dose as needed is recommended. Initiating cyclosporine is expected to increase digoxin levels. For patients without a reliable plasma digoxin concentration in normal range, use only if benefits outweight risks. Extreme caution and close monitoring is necessary.",
          "documentation": [
            {
              "type": "derived-from",
              "display": "digoxin-cyclosporine PDDI knowledge artifact",
              "url": "http://hl7.org/fhir/uv/pddi/PlanDefinition/digoxin-cyclosporine-cds-select",
              "document": {
                "url": "http://hl7.org/fhir/uv/pddi/PlanDefinition/digoxin-cyclosporine-cds-select"
              }
            },
            {
              "type": "documentation",
              "citation": "Dorian et al. Clin Invest Med 1988; 11(2):108-112"
            },
            {
              "type": "documentation",
              "citation": "Dorian et al. Transplant Proc. 1987; 19(1):1825-1827"
            }
          ],
          "condition": [
            {
              "kind": "applicability",
              "expression": {
                "language": "text/cql-identifier",
                "expression": "Is digoxin in prefetch"
              }
            }
          ],
          "dynamicValue": [
            {
              "path": "action.title",
              "expression": {
                "language": "text/cql-identifier",
                "expression": "Get Card 2 Summary"
              }
            },
            {
              "path": "action.description",
              "expression": {
                "language": "text/cql-identifier",
                "expression": "Get Card 2 Detail"
              }
            },
            {
              "path": "activity.extension",
              "expression": {
                "language": "text/cql-identifier",
                "expression": "Get Card 2 Indicator"
              }
            }
          ],
          "action": [
            {
              "title": "Digoxin Level",
              "description": "Order digoxin trough within 24 hours from the initiation of cyclosporine",
              "type": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/action-type",
                    "code": "create"
                  }
                ]
              },
              "definitionCanonical": "http://hl7.org/fhir/uv/pddi/ActivityDefinition/ad203"
            },
            {
              "title": "New Digoxin",
              "description": "Preemptively reduce digoxin dose with new order",
              "condition": [
                {
                  "kind": "applicability",
                  "expression": {
                    "language": "text/cql-identifier",
                    "expression": "Need to reduce Digoxin dose"
                  }
                }
              ],
              "type": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/action-type",
                    "code": "create"
                  }
                ]
              },
              "definitionCanonical": "http://hl7.org/fhir/uv/pddi/ActivityDefinition/ad204"
            }
          ]
        },
        {
          "title": "Within 100 days, the patient has had electrolyte and serum creatinine levels checked, and they are not on a potassium sparing or loop diuretic.",
          "description": "(Potassium: level and date)\n (Magnesium: level and date)\n (Calcium: level and date)\n (Serum creatinine: level and date)\n Hypokalemia, hypomagnesemia, and hypercalcemia may potentiate digoxin toxicity. 50-70% of digoxin is excreted unchanged in the urine. Changing renal function may increase serum concentrations and risk of toxicity.",
          "documentation": [
            {
              "type": "derived-from",
              "display": "digoxin-cyclosporine PDDI knowledge artifact",
              "url": "http://hl7.org/fhir/uv/pddi/PlanDefinition/digoxin-cyclosporine-cds-select",
              "document": {
                "url": "http://hl7.org/fhir/uv/pddi/PlanDefinition/digoxin-cyclosporine-cds-select"
              }
            },
            {
              "type": "documentation",
              "display": "Lip et al. Postgrad Med J. 1993; 69(811):337"
            },
            {
              "type": "documentation",
              "display": "Digoxin-FDA [prescribing information] NDA 20405/S-004"
            }
          ],
          "dynamicValue": [
            {
              "path": "action.title",
              "expression": {
                "language": "text/cql-identifier",
                "expression": "Get Card 3 Summary"
              }
            },
            {
              "path": "action.description",
              "expression": {
                "language": "text/cql-identifier",
                "expression": "Get Card 3 Detail"
              }
            },
            {
              "path": "activity.extension",
              "expression": {
                "language": "text/cql-identifier",
                "expression": "Get Card 3 Indicator"
              }
            }
          ],
          "action": [
            {
              "title": "Serum Creatinine",
              "description": "Order for serum creatinine",
              "type": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/action-type",
                    "code": "create"
                  }
                ]
              },
              "definitionCanonical": "http://hl7.org/fhir/uv/pddi/ActivityDefinition/ad205"
            },
            {
              "title": "Electrolyte Panel",
              "description": "Order for electrolyte panel",
              "type": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/action-type",
                    "code": "create"
                  }
                ]
              },
              "definitionCanonical": "http://hl7.org/fhir/uv/pddi/ActivityDefinition/ad206"
            }
          ]
        }
      ]
    }
  ]
}