← All contracts
OHN-09 Encounter and Care Timeline
- Version
- 1.0.0
- OpenAPI
- 3.1.0
- Source in the repository
modules/OHN-09/api/openapi.json- Servers
https://opeshealthnetwork.com/api/ohn/v1/encounter-timeline
- Authentication
bearer: http bearer
Download the contract (JSON)
Contracts are written in English.
Server paths are under /api/ohn/v1/encounter-timeline. Default deny: role AND purpose must match. Inventory paths OHN-09-API-001..003 are mapped to this disjoint prefix (see ADR-0001).
Operations
OHN-09
GET/patients/{id}/encountersLatest cross-facility timeline projection for a patient (stale flag included)
Operation ID: getPatientTimeline
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
GET/patients/{id}/episodesEpisodes of care with derived boundaries
Operation ID: getPatientEpisodes
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
GET/patients/{id}/patient-viewThe patient's own current, indexed encounters for the OHN-31 patient chart (role patient under purpose patient_access; own record only, otherwise 404; OHN-16 decision read_own_encounters; every read audited)
Operation ID: patientEncounterView
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | The patient's own OHN-03 id (must equal the token subject) |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
GET/encountersIngest worklist and exception queue
Operation ID: listEncounters
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
state | query | string | no | |
facility | query | string (uuid) | no | |
patient_id | query | string (uuid) | no | |
current_only | query | "true" | "false" | no | |
cursor | query | string | no | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
POST/encountersRegister a source encounter (F001, W001)
Operation ID: registerEncounter
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
POST/encounters/projectBuild and store a cross-facility timeline (W003)
Operation ID: projectTimeline
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
GET/encounters/compareField-by-field comparison of two encounters of one patient
Operation ID: compareEncounters
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
left | query | string (uuid) | yes | |
right | query | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
GET/encounters/{id}Encounter with versions, corrections, episodes and handovers
Operation ID: getEncounter
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
POST/encounters/{id}/transitionsAdvance ingestion (W001)
Operation ID: stepEncounter
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
GET/correctionsCorrections and provenance
Operation ID: listCorrections
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
state | query | string | no | |
facility | query | string (uuid) | no | |
cursor | query | string | no | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
POST/correctionsOpen an encounter correction (F002, W002)
Operation ID: openCorrection
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
POST/corrections/{id}/transitionsAdvance a correction; an amendment creates a new encounter version
Operation ID: stepCorrection
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
POST/episode-linksLink an encounter to an episode of care (F003)
Operation ID: linkEpisode
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
GET/handoversCare transitions
Operation ID: listHandovers
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
acknowledged | query | "true" | "false" | no | |
cursor | query | string | no | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
POST/handoversRecord a care transition between two encounters
Operation ID: createHandover
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
POST/handovers/{id}/acknowledgeAcknowledge a handover (not by its recorder)
Operation ID: acknowledgeHandover
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
GET/code-lists/{list}Controlled list (encounter_type, care_setting, transfer_type)
Operation ID: getCodeList
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
list | path | "encounter_type" | "care_setting" | "transfer_type" | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
POST/code-lists/{list}Upsert controlled list entries
Operation ID: upsertCodeList
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
list | path | "encounter_type" | "care_setting" | "transfer_type" | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
GET/policyTimeline policy
Operation ID: getPolicy
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
POST/policySet the timeline policy
Operation ID: setPolicy
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
POST/maintenance/drain-outboxReport pending outbox events (no sink: nothing claimed delivered)
Operation ID: drainOutbox
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
GET/report-catalogAvailable reports
Operation ID: reportCatalog
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
GET/reports/{reportId}Run report R001..R003
Operation ID: runReport
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
reportId | path | "OHN-09-R001" | "OHN-09-R002" | "OHN-09-R003" | yes | |
region | query | string | no | |
facility | query | string (uuid) | no | |
type | query | string | no | |
status | query | string | no | |
jurisdiction | query | string (uuid) | no | |
period_from | query | string | no | |
period_to | query | string | no | |
cursor | query | string | no | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
POST/reports/{reportId}/exportCreate a signed single-use report export
Operation ID: exportReport
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
reportId | path | "OHN-09-R001" | "OHN-09-R002" | "OHN-09-R003" | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
GET/report-exports/{token}Download a report export once
Operation ID: downloadReportExport
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
token | path | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Denied by policy | — |
404 | Not found / not disclosed | — |
409 | Version conflict, illegal transition or idempotency mismatch | |
422 | Domain validation failed | |
429 | Rate limited | — |
503 | Dependency unavailable (fail closed) | — |
Schemas
EncounterCommand
| Name | Type | Required | Description |
|---|
patient_id | string | yes | |
source_facility_id | string | yes | |
encounter_source_id | string | yes | |
encounter_type | string | yes | |
start_at | string | yes | |
end_at | string | no | |
status | "planned" | "in_progress" | "finished" | "cancelled" | "entered_in_error" | yes | |
EncounterStepCommand
| Name | Type | Required | Description |
|---|
to_state | "schema_validated" | "identity_matched" | "source_linked" | "indexed" | "rejected" | yes | |
expected_version | integer | yes | |
reason | string | yes | |
CorrectionCommand
| Name | Type | Required | Description |
|---|
encounter_ref | string | yes | |
field_disputed | "encounter_type" | "start_at" | "end_at" | "status" | yes | |
correct_value | string | yes | |
supporting_evidence | string | yes | |
reason | string | yes | |
CorrectionStepCommand
| Name | Type | Required | Description |
|---|
to_state | "source_contacted" | "amended_by_source" | "projection_refreshed" | "resolved" | yes | |
expected_version | integer | yes | |
reason | string | yes | |
source_response | "amended" | "declined" | no | |
EpisodeLinkCommand
| Name | Type | Required | Description |
|---|
encounter_id | string | yes | |
episode_id | string | yes | |
care_setting | string | yes | |
link_reason | string | yes | |
effective_at | string | yes | |
HandoverCommand
| Name | Type | Required | Description |
|---|
from_encounter_id | string | yes | |
to_encounter_id | string | yes | |
transfer_type | string | yes | |
HandoverAckCommand
| Name | Type | Required | Description |
|---|
expected_version | integer | yes | |
ProjectCommand
| Name | Type | Required | Description |
|---|
patient_id | string | yes | |
PolicyCommand
| Name | Type | Required | Description |
|---|
duplicate_window_minutes | integer | yes | |
late_arrival_hours | integer | yes | |
approval_reference | string | yes | |
expected_version | integer | no | |
ExportCommand
| Name | Type | Required | Description |
|---|
format | "csv" | "pdf" | yes | |
filters | object | no | Open object validated by the report filter rules (region, facility, type, status, jurisdiction, period_from, period_to); unknown keys 422 |
Error
| Name | Type | Required | Description |
|---|
error | string | yes | |
message | string | no | |
details | any | no | |
CodeListBody.entries.item defined inline
| Name | Type | Required | Description |
|---|
code | string | yes | |
label | string | yes | |
active | boolean | no | |