Facility Service — Epics
Service: facility-service Epic prefix: FAC-EPIC Last updated: 2026-04-17
Epics
FAC-EPIC-01 — Hierarchy graph & profiles
| Field | Value |
|---|---|
| Issue type | Epic |
| Summary | DAG hierarchy graph + pluggable HierarchyProfile |
| Status | To Do |
| Priority | Must |
| Labels | service:facility-service, domain:facility, slice:S0 |
| Components | hierarchy, profile |
| Fix version | M0 |
| FR references | FR-FAC-HIER-001..010 |
| Legacy FR refs | FR-HIER-NODE-001..006, FR-HIER-EDGE-001..005, FR-HIER-PROF-001..004, FR-HIER-TRV-001..006 |
| Dependencies | TENANT-EPIC-01, IDENT-EPIC-01 |
| Rollup status | Not started |
Business outcome: Unlocks licensing, access-policy, scheduling, and every clinical service — all of which must scope data to a node context.
Description: Deliver the DAG model for HierarchyNode + HierarchyEdge + HierarchyProfile with cycle detection, profile-driven validation, subtree / ancestor traversal, and Redis-cached context lookup meeting p99 ≤ 20ms for the hot path. Five seeded platform profiles (AFG_MOPH, UAE_DOH, PRIVATE_HOSPITAL, CLINIC_SIMPLE, TELEMEDICINE).
Stories: FAC-US-001, FAC-US-002, FAC-US-003, FAC-US-004, FAC-US-005, FAC-US-006, FAC-US-007
FAC-EPIC-02 — Location operations & hours
| Field | Value |
|---|---|
| Issue type | Epic |
| Summary | Location CRUD, hours, time zone, locale anchored to node |
| Status | To Do |
| Priority | Must |
| Labels | service:facility-service, domain:facility, slice:S0 |
| Components | location |
| Fix version | M0 |
| FR references | FR-FAC-LOC-001..008 |
| Legacy FR refs | FR-FAC-001, FR-FAC-002, FR-FAC-007, FR-FAC-008 |
| Dependencies | FAC-EPIC-01 |
| Rollup status | Not started |
Business outcome: Enables scheduling, registration, and billing to route patients correctly and present localized time/hours.
Description: CRUD for Locations anchored to exactly one HierarchyNode (no orphans). Operational hours, time-zone, locale, capacity. Deactivation policy with occupied-bed safeguard (BR-FAC-002). FHIR Location projection.
Stories: FAC-US-008, FAC-US-009, FAC-US-010, FAC-US-011
FAC-EPIC-03 — Bed lifecycle & safety
| Field | Value |
|---|---|
| Issue type | Epic |
| Summary | Bed aggregate with safe state machine and single-patient invariant |
| Status | To Do |
| Priority | Must |
| Labels | service:facility-service, domain:facility, slice:S1, safety |
| Components | bed |
| Fix version | M1 |
| FR references | FR-FAC-BED-001..006 |
| Legacy FR refs | FR-FAC-003, FR-FAC-006, BR-FAC-001, BR-FAC-002 |
| Dependencies | FAC-EPIC-02 |
| Rollup status | Not started |
Business outcome: Prevents wrong-bed assignments and enables inpatient flow.
Description: Bed aggregate with AVAILABLE → RESERVED → OCCUPIED → CLEANING → AVAILABLE lifecycle; single-active-encounter invariant; housekeeping sub-state; high-volume facility.bed.status_changed.v1 event.
Stories: FAC-US-012, FAC-US-013, FAC-US-014
FAC-EPIC-04 — Resource catalog & scheduling handoff
| Field | Value |
|---|---|
| Issue type | Epic |
| Summary | Rooms, equipment, and other resources available to scheduling |
| Status | To Do |
| Priority | Should |
| Labels | service:facility-service, domain:facility, slice:S1 |
| Components | resource-catalog |
| Fix version | M1 |
| FR references | FR-FAC-RES-001..003 |
| Legacy FR refs | FR-FAC-004 |
| Dependencies | FAC-EPIC-02, SCHED-EPIC-02 |
| Rollup status | Not started |
Business outcome: Enables multi-resource appointment booking (provider + room + equipment).
Description: ResourceCatalogItem CRUD with tenant-wide or location-scoped resources; status lifecycle; events consumed by scheduling-service to build slots.
Stories: FAC-US-015, FAC-US-016
FAC-EPIC-05 — Provider memberships & context cache
| Field | Value |
|---|---|
| Issue type | Epic |
| Summary | Provider↔Node memberships and low-latency context lookup |
| Status | To Do |
| Priority | Must |
| Labels | service:facility-service, domain:facility, slice:S1 |
| Components | membership, cache |
| Fix version | M1 |
| FR references | FR-FAC-MBR-001..004, FR-FAC-CTX-001..002 |
| Legacy FR refs | FR-HIER-MBR-001..004 |
| Dependencies | FAC-EPIC-01, PROVDIR-EPIC-01 |
| Rollup status | Not started |
Business outcome: Access-policy and every clinical service scope correctly.
Description: ProviderNodeMembership with effective-from/to, at-most-one-primary rule. Redis-cached context lookup p99 ≤ 20ms; event-driven invalidation within 30s.
Stories: FAC-US-017, FAC-US-018, FAC-US-019
FAC-EPIC-06 — FHIR & HMIS interop
| Field | Value |
|---|---|
| Issue type | Epic |
| Summary | FHIR Organization/Location/HealthcareService projection |
| Status | To Do |
| Priority | Must |
| Labels | service:facility-service, domain:interop, slice:S2 |
| Components | fhir |
| Fix version | M2 |
| FR references | FR-FAC-FHIR-001..004 |
| Legacy FR refs | (SPEC §6, §10) |
| Dependencies | FAC-EPIC-02, INTEROP-EPIC-01 |
| Rollup status | Not started |
Business outcome: External HMIS/EHR partners can discover facilities and services.
Description: FHIR R4 projection of internal hierarchy; HL7v2 PV1 alignment; HMIS dimensions export.
Stories: FAC-US-020, FAC-US-021
FAC-EPIC-07 — Import/export & multi-site onboarding
| Field | Value |
|---|---|
| Issue type | Epic |
| Summary | Snapshot-based facility definition import/export |
| Status | To Do |
| Priority | Should |
| Labels | service:facility-service, domain:facility, slice:S4 |
| Components | import-export |
| Fix version | M3 |
| FR references | FR-FAC-IO-001..003 |
| Legacy FR refs | FR-FAC-005 |
| Dependencies | FAC-EPIC-02, FAC-EPIC-05 |
| Rollup status | Not started |
Business outcome: Fast onboarding for new tenants migrating from legacy systems.
Description: Bulk JSON import with mandatory dry-run, transactional apply, rollback on failure; full snapshot export for DR and audit.
Stories: FAC-US-022, FAC-US-023
FAC-EPIC-08 — Reliability & quality controls
| Field | Value |
|---|---|
| Issue type | Epic |
| Summary | SLIs, SLOs, chaos tests, coverage gate |
| Status | To Do |
| Priority | Must |
| Labels | service:facility-service, domain:ops, slice:S0 |
| Components | observability |
| Fix version | M1 |
| FR references | NFR-FAC-001..005 |
| Legacy FR refs | NFR-FAC-001, NFR-HIER-001..005 |
| Dependencies | FAC-EPIC-01..07 |
| Rollup status | Not started |
Business outcome: Platform-wide trust in facility-service as the hot path.
Description: Dashboards, alerts, tracing, outbox SLO, p99 guarantee, chaos drills.
Stories: FAC-US-024, FAC-US-025, FAC-US-026