Compound Medication

Introduction #

The CompoundMedication model represents a compound medication formulation that can be prescribed to patients. Compound medications are customized medications mixed or prepared by a compounding pharmacy according to a prescription.

Basic usage #

To get a compound medication by identifier, use the get method on the CompoundMedication model manager:

from canvas_sdk.v1.data.compound_medication import CompoundMedication

compound_medication = CompoundMedication.objects.get(id="123")

Filtering #

Compound medications can be filtered by any attribute that exists on the model.

Filtering for compound medications is done with the filter method on the CompoundMedication model manager.

By attribute #

Specify attributes with filter to filter by those attributes:

from canvas_sdk.v1.data.compound_medication import CompoundMedication

# Get all active compound medications
active_medications = CompoundMedication.objects.filter(active=True)

# Get compound medications by formulation
compound_medications = CompoundMedication.objects.filter(formulation="Testosterone 200mg/mL in Grapeseed Oil")

# Get all Schedule II controlled substances
schedule_ii_medications = CompoundMedication.objects.filter(controlled_substance="II")

# Get compound medications by potency unit
tablet_medications = CompoundMedication.objects.filter(potency_unit_code="C48542")

Multiple filters #

You can combine multiple filters:

from canvas_sdk.v1.data.compound_medication import CompoundMedication

# Get active compound medications that are controlled substances
controlled_active = CompoundMedication.objects.filter(
  active=True,
  controlled_substance__in=["II", "III", "IV", "V"]
)

Attributes #

CompoundMedication #

Field NameType
dbidInteger
activeBoolean
formulationString
potency_unit_codePotencyUnit
controlled_substanceControlledSubstanceSchedule
controlled_substance_ndcString

Enumeration types #

PotencyUnit #

ValueLabel
C62412Applicator
C54564Blister
C64696Caplet
C48480Capsule
C64933Each
C53499Film
C48155Gram
C69124Gum
C48499Implant
C62276Insert
C48504Kit
C120263Lancet
C48506Lozenge
C28254Milliliter
C48521Packet
C65032Pad
C48524Patch
C120216Pen Needle
C62609Ring
C53502Sponge
C53503Stick
C48538Strip
C48539Suppository
C53504Swab
C48542Tablet
C48548Troche
C38046Unspecified
C48552Wafer

ControlledSubstanceSchedule #

KeyValueLabel
SCHEDULE_NOT_SCHEDULEDNNone
SCHEDULE_IIIISchedule II
SCHEDULE_IIIIIISchedule III
SCHEDULE_IVIVSchedule IV
SCHEDULE_VVSchedule V

Notes #

  • The formulation field has a maximum length of 105 characters (as defined by Surescripts).