Skip to main content

The apps: who uses what, and how

Every app talks to the same backend (/api/ops/*) and the same incidents. A call made from the iPhone appears on the dispatcher console within a second. A unit status change from the crew app moves the map, updates the caller's ETA and alerts the ER.

AppPlatformUserSource
Dispatcher terminalWeb /Control-room dispatcherfrontend/src/terminal/ (Terminal.jsx, registry.js, panels.jsx, TerminalMap.jsx, hotkeys.js, Overlays.jsx) reusing frontend/src/live/IncidentDetail.jsx, Panels.jsx
Classic consoleWeb /classic—frontend/src/live/LiveConsole.jsx: the earlier fixed three-column console
ER commandWeb /hospital?h=<id>Emergency departmentfrontend/src/hospital/ErCommand.jsx
Crew web appWeb /ambulance?unit=<id>Ambulance crew (browser / PWA)frontend/src/live/AmbulanceApp.jsx, outbox.js, public/sw.js
Browser 108 lineWeb /callerTesting the voice line from a browser, or reporting by tapping answers (questionnaire)frontend/src/live/CallerLine.jsx
Voice debug pageWeb /debug/voiceDeveloperbackend/app/static/voice_debug.html
Vaazhvu (citizen)iOSMember of the publicios/Vaazhvu/Citizen/ + Shared/
VaazhvuCrewiOSAmbulance crewios/Vaazhvu/Crew/ + Shared/
Legacy viewsWeb /legacy, /legacy/hospital, /legacy/ambulance—Original scenario demo; needs the backend started with VAAZHVU_LEGACY=1, otherwise the page says so
AmbulanceCompanioniOS Swift package (ios/AmbulanceCompanion)—Earlier crew app, superseded by VaazhvuCrew

Dispatcher terminal (/)​

Dispatcher terminal

The control room, built as a keyboard-first terminal with dockable panels. Everything is live over Server-Sent Events (/api/ops/stream), so nothing needs refreshing.

Screen

  • Top bar: command line, live KPIs (active, holds awaiting a human, free ambulances, 8-minute coverage, sim clock), workspace switcher, full screen, connection state.
  • Ticker: a scrolling strip of every live job (severity, status, assigned unit and ETA). Click a job to open it; hover pauses the strip.
  • Panels: thirteen dockable panels, listed below. Drag a tab onto any edge or tab bar to rearrange. Drag the gaps to resize. Double-click a tab bar to maximise. Right-click a tab for its menu. Pop a panel out into its own window for a second monitor (all except the map).
  • Status bar: SSE state, last event sequence, events per minute, workspace, focused panel, current mode (closure, location pick), and a hint while a g chord is pending.
  • Alerts: new calls, critical triage, holds awaiting authorisation, escalations, deteriorating patients, units going out of service and pipeline errors pop up bottom-right. Press Y or click to open the incident.
PanelKeyContents
Incidents1Queue: holds first, then by severity. Live age timers, severity mix bar, active / closed toggle
Map2Units glide between telemetry ticks with a heading arrow. The selected job's route animates. Destination hospital, 4k+ receiving EDs as dots, zones, closures. Follow mode, fit, layer toggles
Incident3Header with confidence; progress stepper (received → triaged → dispatched → on scene → transport → hospital → closed); actions; severity belief; safety policy; destination with ER board and FHIR links
Dispatch4Dispatch intelligence: chosen bundle, alternatives, why the nearest unit was rejected
Conversation5The caller thread (voice and text), with dispatcher reply
Triage6Findings with the caller's words as evidence, and the call → language pipeline (Tanglish spans in v2)
Vitals7Live vitals with sparklines and NEWS2
Units8Fleet table, coverage recommendation, fail / restore
Events9Event stream with kind filters (alerts, dispatch, AI, medical, messages), selected-incident filter, freeze / resume
Call-takingG NRecord or upload a voice call, type a transcript, SMS, SOS
HospitalsG HSearchable receiving hospitals with cath lab / trauma / diversion filters; click to fly there
CoverageG ZExpected demand covered in 8 min, zones from worst to best, redeployment
CopilotG PAsk in plain words about the selected incident or live operations: "why not the nearest?", "which hospital?", "free ALS units near Guindy?", "simulate a trauma call". Answers come from Vaazhvu's records through its MCP tools, and each tool used shows as a chip (MCP · explain_dispatch · 3 ms, simulation tools marked SIM). It cannot dispatch, approve or override. Command line: Copilot: brief me / why not the nearest / why this hospital (AI access and the Copilot)

Workspaces. F1 Dispatch, F2 Call-taking, F3 Map wall, F4 Analysis, F5 Compact (all panels in one group; the default on phones). Alt+1–Alt+5 also work. Each workspace remembers its own arrangement in the browser. Alt+0 resets the current one.

Keyboard. Press ? for the full sheet; every action is also in the command line (⌘K / Ctrl+K, or /).

KeysAction
J / K (or ↓ / ↑ in Incidents)Next / previous incident
⇧J / ⇧KNext / previous unit (the map flies to it)
WNext incident awaiting a human
AApprove the recommended dispatch (confirm with ↵)
OOverride: pick a unit (nearest first), then type a reason
RReply to the caller
XClose the incident (confirm)
⇧DLink the call as another caller for an open incident (merge; nearest first)
⇧USplit a linked call into its own incident (it is then triaged and dispatched)
⇧PPause / resume the simulation (command line: "Demo speed 1× / 2× / 5× / 10×")
LSet the caller's location on the map
NNew call / SMS / SOS
FFollow the working unit; ⇧F shows the whole fleet; . fits the selected job
CRoad closure: click a road
+ / -, arrows (map focused)Zoom, pan
1–9, G + letterJump to a panel (opens it if closed)
Alt+arrowFocus the panel in that direction
Alt+Shift+arrowMove the panel into the neighbouring group (or dock it on that edge)
Alt+Ctrl+arrowSplit the panel off into a new group on that side
Z / Alt+EnterMaximise / restore
Alt+[ / Alt+]Previous / next tab in the group
Alt+P / Alt+WPop out / close the panel
Alt+TAmber / Night theme

The command line also finds incidents by number (0042), units (A12), hospitals by name, panels, demos (config/demo.yaml), demo speed, map layers, closures to clear, and unit fail / restore.

On the map and in the queue. A dashed circle around an incident shows how far the scene may be from the pin (GPS accuracy, or how coarse the named place is; config/geo.yaml). A unit with a green GPS tag is driven by its crew device's live position, not the simulator. Calls within clustering.radius_m / window_sec of an open incident that describe a shared finding are linked to it automatically: ↳ 4117 in the queue marks the extra caller, +1 CALLER the incident it joined; no second ambulance goes. The ECG rhythm strip appears in Vitals when a monitor sends one.

Roles. Each role opens in its own workspace (config/platform.yaml roles.*.home: dispatcher → Dispatch, call-taker → Call-taking, viewer → Map wall) and the terminal remembers per role what you switch to. Panels a role may not use (Analytics, Integrations) say so instead of erroring; crew and ER staff get a pointer to their own app (/ambulance, /hospital).

What a dispatcher can do

ActionHowWhat happens
ApproveA, or Approve on an incident awaiting a humanCommits the recommended units
OverrideO: pick a unit, give a reasonCommits your choice; audited
Fix locationL, then click the mapRe-geocodes, re-dispatches if still waiting
Reply to callerR or the Conversation boxMessage lands in the caller's chat
RedeployApply redeployment (Units or Coverage)Moves an idle unit to cover the zone
Fail a unitfail on a unit, or the command lineUnit goes out of service; its incident is re-dispatched
Road closureC, then click a roadUnits whose route crosses it are re-routed
Create callsCall-taking panel (N)Same intake as real callers
Run a demoCommand line: “demo”Scripted multi-call scenarios
Ask the CopilotCopilot panel (G P)An answer built from MCP tool results; simulations it runs are labelled and audited

The earlier fixed three-column console is still at /classic.


ER command (/hospital?h=<hospital id>&tab=&case=)​

ER command, patient view

The receiving emergency department's view of every patient Vaazhvu brings to it (frontend/src/hospital/, backend ops/er_handoff.py, ops/outreach.py, api_hospital.py). It asks for a sign-in: each hospital has its own account (make hospital-accounts, or the admin portal), and once signed in its staff see only the patients routed to their hospital, the transfers addressed to it, and its own resources and history. Dispatchers, administrators and supervisors may open any hospital's board (picker) to oversee it. Light, dark or follow-the-system theme (top bar). Data comes from hospital-scoped endpoints and a hospital-scoped stream (payload-free pings), so the board never receives another hospital's patients or a caller's number.

  • Status bar (every tab): ED status (Accepting / Limited / Diversion / Temporarily unavailable), cardiac and trauma diversion, ER load, beds, and how fresh the capacity report is. A change that can reroute patients is previewed first ("1 inbound patient affected: will be rerouted").
  • Dashboard: incoming / critical / specialist-prep counts, next arrival, arrived awaiting the ER, capacity with freshness, transfers awaiting an answer, a "Needs attention" list, and What changed? (clinical, operational, hospital and referral changes, each with the action it needs).
  • Incoming: the queue, most urgent first (arrived, critical, deteriorating, arriving now, specialist prep, rerouted here, not acknowledged; then ETA to this hospital). The selected patient shows:
    • the handoff summary (presentation, evidence, current vitals, NEWS2, required capability, ambulance and ETA, destination rationale, what to prepare);
    • Acknowledge pre-alert and Cannot receive… (with a reason: Vaazhvu leaves this hospital out and sends the patient to the next one);
    • deterioration alerts (NEWS2 before → after, consequence) and Why did the decision change?;
    • clinical presentation as "Suspected …" with the severity distribution and confidence; Why this assessment? (the caller's words, findings present / denied / uncertain, k/n sample agreement, uncertainty) with the safety policy contribution shown apart from the AI; Why this ambulance? (why the nearest unit was not chosen); Why this hospital? (capability, diversion, readiness, drive time, load, the alternatives);
    • live tracking (scene, ambulance, this hospital, the road ahead; ETA to this hospital, an estimate via the scene until the patient is on board), live vitals with missing parameters named, ambulance and crew, caller, and the full timeline;
    • Prepare for arrival: items by category (bay, equipment, team, procedure) from config/er_prep.yaml, each Not started / In progress / Ready / Not available / Not required, saved with who and when;
    • on arrival, PATIENT ARRIVED with ACCEPT PATIENT (department, handover notes) or REQUEST IFT (structured reason, what the receiving hospital must provide, candidate hospitals with capability, status, beds, specialists and transfer time, then the referral trail: awaiting response / no answer / declined / accepted, and "Send to the next hospital").
  • Resources: what Vaazhvu's hospital selection reads now, physical capacity (ER beds, resus bays, ICU, monitored beds, theatres, ventilators, cath lab available now, load), capabilities and specialists (on site / on call / unavailable), each with source, who and LIVE / recent / stale / no information; per-figure history.
  • Referrals: transfer requests to this hospital (accept / decline with a reason) and the ones it sent.
  • History: cases handled here and every action taken (audit), with resource changes.

Crew names, the patient's name and the caller's relationship to the patient are not recorded anywhere, so the board says "not recorded" rather than showing a value.


Crew web app (/ambulance?unit=A01)​

Crew web app

A browser or PWA version of the crew screen. Sign-in: username, password and unit (POST /api/auth/login {unit_id}); the session may act only on that unit. In open mode the crew may also continue without an account. End shift signs out. If the session expires, writes are held in the outbox and a sign-in prompt appears. It shows the assignment, the scene and its Directions link, the next action (plus Take the patient for an ambulance supporting on scene), the receiving hospital choice and vitals entry. Actions are queued in an offline outbox (service worker) and replayed when the connection comes back. The iOS crew app below is the main crew client; this one is for any device.

GPS feed: while a unit is selected, the page watches the device position (navigator.geolocation.watchPosition) and posts it to POST /api/ops/units/{id}/position. It sends at most one fix every crew.gps_interval_sec, and only after the unit has moved crew.gps_min_move_m. If the unit hasn't moved, it still resends once crew.gps_heartbeat_sec has passed. All three values come from config/app.yaml through /api/ops/app/config. Fixes go through the same outbox with captured_at. While dispatch receives fresh fixes, the server stops simulating that unit. The top bar shows GPS LIVE (the server reports position_source: device), GPS: simulated position, No GPS permission, or GPS needs HTTPS, because browsers give GPS only to https or localhost pages. Status updates carry the device fix. Every write is sent as role crew, actor crew <unit>. Watching stops on unit change or page close, and a backgrounded tab gets no GPS.


Browser 108 line (/caller) and voice debug page (/debug/voice)​

Browser 108 line
  • /caller: two tabs.
    • Talk: talk to the AI call-taker from a browser, with a transcript.
    • Type answers (/caller?mode=type): for callers who can't or won't talk. Large Tamil + English chips: what happened, awake and talking, breathing normally, heavy bleeding, how many hurt, approximate age, location (browser GPS if allowed, plus a landmark) and a callback number. It sends the answers as plain question-and-answer text to POST /api/ops/intake/text (channel: app, raw answers in caller.questionnaire), then shows the reference, status and ETA from GET /api/ops/incidents/{id}/public and the call-taker's text replies. Talk to 108 now continues the same incident on the voice line. Labels are in frontend/src/live/questionnaire.js; keys also in ui_text (config/app.yaml) take precedence.
  • /debug/voice: for diagnosing the voice line.
    • Shows every message on the wire with timestamps.
    • Push-to-talk (or open mic).
    • Timers for "release → transcript / first reply / first audio".
    • Save uplink WAV keeps exactly the audio the server received. Replay it with scripts/voice_call_sim.py.

Both need the microphone, so open them on http://localhost:8001.


Vaazhvu — citizen iOS app​

Citizen iOS app

One screen per emergency state, never a dashboard. The root (Citizen/CitizenApp.swift) picks the screen from the state; the emergency screen picks its own layout from the incident (Citizen/EmergencyState.swift).

Onboarding (once) ──▶ Home ──hold SOS──▶ AI call (+ request in parallel) ──▶ On the way ──▶ Arriving ──▶ Help has arrived ──▶ To hospital ──▶ Completed
(or Cancelled)

Onboarding (Citizen/OnboardingView.swift, once, before Home; every screen after the first has a back button, and Emergency now? Call 108 stays at the bottom of each, because an emergency can come before setup is done):

  1. Welcome: the brand mark, one line on what SOS does, Get started. Language toggle top right.
  2. About you: name, mobile number, password (create; or Have an account? Sign in). POST /api/auth/register or /login.
  3. For the ambulance crew: blood group, conditions, allergies, medications, emergency contact. PUT /api/auth/me/profile; sent to the crew with every call.
  4. What SOS needs: location and microphone, asked here so an SOS never stops on a permission prompt. Signing out (or an expired session) returns the app to onboarding; an open emergency always stays on screen.

Home. One overwhelming action, two quieter ones; no ambulance list or map.

  • SOS orb: hold for 1.2 s. Two things start at once: the request goes to /intake/sos with your GPS position (the server assigns the nearest suitable ambulance) and the AI call opens. The call is mandatory, because it is how the agent learns what happened; you may hang up. Its socket joins the incident as soon as the request returns it, so both are one incident. With no GPS fix, a bare map opens to drop a pin first, and the call opens after it closes.
  • Medical ▾ above the orb: what help to send (medical by default; police and fire can be added) in a sheet.
  • Talk to 108 (live voice call with the AI call-taker) and Message 108 (SMS-style thread).
  • த / EN switches the language of the app and the AI. Callers may speak or type Tamil, Tanglish or English either way.
  • The profile button opens Account (your details, reports, sign out). Long-press the vaazhvu title for server settings.

Call screen

  • A strip at the top follows the SOS: Requesting help… → Finding the nearest ambulance → the ambulance and its ETA. Tap it (or ‹) to see the emergency screen; the call keeps running.
  • Greeting / talking / replies / interrupting / pauses: the AI greets you in your language and asks what happened; just talk. Your words appear as You bubbles, its answers as 108 AI bubbles, spoken sentence by sentence. Talk over it and it stops and listens.
  • Dispatch news: when an ambulance is dispatched or arrives, the AI tells you, as soon as nobody is talking.
  • ‹ goes back to the emergency screen; the call keeps running, and a Return to call pill brings you back. The red button hangs up.

Message screen. Type, or tap a suggested phrase. Each message goes to /intake/sms from your number. The AI replies in the same thread, and so does a human dispatcher if they write. Only the text conversation is shown here.

Emergency screen (once an incident exists; data from GET /incidents/{id}/public, refetched on every change ping)

  • Map (full screen, under a floating card): your position, the emergency location, the responding ambulance and the blue line of the road it still has to drive (it shrinks as it moves, and after a cancel shows the way back to base); the destination hospital while transporting; hospitals (smaller, dimmed; tap one for details and directions) and other nearby ambulances, faded. Tap the responding ambulance to send it back. The ambulance and you are framed once in the part of the map above the card; then pan freely.
  • Hero, by phase: Help requested → the ETA in minutes with the ambulance and km left → Arriving now → Help has arrived → time to hospital and its name.
  • Progress: Requested · On the way · With you · To hospital (a checklist at large text sizes).
  • One filled action per phase, pinned to the bottom of the card so it never scrolls away: Talk to 108 while help is being arranged, then Call 108 (the real phone dialler), then Done. Talk / Message / Call 108 are round glass buttons under the progress; Call the ambulance crew appears if the crew gave a number.
  • Location, three states from location_verified / needs_location: confirmed, approximate ("correct it if wrong") or needed (drop a pin, shown above everything else). The place is named by a landmark ("Raja Muthiah Salai, Periyamet") from the phone's geocoder (Mappls when licensed), else the server's locality, never coordinates. My location is wrong / Drop a pin until the crew is with the patient.
  • While you wait: the lines in config/app.yaml citizen_guidance for this phase, only the pre-arrival instructions the AI call-taker may already give (calltaker.yaml). Needs clinical validation before real use.
  • Timeline: each change this phone saw (and your SOS, call and location corrections), stamped when it was seen; the public API has no history.
  • Cancel request: confirm, the ambulance is stood down and drives back to base.
  • Completed / Cancelled: a summary with the timeline, then Done.
  • Hidden from the caller on purpose: severity, triage scores, hospital ranking and the incident id.
  • ‹ goes back to Home while the emergency stays open; a Your emergency pill on Home returns you.

Screenshots: docs/screenshots/ios-citizen/ (iPhone 17e): the four onboarding steps, Home in English and Tamil, the call right after an SOS, tracking, large Tamil text, and cancelled.

Live Activity / Dynamic Island: prepared, not switched on. Citizen/EmergencyActivity.swift defines the activity (phase title, ETA date, callsign, milestone) and keeps it in step with the incident; it does nothing until a widget extension and NSSupportsLiveActivities exist.

Offline: if the SOS or SMS cannot reach the server, the app opens the system SMS composer to 108, with your GPS position in the message.

Assets: the app icon, the brand mark and the onboarding background are HTML in ios/Vaazhvu/Design/ (citizen-*.html), rendered to PNG into the asset catalog by scripts/render_ios_assets.sh citizen (headless Chrome; the icon is flattened to RGB for the App Store).

Secrets: none in the app. The server address comes from the git-ignored Config/Local.xcconfig; the session token lives in the Keychain (this device only); the Mappls licence files are git-ignored (Citizen/MapplsLicence/); map tile and LLM keys stay on the server (.env, served config). Release builds accept https only.

Test hooks (Debug builds): -autocall YES opens the voice line at launch; -autosos YES fires the SOS (the same call the orb's hold makes) once a GPS fix exists; -onboardStep N opens an onboarding step; -debugSignIn "<phone> <password>" signs in through the real API. Keychain needs a signed build, so build for the Simulator with CODE_SIGN_IDENTITY=- (ad hoc), not CODE_SIGNING_ALLOWED=NO, to test sign-in.


VaazhvuCrew — ambulance crew iOS app​

Crew iOS app answering a citizen SOS

Sign in (when the server requires accounts, after a session expires, or by choice in open mode): username and password. The session token is kept in the keychain. First launch: pick your vehicle (A01…, ALS/BLS shown). When signed in, picking starts the shift on that unit, and the server then refuses this phone's writes for any other unit. ‹ becomes End shift (sign out). Picking asks once for notification permission. Long-press "Which vehicle?" for server settings. ‹ on the main screen goes back to this picker, but not during a job.

Idle: "Available", the home zone, any repositioning move with its ETA and km, and Go off duty (confirmed; dispatch stops sending jobs). Off duty, the one action is Back in service. The map shows nearby hospitals (violet) to drive to.

Alerts: a new job, an escalation or a new destination shows a banner with a haptic. With the phone locked or in a pocket (the app keeps running for GPS), it also posts a notification with sound. A pill says when notifications are off. The screen stays awake during a job.

On a job (a banner and haptic on every new dispatch, escalation or destination change)

  • Map:
    • the remaining route in blue (it shrinks as you drive);
    • the scene;
    • the destination hospital;
    • your unit;
    • other ambulances as dots.
  • Card:
    • severity, plus support if you are not the transport unit;
    • ETA and km;
    • symptoms and an English summary;
    • the caller's latest words, marked as from the call or the chat;
    • the destination and the patient's age.
  • Buttons:
    • Navigate: opens Apple Maps turn-by-turn to the scene or hospital.
    • Phone: calls the caller's number, when it is a real number.
    • Live (shows the NEWS2 score): opens the live sheet.
    • Card details: what the patient needs (ALS, cardiac, trauma), a real escalation (severity went up), and a clock since dispatch. The ETA shows only while driving somewhere.
    • The big button, full width under the tools, is always the one next action: On scene → Depart to hospital → At hospital → Available (from config/app.yaml: crew_next). Actions go through an offline outbox.

Live sheet

  • Vitals: heart rate, SpO₂, breathing rate and systolic blood pressure, plus a trend chart, NEWS2 and its risk.
  • Triage:
    • the severity probability bars;
    • each finding with the caller's quoted words;
    • what was ruled out.
  • Caller: the voice call and text thread in one feed, marked or .
  • Vitals: HR, SpO₂, RR, BP, temperature and AVPU (with O₂).
  • Record vitals: the crew's own reading. HR, SpO₂ and RR are required; BP, temperature, AVPU and oxygen are optional, and nothing missing is filled in. A value outside a plausible range blocks sending. The last reading shows beside each label. It goes through the offline outbox.
  • Notes: notes from dispatch and the ER (incident comments), and a field to send one back.
  • Job timeline: when each status was reached.
  • Confirm reading: opens Record vitals prefilled with the shown reading, so the crew checks each number on the patient before it is sent as theirs (a simulated reading is never re-sent as a crew measurement). It is hidden until there is a reading.

GPS feed: while a unit is signed in, the phone's position is posted to POST /api/ops/units/{id}/position with accuracy, speed, heading and captured_at. It uses the same pacing as the web app (crew.gps_interval_sec, gps_min_move_m and gps_heartbeat_sec from /app/config). Fixes go through the offline outbox, so fixes taken with no signal replay in order. The server ignores replayed fixes that are already stale and doesn't move the unit for them. A pill under the top bar shows GPS live, Simulated or No GPS permission, using the server's position_source when it sends one. The feed keeps running with the phone locked or another app in front while a unit is signed in (UIBackgroundModes: location, blue status-bar pill), so the server does not fall back to the simulated position. It is started in the foreground, so when-in-use permission is enough. Every request sends X-Vaazhvu-Role: crew and X-Vaazhvu-Actor: crew <unit> (Info.plist VZRole / VZActor). The citizen app sends viewer / citizen.


How the iOS screens stay current​

Tracking, the message thread and the crew's job follow GET /api/ops/changes (?incident= or ?unit=; Shared/ChangeFeed.swift). That feed sends only the type of each event that touches that one incident or unit, never another caller's data, and the screen refetches its own endpoint on each ping. While the feed is down (offline, server restarting), screens refresh every live.fallback_poll_sec (5 s) and keep reconnecting. The nearby-ambulances pill follows many units, so it refreshes every live.nearby_refresh_sec (3 s). Both settings are in config/app.yaml.

How the apps work together (a typical incident)​

  1. Caller: a citizen taps Call in the iOS app and says, in Tanglish, that their father has chest pain near Mylapore tank.
  2. AI: the call-taker asks a follow-up (is he breathing normally?). In the background, triage reaches critical and the policy requires ALS.
  3. Dispatch: the risk engine picks an ALS unit 2 km further away than the nearest BLS one, and says why.
  4. Console: the dispatcher sees all of it live and does nothing, because the dispatch was automatic. If confidence were low, the console would show Approve.
  5. Crew: the VaazhvuCrew phone in unit A04 buzzes "New dispatch · chest pain". The crew taps Navigate, and the caller's words are on the card.
  6. Caller tracking: the citizen's app switches to tracking: blue route, ETA counting down. The AI says the ambulance is on the way, with the ETA.
  7. Road closure: the dispatcher adds a closure. The unit re-routes, and every screen updates.
  8. Scene and hospital: on scene, the crew taps On scene: the incident becomes on scene at once. The server ranks the receiving hospitals from where the patient is, by the same cost as dispatch: drive time, the needed service (cath lab, trauma, obstetrics, ED), diversion and ER load. The best becomes the destination, and the crew sees the top 3 with reasons, Recommended on the first. The crew can tap Go here on another, and that choice sticks unless the hospital diverts. The caller's tracking now names the hospital. Vitals start streaming, NEWS2 rises, the hospital board shows the patient with a cath-lab checklist, and FHIR records are posted. An escalation or an ER diversion re-ranks the hospitals from the unit's current position.
  9. Close: Depart to hospital (the drive starts now; the caller sees the time to hospital) → At hospital → Handover done · available. The incident resolves, and the unit returns or is redeployed to cover the gap. Each button moves the incident; a step that no longer fits is refused (409). Once a crew acts, the simulator's scene and handover timers leave that job alone. A unit that breaks down while transporting gets a new ambulance sent to where it stopped.