Skip to main content

ADR-0044: Ghasi e-prescribing gateway — Canonical persistence for interop FHIR medication resources

Status: Accepted
Date: 2026-04-04
Deciders: Platform / Ghasi e-prescribing gateway module owners
Related: ADR-0043, specs/modules/ghasi-e-prescribing-gateway/SPEC.md

Context

ADR-0043 defines the Ghasi e-prescribing gateway bounded context; persistence of interop medication resources required a concrete choice for schema design, search ownership, and subscription fan-out. This ADR records that decision for e-prescribing-gateway.

Decision

  1. e-prescribing-gateway stores authoritative FHIR JSON for resources it mediates at the interoperability boundary: at minimum MedicationRequest and MedicationDispense (plus persisted Subscription and operational tables for idempotency, outbox, DLQ).

  2. Clinical ownership (product semantics) remains with EHR (prescribing intent) and Pharmacy (fulfillment UX and ERP). Ghasi e-prescribing gateway persistence is the interop system of record for cross-product workflow: validated FHIR, routing metadata, correlation IDs, and versions used for ETag / Subscription delivery.

  3. EHR and Pharmacy backends SHOULD treat Ghasi e-prescribing gateway as the write target for medication interop operations they initiate (POST/PUT scoped by persona). They MAY retain local copies for UI/offline; reconciliation uses business identifiers, correlation IDs, and ETag per SPEC.md FR-RX-004 / FR-RX-005.

  4. Multi-tenant routing (EHR tenant A → pharmacy tenant B) is supported in later iterations: MVP contract tests run with same tenant for prescriber and pharmacy clients; extended routing tables and visibility rules are documented in the module spec, not duplicated here.

  5. IG validation: Runtime validation uses structural checks + pinned fixtures in CI (see TECHNICAL_REQUIREMENTS.md); full in-process HAPI alignment may follow without changing this persistence decision.

Consequences

  • Positive: Single clear source for contract tests, audit, subscriptions, and idempotency; matches “gateway mediates” language in ADR-0043.
  • Negative: EHR/Pharmacy must sync or delegate writes to avoid drift; operational need for replay/backfill if a client bypasses the gateway (out of scope for MVP).

Compliance

This ADR satisfies the Phase 0 gate in PHASED_IMPLEMENTATION_PLAN.md for persistence ADR closure.