← All contracts
OHN-13 Clinical Document Registry
- Version
- 1.0.0
- OpenAPI
- 3.1.0
- Source in the repository
modules/OHN-13/api/openapi.yaml- Servers
https://opeshealthnetwork.com
- Authentication
bearerAuth: http bearer (JWT)
Download the contract (YAML)
Contracts are written in English.
Document ingestion with malware scanning and digest verification (W001), short-lived one-time retrieval with receipts (W002), and amendment with preserved versions (W003). Every POST requires an Idempotency-Key. Document bodies never appear in URLs, events, logs or reports; patient references are never returned.
Operations
Health
GET/health/ohn-13Liveness and database check
Operation ID: ohn13_health
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
404 | Not found or not disclosed | |
Synthetic
POST/api/ohn/v1/documents/synthetic-tokenIssue a synthetic token (synthetic mode only)
Operation ID: ohn13_syntheticToken
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
404 | Not found or not disclosed | |
POST/api/ohn/v1/documents/synthetic/setupConfigure synthetic upstream fakes
Operation ID: ohn13_syntheticSetup
Authentication: bearerAuth
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 (audited) | |
404 | Not found or not disclosed | |
409 | Stale version, invalid transition, conflict or reused idempotency key | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
Documents
GET/api/ohn/v1/documentsDocument index (patient masked)
Operation ID: ohn13_listDocuments
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|
state | query | string | no | |
document_type | query | string | no | |
patient_ref | query | string (uuid) | no | |
source_org | query | string (uuid) | no | |
cursor | query | string | no | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
401 | Unauthenticated | |
403 | Denied by policy (audited) | |
404 | Not found or not disclosed | |
410 | Gone: link expired, used or revoked | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
GET/api/ohn/v1/documents/contextCaller principal and permitted actions
Operation ID: ohn13_context
Authentication: bearerAuth
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
401 | Unauthenticated | |
403 | Denied by policy (audited) | |
404 | Not found or not disclosed | |
410 | Gone: link expired, used or revoked | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
GET/api/ohn/v1/documents/vocabularyControlled vocabularies
Operation ID: ohn13_vocabulary
Authentication: bearerAuth
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
401 | Unauthenticated | |
403 | Denied by policy (audited) | |
404 | Not found or not disclosed | |
410 | Gone: link expired, used or revoked | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
GET/api/ohn/v1/documents/monitorIngest KPIs, 14-day trend and exceptions
Operation ID: ohn13_monitor
Authentication: bearerAuth
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
401 | Unauthenticated | |
403 | Denied by policy (audited) | |
404 | Not found or not disclosed | |
410 | Gone: link expired, used or revoked | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
POST/api/ohn/v1/documents/contentsStore content and scan it; returns storage_locator and sha256
Operation ID: ohn13_uploadContent
Authentication: bearerAuth
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 (audited) | |
404 | Not found or not disclosed | |
409 | Stale version, invalid transition, conflict or reused idempotency key | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
POST/api/ohn/v1/documents/registerRegister a document (F001, W001): 201 indexed, 202 quarantined, 422 rejected
Operation ID: ohn13_registerDocument
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | Success | application/json: object
|
202 | Quarantined for content review | application/json: object
|
400 | Malformed request or missing Idempotency-Key | |
401 | Unauthenticated | |
403 | Denied by policy (audited) | |
404 | Not found or not disclosed | |
409 | Stale version, invalid transition, conflict or reused idempotency key | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
GET/api/ohn/v1/documents/{id}/metadataMetadata, scan, freshness and history (no content)
Operation ID: ohn13_getMetadata
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
401 | Unauthenticated | |
403 | Denied by policy (audited) | |
404 | Not found or not disclosed | |
410 | Gone: link expired, used or revoked | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
GET/api/ohn/v1/documents/{id}/integrity-checksIntegrity re-check history
Operation ID: ohn13_listIntegrityChecks
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
401 | Unauthenticated | |
403 | Denied by policy (audited) | |
404 | Not found or not disclosed | |
410 | Gone: link expired, used or revoked | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
POST/api/ohn/v1/documents/{id}/quarantine-decisionRelease (suspicious only) or reject a quarantined document
Operation ID: ohn13_quarantineDecision
Authentication: bearerAuth
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 (audited) | |
404 | Not found or not disclosed | |
409 | Stale version, invalid transition, conflict or reused idempotency key | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
POST/api/ohn/v1/documents/{id}/revokeRevoke; outstanding delivery links stop working
Operation ID: ohn13_revokeDocument
Authentication: bearerAuth
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 (audited) | |
404 | Not found or not disclosed | |
409 | Stale version, invalid transition, conflict or reused idempotency key | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
POST/api/ohn/v1/documents/{id}/verify-integrityRecompute digests and rescan every version
Operation ID: ohn13_verifyIntegrity
Authentication: bearerAuth
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 (audited) | |
404 | Not found or not disclosed | |
409 | Stale version, invalid transition, conflict or reused idempotency key | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
Amendment
GET/api/ohn/v1/documents/amendmentsAmendment requests
Operation ID: ohn13_listAmendments
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|
state | query | string | no | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
401 | Unauthenticated | |
403 | Denied by policy (audited) | |
404 | Not found or not disclosed | |
410 | Gone: link expired, used or revoked | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
POST/api/ohn/v1/documents/amendments/{id}/decideSteward verifies (links new version, preserves old) or rejects
Operation ID: ohn13_decideAmendment
Authentication: bearerAuth
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 (audited) | |
404 | Not found or not disclosed | |
409 | Stale version, invalid transition, conflict or reused idempotency key | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
GET/api/ohn/v1/documents/{id}/versionsAll versions, oldest preserved
Operation ID: ohn13_listVersions
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
401 | Unauthenticated | |
403 | Denied by policy (audited) | |
404 | Not found or not disclosed | |
410 | Gone: link expired, used or revoked | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
POST/api/ohn/v1/documents/{id}/amendmentsRequest a version correction (F003)
Operation ID: ohn13_requestAmendment
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | 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 (audited) | |
404 | Not found or not disclosed | |
409 | Stale version, invalid transition, conflict or reused idempotency key | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
Retrieval
GET/api/ohn/v1/documents/deliveries/{token}One-time, requester-bound, 5-minute delivery of the document body
Operation ID: ohn13_deliverDocument
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|
token | path | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Success; the body is the stored document with its own media type; headers X-Content-SHA256 and Content-Security-Policy | application/pdf: string (binary)
text/plain: string (binary)
image/png: string (binary)
image/jpeg: string (binary)
application/fhir+json: string (binary)
application/xml: string (binary)
|
401 | Unauthenticated | |
403 | Denied by policy (audited) | |
404 | Not found or not disclosed | |
410 | Gone: link expired, used or revoked | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
GET/api/ohn/v1/documents/{id}/receiptsRetrieval receipts (access audit)
Operation ID: ohn13_listReceipts
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
401 | Unauthenticated | |
403 | Denied by policy (audited) | |
404 | Not found or not disclosed | |
410 | Gone: link expired, used or revoked | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
POST/api/ohn/v1/documents/{id}/retrieveRequest retrieval (F002, W002): delivery link or metadata
Operation ID: ohn13_retrieveDocument
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | 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 (audited) | |
404 | Not found or not disclosed | |
409 | Stale version, invalid transition, conflict or reused idempotency key | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
Reports
GET/api/ohn/v1/documents/reports/{reportId}Run OHN-13-R001..R003
Operation ID: ohn13_runReport
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|
reportId | path | "OHN-13-R001" | "OHN-13-R002" | "OHN-13-R003" | yes | |
from | query | string | no | ISO date-time with offset; a malformed filter answers 422 invalid_filter |
to | query | string | no | ISO date-time with offset; a malformed filter answers 422 invalid_filter |
facility | query | string | no | Organisation id (uuid); validated by the report filter rules |
source | query | string | no | Source organisation id (uuid); validated by the report filter rules |
document_type | query | string | no | |
type | query | string | no | |
status | query | string | no | |
cursor | query | string | no | |
Responses
| Code | Description | Media type |
|---|
200 | Success | application/json: object
|
401 | Unauthenticated | |
403 | Denied by policy (audited) | |
404 | Not found or not disclosed | |
410 | Gone: link expired, used or revoked | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
POST/api/ohn/v1/documents/reports/{reportId}/exportSigned, 5-minute, owner-only CSV or PDF export
Operation ID: ohn13_exportReport
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|
reportId | path | "OHN-13-R001" | "OHN-13-R002" | "OHN-13-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 (audited) | |
404 | Not found or not disclosed | |
409 | Stale version, invalid transition, conflict or reused idempotency key | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
GET/api/ohn/v1/documents/exports/{token}Download an export (audited)
Operation ID: ohn13_downloadExport
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|
token | path | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Success | text/csv: string (binary)
application/pdf: string (binary)
|
401 | Unauthenticated | |
403 | Denied by policy (audited) | |
404 | Not found or not disclosed | |
410 | Gone: link expired, used or revoked | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
Patient access
GET/api/ohn/v1/documents/patients/{patientRef}/patient-viewThe patient's own documents for the OHN-31 patient chart (role patient, purpose patient_access; own record only, otherwise 404; every read audited)
Operation ID: ohn13_patientDocumentView
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|
patientRef | 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
|
401 | Unauthenticated | |
403 | Denied by policy (audited) | |
404 | Not found or not disclosed | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
POST/api/ohn/v1/documents/patients/{patientRef}/patient-view/{id}/retrieveA one-time delivery link for one of the patient's own documents (empty body)
Operation ID: ohn13_patientDocumentRetrieve
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|
patientRef | path | string (uuid) | yes | |
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body
Responses
| Code | Description | Media type |
|---|
201 | Success | application/json: object
|
400 | Malformed request or missing Idempotency-Key | |
401 | Unauthenticated | |
403 | Denied by policy (audited) | |
404 | Not found or not disclosed | |
409 | Stale version, invalid transition, conflict or reused idempotency key | |
422 | Validation failure or domain refusal | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
GET/api/ohn/v1/documents/patient-deliveries/{token}One-time, patient-bound delivery of the document body issued by the patient-view retrieve
Operation ID: ohn13_patientDeliverDocument
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|
token | path | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Success; the body is the stored document with its own media type; headers X-Content-SHA256 and Content-Security-Policy | application/pdf: string (binary)
text/plain: string (binary)
image/png: string (binary)
image/jpeg: string (binary)
application/fhir+json: string (binary)
application/xml: string (binary)
|
401 | Unauthenticated | |
403 | Denied by policy (audited) | |
404 | Not found or not disclosed | |
410 | Gone: link expired, used or revoked | |
429 | Rate limited; see Retry-After | |
503 | Jurisdiction service or another dependency unavailable; nothing changed | |
Schemas
Error
| Name | Type | Required | Description |
|---|
error | string | yes | |
message | string | no | |
details | any | no | |
Document
JSON document; shapes are listed in modules/OHN-13/data/schema.md
object
Receipt
| Name | Type | Required | Description |
|---|
receipt_id | string (uuid) | yes | |
committed_at | string (date-time) | yes | |
aggregate_id | string (uuid) | yes | |
aggregate_type | string | yes | |
version | integer | yes | |
status | "committed" | "denied" | "pending" | yes | |
CommandResult
| Name | Type | Required | Description |
|---|
receipt | Receipt | no | |
Versioned
| Name | Type | Required | Description |
|---|
expected_version | integer | yes | |
Export
| Name | Type | Required | Description |
|---|
format | "csv" | "pdf" | yes | |
filters | object | no | |
Reasoned
| Name | Type | Required | Description |
|---|
expected_version | integer | yes | |
reason | string | yes | |
Content
| Name | Type | Required | Description |
|---|
media_type | "application/pdf" | "text/plain" | "image/png" | "image/jpeg" | "application/fhir+json" | "application/xml" | yes | |
content_base64 | string | yes | At most 2 MB once decoded |
Register
OHN-13-F001 Document registry entry
| Name | Type | Required | Description |
|---|
patient_ref | string (uuid) | yes | Restricted; never returned |
source_org | string (uuid) | yes | |
document_type | "discharge_summary" | "referral_letter" | "lab_report" | "imaging_report" | "prescription" | "consent_form" | "operative_note" | "clinic_letter" | yes | |
clinical_date | string (date) | yes | |
content_hash | string | yes | |
storage_locator | string (uuid) | yes | |
security_label | "normal" | "restricted" | "very_restricted" | yes | |
Retrieve
OHN-13-F002 Document retrieval request (document_id is the path id)
| Name | Type | Required | Description |
|---|
clinical_purpose | "treatment" | "care_coordination" | "emergency_care" | yes | |
relationship_ref | string (uuid) | yes | |
requested_format | "original" | "metadata_only" | yes | |
Amendment
OHN-13-F003 Document version correction (document_id is the path id)
| Name | Type | Required | Description |
|---|
replacement_ref | string (uuid) | yes | |
change_reason | string | yes | |
author_id | string (uuid) | yes | |
effective_at | string (date-time) | yes | |
QuarantineDecision
| Name | Type | Required | Description |
|---|
expected_version | integer | yes | |
decision | "release" | "reject" | yes | |
reason | string | yes | |
AmendmentDecision
| Name | Type | Required | Description |
|---|
expected_version | integer | yes | |
decision | "verify" | "reject" | yes | |
reason | string | yes | |
SyntheticToken
| Name | Type | Required | Description |
|---|
principal_id | string (uuid) | yes | |
role | "clinical_document_steward" | "licensed_clinician" | "document_source" | "unauthorized_viewer" | "patient" | yes | |
jurisdiction | string (uuid) | yes | |
organization_id | string (uuid) | yes | |
purpose | "document_management" | "document_submission" | "treatment" | "care_coordination" | "emergency_care" | "patient_access" | yes | |
practitioner_id | string (uuid) | no | Optional OHN-06 health-worker id the gateway attests |
SyntheticSetup
| Name | Type | Required | Description |
|---|
deny_patients | array of string (uuid) | no | |
deny_labels | array of "normal" | "restricted" | "very_restricted" | no | |
down | array of "OHN-01" | "OHN-16" | "OHN-42" | no | |
reset | boolean | no | |