Triage and pre-consultation APIs
How systems and devices use the triage and patient queue service (OHN-61) and pre-consultation questionnaires (OHN-62), including FHIR, self check-in, public departments, displays, offline sync and price lists.
OHN-61 Triage and Patient Queue handles arrival and check-in, live queues per department, call screens, vital signs, acuity on a configured triage scale, reassessment, handover and outcomes. OHN-62 Pre-consultation Questionnaires collects the patient’s answers before the consultation, at a kiosk, in the patient app, by SMS link or by USSD. Both are under /api/ohn/v1 (/triage/… and /pre-consult/…); the full contracts are in the API reference (OHN-62).
All examples use synthetic data.
Who calls what
| Caller | How it gets a token | Typical operations |
|---|---|---|
| Facility staff (reception, triage officer, clinician, cashier) | Signed-in session, then a module token (Authentication) | Tickets, queue, vitals, assessment, handover, payment gate |
Waiting-room kiosk (kiosk_device) | private_key_jwt → /platform/external-tokens (purpose triage_reception; preconsult_capture for OHN-62) | Self check-in, public departments, start a questionnaire |
Waiting-room display (display_device) | private_key_jwt (purpose waiting_room_display) | The display’s call feed |
Edge node (edge_sync) | private_key_jwt (purpose triage_sync) | Offline sync batches |
Third-party triage system (external_triage_system) | private_key_jwt (purpose triage_external_intake or triage_interop) | Inbound FHIR encounters, FHIR Encounter reads |
FHIR client (fhir_client) | private_key_jwt (purpose triage_interop / preconsult_interop) | FHIR reads (OHN-61 and OHN-62) |
| Patient (no account needed) | A one-time token in a link or on the ticket slip | Own ticket status, own payment details, own questionnaire |
Every request is still checked by the policy engine (OHN-16), resource by resource. A device token carries its facility; a kiosk can act only for that facility.
Self check-in and public departments
GET /triage/public/departments?facility_id=…lists the departments a patient may choose. It returns only active departments of a facility that has self check-in switched on. Each entry haspublic_label(what to display), andnameandkind, which arenullfor sensitive departments so the screen never reveals them. A kiosk may ask only for its own facility (403otherwise); every call is audited.POST /triage/self-check-inchecks a patient in with a Health ID and date of birth, an appointment QR code or an access card, and returns the ticket.GET /triage/tickets/{ticket_id}/slipgives the printable ticket slip with a QR code of the patient’s public status link.GET /triage/public/tickets/{token}is the patient’s live ticket status, with no login. It never shows a name, Health ID, acuity or clinical data.
Waiting-room displays
Register a display with POST /triage/displays, then let the device poll GET /triage/displays/{display_id}/feed every 3 to 5 seconds. The feed supports ETag / If-None-Match and answers 304 when nothing changed, so a display on a weak connection costs almost nothing.
Triage scale: fail closed
Acuity is computed only from an approved, active triage scale configured by the jurisdiction or facility. With no active scale, the assessment endpoints answer 503 not_configured; check-in, queueing by arrival time, calling and vital signs keep working, and the queue reports scale: null. The network never invents a triage level.
Offline sync from an edge node
POST /triage/sync/batches applies queued operations in performed_at order and returns a result per operation. Each operation is authorised as if it had been made online:
- a signed-in user may upload only their own work (
performer_mismatchotherwise); - an
edge_syncnode relays only the work of a person on a shift of the facility that coversperformed_at, and the operation runs with that person’s shift role (performer_not_on_shiftotherwise); - each operation is applied exactly once (idempotent per client operation id).
Conflicts are listed by GET /triage/sync/conflicts and resolved by staff (keep_server, apply_client, apply_as_reassessment, discard); clinical data is never silently overwritten.
Facility price list and the payment gate
GET /triage/tariffsreturns the facility’s price list (past and future entries) with its version;PUT /triage/tariffsreplaces it, versioned and audited.GET /triage/tariffs/effective?facility_id=…&service_code=…&at=…returns the price in effect at an instant. When there is none (404), the payment gate never clears by itself and the cashier confirms payment by hand.- Staff read a ticket’s gate with
GET /triage/tickets/{ticket_id}/financial-state; the patient reads their own payment details withGET /triage/public/tickets/{token}/payment.
Pre-consultation questionnaires (OHN-62)
- Questionnaires are versioned configuration (
/pre-consult/definitions), activated and retired by the jurisdiction or facility.GET /pre-consult/departments/{department_id}/questionnaireresolves the active one (facility and complaint first, then facility, then jurisdiction). - A response is started at check-in or in the portal (
POST /pre-consult/responses), saved, then submitted. Submission checks required items, evaluates the configured red-flag rules and files the answers in the shared record as a FHIRQuestionnaireResponse. - Patients without an account answer through a one-time link (
/pre-consult/public/sessions/{token}): rate-limited, the token is stored hashed and spent on submit. Basic phones use the USSD relay (POST /pre-consult/ussd/sessions). GET /pre-consult/safety-screenresolves the universal danger-sign screen.
FHIR R4
Both services serve a read-only FHIR R4 facade over their own data, checked by the policy engine for every resource. Any search parameter not listed below is refused with 422.
| Service | Endpoints | Search parameters | Who may call |
|---|---|---|---|
| OHN-61 | GET /api/ohn/v1/triage/fhir/R4/{type} and /{type}/{id} for Encounter, Observation, QuestionnaireResponse, Flag, Task, Provenance | patient, encounter, status, date, _lastUpdated, _count (1 to 200, default 50) | FHIR clients (all types); third-party triage systems (Encounter); clinicians and triage officers; auditors (Provenance) |
| OHN-61 | GET /api/ohn/v1/triage/fhir/R4/metadata | Public (CapabilityStatement, no data) | |
| OHN-62 | GET /api/ohn/v1/pre-consult/fhir/R4/Questionnaire and /{id} | url, status, _count (active, approved definitions only) | FHIR clients, third-party triage systems, clinicians, triage officers |
| OHN-62 | GET /api/ohn/v1/pre-consult/fhir/R4/QuestionnaireResponse and /{id} | patient (required: Patient/<id> or the id), url, status, _count | FHIR clients, clinicians, triage officers |
Inbound triage from a third-party system. Governance registers the system and its acuity code map (GET/POST /triage/external-systems, PUT /triage/external-systems/{id}). The system then sends a FHIR R4 Bundle to POST /triage/external/encounters with its gateway token (role external_triage_system). The network maps it to a ticket and an assessment with Provenance. It is idempotent per Bundle.identifier. An acuity code that is not in the map is stored as external_unmapped and never turned into a triage level; Flag resources raise the normal escalation path.
Triage history for the chart. GET /triage/patients/{patient_id}/triage-history (clinicians, triage officers and the chart service) returns every ticket, final level, encounter, vital signs and pre-consultation link of a patient, paged with an X-Next-Cursor header.
How triage writes into the shared record (encounter, vital-sign observations, questionnaire responses) is described in FHIR R4 interoperability.
Current contracts
| Service | Version | Operations |
|---|---|---|
| OHN-61 Triage and Patient Queue | 1.3.7 | 106 |
| OHN-62 Pre-consultation Questionnaires | 1.3.0 | 37 |