Series · Part 4 of 6
Building Djengo
Every operator Djengo serves eventually asks the same question: where is this? Which ward is the patient in. Which unit is the tenant leasing. Which room does housekeeping clean next. The answer has to work for a hospital, an estate, and a hotel without becoming three products.
Branch is not a facility#
| Concept | What it answers | Example |
|---|---|---|
| Branch | Which property or site? | Sunrise Hospital, Ikeja |
| Facility node | Where inside that property? | Block A → Ward 3 → Room 301 |
Branches already carry payroll scope, departments, and hotel links. Facility nodes are a tree that always lives under exactly one branch. Keeping them separate meant I never had to migrate the branch table to support a ward.
One tree, shaped by mode#
HOSPITAL ESTATE
Branch (campus) Branch (estate phase)
└─ BLOCK └─ BLOCK
└─ WARD └─ BUILDING
└─ ROOM └─ UNIT
└─ BED (optional) └─ ROOM (optional)| facility_mode | What the product expects |
|---|---|
| GENERAL | Branches and departments only |
| HOSPITAL | Block → Ward → Room under each branch |
| ESTATE | Block → Building → Unit |
| HOSPITALITY | Rooms live in operations today; the tree is optional |
What hangs off a node#
| Data | Links to |
|---|---|
| Patient admission or bed | WARD or ROOM |
| Estate tenant or lease | UNIT |
| Housekeeping task | ROOM, plus the assigned staff |
| Staff role at a property | Branch, not a node |
Clinical departments like radiology or pharmacy stay in departments, because they are functions, not places. That one distinction removed a week of confused UI.
The lesson I keep relearning: model the nouns the operator already uses, keep each one answering a single question, and let a mode setting change the shape instead of forking the product.
← Part 3
Multi-tenancy without a tenant_id
Part 5 →
State machines are product decisions
Key takeaways
What to remember
- Branch answers which property; nodes answer where inside.
- A mode setting shapes the tree instead of forking the product.
- Roles belong to properties, not rooms.





