Skip to content

← 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

CodeDescriptionMedia type
200Success
application/json: object
404Not found or not disclosed
application/json: Error

Synthetic

POST/api/ohn/v1/documents/synthetic-tokenIssue a synthetic token (synthetic mode only)

Operation ID: ohn13_syntheticToken

Request body (required)

Responses

CodeDescriptionMedia type
200Success
application/json: object
404Not found or not disclosed
application/json: Error
POST/api/ohn/v1/documents/synthetic/setupConfigure synthetic upstream fakes

Operation ID: ohn13_syntheticSetup

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Success
application/json: object
400Malformed request or missing Idempotency-Key
application/json: Error
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
409Stale version, invalid transition, conflict or reused idempotency key
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error

Documents

GET/api/ohn/v1/documentsDocument index (patient masked)

Operation ID: ohn13_listDocuments

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
statequerystringno
document_typequerystringno
patient_refquerystring (uuid)no
source_orgquerystring (uuid)no
cursorquerystringno

Responses

CodeDescriptionMedia type
200Success
application/json: object
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
410Gone: link expired, used or revoked
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
GET/api/ohn/v1/documents/contextCaller principal and permitted actions

Operation ID: ohn13_context

Authentication: bearerAuth

Responses

CodeDescriptionMedia type
200Success
application/json: object
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
410Gone: link expired, used or revoked
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
GET/api/ohn/v1/documents/vocabularyControlled vocabularies

Operation ID: ohn13_vocabulary

Authentication: bearerAuth

Responses

CodeDescriptionMedia type
200Success
application/json: object
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
410Gone: link expired, used or revoked
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
GET/api/ohn/v1/documents/monitorIngest KPIs, 14-day trend and exceptions

Operation ID: ohn13_monitor

Authentication: bearerAuth

Responses

CodeDescriptionMedia type
200Success
application/json: object
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
410Gone: link expired, used or revoked
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
POST/api/ohn/v1/documents/contentsStore content and scan it; returns storage_locator and sha256

Operation ID: ohn13_uploadContent

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Success
application/json: object
400Malformed request or missing Idempotency-Key
application/json: Error
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
409Stale version, invalid transition, conflict or reused idempotency key
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
POST/api/ohn/v1/documents/registerRegister a document (F001, W001): 201 indexed, 202 quarantined, 422 rejected

Operation ID: ohn13_registerDocument

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Success
application/json: object
202Quarantined for content review
application/json: object
400Malformed request or missing Idempotency-Key
application/json: Error
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
409Stale version, invalid transition, conflict or reused idempotency key
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
GET/api/ohn/v1/documents/{id}/metadataMetadata, scan, freshness and history (no content)

Operation ID: ohn13_getMetadata

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Success
application/json: object
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
410Gone: link expired, used or revoked
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
GET/api/ohn/v1/documents/{id}/integrity-checksIntegrity re-check history

Operation ID: ohn13_listIntegrityChecks

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Success
application/json: object
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
410Gone: link expired, used or revoked
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
POST/api/ohn/v1/documents/{id}/quarantine-decisionRelease (suspicious only) or reject a quarantined document

Operation ID: ohn13_quarantineDecision

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Success
application/json: object
400Malformed request or missing Idempotency-Key
application/json: Error
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
409Stale version, invalid transition, conflict or reused idempotency key
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
POST/api/ohn/v1/documents/{id}/revokeRevoke; outstanding delivery links stop working

Operation ID: ohn13_revokeDocument

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Success
application/json: object
400Malformed request or missing Idempotency-Key
application/json: Error
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
409Stale version, invalid transition, conflict or reused idempotency key
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
POST/api/ohn/v1/documents/{id}/verify-integrityRecompute digests and rescan every version

Operation ID: ohn13_verifyIntegrity

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Success
application/json: object
400Malformed request or missing Idempotency-Key
application/json: Error
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
409Stale version, invalid transition, conflict or reused idempotency key
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error

Amendment

GET/api/ohn/v1/documents/amendmentsAmendment requests

Operation ID: ohn13_listAmendments

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
statequerystringno

Responses

CodeDescriptionMedia type
200Success
application/json: object
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
410Gone: link expired, used or revoked
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
POST/api/ohn/v1/documents/amendments/{id}/decideSteward verifies (links new version, preserves old) or rejects

Operation ID: ohn13_decideAmendment

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Success
application/json: object
400Malformed request or missing Idempotency-Key
application/json: Error
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
409Stale version, invalid transition, conflict or reused idempotency key
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
GET/api/ohn/v1/documents/{id}/versionsAll versions, oldest preserved

Operation ID: ohn13_listVersions

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Success
application/json: object
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
410Gone: link expired, used or revoked
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
POST/api/ohn/v1/documents/{id}/amendmentsRequest a version correction (F003)

Operation ID: ohn13_requestAmendment

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Success
application/json: object
400Malformed request or missing Idempotency-Key
application/json: Error
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
409Stale version, invalid transition, conflict or reused idempotency key
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error

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

NameInTypeRequiredDescription
tokenpathstringyes

Responses

CodeDescriptionMedia type
200Success; 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)
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
410Gone: link expired, used or revoked
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
GET/api/ohn/v1/documents/{id}/receiptsRetrieval receipts (access audit)

Operation ID: ohn13_listReceipts

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Success
application/json: object
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
410Gone: link expired, used or revoked
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
POST/api/ohn/v1/documents/{id}/retrieveRequest retrieval (F002, W002): delivery link or metadata

Operation ID: ohn13_retrieveDocument

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Success
application/json: object
400Malformed request or missing Idempotency-Key
application/json: Error
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
409Stale version, invalid transition, conflict or reused idempotency key
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error

Reports

GET/api/ohn/v1/documents/reports/{reportId}Run OHN-13-R001..R003

Operation ID: ohn13_runReport

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
reportIdpath"OHN-13-R001" | "OHN-13-R002" | "OHN-13-R003"yes
fromquerystringnoISO date-time with offset; a malformed filter answers 422 invalid_filter
toquerystringnoISO date-time with offset; a malformed filter answers 422 invalid_filter
facilityquerystringnoOrganisation id (uuid); validated by the report filter rules
sourcequerystringnoSource organisation id (uuid); validated by the report filter rules
document_typequerystringno
typequerystringno
statusquerystringno
cursorquerystringno

Responses

CodeDescriptionMedia type
200Success
application/json: object
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
410Gone: link expired, used or revoked
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
POST/api/ohn/v1/documents/reports/{reportId}/exportSigned, 5-minute, owner-only CSV or PDF export

Operation ID: ohn13_exportReport

Authentication: bearerAuth

Parameters

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

Request body (required)

Responses

CodeDescriptionMedia type
201Success
application/json: object
400Malformed request or missing Idempotency-Key
application/json: Error
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
409Stale version, invalid transition, conflict or reused idempotency key
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
GET/api/ohn/v1/documents/exports/{token}Download an export (audited)

Operation ID: ohn13_downloadExport

Authentication: bearerAuth

Parameters

NameInTypeRequiredDescription
tokenpathstringyes

Responses

CodeDescriptionMedia type
200Success
text/csv: string (binary)
application/pdf: string (binary)
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
410Gone: link expired, used or revoked
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error

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

NameInTypeRequiredDescription
patientRefpathstring (uuid)yesThe patient's own OHN-03 id (must equal the token subject)

Responses

CodeDescriptionMedia type
200Success
application/json: object
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
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

NameInTypeRequiredDescription
patientRefpathstring (uuid)yes
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body

  • application/json: object

Responses

CodeDescriptionMedia type
201Success
application/json: object
400Malformed request or missing Idempotency-Key
application/json: Error
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
409Stale version, invalid transition, conflict or reused idempotency key
application/json: Error
422Validation failure or domain refusal
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error
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

NameInTypeRequiredDescription
tokenpathstringyes

Responses

CodeDescriptionMedia type
200Success; 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)
401Unauthenticated
application/json: Error
403Denied by policy (audited)
application/json: Error
404Not found or not disclosed
application/json: Error
410Gone: link expired, used or revoked
application/json: Error
429Rate limited; see Retry-After
application/json: Error
503Jurisdiction service or another dependency unavailable; nothing changed
application/json: Error

Schemas

Error

NameTypeRequiredDescription
errorstringyes
messagestringno
detailsanyno

Document

JSON document; shapes are listed in modules/OHN-13/data/schema.md

object

Receipt

NameTypeRequiredDescription
receipt_idstring (uuid)yes
committed_atstring (date-time)yes
aggregate_idstring (uuid)yes
aggregate_typestringyes
versionintegeryes
status"committed" | "denied" | "pending"yes

CommandResult

NameTypeRequiredDescription
receiptReceiptno

Empty

object

Versioned

NameTypeRequiredDescription
expected_versionintegeryes

Export

NameTypeRequiredDescription
format"csv" | "pdf"yes
filtersobjectno

Reasoned

NameTypeRequiredDescription
expected_versionintegeryes
reasonstringyes

Content

NameTypeRequiredDescription
media_type"application/pdf" | "text/plain" | "image/png" | "image/jpeg" | "application/fhir+json" | "application/xml"yes
content_base64stringyesAt most 2 MB once decoded

Register

OHN-13-F001 Document registry entry

NameTypeRequiredDescription
patient_refstring (uuid)yesRestricted; never returned
source_orgstring (uuid)yes
document_type"discharge_summary" | "referral_letter" | "lab_report" | "imaging_report" | "prescription" | "consent_form" | "operative_note" | "clinic_letter"yes
clinical_datestring (date)yes
content_hashstringyes
storage_locatorstring (uuid)yes
security_label"normal" | "restricted" | "very_restricted"yes

Retrieve

OHN-13-F002 Document retrieval request (document_id is the path id)

NameTypeRequiredDescription
clinical_purpose"treatment" | "care_coordination" | "emergency_care"yes
relationship_refstring (uuid)yes
requested_format"original" | "metadata_only"yes

Amendment

OHN-13-F003 Document version correction (document_id is the path id)

NameTypeRequiredDescription
replacement_refstring (uuid)yes
change_reasonstringyes
author_idstring (uuid)yes
effective_atstring (date-time)yes

QuarantineDecision

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

AmendmentDecision

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

SyntheticToken

NameTypeRequiredDescription
principal_idstring (uuid)yes
role"clinical_document_steward" | "licensed_clinician" | "document_source" | "unauthorized_viewer" | "patient"yes
jurisdictionstring (uuid)yes
organization_idstring (uuid)yes
purpose"document_management" | "document_submission" | "treatment" | "care_coordination" | "emergency_care" | "patient_access"yes
practitioner_idstring (uuid)noOptional OHN-06 health-worker id the gateway attests

SyntheticSetup

NameTypeRequiredDescription
deny_patientsarray of string (uuid)no
deny_labelsarray of "normal" | "restricted" | "very_restricted"no
downarray of "OHN-01" | "OHN-16" | "OHN-42"no
resetbooleanno