System Design Atlas

Hospital medication orders

06 / 10Worked example

The overall architecture

How are the responsibility for medication order and external processing divided between modules and processes?

The local consistency rule determines the medication documentation API boundary. Reconciliation processing runs separately for deferred work. The modules prescription status, verification record, dispensing record, documentation completion structure responsibility within the API; they are not individually operated services. The clinical master system sends assigned prescription revisions to reconciliation processing. The medication documentation API checks roles and maintains orders, verification evidence and dispensing records in a relational datastore. Prescribers, verifiers, dispensers and documenting professionals have separate interface actions. Feedback goes to the master system after local storage. The diagram shows documentation flows and provides no control path to dosing devices or treatment calculations.

Starting point The actual action retains its own evidence.

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.

Runtime components and datastores

Runtime topology · processes, data stores and external systems

Clinical master systemEntrance or reading path

Medication documentation

Medication documentation APIDomain validation and commit
Relational documentation storeAuthoritative relational data store
Reconciliation processingProcess durably stored work
Professional interfacesUse of results
Clinical master system → Reconciliation processingAssigned prescription revision
Reconciliation processing → Relational documentation storeSave revision locally
Professional interfaces → Medication documentation APIRole-related action
Medication documentation API → Relational documentation storeOrder, verification evidence and dispensing record
Relational documentation store → Reconciliation processingStored response
Reconciliation processing → Clinical master systemFeedback after local commit

The map shows documentation flows and separate specialist roles; it leads neither to dosing devices nor to therapy calculation.

The clinical master system sends assigned prescription revisions to reconciliation processing. The medication documentation API checks roles and maintains orders, verification evidence and dispensing records in a relational datastore. Prescribers, verifiers, dispensers and documenting professionals have separate interface actions. Feedback goes to the master system after local storage. The diagram shows documentation flows and provides no control path to dosing devices or treatment calculations.

Domain responsibilities within the API

Interior view · Medication documentation API

Process framework · Medication documentation API

Prescription stateMaintain the current prescription revision and aggregate version
Verification recordBind domain verification to the exact revision
Dispensing recordStore the dispensing event and replay record
Documentation closureDocument the actual outcome or resolve the investigation case
Verordnungsstand → PrüfbelegDomain call
Prüfbeleg → AusgabenachweisDomain call
Ausgabenachweis → DokumentationsabschlussDomain call

These modules organize responsibilities within the API process and share its server boundary.

The medication documentation API contains prescription state, verification evidence, dispensing records and documentation completion. Domain calls connect modules within the same API process.

Map responsibilities to runtime components

Domain taskRuntimeResponsibility
Prescription stateMedication documentation APIMaintains prescription content for which the prescriber is clinically responsible.
Verification recordMedication documentation APIBinds verification evidence to the exact prescription revision.
Dispensing recordMedication documentation APIRecords evidenced dispensing against the specific revision.
Documentation closureMedication documentation APILinks the actual action or omission to completion.
Reconciliation processingSeparate background processProcesses stored work and external feedback.
Clinical master systemExternal boundaryProvides or confirms the evidence agreed for this case.

Prescription state

Runtime
Medication documentation API
Responsibility
Maintains prescription content for which the prescriber is clinically responsible.

Verification record

Runtime
Medication documentation API
Responsibility
Binds verification evidence to the exact prescription revision.

Dispensing record

Runtime
Medication documentation API
Responsibility
Records evidenced dispensing against the specific revision.

Documentation closure

Runtime
Medication documentation API
Responsibility
Links the actual action or omission to completion.

Reconciliation processing

Runtime
Separate background process
Responsibility
Processes stored work and external feedback.

Clinical master system

Runtime
External boundary
Responsibility
Provides or confirms the evidence agreed for this case.

Reconciliation runs outside the local verification transaction

Reconciliation runs outside the local verification transaction

Reconciliation runs outside the local verification transaction.

Dispensing and documentation reference the exact approved prescription revision; a new revision invalidates the old local dispensing approval.

Prescription revisions, check records, dispensing events, and documentation must represent the same valid state. Your exercise identifies the input and expected result.

Alternative considered
A separate service for each module distributes the promise “dispensing and documentation reference exactly the approved prescription revision; a new revision devalues the old local dispensing approval.” to additional network boundaries.
Trade-off
Common schema changes require coordinated releases.
Reassess
Significantly deviating burden of reconciliation processing or independent responsibility justifies a runtime boundary.

Try it yourself

Assign prescription status, reconciliation processing and clinical master system to the types module, process and external system. Justify the authoritative datastore.

A hint for your attempt

A domain responsibility becomes a process only when it has its own execution unit.

Compare with a possible solution
Boundaries
Prescription status is a module in Medication Documentation API; reconciliation processing is its own process; Clinical master system lies outside.
Storage
Prescription revisions, verification records, dispensing events and documentation holds the authoritative evidence. Dispensing and documentation reference the exact approved prescription revision; a new revision invalidates the old local dispensing approval. The joint transaction protects this connection; external responses remain separate evidence.

Apply to your project

Which planned service boundary would distribute a currently local guarantee across the network?

Next: Loss of response only repeats the same dispensing record.