Skip to content
Event storming templates

Event Storm — Electronic Prescription Dispensing

Prescribing, spine and pharmacy contexts for an electronic prescription service, with a nominated-pharmacy policy, a stock substitution hotspot and an expiry event nobody commands.

Template previewEvent storming
Electronic prescriptions — prescribe to reimbursementBounded contexts3Domain events8Event coverage87.5%Hotspots3Model smells1Domain eventCommandActorAggregatePolicyRead modelExternal systemHotspotPrescribing2 events · 2 commands · 1 policy · 1 hotspotPrescriptionSpine2 events · 1 command · 1 policy · 1 hotspotPrescription messagePharmacy4 events · 4 commands · 1 policy · 1 hotspotDispensing episodeDispensing episodeGeneral practitionerPrescribe medicinePrescription signedRepeat medicationreview listGeneral practitionerCancel prescriptionPrescriptioncancelledClinical decisionsupport serviceCancellation arrivesafter the pharmacyhas already dispensedWhen prescriptionsigned, route tonominated pharmacySpine routerRoute to pharmacyPrescriptiondownloadedPrescription expiredPrescription trackerNHS spine directoryPatient walks into adifferent pharmacyfrom the nominated…When prescriptiondownloaded, reservestockDispensary systemReserve stockStock reservedPharmacistPerform clinicalcheckClinical checkcompletedPharmacistHand out medicineMedicine handed topatientOwings and collectionboardPrescription pricingauthorityOwing issued becauseonly half thequantity is in stockWhen medicine handedto patient, claimreimbursementDispensary systemClaim reimbursementReimbursement claimedPatientWorkshop checksEvents with no producing command1Prescription expiredCommands with no resulting event0noneCommands with no aggregate0noneAggregates with no events0nonePolicies with a missing trigger event0nonePolicies with a missing command0noneHotspots per context3Prescribing 1 · Spine 1 · Pharmacy 1Cross-context flows2Prescribing → Spine · Spine → Pharmacy

Make it your own.

title "Electronic prescriptions — prescribe to reimbursement"

context "Prescribing"
  actor "General practitioner"
  aggregate Prescription
  command "Prescribe medicine" by "General practitioner" on Prescription emits "Prescription signed"
  event "Prescription signed"
  readmodel "Repeat medication review list"
  command "Cancel prescription" by "General practitioner" on Prescription
  event "Prescription cancelled" from "Cancel prescription"
  external "Clinical decision support service"
  hotspot "Cancellation arrives after the pharmacy has already dispensed"
  policy "When prescription signed, route to nominated pharmacy" then "Route to pharmacy"

context "Spine"
  aggregate "Prescription message"
  command "Route to pharmacy" by "Spine router" on "Prescription message"
  event "Prescription downloaded" from "Route to pharmacy"
  event "Prescription expired"
  readmodel "Prescription tracker"
  external "NHS spine directory"
  hotspot "Patient walks into a different pharmacy from the nominated one"
  policy "When prescription downloaded, reserve stock" then "Reserve stock"

context "Pharmacy"
  actor Pharmacist
  actor Patient
  aggregate "Dispensing episode"
  command "Reserve stock" by "Dispensary system" on "Dispensing episode"
  event "Stock reserved" from "Reserve stock"
  command "Perform clinical check" by Pharmacist on "Dispensing episode"
  event "Clinical check completed" from "Perform clinical check"
  command "Hand out medicine" by Pharmacist on "Dispensing episode"
  event "Medicine handed to patient" from "Hand out medicine"
  readmodel "Owings and collection board"
  external "Prescription pricing authority"
  hotspot "Owing issued because only half the quantity is in stock"
  policy "When medicine handed to patient, claim reimbursement" then "Claim reimbursement"
  command "Claim reimbursement" by "Dispensary system" on "Dispensing episode"
  event "Reimbursement claimed" from "Claim reimbursement"