Facility — How it works
Overview
The facility engine models where care happens: facilities and their internal structure (departments,
locations, rooms), the services a facility offers, and per-facility configuration. Facilities carry
logical geography ids so they roll up through the metadata hierarchy for geographic access
scoping (GeographyScopeResolver).
Data model & ownership
| Table | Purpose |
|---|---|
facility | A care location; tenant-scoped; logical geography ids. |
department | A unit within a facility. |
location / room | Physical sub-structure. |
facility_service | Services the facility offers. |
facility_configuration | Per-facility settings. |
Key rules & invariants
- A facility's geography ids reference the metadata hierarchy; inherited
geographic scopes cover facilities via
GeographyScopeResolver. - Departments/locations/rooms belong to their facility; access scopes can target facility or department.
API
See the API Reference. Endpoint groups under /api/v1/facility: facilities,
departments, locations, rooms, services, configuration.
Configuration & feature flags
None.
Related features
- Metadata (geography), Access control (facility/ department scopes), Module (per-facility module activation), Queue (facility-scoped queues).