← All contracts
OHN-62 Pre-consultation Questionnaires
- Version
- 1.3.0
- OpenAPI
- 3.1.0
- Source in the repository
modules/OHN-62/api/openapi.yaml- Servers
https://opeshealthnetwork.com
- Authentication
bearer: http bearer (JWT)
Download the contract (YAML)
Contracts are written in English.
Department- and complaint-specific questionnaires supplied as versioned configuration by the jurisdiction or facility; patient capture before arrival (portal, phone /p, SMS link, USSD) or at check-in (kiosk, staff-assisted) in EN and FR; configured red-flag rules signalled to OHN-61; responses filed in OHN-13 as FHIR QuestionnaireResponse. No clinical question bank is part of this contract. Deployable: care-exchange. Module key: preconsult. Tables: ohn62_*. Every write needs Idempotency-Key; strict bodies (unknown keys 422).
Operations
Other operations
GET/api/ohn/v1/pre-consult/definitionsList questionnaire definitions (jurisdiction scope, or the caller's facility)
Operation ID: OHN_62_API_001
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
jurisdiction_id | query | string (uuid) | yes | |
facility_id | query | string (uuid) | no | |
department_kind | query | "emergency" | "opd_general" | "eye" | "dental" | "maternity" | "paediatrics" | "cardiology" | "diabetes" | "ent" | "dermatology" | "mental_health" | "surgery" | … | no | |
state | query | "draft" | "active" | "retired" | no | |
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
422 | validation_failed (bad query) | |
POST/api/ohn/v1/pre-consult/definitionsLoad a definition as draft. Validates: unique link_ids, enable_when refers to an earlier item with a compatible answer type, options for choice items, unit for quantity, EN and FR text everywhere, red-flag conditions refer to existing items, complaint and body-site codes valid in OHN-23
Operation ID: OHN_62_API_002
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
scope | query | "jurisdiction" | "facility" | yes | |
jurisdiction_id | query | string (uuid) | yes | |
facility_id | query | string (uuid) | no | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | OK | |
401 | Unauthenticated | |
403 | preconsult_admin may only create facility scope for their own facility | |
404 | Not found or outside scope (never discloses existence) | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
422 | validation_failed (details per field) | |
502 | upstream_unavailable (OHN-23 or OHN-61 department check) | |
GET/api/ohn/v1/pre-consult/definitions/{definition_id}Get one definition (full, with red-flag rules)
Operation ID: OHN_62_API_003
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
definition_id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
422 | validation_failed (bad query) | |
POST/api/ohn/v1/pre-consult/definitions/{definition_id}/activateActivate an approved definition (state in_review with decision approved); retires the previous active version with the same key
Operation ID: OHN_62_API_004
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
definition_id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
422 | validation_failed or definition_not_approved (a real definition cannot use the demo approval_ref); review_required (no approved review), definition_expired; translation_not_reviewed (EN and FR must be reviewed for a non-demo definition); candidate_bank_not_activatable (a candidate-bank definition needs review, approval_ref and reviewed translations like any other) | |
POST/api/ohn/v1/pre-consult/definitions/{definition_id}/retireRetire a definition (open responses keep their version)
Operation ID: OHN_62_API_005
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
definition_id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
422 | validation_failed (details per field) | |
POST/api/ohn/v1/pre-consult/definitions/load-demoLoad and activate the SYNTHETIC demo questionnaires (eye, dental, general consultation, diabetes, cardiology). NOT clinically approved. Only when OHN62_ALLOW_DEMO_CONFIG=true and not production
Operation ID: OHN_62_API_006
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
jurisdiction_id | query | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
201 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | demo_config_disabled | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
422 | validation_failed (details per field) | |
GET/api/ohn/v1/pre-consult/complaintsPresenting complaints that have a questionnaire for a department (for the check-in picker)
Operation ID: OHN_62_API_007
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
department_id | query | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
422 | validation_failed (bad query) | |
GET/api/ohn/v1/pre-consult/departments/{department_id}/questionnaireResolve the active questionnaire: facility+department+complaint, then facility+department, then jurisdiction+department kind+complaint, then jurisdiction+department kind. 404 no_questionnaire when none (check-in continues without one)
Operation ID: OHN_62_API_008
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
department_id | path | string (uuid) | yes | |
complaint_system | query | "snomed_ct" | "local" | no | |
complaint_code | query | string | no | |
language | query | "en" | "fr" | no | |
visit_type | query | "new" | "follow_up" | "review" | no | |
age_months | query | integer | no | |
pregnancy_context | query | "anc" | "pnc" | no | |
audience | query | "patient" | "nurse" | "clinician" | no | |
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | no_questionnaire, or department not found | |
422 | validation_failed (bad query) | |
GET/api/ohn/v1/pre-consult/responsesList responses: by ticket, by patient, or by appointment (staff; OHN-16 evaluated with purpose treatment, every read audited)
Operation ID: OHN_62_API_010
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
ticket_id | query | string (uuid) | no | |
patient_id | query | string (uuid) | no | |
appointment_id | query | string (uuid) | no | |
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
422 | exactly one filter is required | |
POST/api/ohn/v1/pre-consult/responsesStart a response at check-in (kiosk or staff-assisted) or in the portal
Operation ID: OHN_62_API_009
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | OK | |
401 | Unauthenticated | |
403 | patient may start only for themselves (or an OHN-19 representative) | |
404 | no_questionnaire | |
409 | an in-progress response exists for this patient and department (details.response_id) | |
422 | validation_failed, private_capture_required (a private definition started on a kiosk), definition_not_applicable (ResponseStart.definition_id not active or not for this department) | |
GET/api/ohn/v1/pre-consult/responses/{response_id}Get a response (staff; patient sees own without red_flags)
Operation ID: OHN_62_API_011
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
response_id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
422 | validation_failed (bad query) | |
PUT/api/ohn/v1/pre-consult/responses/{response_id}/answersSave answers (partial saves allowed while in_progress). Answers to items hidden by enable_when are dropped
Operation ID: OHN_62_API_012
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
response_id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
422 | answer_invalid: wrong type, option not in list, number outside configured min/max, text too long, unknown link_id; decline_not_allowed | |
POST/api/ohn/v1/pre-consult/responses/{response_id}/submitSubmit: checks required visible items, evaluates the configured red-flag rules, files a FHIR QuestionnaireResponse in OHN-13, and signals OHN-61 when linked to a ticket
Operation ID: OHN_62_API_013
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
response_id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
422 | validation_failed: details.missing lists required visible link_ids | |
POST/api/ohn/v1/pre-consult/responses/{response_id}/amendStaff amend after submission with reason (new OHN-13 document version; previous kept)
Operation ID: OHN_62_API_014
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
response_id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
422 | validation_failed (details per field) | |
POST/api/ohn/v1/pre-consult/responses/{response_id}/entered-in-errorMark a response entered in error (wrong patient); OHN-13 document is marked too
Operation ID: OHN_62_API_015
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
response_id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
422 | validation_failed (details per field) | |
POST/api/ohn/v1/pre-consult/invitationsInvite the patient to answer before arrival via OHN-53 (SMS link, USSD session or portal notice) for an OHN-54 appointment or an open ticket
Operation ID: OHN_62_API_016
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | no_questionnaire | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
422 | validation_failed or channel_not_supported (ussd needs an ussd_compatible definition); department_id missing for an appointment invitation | |
502 | upstream_unavailable (OHN-53 or OHN-54) | |
POST/api/ohn/v1/pre-consult/invitations/{invitation_id}/revokeRevoke an invitation
Operation ID: OHN_62_API_017
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
invitation_id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
422 | validation_failed (details per field) | |
GET/api/ohn/v1/pre-consult/me/pendingPatient portal (OHN-31): my open invitations and drafts
Operation ID: OHN_62_API_018
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
422 | validation_failed (bad query) | |
GET/api/ohn/v1/pre-consult/public/sessions/{token}Phone /p page or SMS link: open the questionnaire by one-time token (no login). Rate-limited; token hashed at rest; no name or Health ID in the reply beyond the facility name
Operation ID: OHN_62_API_019
Parameters
| Name | In | Type | Required | Description |
|---|
token | path | string | yes | |
language | query | "en" | "fr" | no | |
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
410 | invitation_expired or invitation_used | |
422 | validation_failed (bad query) | |
429 | rate limited | |
PUT/api/ohn/v1/pre-consult/public/sessions/{token}/answersSave answers by token
Operation ID: OHN_62_API_020
Parameters
| Name | In | Type | Required | Description |
|---|
token | path | string | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
410 | invitation_expired or invitation_used | |
422 | validation_failed (details per field) | |
429 | rate limited | |
POST/api/ohn/v1/pre-consult/public/sessions/{token}/submitSubmit by token (the token is spent)
Operation ID: OHN_62_API_021
Parameters
| Name | In | Type | Required | Description |
|---|
token | path | string | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
410 | invitation_expired or invitation_used | |
422 | validation_failed (details per field) | |
429 | rate limited | |
POST/api/ohn/v1/pre-consult/ussd/sessionsOHN-53 USSD gateway relay: next question/answer step of an ussd_compatible questionnaire
Operation ID: OHN_62_API_022
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
410 | invitation_expired or invitation_used | |
422 | validation_failed (details per field) | |
POST/api/ohn/v1/pre-consult/tickets/{ticket_id}/attachService call from OHN-61 at check-in: link the patient's submitted/in-progress response (same appointment, or same department within the configured window) to the ticket and return its red flags
Operation ID: OHN_62_API_023
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
ticket_id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | never returned for a missing questionnaire: none_configured is a 200 | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
422 | validation_failed (details per field) | |
GET/api/ohn/v1/pre-consult/reports/completionCompletion report OHN-62-R001: invited/started/submitted by department, definition and channel
Operation ID: OHN_62_API_024
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
facility_id | query | string (uuid) | yes | |
from | query | string (date) | yes | |
to | query | string (date) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
422 | validation_failed (bad query) | |
POST/api/ohn/v1/pre-consult/reports/completion/exportExport OHN-62-R001 as CSV/PDF watermarked via OHN-16 marks; counts under 5 suppressed
Operation ID: OHN_62_API_025
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | File with X-OHN-Mark-Id header | text/csv: string
application/pdf: string (binary)
|
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
422 | validation_failed (details per field) | |
502 | upstream_unavailable (OHN-16 mark) | |
POST/api/ohn/v1/pre-consult/definitions/{definition_id}/request-reviewdraft -> in_review (author)
Operation ID: OHN_62_API_026
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
definition_id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
422 | validation_failed (details per field) | |
POST/api/ohn/v1/pre-consult/definitions/{definition_id}/reviewReview decision by a reviewer who is not the author (approved, or changes_requested -> back to draft)
Operation ID: OHN_62_API_027
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
definition_id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | self_review_forbidden | |
404 | Not found or outside scope (never discloses existence) | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
422 | validation_failed (details per field) | |
GET/api/ohn/v1/pre-consult/reports/questionnaire_versionsReport questionnaire_versions: usage_count, completion_rate, declined_questions, draft_or_expired by department, version and language
Operation ID: OHN_62_API_028
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
facility_id | query | string (uuid) | yes | |
from | query | string (date) | yes | |
to | query | string (date) | yes | |
department_id | query | string (uuid) | no | |
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
422 | validation_failed (bad query) | |
GET/api/ohn/v1/pre-consult/safety-screenResolve the active universal danger-sign screen (facility, then jurisdiction). 404 no_questionnaire when none is configured: check-in continues and the ticket shows safety_screen not_configured
Operation ID: OHN_62_API_029
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
facility_id | query | string (uuid) | yes | |
language | query | "en" | "fr" | no | |
age_months | query | integer | no | |
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | no_questionnaire | |
422 | validation_failed (bad query) | |
POST/api/ohn/v1/pre-consult/definitions/{definition_id}/suspendEmergency stop: an active definition stops resolving at once (next resolution level applies); reason required; resume = activate again
Operation ID: OHN_62_API_030
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
definition_id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
422 | validation_failed (details per field) | |
POST/api/ohn/v1/pre-consult/responses/{response_id}/staff-reviewStaff marks a submitted response accepted_for_triage or staff_review_required (shown to the triage officer)
Operation ID: OHN_62_API_031
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
response_id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
422 | validation_failed (details per field) | |
POST/api/ohn/v1/pre-consult/definitions/load-candidate-bankDEV/DEMO only (OHN62_ALLOW_DEMO_CONFIG): load the owner's 26-department candidate question bank as DRAFT definitions marked candidate_bank and NOT_CLINICALLY_APPROVED; nothing is activated
Operation ID: OHN_62_API_032
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
jurisdiction_id | query | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
201 | OK | |
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | demo_config_disabled | |
409 | version_conflict, invalid_transition or idempotency_mismatch | |
422 | validation_failed (details per field) | |
GET/api/ohn/v1/pre-consult/fhir/R4/QuestionnaireFHIR R4 search Questionnaire (Questionnaire: active approved definitions only; QuestionnaireResponse: patient, encounter, authored; OHN-16 evaluated)
Operation ID: OHN_62_API_033
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
patient | query | string | no | |
url | query | string | no | |
status | query | string | no | |
_count | query | integer | no | |
Responses
| Code | Description | Media type |
|---|
200 | FHIR R4 resource or searchset Bundle | application/fhir+json: object
|
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
422 | validation_failed (bad query) | |
GET/api/ohn/v1/pre-consult/fhir/R4/Questionnaire/{resource_id}FHIR R4 read Questionnaire
Operation ID: OHN_62_API_034
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
resource_id | path | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | FHIR R4 resource or searchset Bundle | application/fhir+json: object
|
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
422 | validation_failed (bad query) | |
GET/api/ohn/v1/pre-consult/fhir/R4/QuestionnaireResponseFHIR R4 search QuestionnaireResponse (Questionnaire: active approved definitions only; QuestionnaireResponse: patient, encounter, authored; OHN-16 evaluated)
Operation ID: OHN_62_API_035
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
patient | query | string | no | |
url | query | string | no | |
status | query | string | no | |
_count | query | integer | no | |
Responses
| Code | Description | Media type |
|---|
200 | FHIR R4 resource or searchset Bundle | application/fhir+json: object
|
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
422 | validation_failed (bad query) | |
GET/api/ohn/v1/pre-consult/fhir/R4/QuestionnaireResponse/{resource_id}FHIR R4 read QuestionnaireResponse
Operation ID: OHN_62_API_036
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
resource_id | path | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | FHIR R4 resource or searchset Bundle | application/fhir+json: object
|
401 | Unauthenticated | |
403 | Role or OHN-16 policy denies (consent_required when an OHN-15 consent is missing) | |
404 | Not found or outside scope (never discloses existence) | |
422 | validation_failed (bad query) | |
GET/health/ohn-62Liveness/readiness of the module
Operation ID: OHN_62_HEALTH
Responses
| Code | Description | Media type |
|---|
200 | OK | — |
Schemas
Error
| Name | Type | Required | Description |
|---|
error | string | yes | Stable code: unauthenticated, forbidden, not_found, validation_failed, idempotency_key_required, idempotency_mismatch, version_conflict, invalid_transition, not_configured, no_questionnaire, demo_config_disabled, definition_not_approved, invitation_expired, invitation_used, answer_invalid, channel_not_supported, upstream_unavailable, consent_required, review_required, self_review_forbidden, definition_expired, decline_not_allowed, translation_not_reviewed, private_capture_required, definition_suspended, candidate_bank_not_activatable |
message | string | no | |
details | any | no | |
I18nText
| Name | Type | Required | Description |
|---|
en | string | yes | |
fr | string | yes | |
Coding
| Name | Type | Required | Description |
|---|
system | "snomed_ct" | "loinc" | "local" | yes | |
code | string | yes | |
display | string | no | |
AnswerOption
| Name | Type | Required | Description |
|---|
code | string | yes | |
display | I18nText | yes | |
coding | Coding | no | |
EnableWhen
| Name | Type | Required | Description |
|---|
question | string | yes | link_id of an earlier item |
operator | "exists" | "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "includes" | yes | |
answer | any | no | boolean, option code, number or date, matching the question's type |
Item
| Name | Type | Required | Description |
|---|
link_id | string | yes | |
type | "boolean" | "single_choice" | "multiple_choice" | "quantity" | "date" | "scale" | "text" | "body_site" | "group" | "display" | yes | |
text | I18nText | yes | |
help | I18nText | no | |
required | boolean | no | |
options | array of AnswerOption | no | single_choice and multiple_choice |
unit | string | no | UCUM unit for quantity, e.g. mm[Hg], kg, mmol/L |
min | number | no | |
max | number | no | |
decimals | integer | no | |
scale | Item.scale | no | |
body_sites | array of AnswerOption | no | body_site: configured site list (SNOMED body structure codes validated with OHN-23 at load) |
max_length | integer | no | |
date_range | Item.date_range | no | |
enable_when | array of EnableWhen | no | |
enable_behavior | "all" | "any" | no | |
items | array of Item | no | children of a group |
coding | Coding | no | |
ussd_compatible | boolean | no | computed: boolean, single_choice (<=9 options), scale, quantity |
allow_decline | boolean | no | default true; false means a required item cannot be declined |
RedFlagRule
| Name | Type | Required | Description |
|---|
id | string | yes | |
when | array of EnableWhen | yes | |
match | "all" | "any" | no | |
effect | "flag_officer" | "raise_priority" | "urgent_review" | yes | urgent_review: immediate staff review; OHN-61 raises an escalation (trigger danger_screen). Configured only; never a diagnosis or reassurance shown to the patient |
message | I18nText | yes | |
suggest_discriminator | string | no | optional OHN-61 scale discriminator id pre-selected for the officer to confirm; never assigns acuity |
on_unknown | "ignore" | "screen_incomplete" | no | safety screens default to screen_incomplete: an unknown or declined answer to a referenced item is never read as 'no'; OHN-61 shows 'screen incomplete' to staff |
QuestionnaireDocument
| Name | Type | Required | Description |
|---|
title | I18nText | yes | |
department_kind | "emergency" | "opd_general" | "eye" | "dental" | "maternity" | "paediatrics" | "cardiology" | "diabetes" | "ent" | "dermatology" | "mental_health" | "surgery" | … | yes | |
department_id | string (uuid) | no | facility scope only: bind to one OHN-61 department |
complaint | Coding | no | |
complaint_label | I18nText | no | |
estimated_minutes | integer | no | |
items | array of Item | yes | |
red_flag_rules | array of RedFlagRule | yes | |
source_reference | string | no | |
valid_until | string (date) | no | |
kind | "department" | "safety_screen" | no | safety_screen: the universal danger-sign screen asked of every patient before department questions (department_kind is ignored); department: the default |
audience | "patient" | "nurse" | "clinician" | no | patient (pre-consultation, shown on patient channels), nurse (triage stage, staff views only) or clinician (consultation prompts, clinician view only); default patient |
visit_type | "new" | "follow_up" | "review" | no | |
age_band | QuestionnaireDocument.age_band | no | |
pregnancy_context | "anc" | "pnc" | no | |
capture_privacy | "standard" | "private" | no | private: never offered on a shared kiosk; staff-assisted only in a private room, or on the patient's own device |
translation_status | QuestionnaireDocument.translation_status | no | |
source_topic_tags | array of string | no | guideline topics the content was derived from (e.g. who_iitt, imci, who_pen); provenance only, not a claim of validation |
Definition
| Name | Type | Required | Description |
|---|
id | string (uuid) | yes | |
scope | "jurisdiction" | "facility" | yes | |
jurisdiction_id | string (uuid) | no | |
facility_id | string | null (uuid) | no | |
key | string | no | department_kind[/department_id][/complaint system|code] |
version | integer | yes | |
state | "draft" | "in_review" | "active" | "retired" | "expired" | "suspended" | yes | |
approval_ref | string | null | no | |
synthetic_demo | boolean | yes | |
clinically_approved | boolean | no | |
activated_at | string | null (date-time) | no | |
document | QuestionnaireDocument | yes | |
row_version | integer | no | |
valid_until | string | null (date) | no | after this date the definition is expired and no longer resolves |
review | Definition.review.option-1 | null | no | |
created_by | string | no | |
warnings | array of string | no | non-blocking load warnings, e.g. patient questionnaire with more than 7 items visible by default |
candidate_bank | boolean | no | loaded from the owner's candidate question bank (v1.1); always NOT_CLINICALLY_APPROVED, draft only, can never be activated without review, approval_ref and reviewed translations |
Activate
| Name | Type | Required | Description |
|---|
approval_ref | string | yes | |
expected_version | integer | yes | |
Reasoned
| Name | Type | Required | Description |
|---|
expected_version | integer | yes | |
reason | string | yes | |
Resolved
| Name | Type | Required | Description |
|---|
definition | RenderedDefinition | yes | |
matched_on | "facility_department_complaint" | "facility_department" | "jurisdiction_kind_complaint" | "jurisdiction_kind" | no | |
RenderedDefinition
| Name | Type | Required | Description |
|---|
definition_id | string (uuid) | yes | |
version | integer | yes | |
language | "en" | "fr" | yes | |
title | string | yes | |
items | array of object | yes | Item with text/help/labels resolved to the language; red_flag_rules are never sent to patients |
synthetic_demo | boolean | yes | |
disclaimer | string | null | no | |
Answer
| Name | Type | Required | Description |
|---|
link_id | string | yes | |
value_boolean | boolean | no | |
value_code | string | no | |
value_codes | array of string | no | |
value_number | number | no | |
value_date | string (date) | no | |
value_text | string | no | |
declined | boolean | no | the patient chose not to answer; no value field allowed |
decline_reason | "prefer_not_to_say" | "do_not_know" | "not_applicable" | no | |
ResponseStart
| Name | Type | Required | Description |
|---|
patient_id | string (uuid) | yes | |
department_id | string (uuid) | yes | |
complaint | Coding | no | |
ticket_id | string (uuid) | no | |
appointment_id | string (uuid) | no | |
channel | "kiosk" | "staff_assisted" | "portal" | yes | |
language | "en" | "fr" | yes | |
definition_id | string (uuid) | no | optional (1.2.0): the definition the client resolved, e.g. GET /safety-screen Resolved.definition.definition_id to start the safety screen for a ticket, or a department definition resolved with visit_type/age_months/pregnancy_context. It must be active and apply to the department (the safety screen applies everywhere), else 422 definition_not_applicable. Without it the department questionnaire is resolved. A safety-screen response and a department response may be open together for the same patient and department. |
AnswersPut
| Name | Type | Required | Description |
|---|
answers | array of Answer | yes | |
expected_version | integer | yes | |
Response
| Name | Type | Required | Description |
|---|
id | string (uuid) | yes | |
definition_id | string (uuid) | yes | |
definition_version | integer | yes | |
patient_id | string (uuid) | yes | |
department_id | string (uuid) | yes | |
facility_id | string (uuid) | no | |
complaint | Coding | null | no | |
ticket_id | string | null (uuid) | no | |
appointment_id | string | null (uuid) | no | |
channel | "portal" | "phone_web" | "sms_link" | "ussd" | "kiosk" | "staff_assisted" | yes | |
language | "en" | "fr" | yes | |
entered_by | string | no | patient, representative or staff user id (staff_assisted/kiosk) |
status | "in_progress" | "submitted" | "amended" | "entered_in_error" | "expired" | "staff_review_required" | "accepted_for_triage" | yes | |
answers | array of Answer | yes | |
red_flags | array of Response.red_flags.item | no | staff views only; never returned on patient channels |
submitted_at | string | null (date-time) | no | |
document_id | string | null (uuid) | no | OHN-13 document holding the FHIR QuestionnaireResponse |
record_sync | "not_submitted" | "pending_upstream" | "filed" | "failed" | no | |
synthetic_demo | boolean | no | |
version | integer | yes | |
declined_link_ids | array of string | no | shown to staff as 'declined', never as a missing answer |
amendments | array of Response.amendments.item | no | append-only; the original answers are never overwritten |
Invitation
| Name | Type | Required | Description |
|---|
id | string (uuid) | yes | |
patient_id | string (uuid) | yes | |
appointment_id | string | null (uuid) | no | |
ticket_id | string | null (uuid) | no | |
department_id | string (uuid) | no | |
channel | "sms_link" | "ussd" | "portal" | yes | |
language | "en" | "fr" | no | |
expires_at | string (date-time) | yes | |
state | "sent" | "opened" | "submitted" | "expired" | "revoked" | "delivery_failed" | yes | |
InvitationCreate
| Name | Type | Required | Description |
|---|
appointment_id | string (uuid) | no | |
ticket_id | string (uuid) | no | |
channel | "sms_link" | "ussd" | "portal" | yes | |
language | "en" | "fr" | yes | |
department_id | string (uuid) | no | required with appointment_id unless ticket_id is given (an OHN-54 appointment has no OHN-61 department); must belong to the appointment's facility |
Attach
| Name | Type | Required | Description |
|---|
patient_id | string (uuid) | yes | |
department_id | string (uuid) | yes | |
facility_id | string (uuid) | yes | |
appointment_id | string (uuid) | no | |
complaint | Coding | no | |
AttachResult
| Name | Type | Required | Description |
|---|
questionnaire_available | boolean | yes | |
state | "none_configured" | "not_started" | "in_progress" | "submitted" | yes | |
response_ids | array of string (uuid) | yes | |
red_flags | array of AttachResult.red_flags.item | yes | |
ExportRequest
| Name | Type | Required | Description |
|---|
facility_id | string (uuid) | yes | |
from | string (date) | yes | |
to | string (date) | yes | |
format | "csv" | "pdf" | yes | |
Versioned
| Name | Type | Required | Description |
|---|
expected_version | integer | yes | |
AmendRequest
| Name | Type | Required | Description |
|---|
answers | array of Answer | yes | |
reason | string | yes | |
expected_version | integer | yes | |
UssdStep
| Name | Type | Required | Description |
|---|
session_ref | string | yes | |
msisdn_hash | string | yes | |
invitation_code | string | no | |
input | string | yes | |
UssdReply
| Name | Type | Required | Description |
|---|
text | string | yes | |
end | boolean | yes | |
Review
| Name | Type | Required | Description |
|---|
decision | "approved" | "changes_requested" | yes | |
comment | string | no | |
expected_version | integer | yes | |
StaffReview
| Name | Type | Required | Description |
|---|
decision | "accepted_for_triage" | "staff_review_required" | yes | |
note | string | no | |
expected_version | integer | yes | |
Item.scale defined inline
| Name | Type | Required | Description |
|---|
min | integer | yes | |
max | integer | yes | |
step | integer | no | |
min_label | I18nText | no | |
max_label | I18nText | no | |
Item.date_range defined inline
| Name | Type | Required | Description |
|---|
not_after_today | boolean | no | |
not_before_years | integer | no | |
QuestionnaireDocument.age_band defined inline
| Name | Type | Required | Description |
|---|
min_months | integer | no | |
max_months | integer | no | |
QuestionnaireDocument.translation_status defined inline
| Name | Type | Required | Description |
|---|
en | "draft" | "reviewed" | yes | |
fr | "draft" | "reviewed" | yes | |
Definition.review.option-1 defined inline
| Name | Type | Required | Description |
|---|
requested_by | string | yes | |
requested_at | string (date-time) | yes | |
decision | "approved" | "changes_requested" | null | no | |
reviewed_by | string | null | no | |
reviewed_at | string | null (date-time) | no | |
comment | string | null | no | |
Response.red_flags.item defined inline
| Name | Type | Required | Description |
|---|
rule_id | string | yes | |
effect | string | yes | |
message | I18nText | yes | |
suggest_discriminator | string | null | no | |
Response.amendments.item defined inline
| Name | Type | Required | Description |
|---|
at | string (date-time) | yes | |
by | string | yes | |
reason | string | yes | |
document_version | integer | null | no | |
TokenSession.response defined inline
| Name | Type | Required | Description |
|---|
id | string (uuid) | yes | |
status | string | yes | |
answers | array of Answer | yes | |
version | integer | yes | |
AttachResult.red_flags.item defined inline
| Name | Type | Required | Description |
|---|
rule_id | string | yes | |
effect | string | yes | |
message | I18nText | no | |
CompletionReport.rows.item defined inline
| Name | Type | Required | Description |
|---|
department_id | string (uuid) | yes | |
definition_id | string (uuid) | no | |
invited | integer | yes | |
started | integer | yes | |
submitted | integer | yes | |
submitted_before_arrival | integer | no | |
by_channel | object | no | |
red_flags_raised | integer | no | |
VersionsReport.rows.item defined inline
| Name | Type | Required | Description |
|---|
department_id | string (uuid) | yes | |
definition_id | string (uuid) | yes | |
version | integer | yes | |
language | "en" | "fr" | yes | |
state | string | no | |
usage_count | integer | no | responses started |
completion_rate | number | null | no | submitted / started |
declined_questions | integer | no | declined answers in submitted responses |
declined_by_item | object | no | |
draft_or_expired | boolean | no | |