Prescription

Introduction #

The Prescription model represents a prescription for a medication that has been written for a patient. Prescriptions track the full lifecycle of a medication order, including dosage details, pharmacy information, and electronic prescribing status.

Basic usage #

To get a prescription by identifier, use the get method on the Prescription model manager:

from canvas_sdk.v1.data.prescription import Prescription

prescription = Prescription.objects.get(id="b80b1cdc-2e6a-4aca-90cc-ebc02e683f35")

If you have a patient object, the prescriptions for a patient can be accessed with the prescriptions attribute on a Patient object:

from canvas_sdk.v1.data.patient import Patient

patient = Patient.objects.get(id="1eed3ea2a8d546a1b681a2a45de1d790")
prescriptions = patient.prescriptions.all()

If you have a patient ID, you can get the prescriptions for the patient with the for_patient method on the Prescription model manager:

from canvas_sdk.v1.data.prescription import Prescription

patient_id = "1eed3ea2a8d546a1b681a2a45de1d790"
prescriptions = Prescription.objects.for_patient(patient_id)

Filtering #

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

Filtering for prescriptions is done with the filter method on the Prescription model manager.

By attribute #

Specify an attribute with filter to filter by that attribute:

from canvas_sdk.v1.data.prescription import Prescription, PrescriptionStatus

prescriptions = Prescription.objects.filter(status=PrescriptionStatus.OPEN)
from canvas_sdk.v1.data.prescription import Prescription, PrescriptionResponse

approved_prescriptions = Prescription.objects.filter(response_type=PrescriptionResponse.APPROVED)

Active prescriptions #

The active method returns committed prescriptions that have not been denied:

from canvas_sdk.v1.data.prescription import Prescription

active_prescriptions = Prescription.objects.active()

Committed prescriptions #

The committed method returns prescriptions that have been committed and not entered in error:

from canvas_sdk.v1.data.prescription import Prescription

committed_prescriptions = Prescription.objects.committed()

Attributes #

Prescription #

Field NameType
idUUID
dbidInteger
patientPatient
noteNote
prescriberStaff
supervising_providerStaff
medicationMedication
compound_medicationCompoundMedication
previous_medicationMedication
indicationsAssessment[]
related_refillPrescription
statusPrescriptionStatus
response_typePrescriptionResponse
is_refillBoolean
is_adjustmentBoolean
is_epcsBoolean
generic_substitutions_allowedBoolean
written_dateDateTime
dispensed_dateDateTime
end_dateDate
end_date_original_inputString
sig_original_inputString
dose_formString
dose_routeString
dose_quantityFloat
dose_frequencyFloat
dose_frequency_intervalString
maximum_daily_doseString
potency_quantityFloat
dispense_quantityFloat
duration_in_daysInteger
count_of_refills_allowedInteger
note_to_pharmacistString
pharmacy_nameString
pharmacy_ncpdp_idString
pharmacy_addressString
pharmacy_phone_numberString
pharmacy_fax_numberString
pharmacy_is_read_onlyBoolean
message_idString
prescription_order_numberString
reason_codeString
error_messageString
deletedBoolean
entered_in_errorCanvasUser
committerCanvasUser
createdDateTime
modifiedDateTime

Enumeration types #

PrescriptionStatus #

EnumValueLabel
OPENopenOpen
PENDINGpendingPending
ACCEPTEDultimately-acceptedUltimately Accepted
ERRORerrorError
CANCEL_REQUESTEDcancel-requestedCancel Requested
CANCELEDcanceledCanceled
CANCEL_DENIEDcancel-deniedCancel Denied
RECEIVEDreceivedReceived by DrFirst
SIGNEDsignedSigned
INQUEUEinqueueIn Queue
TRANSMITTEDtransmittedTransmitted
DELIVEREDdeliveredDelivered

PrescriptionResponse #

EnumValueLabel
APPROVEDAApproved
APPROVED_WITH_CHANGESCApproved with changes
DENIEDDDenied
DENIED_PRESCRIPTION_TO_FOLLOWNDenied, new prescription to follow