Skip to content

← All contracts

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

Download the contract (JSON)

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

GET/clinician/worklistWorklist: my active contexts and pending relationships (API-001)

Operation ID: worklist

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency 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

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
409Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency 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

NameInTypeRequiredDescription
idpathstring (uuid)yes
context_idquerystring (uuid)noRequired; validated by the module (422 domain_validation_failed when missing).
sectionsquerystringnoComma-separated section codes
facility_idquerystring (uuid)no
purposequerystringno

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/clinician/patients/{id}/sections/{section}/comparisonCompare the sources of one section (W002)

Operation ID: compareSources

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
sectionpathstringyes
context_idquerystring (uuid)noRequired; validated by the module (422 domain_validation_failed when missing).

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/clinician/emergency-requestsEmergency path: justified, bounded, never silent (W003)

Operation ID: requestEmergency

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
409Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/clinician/contextsMy contexts (supervisors: all in jurisdiction)

Operation ID: listContexts

Authentication: bearer

Parameters

NameInTypeRequiredDescription
statequery"active" | "ended"no
cursorquerystringno

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/clinician/contexts/{id}Context with authorization basis and history

Operation ID: getContext

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency 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

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
409Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/clinician/relationshipsRelationships (state)

Operation ID: listRelationships

Authentication: bearer

Parameters

NameInTypeRequiredDescription
statequerystringno
cursorquerystringno

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/clinician/relationshipsDeclare a care relationship (F002)

Operation ID: declareRelationship

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
409Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/clinician/relationships/{id}/decisionApprove or reject a pending relationship (supervisor, not the declarer)

Operation ID: decideRelationship

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
409Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/clinician/correction-referralsMy referrals

Operation ID: listReferrals

Authentication: bearer

Parameters

NameInTypeRequiredDescription
cursorquerystringno

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/clinician/correction-referralsRefer a source discrepancy for correction (F003); delivery is not claimed

Operation ID: createReferral

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
409Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/clinician/conflictsUnresolved source conflicts (supervisor)

Operation ID: listConflicts

Authentication: bearer

Parameters

NameInTypeRequiredDescription
riskquery"high" | "standard"no
referral_statequery"none" | "referred"no
cursorquerystringno

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/clinician/policyRead policy (unset = fail closed)

Operation ID: readPolicy

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/clinician/policyWrite policy

Operation ID: writePolicy

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
409Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/clinician/code-lists/{list}Read code list

Operation ID: listCodes

Authentication: bearer

Parameters

NameInTypeRequiredDescription
listpath"care_purpose" | "relationship_basis" | "requested_category" | "clinical_urgency"yes

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/clinician/code-lists/{list}Upsert code list entries

Operation ID: upsertCodes

Authentication: bearer

Parameters

NameInTypeRequiredDescription
listpath"care_purpose" | "relationship_basis" | "requested_category" | "clinical_urgency"yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
409Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/clinician/maintenance/context-sweepClose contexts past their expiry

Operation ID: contextSweep

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
409Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/clinician/maintenance/drain-outboxDrain outbox (no sink => nothing marked delivered)

Operation ID: drainOutbox

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
409Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/clinician/report-catalogReport catalog

Operation ID: reportCatalog

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/clinician/reports/{reportId}Run report

Operation ID: runReport

Authentication: bearer

Parameters

NameInTypeRequiredDescription
reportIdpath"OHN-32-R001" | "OHN-32-R002" | "OHN-32-R003"yes
facilityquerystring (uuid)no
riskquery"high" | "standard"no
period_fromquerystringno
period_toquerystringno
cursorquerystringno

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
POST/clinician/reports/{reportId}/exportCreate signed single-use export

Operation ID: createExport

Authentication: bearer

Parameters

NameInTypeRequiredDescription
reportIdpath"OHN-32-R001" | "OHN-32-R002" | "OHN-32-R003"yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
409Version conflict, illegal transition, ended/expired context, identity changed, or idempotency mismatch
application/json: Error
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—
GET/clinician/exports/{token}Download export (owner only, single use, 5 min)

Operation ID: fetchExport

Authentication: bearer

Parameters

NameInTypeRequiredDescription
tokenpathstringyes

Responses

CodeDescriptionMedia type
200OK
application/json: object
400Malformed / missing Idempotency-Key—
401Unauthenticated—
403Role/purpose denied, MFA required, no care relationship, context mismatch, or separation of duties—
404Not found / out of scope—
422Validation or domain refusal
application/json: Error
429Rate limited—
503Dependency unavailable (fails closed)—

Other operations

GET/health/ohn-32Liveness incl. DB and dependency modes

Operation ID: health

Responses

CodeDescriptionMedia type
200ok—
503unavailable—

Schemas

Error

NameTypeRequiredDescription
errorstringyes
messagestringno
detailsanyno

Resolve

NameTypeRequiredDescription
patient_id_or_identifierstringyesNever stored in clear; only a hash is kept
facility_idstring (uuid)yes
encounter_or_relationship_refstring (uuid)yesAn active care relationship of the caller at this facility
care_purposestringyes
device_refstringno

Relationship

NameTypeRequiredDescription
patient_refstring (uuid)yes
facility_idstring (uuid)yes
requested_categorystringyes
relationship_basisstringyes
case_referencestring (uuid)yes
reasonstringyes

RelationshipDecision

NameTypeRequiredDescription
decision"approve" | "reject"yes
reasonstringyes
expected_versionintegeryes

Referral

NameTypeRequiredDescription
context_idstring (uuid)yes
source_record_refstring (uuid)yes
discrepancystringyes
clinical_urgencystringyes
source_contactstring (uuid)yes

Emergency

NameTypeRequiredDescription
patient_id_or_identifierstringyes
facility_idstring (uuid)yes
case_referencestring (uuid)yes
justificationstringyes
requested_sectionsarray of stringyes
duration_minutesintegeryes
device_refstringno

EndContext

NameTypeRequiredDescription
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.

NameTypeRequiredDescription
relationship_hoursinteger | nullno
context_minutesinteger | nullno
emergency_max_minutesinteger | nullno
stale_after_hoursinteger | nullno
high_risk_sectionsarray of stringno
approval_referencestringyes

CodeListUpsert

NameTypeRequiredDescription
entriesarray of CodeListUpsert.entries.itemyes

ExportCommand

NameTypeRequiredDescription
format"csv" | "pdf"yes
filtersReportFiltersno

ChartView

NameTypeRequiredDescription
context_idstring (uuid)no
patient_idstring (uuid)no
emergencybooleanno
banner"emergency_access" | nullno
record_completebooleannoFalse whenever any section is incomplete, empty or in conflict
has_conflictsbooleanno
sectionsarray of ChartView.sections.itemno
not_permitted_sectionsarray of stringno

Report

NameTypeRequiredDescription
report_id"OHN-32-R001" | "OHN-32-R002" | "OHN-32-R003"no
titlestringno
columnsarray of stringno
rowsarray of objectno
summaryobjectno
state"rendered" | "no_authorized_data"no
generated_atstring (date-time)no
next_cursorstring | nullno

ReportFilters

NameTypeRequiredDescription
facilitystring (uuid)no
risk"high" | "standard"no
period_fromstringno
period_tostringno

CodeListUpsert.entries.item defined inline

NameTypeRequiredDescription
codestringyes
label_enstringyes
label_frstringyes
activebooleanno

ChartView.sections.item defined inline

NameTypeRequiredDescription
sectionstringno
completebooleanno
freshness"current" | "stale" | "unknown"no
warning"sources_conflict" | "incomplete" | "no_source" | "stale" | "age_unknown" | nullno
sourcesarray of anynoEach source keeps its provenance, as-of time and version