OHN-32 Clinician Network Access Portal
- Version
- 1.0.1
- OpenAPI
- 3.1.0
- Source in the repository
modules/OHN-32/api/openapi.json- Servers
https://opeshealthnetwork.com/api/ohn/v1- Authentication
bearer: http bearer
Contracts are written in English.
Base path /api/ohn/v1. Every POST requires Idempotency-Key; mutations use expected_version. Routes default-deny on role AND purpose (clinical_care_access); patient-linked calls need an MFA session. A clinical context is bound to one patient, facility and purpose. Reconciled with the observed TypeScript behaviour (docs/program/java/ohn-32-contract-changes.md). Query keys not declared are refused (422).
Operations
- OHN-32 (24)
- Other operations (1)
OHN-32
GET/clinician/worklistWorklist: my active contexts and pending relationships (API-001)
Operation ID: worklist
Authentication: bearer
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/clinician/patient-resolveOpen a patient: MFA, licence and affiliation, proven relationship, policy scope (API-002; F001; W001)
1.0.1: for a relationship with basis patient_approved (patient-access contract 1.1.0), the context's allowed categories are the OHN-16 decision's categories intersected with the sections the patient granted (empty intersection: 403 denied_by_policy); declared relationships are unchanged. GET /clinician/patients/{id}/summary names the other requested sections as not_permitted_sections.
Operation ID: resolvePatient
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:Resolve
Responses
| Code | Description | Media type |
|---|---|---|
201 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch | application/json: Error |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/clinician/patients/{id}/summaryChart sections with provenance, freshness and warnings (API-003); re-validates the context
Operation ID: chartSummary
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
context_id | query | string (uuid) | no | Required; validated by the module (422 domain_validation_failed when missing). |
sections | query | string | no | Comma-separated section codes |
facility_id | query | string (uuid) | no | |
purpose | query | string | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/clinician/patients/{id}/sections/{section}/comparisonCompare the sources of one section (W002)
Operation ID: compareSources
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
section | path | string | yes | |
context_id | query | string (uuid) | no | Required; validated by the module (422 domain_validation_failed when missing). |
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/clinician/emergency-requestsEmergency path: justified, bounded, never silent (W003)
Operation ID: requestEmergency
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:Emergency
Responses
| Code | Description | Media type |
|---|---|---|
201 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch | application/json: Error |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/clinician/contextsMy contexts (supervisors: all in jurisdiction)
Operation ID: listContexts
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
state | query | "active" | "ended" | no | |
cursor | query | string | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/clinician/contexts/{id}Context with authorization basis and history
Operation ID: getContext
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/clinician/contexts/{id}/endEnd a context (logout, switched, completed). An emergency context also ends its OHN-17 grant; the answer then carries emergency_grant_released (false = OHN-17 unavailable, recorded as grant_release_pending; the grant ends at its own time limit)
Operation ID: endContext
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:EndContext
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch | application/json: Error |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/clinician/relationshipsRelationships (state)
Operation ID: listRelationships
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
state | query | string | no | |
cursor | query | string | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/clinician/relationshipsDeclare a care relationship (F002)
Operation ID: declareRelationship
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:Relationship
Responses
| Code | Description | Media type |
|---|---|---|
201 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch | application/json: Error |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/clinician/relationships/{id}/decisionApprove or reject a pending relationship (supervisor, not the declarer)
Operation ID: decideRelationship
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:RelationshipDecision
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch | application/json: Error |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/clinician/correction-referralsMy referrals
Operation ID: listReferrals
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
cursor | query | string | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/clinician/correction-referralsRefer a source discrepancy for correction (F003); delivery is not claimed
Operation ID: createReferral
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:Referral
Responses
| Code | Description | Media type |
|---|---|---|
201 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch | application/json: Error |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/clinician/conflictsUnresolved source conflicts (supervisor)
Operation ID: listConflicts
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
risk | query | "high" | "standard" | no | |
referral_state | query | "none" | "referred" | no | |
cursor | query | string | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/clinician/policyRead policy (unset = fail closed)
Operation ID: readPolicy
Authentication: bearer
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/clinician/policyWrite policy
Operation ID: writePolicy
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:Policy
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch | application/json: Error |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/clinician/code-lists/{list}Read code list
Operation ID: listCodes
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
list | path | "care_purpose" | "relationship_basis" | "requested_category" | "clinical_urgency" | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/clinician/code-lists/{list}Upsert code list entries
Operation ID: upsertCodes
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
list | path | "care_purpose" | "relationship_basis" | "requested_category" | "clinical_urgency" | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:CodeListUpsert
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch | application/json: Error |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/clinician/maintenance/context-sweepClose contexts past their expiry
Operation ID: contextSweep
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch | application/json: Error |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/clinician/maintenance/drain-outboxDrain outbox (no sink => nothing marked delivered)
Operation ID: drainOutbox
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch | application/json: Error |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/clinician/report-catalogReport catalog
Operation ID: reportCatalog
Authentication: bearer
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/clinician/reports/{reportId}Run report
Operation ID: runReport
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
reportId | path | "OHN-32-R001" | "OHN-32-R002" | "OHN-32-R003" | yes | |
facility | query | string (uuid) | no | |
risk | query | "high" | "standard" | no | |
period_from | query | string | no | |
period_to | query | string | no | |
cursor | query | string | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
POST/clinician/reports/{reportId}/exportCreate signed single-use export
Operation ID: createExport
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
reportId | path | "OHN-32-R001" | "OHN-32-R002" | "OHN-32-R003" | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:ExportCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
409 | Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch | application/json: Error |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
GET/clinician/exports/{token}Download export (owner only, single use, 5 min)
Operation ID: fetchExport
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
token | path | string | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | OK | application/json: object |
400 | Malformed / missing Idempotency-Key | — |
401 | Unauthenticated | — |
403 | Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties | — |
404 | Not found / out of scope | — |
422 | Validation or domain refusal | application/json: Error |
429 | Rate limited | — |
503 | Dependency unavailable (fails closed) | — |
Other operations
GET/health/ohn-32Liveness incl. DB and dependency modes
Operation ID: health
Responses
| Code | Description | Media type |
|---|---|---|
200 | ok | — |
503 | unavailable | — |
Schemas
Error
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes | |
message | string | no | |
details | any | no |
Resolve
| Name | Type | Required | Description |
|---|---|---|---|
patient_id_or_identifier | string | yes | Never stored in clear; only a hash is kept |
facility_id | string (uuid) | yes | |
encounter_or_relationship_ref | string (uuid) | yes | An active care relationship of the caller at this facility |
care_purpose | string | yes | |
device_ref | string | no |
Relationship
| Name | Type | Required | Description |
|---|---|---|---|
patient_ref | string (uuid) | yes | |
facility_id | string (uuid) | yes | |
requested_category | string | yes | |
relationship_basis | string | yes | |
case_reference | string (uuid) | yes | |
reason | string | yes |
RelationshipDecision
| Name | Type | Required | Description |
|---|---|---|---|
decision | "approve" | "reject" | yes | |
reason | string | yes | |
expected_version | integer | yes |
Referral
| Name | Type | Required | Description |
|---|---|---|---|
context_id | string (uuid) | yes | |
source_record_ref | string (uuid) | yes | |
discrepancy | string | yes | |
clinical_urgency | string | yes | |
source_contact | string (uuid) | yes |
Emergency
| Name | Type | Required | Description |
|---|---|---|---|
patient_id_or_identifier | string | yes | |
facility_id | string (uuid) | yes | |
case_reference | string (uuid) | yes | |
justification | string | yes | |
requested_sections | array of string | yes | |
duration_minutes | integer | yes | |
device_ref | string | no |
EndContext
| Name | Type | Required | Description |
|---|---|---|---|
reason | "logout" | "switched" | "completed" | yes |
Policy
All six keys must be present in the body (module-enforced, 422 otherwise); the five numeric/list fields may be null, meaning "not configured" (fail closed). They are not listed in required only because the server code generator would then reject null.
| Name | Type | Required | Description |
|---|---|---|---|
relationship_hours | integer | null | no | |
context_minutes | integer | null | no | |
emergency_max_minutes | integer | null | no | |
stale_after_hours | integer | null | no | |
high_risk_sections | array of string | no | |
approval_reference | string | yes |
CodeListUpsert
| Name | Type | Required | Description |
|---|---|---|---|
entries | array of CodeListUpsert.entries.item | yes |
ExportCommand
| Name | Type | Required | Description |
|---|---|---|---|
format | "csv" | "pdf" | yes | |
filters | ReportFilters | no |
ChartView
| Name | Type | Required | Description |
|---|---|---|---|
context_id | string (uuid) | no | |
patient_id | string (uuid) | no | |
emergency | boolean | no | |
banner | "emergency_access" | null | no | |
record_complete | boolean | no | False whenever any section is incomplete, empty or in conflict |
has_conflicts | boolean | no | |
sections | array of ChartView.sections.item | no | |
not_permitted_sections | array of string | no |
Report
| Name | Type | Required | Description |
|---|---|---|---|
report_id | "OHN-32-R001" | "OHN-32-R002" | "OHN-32-R003" | no | |
title | string | no | |
columns | array of string | no | |
rows | array of object | no | |
summary | object | no | |
state | "rendered" | "no_authorized_data" | no | |
generated_at | string (date-time) | no | |
next_cursor | string | null | no |
ReportFilters
| Name | Type | Required | Description |
|---|---|---|---|
facility | string (uuid) | no | |
risk | "high" | "standard" | no | |
period_from | string | no | |
period_to | string | no |
CodeListUpsert.entries.item defined inline
| Name | Type | Required | Description |
|---|---|---|---|
code | string | yes | |
label_en | string | yes | |
label_fr | string | yes | |
active | boolean | no |
ChartView.sections.item defined inline
| Name | Type | Required | Description |
|---|---|---|---|
section | string | no | |
complete | boolean | no | |
freshness | "current" | "stale" | "unknown" | no | |
warning | "sources_conflict" | "incomplete" | "no_source" | "stale" | "age_unknown" | null | no | |
sources | array of any | no | Each source keeps its provenance, as-of time and version |