Hospital ERP — Multi‑Tenant
A multi-tenant hospital system: each hospital on its own database and domain, and inside it the full clinical journey from booking to discharge — clinics, beds, pharmacy, lab, radiology, surgery and insurance, with configurable approval chains and an audit trail on every change.
Overview
Multi‑tenant hospital platform: appointments and visits, admissions, beds and transfers, pharmacy dispensing, lab and radiology orders, insurance claims, surgeries and telemedicine — with approval chains and a full audit trail.
01The challenge
A hospital is not one system but several sharing a single patient: the clinic writes a diagnosis, the lab runs an order, the pharmacy dispenses from a batch with an expiry date, insurance approves or denies, and finance bills the remainder. If each of those keeps its own patient file, you end up with four copies of the same person.
Selling the system to more than one hospital adds a hard constraint: a patient’s data in one facility must never surface in another — a regulatory obligation, not a technical preference.
02What we built
Each hospital is an independent tenant with its own database and domain via stancl/tenancy, and routes are split into central routes (creating and managing tenants) and tenant routes. Separation is structural: no query crosses the boundary.
Inside a tenant, the patient is one entity and the visit hangs off it — and the visit is the spine of the journey: vitals, notes, diagnoses, lab and radiology orders and prescriptions all attach to it. The pharmacy dispenses from drug batches with numbers and expiry dates, so dispensing draws down the right batch rather than an abstract balance.
Approvals were built as an engine: a chain is defined by its steps and each step’s owner, then applied to a bed transfer, an insurance claim or any action needing sign-off — with no new code per case. Over all of it, automatic auditing records every change and who made it.
03The outcome
A patient has one record that every department reads, so duplicate files and the discrepancies between them disappeared, and a course of treatment reads end to end in one place.
The platform sells to more than one facility without a manual deployment per site, with patient-data isolation guaranteed structurally rather than by query discipline.
What the system does
The modules that were delivered and put into daily use.
-
01
Full per-hospital isolation with a separate database and domain, plus central routes for tenant management.
-
02
One clinical journey: appointments, visits, vitals, notes, diagnoses and prescriptions, all on a single patient record.
-
03
Inpatient management: admissions and discharges, rooms and beds, and bed transfers with a full history.
-
04
A pharmacy with drug batches: batch numbers and expiry dates, dispensing records and pharmacy reporting.
-
05
Lab and radiology orders with line items and reports, and surgeries with a defined team per operation.
-
06
Insurance: companies, policies and claims, service price lists, and invoices with line items and payment transactions.
-
07
A configurable approval engine: chains with steps and owners, applied to any action that needs sign-off.
-
08
A patient portal: OTP login, their own appointments, invoices and sessions, and telemedicine sessions.
-
09
Automatic auditing on every change, roles and permissions, and editable notification templates.
Technologies used
What this system is actually built on — not a generic list.