System Design Atlas

Hospital medication orders

07 / 10Worked example

Critical flow

What proof remains for medication order after lost result, and what may happen afterwards?

Now the architecture is tested at its sensitive point of failure. Dispensing is recorded with verification evidence in a local transaction. The response is lost after commit. A retry returns the same dispensing record. A prescription change received in the meantime requires domain review after dispensing and must preserve that record.

Starting point Reconciliation runs outside the local verification transaction.

Assumptions for the example case

Own fictitious example design. A fictional documentation workflow for a single medication order whose clinical decisions have already been made, without recommendations on substances, doses or treatment. Technical feedback is marked for clarification from age 60 seconds onwards; this threshold does not provide medical clearance. All figures and test goals are illustrative assumptions.

Critical flow with commit and failure point

Critical flow · Commit, failure point and replay

Dispensing is committed locally with verification evidence. The response is then lost, and the master system supplies a new revision.

Dispensing interface
Medication documentation API
Relational documentation store
Reconciliation processing
Clinical master system
  1. 01 Dispensing interface → Medication documentation APIConfirm dispensing against revision 3
  2. 02 Medication documentation API → Relational documentation storeCheck the role, revision and verification record; commit the evidence
  3. 03 Relational documentation store → Medication documentation APIDispensing record A-26 durably stored
  4. 04 Medication documentation API · Local processingResponse to the professional interface is lost
  5. 05 Dispensing interface → Medication documentation APIRetry the same dispensing command
  6. 06 Medication documentation API → Dispensing interfaceDeliver a stored A-26 receipt
  7. 07 Clinical master system → Reconciliation processingSupply prescription revision 4
  8. 08 Reconciliation processing → Relational documentation storeStore the new revision · Flag the need for investigation
  9. 09 Relational documentation store → Medication documentation APIShow the order as an investigation case

Result: The dispensing record is preserved; revision 4 does not invalidate an effect already documented.

Dispensing and documentation bind the exact approved prescription revision.

Dispensing is recorded with verification evidence in a local transaction. The response is lost after commit. A retry returns the same dispensing record. A prescription change received in the meantime requires domain review after dispensing and must preserve that record.

Ordering and failure outcomes

Required order
Dispensing is recorded with verification evidence in a local transaction. The response is lost after commit. A retry returns the same dispensing record. A prescription change received in the meantime requires domain review after dispensing and must preserve that record.
Crash before commit
For medication order M-26 there is still no new permanent proof. The same command may be re-examined; unconfirmed intermediate work does not give a domain guarantee.
Crash after commit, before response
The command journal entry records the original result. Identical replay returns that evidence; a fresh view of the current state comes from the read contract.
External uncertainty
A lack of feedback from Clinical master system remains unknown. Confirmed acceptance, safe rejection and lack of proof are given different conditions; the responsible role clarifies using the same reference.

After response loss, retry only the same dispensing record

After response loss, retry only the same dispensing record

After response loss, retry only the same dispensing record.

Dispensing is recorded with verification evidence in a local transaction. The response is lost after commit. A retry returns the same dispensing record. A prescription change received in the meantime requires domain review after dispensing and must preserve that record.

Dispensing and documentation reference the exact approved prescription revision; a new revision invalidates the old local dispensing approval. The exercise specifies the input and expected result.

Alternative considered
Submitting a new request after a response is lost can execute the same business operation again.
Trade-off
Open evidence of clinical master system requires a work list.
Reassess
Frequent unresolved outcomes require a more reliable contract for external reconciliation.

Try it yourself

Mark the commit point, failure point and next permitted action. Explain the effect of an identical retry.

A hint for your attempt

Trace the same request through the datastore and response path.

Compare with a possible solution
Flow and failure
Dispensing is recorded with verification evidence in a local transaction. The response is lost after commit. A retry returns the same dispensing record. A prescription change received in the meantime requires domain review after dispensing and must preserve that record.
Commit and replay
Domain change and command result are stored together before response. Loss of response after commit leads to reading this result. For medication order M-26, this does not give rise to a second effect.

Apply to your project

What feedback could be missing even though the underlying action has already taken place?

Next: Version conflicts are checked before performance issues.