Skip to content
All posts

A hospital, end to end: one ontology from the front desk to the pharmacy

Isometric hospital ontology between agents, what-if, reports, sources and memory. Synthetic proposed setup.

A hospital is one place to a patient. To the people running it, it is hundreds of handovers. A bed is ready, but the porter has not been called. Surgery is finished, but the discharge medicines are not.

An ontology joins those handovers up. It names the things, records their properties and links them together. A digital twin is that model kept up to date. Here is how a hospital team would build towards one with Eunomia.

An illustrative case study. Riverbend General Hospital is an invented Australian private hospital. Every person, supplier, record and number below is synthetic. This is not clinical advice or a report of a hospital deployment. Health information is sensitive information under the Australian Privacy Act. See the OAIC health privacy guide.

What works today, and what the team would build

Eunomia 2.2.0, released on 9 November 2026, ships the project ontology, CSV auto-mapping and import, certified metrics, impact views and what-ifs that save nothing. It also ships coverage, readiness and strict mode. Staff can ask through in-app chat, or through an agent such as Claude Code over MCP.

The hospital model below is a proposed setup using those pieces. Live HL7 or FHIR feeds from hospital systems and a dedicated hospital twin UI are coming, not shipped features. Today, a team would import approved CSV snapshots and add sourced memories. Each answer is only as fresh as that input. Eunomia would sit alongside the hospital's clinical, dispensing, booking and alert systems. Those systems remain the record of care.

The model and its boundaries

Riverbend has 350 beds, an emergency department, theatres, wards, outpatient clinics and an on-site pharmacy. Nora Bell arrives after a fall with a fractured hip. Her sister, Elise, comes with her. Every record below is invented. The team would approve typed properties for each kind, including IDs, status, source time, units, cost, expiry and booking references.

The team also approves the definitions of its numbers. A certified metric is a reviewed calculation. It is not an external certification, a clinical endorsement or a guarantee that the input is correct.

Certified metricDefinition for this example
Bed occupancyOccupied staffed beds divided by available staffed beds, at the same snapshot time
ED median waitThe hospital reporting system calculates the median arrival-to-first-clinician wait; import one dated summary and read its value
Theatre utilisationUsed session minutes divided by available session minutes, for the selected day
Stock days of coverUsable units divided by the agreed daily use, for one medicine and location
Expiring stock valueQuantity times unit cost, summed for batches expiring in the selected period
Cost per bed dayAllocated daily operating cost divided by occupied bed days, using a finance-approved daily summary

Eunomia's metric engine supports sums, averages, ratios and per-row arithmetic. It does not have a native median calculation in 2.2.0. For the ED figure, the source computes the median. The approved metric reads the single selected daily summary, rather than averaging several daily medians. For costs and days of cover, the team supplies the agreed allocations and demand assumptions as typed properties.

Keep the memory in the right hands

Riverbend would create clinical, pharmacy and admin vaults, with membership for the people who need each space. Clinical memory holds Nora's encounter and handover references. Pharmacy holds stock, batches and dispensing references. Admin holds booking, capacity and finance summaries. An executive's admin view uses aggregate figures, not Nora's clinical history.

Vault membership controls access to memory. A token can be limited to one vault. A graph link does not bypass that boundary: relation endpoints must be in the same vault. For a batch trace that needs patient references, Riverbend would prepare a minimum, approved trace dataset inside a restricted pharmacy vault. An authorised clinician resolves those references in the clinical system. It would not quietly join private clinical memory into an admin answer.

Eunomia supports self-hosting, a database per organisation, and audit and change logs. Those are useful controls. They do not by themselves establish health privacy compliance or any healthcare certification. The hospital must decide access, lawful use, retention and which model endpoint may process health information before using real records.

Eleven modules, one connected hospital

Each module has a diagram, user stories and a scripted exchange. The diagrams illustrate the proposed setup. They are not a shipped hospital UI or captured product outputs. A receipt names the source record and its time. Numbers come from approved metrics through metric_eval, computed on the server. Coverage is checked first. Missing data and warnings stay visible.

01. The hospital twin

Hospital teams, when agreeing the model before importing data.

Animated isometric hospital diagram: the hospital twin. Synthetic example.

User stories

  • As a hospital modeller, I want to name the hospital kinds and links, so that every team uses an agreed vocabulary.
  • As a vault owner, I want to separate clinical, pharmacy and admin memory, so that access follows each person's duties.
  • As an operations lead, I want to see source times and coverage, so that I know what the model can answer.

The middle slab is the hospital ontology. Patients, encounters, beds, wards, clinicians, orders, medicines, batches, fridges, suppliers, theatre sessions and roster shifts share reviewed links. Agents, what-if runs and reports read that model. Approved sources and memory sit below it.

An encounter is admitted_to a ward and assigned_to a bed. An order is prescribed a medication and dispensed_from a batch. A batch is stored_in a fridge and supplied_by a supplier. These are reviewed links, not facts an agent invents.

Hospital modeller: "What can we ask from today's import?"

Eunomia, coverage: "Check the approved terms, metrics and source coverage first. Missing inputs remain visible. Live HL7 or FHIR feeds and a dedicated hospital twin UI are coming."

02. Patient and family

Nora and Elise, from arrival to consent, discharge and follow-up.

Animated isometric hospital diagram: patient and family. Synthetic example.

User stories

  • As a patient, I want to understand the reported wait, so that I can ask staff what happens next.
  • As a family member, I want to have the recorded communication preference checked, so that I join explanations with the patient's agreement.
  • As a patient, I want to take home checked instructions and a confirmed follow-up, so that I know the agreed next steps.

The ontology holds Nora's patient reference, the ED encounter, a recorded preference to involve Elise, and later the discharge and follow-up references. Nora does not need to learn the word ontology. Staff use the model to answer her questions, then check the source. This is not a shipped patient portal.

Elise: "How long will Nora wait?"

Registration officer, asking Eunomia: "What was today's ED median wait?"

Eunomia, metric: "38 minutes in the selected ED summary. Source: ED-SUM-09, exported at 09:00. That describes earlier attendances, not Nora's place in the queue."

The triage nurse explains that urgency determines who is seen next. The treating team discusses surgery with Nora and records consent in the clinical system.

Nora: "Can you explain it with Elise here?"

Nurse, asking Eunomia: "Recall the recorded communication preference for this encounter."

Eunomia, recall: "Nora asked for Elise to join explanations. Source: intake note IN-104, 08:35. The consent form is a separate record, CONS-104."

A remembered preference is not consent to a procedure, or permission to share every record. At discharge, a nurse and pharmacist explain the approved instructions and check Nora's understanding.

Nora: "Which instructions do I take home, and when is follow-up?"

Discharge nurse, asking Eunomia: "Recall Nora's signed discharge plan and confirmed booking."

Eunomia, recall: "Plan DS-104 version 2 and medicine list MED-104 version 3 are the recorded documents. Booking BK-104 is confirmed for the fracture clinic on 23 November at 10:00. Source: booking export, 12:10."

Staff hand over the checked documents, including the care team's advice on when and how to seek help. They book the appointment in the booking system. Eunomia recalls its confirmation; it does not make the booking here.

03. Registration and admin

Intake, bed and theatre coordinators, while planning the admission.

Animated isometric hospital diagram: registration and admin. Synthetic example.

User stories

  • As a registration officer, I want to link intake to one encounter, so that departments refer to the same admission.
  • As a bed manager, I want to find available staffed beds with dated status, so that I can check release before allocation.
  • As a theatre coordinator, I want to trace the effect of moving a session, so that I can confirm bookings, recovery beds and roster coverage.

Intake links Nora to encounter ENC-104, rather than creating a new person for every department. Admin sees identity and booking references, the bed request, the theatre session and the relevant roster. Clinical detail stays with the clinical team.

Bed manager: "Which staffed orthopaedic beds are free in the latest snapshot?"

Eunomia, recall: "Beds O-12 and O-14 are marked available. Source: BED-0900. O-12 has a cleaning note; check its release before assigning it."

The manager confirms a bed in the bed system, then imports the updated snapshot. The theatre coordinator links ENC-104 to tomorrow's planned session, TS-10A, and checks the nurse roster with the ward manager.

Theatre coordinator: "What does moving TS-10A affect?"

Eunomia, impact: "The linked case list, recovery-bed plan and roster shifts. Each path is shown. The booking team must confirm changes in the scheduling system."

Billing staff attach the episode and procedure coding references after clinical documentation is complete. A qualified coder assigns and checks the codes. Eunomia recalls the coding status and missing documents, not a guessed bill or an automatically chosen clinical code.

04. Triage and ward nurses

Triage and ward nurses, at assessment, rounds, handover and escalation.

Animated isometric hospital diagram: triage and ward nurses. Synthetic example.

User stories

  • As a triage nurse, I want to recall the recorded assessment and observations, so that I can check their source and time.
  • As a ward nurse, I want to find handover, falls-risk and medication references, so that I can check the live chart before care.
  • As a ward nurse, I want to find the responsible team after escalating deterioration, so that I can support the hospital's escalation process.

The triage nurse records category 3 in this fictional encounter, based on their assessment. Eunomia recalls the recorded category; it does not triage Nora. The clinical vault holds references to observations, orders, falls-risk assessments and handovers, with who recorded them and when.

Ward nurse: "What needs checking at handover for Nora?"

Eunomia, recall: "Handover HN-104 records assisted mobilisation and a falls-risk plan. Observation set OBS-104 and the active orders are linked. Read the current chart before care."

At medication rounds, the nurse checks the live medication chart and the patient at the bedside. A copied order is context, not authority to administer a medicine.

Later, the hospital's existing observation system raises a deterioration alert. The nurse follows the hospital's escalation process immediately. Eunomia is not the monitor or alarm.

Nurse, after escalating: "Recall the latest handover and responsible team for this encounter."

Eunomia, recall: "HN-104, recorded at 14:00, links the ward consultant and current team roster. The imported observation snapshot is older than the alert. Use the live chart."

The time on a source matters as much as the words in it.

05. Doctors in ED, theatre and the ward

The ED registrar, surgeon and ward consultant, as Nora moves through care.

Animated isometric hospital diagram: doctors in ed, theatre and the ward. Synthetic example.

User stories

  • As an ED registrar, I want to find recorded history, orders and outstanding results, so that I can see what still needs checking.
  • As a surgeon, I want to match the theatre list to encounter and consent references, so that I can verify the current source records.
  • As a ward consultant, I want to recall the signed discharge summary and linked results, so that the next team can find the approved version.

The ED registrar records Nora's history and examination, requests imaging and enters orders in the clinical system. The ontology links those orders and result references to ENC-104.

ED registrar: "Recall the history and outstanding results recorded for ENC-104."

Eunomia, recall: "ED note ED-104 and imaging request IMG-104 are linked. The export marks the report as pending. No final result is present in this snapshot."

The surgeon reviews the actual imaging, examines Nora and agrees the plan with her. Before theatre, they check the list, consent and the hospital's safety process.

Surgeon: "Which encounter and consent reference are linked to Nora on tomorrow's list?"

Eunomia, recall: "ENC-104 is scheduled_in TS-10A. CONS-104 is the linked consent reference. Source: theatre export TH-1600. Confirm against the current list and consent record."

After surgery, the ward consultant reviews recovery with nurses, pharmacy and allied health. For discharge, the consultant signs the summary in the clinical system. Eunomia can recall the signed version and linked results. It does not decide Nora is fit for discharge or create an unsigned plan that looks final.

06. Pharmacy and ward stock

The pharmacy lead, at stock review, cold-chain checks and a supplier shortage.

Animated isometric hospital diagram: pharmacy and ward stock. Synthetic example.

User stories

  • As a pharmacist, I want to see ward imprest stock with units and source times, so that I can check the usable supply.
  • As a pharmacy lead, I want to trace batches, expiry and cold-chain storage, so that I can investigate affected stock.
  • As an authorised pharmacist, I want to find the controlled drugs register reference, so that I can check reconciliation in the approved system.
  • As a procurement lead, I want to compare days of cover with supplier shortage notes, so that I can discuss safe supply with pharmacy and clinicians.

Pharmacy lead Mira Cole sees medicines by ward and imprest, the agreed stock kept on each ward. Every stock position needs a medicine, location, usable quantity and time. Batches carry expiry dates and costs. Cold-chain batches link to fridges. Supplier links hold delivery and shortage notes.

Mira: "How many days of IV fluid cover does Ward O have?"

Eunomia, metric: "6 days: 120 usable bags divided by the agreed 20 bags a day. Receipt: stock position IV-O-09, 09:00. Quarantined stock is excluded."

Mira: "What stock expires in the next 30 days?"

Eunomia, metric: "A$480 in the selected batch snapshot. Receipt: 40 units in batch EXP-01 at A$12 each. Review the expiry filter and stock count before action."

A fictional supplier, Wattle Medical Supply, reports a delayed IV fluid delivery. Mira asks for an impact view of the linked stock positions and ward demand records. She checks alternatives with procurement and clinicians. Eunomia does not choose a substitute medicine.

For controlled drugs, the model would hold a restricted reference to the hospital's S8 register and its reconciliation status. The legally required register, authorised checks and local procedures remain in the hospital's approved system. This example does not claim Eunomia is an S8 register.

07. Executive and operations

Operations and finance leads, at the daily capacity review.

Animated isometric hospital diagram: executive and operations. Synthetic example.

User stories

  • As an operations director, I want to see occupancy, ED waits and theatre utilisation, so that I can discuss pressure using agreed figures.
  • As a workforce lead, I want to find unfilled roster shifts, so that I can check coverage with ward managers.
  • As a finance lead, I want to read the approved cost per bed day, so that I can trace the allocation and denominator.
  • As an executive, I want to see missing summaries and metric receipts, so that I can judge the limits of the report.

Operations gets dated, aggregate snapshots in its admin vault. The executive can ask about bed occupancy, ED waits, theatre utilisation, staffing gaps and the cost per bed day. Finance and clinical teams agree the definitions first.

Operations director: "Where are we tight today?"

Eunomia, metrics: "Bed occupancy is 90%: 315 of 350 staffed beds. Theatre utilisation is 75%: 360 of 480 available minutes. Two roster shifts are unfilled. Allocated cost per occupied bed day is A$1,200: A$378,000 divided by 315. Receipts: BED-0900, TS-DAY-09, ROSTER-09 and FIN-09."

The numbers use the same time window and the selected summary records. If ten beds close for staffing, the denominator must change. A building with 350 physical beds is not always a hospital with 350 usable beds. The executive sees the reporting gap when a summary is missing, rather than a reassuring zero.

08. Scenario: an overnight fridge failure

Pharmacy and ward teams, after the 07:00 cold-chain incident import.

Animated isometric hospital diagram: scenario: an overnight fridge failure. Synthetic example.

User stories

  • As a pharmacy lead, I want to walk from a failed fridge to stored batches, so that I can check the quarantine scope.
  • As a ward pharmacist, I want to trace batches to ward stock and orders due today, so that I can arrange a checked supply review.
  • As an authorised clinician, I want to resolve affected patient references in the clinical system, so that I can verify current orders before action.

At 07:00, an imported incident says fridge F-02 failed overnight. The pharmacy team follows its cold-chain procedure and quarantines affected stock pending assessment. The failure report comes from the hospital's monitoring process, not a Eunomia sensor feed.

Mira: "What does F-02 affect, including today's due doses?"

Eunomia, impact: "F-02 links to insulin batch INS-27, then ward stock in O and M. Linked order records identify four patient references with doses due today. Sources: incident CF-02 at 07:00, batch snapshot at 06:00 and due-order export at 07:10."

The agent follows the recorded paths, checks due dates and shows the reason each record is included. For a path longer than one neighbourhood query, it walks the next links explicitly. These are potentially affected orders, not evidence that a patient received compromised stock. An authorised pharmacist and ward team check the current orders and arrange safe supply.

09. Scenario: a two-week flu surge

Operations, workforce and pharmacy leads, before changing a roster or order.

Animated isometric hospital diagram: scenario: a two-week flu surge. Synthetic example.

User stories

  • As an operations planner, I want to test 20% more arrivals over two weeks, so that I can compare explicit assumptions with capacity.
  • As a workforce lead, I want to compare baseline and surge nurse shifts, so that I can see the assumed staffing gap.
  • As a pharmacy lead, I want to compare oseltamivir and IV fluid demand with usable stock, so that I can review supply assumptions.
  • As a vault owner, I want to run a what-if that saves nothing, so that the planning exercise does not change stored records.

The operations director asks the question before changing the roster or placing an order. The team prepares one approved planning record for each resource, covering the same 14-day window. These hold baseline demand, usable capacity and the team's assumed surge requirement.

Operations director: "Test 20% more arrivals for 14 days. Use our agreed resource assumptions. Save nothing."

Eunomia, what-if: "Under those assumptions, arrivals move from 2,800 to 3,360. Peak occupied-bed demand moves from 315 to 378, which is 28 above capacity. Required nurse shifts move from 280 to 336, which is 36 above the 300 available. Oseltamivir demand moves from 100 to 120 courses against 110 available. IV fluid demand moves from 1,000 to 1,200 bags against 1,100 available. Nothing was saved."

The team explicitly assumes each listed requirement rises by 20%. It scales those properties in scenario_run; approved metrics read demand and capacity to show the gaps. Peak beds are a peak count, while shifts and stock are totals for the fortnight. They are not added together. These flu planning totals are separate from Ward O's daily stock example.

This is arithmetic on stated assumptions, not a forecast, a staffing recommendation or a treatment plan. Raising arrivals alone would not automatically alter linked beds, rosters or medicines. Clinical and operations leads must supply a defensible demand model, review the result and make any real changes in the hospital's systems.

10. Scenario: a batch recall

The authorised pharmacy team, after supplier notice RC-42 arrives.

Animated isometric hospital diagram: scenario: a batch recall. Synthetic example.

User stories

  • As a pharmacist, I want to trace a recalled batch through dispensing events, so that I can find every matching patient reference in the export.
  • As a pharmacy lead, I want to check trace coverage against the full dispensing record, so that I can identify missing data before follow-up.
  • As an authorised recall coordinator, I want to record patient contact outcomes in the source system, so that the team can reconcile the recall response.

Later, a separate supplier notice recalls batch AB-42 of a fictional discharge medicine. The trace goes through dispensing events, rather than assuming everyone on a ward received the batch.

Pharmacist: "Find every patient dispensed AB-42 in this imported trace."

Eunomia, recall and impact: "D-104 links AB-42 to Nora's reference; D-118 links it to patient P-118. Source: dispensing export DP-1800 and recall notice RC-42. This is every match in that export, not a guarantee that the export is complete."

Pharmacy reconciles the full dispensing record, checks stock and follows the recall procedure. The authorised team contacts patients and records the outcome in its own system. Eunomia does not send recall messages or change prescriptions in this example.

11. Scenario: governance and receipts

The agent and pharmacy vault owner, when a new kind needs approval.

Animated isometric hospital diagram: scenario: governance and receipts. Synthetic example.

User stories

  • As a vault owner, I want to hold unapproved kinds in strict mode, so that an agent cannot extend the model without review.
  • As a pharmacy lead, I want to review proposed properties and links, so that the model uses an agreed meaning.
  • As an agent operator, I want to retry after the owner approves the kind, so that the write follows the approved model.
  • As a metric reviewer, I want to attach a definition and source receipt to each number, so that people can check how it was calculated.

Strict mode is switched on by the pharmacy vault owner. It is off by default.

Agent: "Create a cold_chain_incident for F-02."

Eunomia: "That custom kind is not approved. The write is refused and a proposal is filed."

Mira, the vault owner: "I will review cold_chain_incident, its properties and links in Memory spaces, Kinds and links."

Mira approves it in her browser session, then the agent retries the write. The agent's API token cannot approve its own proposal. Readiness shows outstanding proposals; coverage shows whether a question has an approved term or metric behind it.

Numbers use certified metrics through metric_eval, with dated source receipts. Certified means the calculation has been reviewed. It is not external certification or a clinical endorsement.

The useful part is the handover

Nora goes home with checked instructions, reconciled medicines and a confirmed follow-up. The nurse, surgeon, pharmacist, booking officer and operations director have asked different questions about connected work. Each answer has a source. Each number has a definition. Each person still owns their decision.

That is the hospital model worth building: start with approved names and reliable snapshots, keep the sensitive memory in the right vault, and show what the model does not know.

For the shipped behaviour and setup details, see the 2.2.0 README, agent and ontology guide and vault architecture.


Want to map your own operation? Talk to the Eunomia team about an ontology built around your data and your team's approvals.