Skip to main content

Traceability Matrix: Offline-First Platform

Version: 1.0
Date: 2026-03-28
Companion: SPEC.md, TECHNICAL_REQUIREMENTS.md


1. Functional requirement traceability

FR IDSummaryEvidence / test expectation
FR-OFF-001Local drafts and queue scoped to tenantModule E2E + manual test plan when client outbox exists; TESTING_STANDARDS.md sync/offline row
FR-OFF-002Stable mutation id + server idempotencyregistration controller tests for Idempotency-Key / cache; future ehr-web integration tests
FR-OFF-003Reconcile server outcomesClient unit tests (future outbox); service contract tests
FR-OFF-004Conflicts surfacedModule specs (e.g. optimistic lock 409)
FR-OFF-005Modules document offline scopeEach specs/modules/<m>/SPEC.md
FR-OFF-006NATS server-onlyArchitecture review; no client NATS

2. Technical requirement traceability

TR IDSummaryEvidence
TR-OFF-001..003Mutation identity + idempotent responseregistration patients.controller.ts, unit tests
TR-OFF-005BFF forwards idempotencyFuture: ehr-web app/api/registration/patients/route.ts headers
TR-OFF-006Kong preserves headersInfra review; kong.yml
TR-OFF-007..008Retry/backoffClient implementation (future)

3. Platform adoption by module (phase)

Module / areaOffline phaseNotes
registrationServer idempotencyPOST /v1/patients with Redis-backed dedupe; see registration API_DOCS.md
ehr-web (registration UI)Online-firstNo unified IndexedDB outbox; users rely on network; align with FR-OFF-002 when outbox ships
orders / requisitions (CPOE)Target (drafts)Retired standalone reqref spec; use orders-cpoe/SPEC.md + ADR-0046; offline drafts align with CPOE / DMS
clinical-notes (consolidated)TargetDraft sync in consolidated package; module spec governs
appointments (consolidated)TargetPending booking queue per package
PlatformSPEC + TRThis folder

Phases: noneserver-idempotency onlyclient queue plannedimplemented.


4. Test case catalog (platform)

Test IDAreaDescription
TC-OFF-001IdempotencyDuplicate POST /v1/patients with same key returns same patient id
TC-OFF-002Tenant scopeIdempotency key does not collide across tenants
TC-OFF-003ConflictStale version on PUT returns structured 409
TC-OFF-004Sync/offlineQueue replay does not double-apply server effects (future client suite)

Where implemented: registration Jest tests cover TC-OFF-001 partial (same controller). Full cross-tenant TC-OFF-002 should live in integration tests when added.