Skip to main content

09 — Frontend Workflows and User Journeys

Status: populated Last updated: 2026-04-18 Companion: 07 epics-and-user-stories · 08 frontend-design-guidelines · 16 offline-first · 13 security-compliance-tenancy

This document enumerates the canonical end-to-end UI workflows across the seven Ghasi-eHealth surfaces. Each workflow declares: actors, role-based UI variants, services touched, state model, offline fallbacks, and links to the J-NN journey in 07 §4.

1. Critical-path workflow map

IDWorkflowPrimary surfaceJourney linkE2E gate
W-01Clinician sign-in → patient list → chart → order → signClinician WebJ-03Yes
W-02Registration desk intake (new patient, returning patient, emergency)Registration StationJ-02, J-17Yes
W-03Scheduling — book, reschedule, cancel, waitlist, overbookScheduling view in Clinician Web + Patient PortalJ-02, J-10Yes
W-04Pharmacy / dispense — queue, verify, counsel, label, dispensePharmacy PortalJ-04, J-18Yes
W-05Lab workflow — accession, specimen, instrument feed, verify, releaseLab PortalJ-05, J-12Yes
W-06Patient portal — account, appointments, results, messages, demographic updatePatient Portal Web + MobileJ-09, J-10, J-12, J-21Yes
W-07Virtual visit — pre-visit checklist → call → note → billVirtual Care RoomJ-08Yes
W-08Field immunization clinic (full offline)Provider MobileJ-07, J-25Yes
W-09Radiology report draftingClinician Web (radiologist persona)J-06Yes
W-10Break-glass emergency accessClinician Web (any)J-17Yes

2. Cross-workflow conventions

  • Every workflow logs analytics events to the observability pipeline (12 observability-telemetry).
  • Every workflow honors LTR + RTL; visual regression suite covers both.
  • Every workflow has a documented offline fallback (or explicitly states "online-only" with rationale).
  • Every PHI read/write emits an audit.* event before the user-facing response completes.
  • Every AI-assisted step surfaces provenance and a HITL signature step.

W-01 — Clinician clinical workflow

Actors: Physician, nurse, resident, charge nurse, midlevel. Surfaces: Clinician Web (primary), Provider Mobile (read-only chart + quick note). Services touched: identity · patient-chart · orders · medication · terminology · laboratory · radiology · communication · audit · ai-gateway (optional scribe).

State diagram

Step-by-step

#StepAcceptanceOffline fallbackAI
1Sign in via Keycloak (OIDC)JWT + device-bind on trusted workstationsDesktop station: last-good token cached 8 h
2Land on patient list (assigned + ward)Sortable by triage / last-vitals / stat-ordersCached worklist (last 24 h)Cohort triage hint (opt-in)
3Open chartAllergy banner, active problems, active meds, last vitals in < 2.5 s p75Read-only chart from cache
4Review longitudinal dataTimeline widget scrubbing encountersRead-onlySummary card
5Order entryUnified CPOE card with DDI + allergy + duplicate checkQueued locally, sealed; released on reconnectOrder set suggest
6Sign ordersPIN / WebAuthn step-upQueued with counter-signature
7Document noteRich-text + structured blocks; template libraryDrafted locallyScribe (see W-07)
8Sign noteAttested; immutable afterwardQueued

Role-based variants

RoleVariant
PhysicianFull CPOE, full note authoring, sign authority
ResidentCPOE with co-signing required from attending
NurseNo CPOE; vitals entry, med admin rec, structured notes
Charge nurseWard-level census view; assignment UI
MidlevelScope-limited CPOE (no controlled substances unless credentialed)

Offline fallback

On desktop: queued writes held in SQLite outbox, visible in Sync Center. On Provider Mobile: read-only chart from Realm cache; new notes queued as append-only.


W-02 — Registration desk workflow

Actors: Registration clerk, triage nurse, cashier. Surfaces: Registration Station (Electron desktop, Windows / macOS / Linux). Services touched: registration · identity · patient-chart · scheduling · facility · insurance (claims) · document · communication · audit.

State diagram

Variants

ScenarioVariant
New patientFull demographics, consent, biometric capture (photo, ID scan), guardian if minor
Returning patientIdentity match (NID + DOB + phone) → confirm demographics → new encounter
Emergency walk-inSkip scheduling; create "John/Jane Doe" stub; reconcile identity later
Outreach enrolmentOffline registration on mobile; sync reconciliation at return
Cross-facility transferAccept external identity via interop-service; MRN reconciliation UI

Offline fallback

Full offline support. SQLite outbox persists all registrations. Identity match falls back to local index; "deferred match" state if server index unavailable. All PHI writes carry clientMutationId for idempotent replay on reconnect.

Key form affordances

  • Name fields accept bidi text; <bdi> isolates Latin drug names inside Dari sentences.
  • Date of birth: Solar Hijri + Gregorian picker; stored as ISO-8601.
  • National ID (Tazkira) + biometric capture hooks.
  • Consent: versioned policy text; signed; audit log.

W-03 — Scheduling workflow

Actors: Scheduler, clerk, clinician, patient (portal), nurse. Surfaces: Clinician Web (scheduling module), Patient Portal, Patient Mobile. Services touched: scheduling · provider-directory · facility · communication · patient-portal · audit.

Sub-workflows

SubDescriptionRole variants
BookSearch slots by provider / specialty / location / date → confirmStaff can overbook; patient cannot
RescheduleMove an existing appointment with conflict checkPatient limited to 1 self-reschedule / appt
CancelWith policy-driven confirmation + optional reason
WaitlistAdd to waitlist; auto-promote when slot opensOpt-in by patient
OverbookStaff-only; requires reason codeAudit event mandatory
Resource bookingBook facility resource (bed, exam room, infusion chair)Staff only

State (per appointment)

Offline fallback

Read-only slot list from cached facility schedule. Booking is online-only (server must validate slot availability authoritatively). On reconnect, stale views refresh via NATS-driven cache invalidation.


W-04 — Pharmacy workflow

Actors: Pharmacist, pharmacy tech, dispenser, cashier. Surfaces: Pharmacy Portal (Next.js web). Services touched: medication · ghasi-eprescribing-gateway · orders · terminology · billing · audit.

Queue → verify → counsel → dispense flow

Step variants

StepNotes
QueuePoll / subscribe to eprescribing.gateway.medication_request.*
VerifyPharmacist checks DDI, allergy, therapeutic duplication; may substitute with prescriber approval
LabelPrint specimen/dose label with bilingual instructions
CounselPatient education; bilingual material; record counseling event
DispenseStock decrement, controlled-substance check, MedicationDispense back through gateway
RejectReason code; notify prescriber via communication-service

Offline fallback

Partial — read queue from last-sync cache; writes queued. Controlled-substance dispensing is online-only (requires canonical stock authority).


W-05 — Lab workflow

Actors: Lab tech, pathologist, accessioning clerk. Surfaces: Lab Portal (Next.js). Services touched: laboratory · orders · interop (instrument feeds, HL7 v2) · patient-chart · communication · audit.

Flow

Role variants

RoleCapabilities
Accessioning clerkReceive, label, route to worklist
Lab techRun, enter manual results, flag critical
PathologistVerify, sign, release
SupervisorReopen, correct, delta-release

Offline fallback

Instrument bench can operate offline via local HL7 buffering in the interop-service adapter. Result release to patients is online-only (consent gating).


W-06 — Patient portal workflow

Actors: Patient, guardian, caregiver. Surfaces: Patient Portal Web + Patient Mobile. Services touched: identity (portal realm) · patient-portal · scheduling · patient-chart (read) · laboratory (released results) · communication · audit.

Sub-workflows

SubSteps
AccountSign-up (OTP + phone verify) → identity match → link to chart
AppointmentsView, book, reschedule, cancel
ResultsReleased-only; annotated with clinician message if any
MessagesSecure thread with care team (async, non-urgent)
DemographicsPatient-initiated update → clinic review queue
Consent & DSARConsent change, data export, deletion (DPO-mediated)

Offline UX

Mobile: read-only cache of last-seen chart, results, and appointments. No writes queued from portal (by policy — patient writes require online confirmation to prevent impersonation replay attacks).

Role variants

PersonaVariant
PatientFull self-service
Guardian (minor)Delegated access; minor-rules (no sensitive categories until age of majority)
Caregiver (delegated)Patient-granted scoped access; time-boxed

W-07 — Virtual visit workflow

Actors: Clinician, patient, optional interpreter. Surfaces: Virtual Care Room (Next.js + Jitsi SDK). Services touched: virtual-care · communication · identity · patient-chart · billing · ai-gateway (scribe) · audit.

Flow

Pre-visit checklist

  • Tech check — camera, mic, network speed.
  • Consent to telemedicine (versioned policy).
  • Reason for visit and vital self-entry (patient).
  • Pharmacy preferences confirmed.

Offline fallback

Online-only. If connection degrades, session FSM transitions to RECONNECTING; session auto-ends after TIMEOUT with state preserved for resumption within 15 min.


W-08 — Field immunization clinic (full offline)

Actors: Outreach nurse, team lead. Surfaces: Provider Mobile (Expo + Realm). Services touched: immunizations · registration · patient-chart · interop · population-health · audit.

Flow

Offline model

  • Full offline capability — patient identification (NID scan, biometric), dose administration, consent, AEFI recording.
  • Local Realm DB; append-only events; MAC-signed batches.
  • Conflict policy per aggregate: Patient — server-authoritative (MPI); Immunization — append-only; Consent — LWW + diff (manual resolution on re-enrol).
  • Bundle re-sync in ≤ 60 s for ≤ 10 MB per device after reconnect.

HMIS linkage

Verified doses project into population-health-service daily aggregates; monthly indicator exports to MoPH via interop-service.


W-09 — Radiology report drafting

Actors: Radiologist, resident, technologist. Surfaces: Clinician Web with radiologist persona layout + viewer launch (external DICOM viewer). Services touched: radiology · orders · patient-chart · document · ai-gateway · audit.

Flow

#Step
1Pick worklist entry by modality / priority
2Launch viewer (signed URL; DICOM studies)
3AI draft summary streams into report pane
4Radiologist edits, adds impression, signs
5Report released → chart + communication to ordering clinician

AI provenance

Every AI-drafted report section carries provenance badge; radiologist signature = human attestation; reports without a human signature cannot release.


W-10 — Break-glass workflow

Actors: Clinician in emergency. Surfaces: Clinician Web. Services touched: identity · patient-chart · audit.

Flow

  1. Clinician attempts access outside ABAC scope (e.g., patient on another ward).
  2. Access-policy denies; UI offers "Break-glass" with reason codes.
  3. Clinician confirms with step-up (PIN / WebAuthn).
  4. Access granted for time-boxed window (default 4 h).
  5. Elevated audit event fires (audit.breakglass.invoked).
  6. Compliance review queue receives the event; manual review within 24 h.

Offline behaviour

On desktop with last-good ABAC decisions cached: break-glass decisions are queued; audit event signed locally; flushed on reconnect with tamper detection.


3. Notifications and messaging

Every workflow emits notifications through communication-service:

TriggerChannel defaultUrgencyTemplate
Appointment bookedSMS + portal inboxnormalappt.booked
Appointment tomorrowSMS + pushnormalappt.reminder.24h
Result releasedportal inbox (SMS if opted)normalresult.released
Critical resultcall + SMS + pushcriticalresult.critical
Rx readySMSnormalrx.ready
DSAR exportportal download linknormaldsar.ready

PHI never leaks into push / SMS payloads — templates are generic; detailed content accessed only in authenticated surface.

4. Error and exception patterns

  • Validation errors — inline, aria-describedby tie; surface stable error code; never raw stack.
  • ABAC denials — neutral message + optional break-glass invitation (W-10).
  • Licensing denials — inline with "contact administrator" affordance.
  • Network loss — Sync pill flips to offline; in-flight mutations preserved; user informed non-blockingly.
  • AI refusal — clear, neutral; rephrase invitation.
  • Audit write failure — the entire write is rolled back; user sees "Try again".

5. Why this set of workflows

These ten workflows cover every licensed module and every persona in the platform. Each has an E2E gate because they represent the workflows where regressions would be noticed first by clinical staff and where failure has real-world patient-safety implications. Offline fallbacks follow 16 offline-first invariants; AI affordances follow 08 design guidelines §10. Role-based UI variants reuse the same component tree — divergence is carried in Zustand role selectors, not in duplicate screens.

6. Open questions

  • Final shape of the pharmacy counseling capture on mobile pharmacies in field deployments.
  • Whether virtual care should offer a peer-to-peer fallback (without media server) for low-bandwidth scenarios.