type and its data.
Every event’s
data includes the record’s id, its externalId when one was set, and the patient as { id, externalId }.
Order events
photon:order:created
An order was sent. Each prescription on it becomes a fill.pharmacyId is set when the pharmacy was chosen before sending, and is null while the patient is still choosing.
photon:order:placed
The order was sent to a pharmacy. If it’s rerouted, you get this event again for the new pharmacy.photon:order:fulfillment
The pharmacy made progress. You get one event for each step.carrier and trackingNumber are included when the pharmacy provides them.
photon:order:rerouted
The order moved to a different pharmacy, usually because the patient chose another one.pharmacy is the new pharmacy, with the same shape as in photon:order:placed.
photon:order:completed
Picked up or delivered.data has only id, externalId and patient.
photon:order:canceled
Canceled.data has only id, externalId and patient.
photon:order:error
Something went wrong with the order that needs attention.reason explains what went wrong, for a person to read.
Prescription events
photon:prescription:created
A draft became an active prescription. Drafts themselves send no events.photon:prescription:depleted
Every fill the prescription allows is now on an order, so it can’t be ordered again. This doesn’t mean the medication has been picked up or has run out. A one-fill prescription is depleted as soon as its order is sent.data has only id, externalId and patient.
photon:prescription:active
A depleted prescription has fills available again, for example because an order with one of its fills was canceled.data has only id, externalId and patient.
photon:prescription:canceled
The prescription was canceled and can’t be filled.data has only id, externalId and patient.