Skip to main content

Backend and Service Map (Desktop EHR)

Version: 1.0
Date: 2026-03-31
Companion: SPEC.md, ../../../MODULE_INDEX.md

This document maps personas/features to module specs, service folders under apps/services, and API documentation entry points. It includes a sync/offline write column: whether the platform currently exposes documented idempotent writes suitable for outbound replay (verify in code before claiming “done”).

Legend — Offline write posture:

ValueMeaning
Yes (partial)At least one write path has known idempotency (Idempotency-Key / clientMutationId) in service code or module API docs.
PlannedModule spec targets offline; server idempotency may be incomplete — implement read/cache + queue only after TR verification.
Online-firstDepends on live external systems, realtime, or internal-only routes — expect online-only or heavy degradation offline.

1. Governance, identity, and platform configuration

Used by all personas for login, tenant, licensing, and effective config.

ConcernModule folderService folderAPI / docs pointerOffline write
IAM / identitymodules/iam/iamAPI_DOCS.mdOnline-first (token issuance)
Hierarchymodules/hierarchy/hierarchyAPI_DOCS.mdOnline-first
Access policymodules/access-policy/access-policyAPI_DOCS.mdOnline-first (evaluate live)
Config resolvermodules/config-resolver/config-resolverAPI_DOCS.md, CONFIG_MODEL.mdCache reads offline; writes online-first
Licensingmodules/licensing/licensingAPI_DOCS.mdCache entitlement snapshot; admin changes online-first
Tenantmodules/tenant/tenantAPI_DOCS.mdOnline-first for admin mutations
Platform adminmodules/platform-admin/platform-adminAPI_DOCS.mdOnline-first
Auditmodules/audit/auditAPI_DOCS.mdClient emits via APIs that reach audit; follow module flows

Edge routing: API_PATH_CONVENTIONS.md — browser/desktop use Kong-public /api/... and /v1/... as exposed; never ship /internal/... from the desktop client.


2. Clinical EHR (clinician / nurse personas)

Feature areaModule folderService folderAPI docsOffline write
Patient chartmodules/patient-chart/patient-chart-serviceAPI_DOCS.mdPlanned — verify versioning
Registrationmodules/registration/registrationAPI_DOCS.mdYes (partial)POST /v1/patients idempotency (see offline-first pack)
Clinical notesmodules/clinical-notes/clinical-notesAPI_DOCS.mdPlanned — signing rules may need online
Orders / CPOEmodules/orders-cpoe/ordersAPI_DOCS.mdYes (partial) — orders service supports Idempotency-Key on create
Resultsmodules/results/resultsAPI_DOCS.mdOnline-first for fresh feeds; cache reads offline
Medicationsmodules/medication-management/medicationAPI_DOCS.mdPlanned
Allergiesmodules/allergies/allergiesAPI_DOCS.mdPlanned
Vitalsmodules/vitals/vitalsAPI_DOCS.mdPlanned
Problem listmodules/problem-list/problem-listAPI_DOCS.mdPlanned
Immunizationsmodules/immunizations/immunizationsAPI_DOCS.mdPlanned (licensed add-on)
Care plansmodules/care-plans/care-plans-serviceAPI_DOCS.mdPlanned (licensed add-on)
Provider directorymodules/provider-directory/provider-directoryAPI_DOCS.mdCache offline
Schedulingmodules/scheduling/schedulingAPI_DOCS.md, SPEC.md FR-DSK-015/016, UI_AND_DESIGN_PARITY.md §8Online-first for live free/busy and instant holds; cached calendars + queued intents offline; rich UI + OS notifications on desktop per product
Facilitymodules/facility-management/facilityAPI_DOCS.mdAdmin-heavy; online-first
Requisitions / referralsRetiredorders-cpoe, document-managementorders, document-managementRETIRED.md, ADR-0046CPOE + DMS
Terminologymodules/terminology/terminologyAPI_DOCS.mdCache reads offline

3. Financial, insurance, and add-on clinical systems

Feature areaModule folderService folderAPI / docsOffline write
Billingmodules/billing/billingOnline-first for live financial posts
Claimsmodules/claims/claimsOnline-first (clearinghouse / submission)
Insurancemodules/insurance/insuranceOnline-first for eligibility / payers
Laboratory LISmodules/laboratory-lis/laboratory-lisOnline-first for live lab interfaces
Radiology PACSmodules/radiology-pacs/radiology-pacsOnline-first for streaming / DICOMweb
Messagingmodules/messaging/messagingAPI_DOCS.md, NOTIFICATIONS_PLATFORM.mdOnline-first for live delivery
AI orchestratormodules/ai-orchestrator/ai-orchestratorCloud: AI_PLATFORM.md — HTTPS to Kong /v1/ai/... only; offline unless local engine enabled. Local on-device inference does not replace server audit/orchestrator obligations unless product defines hybrid sync — see SOLUTION_DESIGN.md §11, TECHNICAL_REQUIREMENTS.md §10
Patient portal (server)modules/patient-portal/patient-portal-apiN/A for desktop EHR persona focus

4. Interoperability gateways

SurfaceModule / appNotes
FHIR R4modules/fhir-gateway/, fhir-gatewayUse /fhir/R4/... per API_PATH_CONVENTIONS.md when FHIR is the contract.
HL7 v2modules/hl7v2-interop/Server-side; not a desktop broker.

5. Suggested dependency order for desktop vertical slices

  1. Shell + auth + session (IAM, token storage, tenant selection).
  2. Licensing + config-resolver cached snapshot + guards (match ehr-web behavior).
  3. Registration — strong idempotency story for offline create.
  4. Patient chart + chart submodules — read-heavy cache, then writes per module TR.
  5. Orders — partial idempotency already in codebase.
  6. Scheduling — rich calendar/agenda UI + notifications (SPEC.md FR-DSK-015/016); align with scheduling online-first rules.
  7. AI assist — cloud orchestrator integration; optional local engine behind policy flags (AI_PLATFORM.md).
  8. Admin / platform flows last or web-only depending on product.

6. Maintenance

When a module gains idempotent offline replay, update this table and TRACEABILITY_MATRIX.md. Source of truth for REST shapes remains each module API_DOCS.md and Kong infra/kong/*.yml.