OHN-18 Clinical Audit and Data Provenance
- Version
- 1.1.0
- OpenAPI
- 3.1.0
- Source in the repository
modules/OHN-18/api/openapi.yaml- Servers
https://opeshealthnetwork.com- Authentication
bearerAuth: http bearer (JWT)
Contracts are written in English.
Tamper-evident who/what/why/where/when evidence for access, changes and clinical assertions. All routes live under /api/ohn/v1/audit. Every POST requires an Idempotency-Key header. Default deny: only security_auditor and privacy_officer roles are permitted. Synthetic data only. 1.1.0 (2026-11-23): read-only role inspector (purpose regulatory_audit). It may call every GET and POST /reports/{report_id}/export, nothing else (ingest, investigations, integrity/verify, disclosure-trace-requests and transitions answer 403 and are recorded as denied.<action>). Every GET it makes is recorded first in the audit records (action audit.inspector.read); when that record cannot be written the answer is 503 audit_unavailable. Its export download is an attachment (Content-Disposition) and carries the OHN-16 security watermark with "INSPECTION COPY" (header X-OHN-Document-Mark; X-OHN-Unmarked-SHA256 is the digest the export signature covers). Java: tokens are issued by the gateway (ES256, audience ohn-18); the TypeScript synthetic sign-in helpers are not part of this contract.
Operations
- events (4)
- integrity (3)
- disclosures (3)
- workflows (1)
- reports (3)
- Other operations (3)
events
GET/api/ohn/v1/audit/events
OHN-18-API-001. Cursor-paginated audit envelopes in the caller's jurisdiction. Patient references are masked.
Operation ID: ohn18_getAuditEvents
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
cursor | query | string | no | |
page_size | query | string | no | Clamped to 1..100, default 25 |
decision | query | string | no | |
kind | query | string | no | |
domain | query | string | no | Resource type |
patient_id | query | string | no | |
period_from | query | string | no | |
period_to | query | string | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Page of envelopes with provenance and next_cursor | application/json: JsonObject |
401 | Missing or invalid bearer token | — |
403 | denied_by_policy (role, purpose or jurisdiction) | — |
429 | rate_limited, with Retry-After | — |
POST/api/ohn/v1/audit/events
Append one access decision to the jurisdiction's hash chain (W001 access_decided).
Operation ID: ohn18_ingestAuditEvent
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:AuditEventCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Envelope appended; receipt with sequence_number and entry_hash | application/json: JsonObject |
400 | missing_idempotency_key | — |
403 | denied_by_policy (role, purpose or jurisdiction) | — |
409 | stale_version, idempotency_conflict or request_in_progress | — |
422 | domain_validation_failed with field details | — |
503 | jurisdiction_unavailable, identity_provider_unavailable or dependency_unavailable; nothing written | — |
GET/api/ohn/v1/audit/events/{id}
Operation ID: ohn18_getAuditEvent
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Envelope detail with chain verification, provenance links and history timeline | application/json: JsonObject |
404 | not_found | — |
POST/api/ohn/v1/audit/investigations
Form OHN-18-F001 (Audit investigation).
Operation ID: ohn18_openInvestigation
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:AuditInvestigationCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Investigation envelope appended with receipt | application/json: JsonObject |
404 | not_found | — |
422 | domain_validation_failed with field details | — |
integrity
POST/api/ohn/v1/audit/integrity/verify
OHN-18-API-003, form OHN-18-F002. Recomputes the hash chain over a sequence range and compares with expected_root_hash. Never repairs. A mismatch emits audit.integrity.failure.
Operation ID: ohn18_verifyIntegrity
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:IntegrityVerificationCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Checkpoint recorded (result passed or failed) | application/json: JsonObject |
403 | denied_by_policy (role, purpose or jurisdiction) | — |
409 | stale_version, idempotency_conflict or request_in_progress | — |
422 | domain_validation_failed with field details | — |
503 | jurisdiction_unavailable, identity_provider_unavailable or dependency_unavailable; nothing written | — |
GET/api/ohn/v1/audit/integrity/state
Operation ID: ohn18_getIntegrityState
Authentication: bearerAuth
Responses
| Code | Description | Media type |
|---|---|---|
200 | Current chain head, length and computed root hash for the jurisdiction | application/json: JsonObject |
GET/api/ohn/v1/audit/integrity/verifications
Operation ID: ohn18_listVerifications
Authentication: bearerAuth
Responses
| Code | Description | Media type |
|---|---|---|
200 | Provenance links (verification runs) | application/json: JsonObject |
disclosures
GET/api/ohn/v1/audit/checkpoints
Operation ID: ohn18_listCheckpoints
Authentication: bearerAuth
Responses
| Code | Description | Media type |
|---|---|---|
200 | Disclosure trace requests (AuditIntegrityCheckpoint aggregate) | application/json: JsonObject |
POST/api/ohn/v1/audit/disclosure-trace-requests
Form OHN-18-F003. Opens W003 at rights_request_authorized.
Operation ID: ohn18_requestDisclosureTrace
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:DisclosureTraceCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Trace request recorded | application/json: JsonObject |
422 | domain_validation_failed with field details | — |
GET/api/ohn/v1/audit/patients/{id}/disclosures
OHN-18-API-002 (relocated under /audit because /api/ohn/v1/patients is owned by OHN-01/02/03). Never returns other patients or staff security secrets.
Operation ID: ohn18_getPatientDisclosures
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
purpose | query | string | no | |
date_from | query | string | no | |
date_to | query | string | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Disclosure entries with authorized and denied counts | application/json: JsonObject |
400 | Malformed patient id | — |
workflows
POST/api/ohn/v1/audit/workflows/{kind}/{id}/transitions
Advance W001 clinical_access_audit, W002 integrity_review or W003 patient_disclosure_accounting by exactly one step with optimistic concurrency.
Operation ID: ohn18_transitionWorkflow
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
kind | path | string | yes | clinical_access_audit, integrity_review or patient_disclosure_accounting; anything else is 404 |
id | path | string | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:WorkflowTransitionCommand
Responses
| Code | Description | Media type |
|---|---|---|
200 | Transition committed with receipt | application/json: JsonObject |
409 | stale_version, idempotency_conflict or request_in_progress | — |
422 | domain_validation_failed with field details | — |
reports
GET/api/ohn/v1/audit/reports/{reportId}
Operation ID: ohn18_getReport
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
reportId | path | string | yes | OHN-18-R001, OHN-18-R002 or OHN-18-R003; anything else is 404 |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Report rows, metric definition, period and source freshness | application/json: JsonObject |
POST/api/ohn/v1/audit/reports/{reportId}/export
Operation ID: ohn18_createExport
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
reportId | path | string | yes | OHN-18-R001, OHN-18-R002 or OHN-18-R003; anything else is 404 |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:ExportCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Ed25519-signed export, registered in OHN-45 (signature.ohn45_artifact_ref / ohn45_signature_ref); one-time retrieval path; emits audit.export.generated | application/json: JsonObject |
503 | signing_unavailable (no key or OHN-45 unreachable) or policy_not_configured (R003); nothing generated | — |
GET/api/ohn/v1/audit/exports/{token}
Operation ID: ohn18_downloadExport
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
token | path | string | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | CSV or PDF body with X-OHN-Signature header | text/csv: string (binary)application/pdf: string (binary) |
404 | not_found | — |
Other operations
GET/health/ohn-18
Operation ID: ohn18_health
Responses
| Code | Description | Media type |
|---|---|---|
200 | Database reachable | application/json: JsonObject |
503 | Database unavailable | — |
GET/api/ohn/v1/audit/health
Database and dependency modes (live / unavailable-fail-closed). Reachable through the platform's /api/ohn proxy.
Operation ID: ohn18_externalHealth
Responses
| Code | Description | Media type |
|---|---|---|
200 | Healthy | application/json: JsonObject |
503 | Database unavailable | — |
GET/api/ohn/v1/audit/jurisdictions
OHN-01 jurisdictions in force (status active or reinstated).
Operation ID: ohn18_listJurisdictions
Authentication: bearerAuth
Responses
| Code | Description | Media type |
|---|---|---|
200 | Jurisdictions from OHN-01 | application/json: JsonObject |
503 | jurisdiction_unavailable, identity_provider_unavailable or dependency_unavailable; nothing written | — |
Schemas
JsonObject
object
AuditDecision
"permitted" | "denied"
RequestPurpose
"patient_rights_request" | "regulatory_audit" | "legal_disclosure" | "continuity_of_care"
AuditEventCommand
| Name | Type | Required | Description |
|---|---|---|---|
jurisdiction_id | string (uuid) | yes | |
actor_id | string (uuid) | yes | |
actor_role | string | yes | |
action | string | yes | |
resource_type | string | yes | |
resource_id | string (uuid) | yes | |
patient_id | string (uuid) | no | |
facility_id | string (uuid) | no | |
purpose | RequestPurpose | yes | |
decision | AuditDecision | yes | |
reason | string | no | |
event_time | string (date-time) | no |
AuditInvestigationCommand
| Name | Type | Required | Description |
|---|---|---|---|
event_id | string (uuid) | yes | |
investigation_reason | string | yes | |
investigator_id | string (uuid) | yes | |
scope | string | yes | |
case_ref | string (uuid) | no |
IntegrityVerificationCommand
| Name | Type | Required | Description |
|---|---|---|---|
jurisdiction_id | string (uuid) | yes | |
sequence_from | integer | yes | |
sequence_to | integer | yes | Must be >= sequence_from |
expected_root_hash | string | yes | |
verification_environment | "production" | "staging" | "disaster_recovery" | yes |
DisclosureTraceCommand
| Name | Type | Required | Description |
|---|---|---|---|
patient_id | string (uuid) | yes | |
date_from | string (date) | yes | |
date_to | string (date) | yes | |
request_purpose | RequestPurpose | yes | |
recipient_scope | string | no |
WorkflowTransitionCommand
| Name | Type | Required | Description |
|---|---|---|---|
expected_version | integer | yes | |
to_state | string | yes | |
evidence_ref | string (uuid) | yes | |
reason | string | yes |
ExportCommand
| Name | Type | Required | Description |
|---|---|---|---|
format | "csv" | "pdf" | yes | |
period_from | string (date-time) | no | |
period_to | string (date-time) | no | |
facility_id | string (uuid) | no | |
severity | "low" | "medium" | "high" | "critical" | no | |
patient_id | string (uuid) | no | |
request_purpose | RequestPurpose | no |