Aller au contenu

← Tous les contrats

OHN-18 Clinical Audit and Data Provenance

Version
1.1.0
OpenAPI
3.1.0
Source dans le dépôt
modules/OHN-18/api/openapi.yaml
Serveurs
https://opeshealthnetwork.com
Authentification
bearerAuth: http bearer (JWT)

Télécharger le contrat (YAML)

Les contrats sont rédigés en anglais.

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.

Opérations

events

GET/api/ohn/v1/audit/events

OHN-18-API-001. Cursor-paginated audit envelopes in the caller's jurisdiction. Patient references are masked.

Identifiant d’opération: ohn18_getAuditEvents

Authentification: bearerAuth

Paramètres

NomEmplacementTypeObligatoireDescription
cursorquerystringnon
page_sizequerystringnonClamped to 1..100, default 25
decisionquerystringnon
kindquerystringnon
domainquerystringnonResource type
patient_idquerystringnon
period_fromquerystringnon
period_toquerystringnon

Réponses

CodeDescriptionType de média
200Page of envelopes with provenance and next_cursor
application/json: JsonObject
401Missing or invalid bearer token—
403denied_by_policy (role, purpose or jurisdiction)—
429rate_limited, with Retry-After—
POST/api/ohn/v1/audit/events

Append one access decision to the jurisdiction's hash chain (W001 access_decided).

Identifiant d’opération: ohn18_ingestAuditEvent

Authentification: bearerAuth

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

Réponses

CodeDescriptionType de média
201Envelope appended; receipt with sequence_number and entry_hash
application/json: JsonObject
400missing_idempotency_key—
403denied_by_policy (role, purpose or jurisdiction)—
409stale_version, idempotency_conflict or request_in_progress—
422domain_validation_failed with field details—
503jurisdiction_unavailable, identity_provider_unavailable or dependency_unavailable; nothing written—
GET/api/ohn/v1/audit/events/{id}

Identifiant d’opération: ohn18_getAuditEvent

Authentification: bearerAuth

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstringoui

Réponses

CodeDescriptionType de média
200Envelope detail with chain verification, provenance links and history timeline
application/json: JsonObject
404not_found—
POST/api/ohn/v1/audit/investigations

Form OHN-18-F001 (Audit investigation).

Identifiant d’opération: ohn18_openInvestigation

Authentification: bearerAuth

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

Réponses

CodeDescriptionType de média
201Investigation envelope appended with receipt
application/json: JsonObject
404not_found—
422domain_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.

Identifiant d’opération: ohn18_verifyIntegrity

Authentification: bearerAuth

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

Réponses

CodeDescriptionType de média
201Checkpoint recorded (result passed or failed)
application/json: JsonObject
403denied_by_policy (role, purpose or jurisdiction)—
409stale_version, idempotency_conflict or request_in_progress—
422domain_validation_failed with field details—
503jurisdiction_unavailable, identity_provider_unavailable or dependency_unavailable; nothing written—
GET/api/ohn/v1/audit/integrity/state

Identifiant d’opération: ohn18_getIntegrityState

Authentification: bearerAuth

Réponses

CodeDescriptionType de média
200Current chain head, length and computed root hash for the jurisdiction
application/json: JsonObject
GET/api/ohn/v1/audit/integrity/verifications

Identifiant d’opération: ohn18_listVerifications

Authentification: bearerAuth

Réponses

CodeDescriptionType de média
200Provenance links (verification runs)
application/json: JsonObject

disclosures

GET/api/ohn/v1/audit/checkpoints

Identifiant d’opération: ohn18_listCheckpoints

Authentification: bearerAuth

Réponses

CodeDescriptionType de média
200Disclosure 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.

Identifiant d’opération: ohn18_requestDisclosureTrace

Authentification: bearerAuth

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

Réponses

CodeDescriptionType de média
201Trace request recorded
application/json: JsonObject
422domain_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.

Identifiant d’opération: ohn18_getPatientDisclosures

Authentification: bearerAuth

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstringoui
purposequerystringnon
date_fromquerystringnon
date_toquerystringnon

Réponses

CodeDescriptionType de média
200Disclosure entries with authorized and denied counts
application/json: JsonObject
400Malformed 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.

Identifiant d’opération: ohn18_transitionWorkflow

Authentification: bearerAuth

Paramètres

NomEmplacementTypeObligatoireDescription
kindpathstringouiclinical_access_audit, integrity_review or patient_disclosure_accounting; anything else is 404
idpathstringoui
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

Réponses

CodeDescriptionType de média
200Transition committed with receipt
application/json: JsonObject
409stale_version, idempotency_conflict or request_in_progress—
422domain_validation_failed with field details—

reports

GET/api/ohn/v1/audit/reports/{reportId}

Identifiant d’opération: ohn18_getReport

Authentification: bearerAuth

Paramètres

NomEmplacementTypeObligatoireDescription
reportIdpathstringouiOHN-18-R001, OHN-18-R002 or OHN-18-R003; anything else is 404

Réponses

CodeDescriptionType de média
200Report rows, metric definition, period and source freshness
application/json: JsonObject
POST/api/ohn/v1/audit/reports/{reportId}/export

Identifiant d’opération: ohn18_createExport

Authentification: bearerAuth

Paramètres

NomEmplacementTypeObligatoireDescription
reportIdpathstringouiOHN-18-R001, OHN-18-R002 or OHN-18-R003; anything else is 404
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

Réponses

CodeDescriptionType de média
201Ed25519-signed export, registered in OHN-45 (signature.ohn45_artifact_ref / ohn45_signature_ref); one-time retrieval path; emits audit.export.generated
application/json: JsonObject
503signing_unavailable (no key or OHN-45 unreachable) or policy_not_configured (R003); nothing generated—
GET/api/ohn/v1/audit/exports/{token}

Identifiant d’opération: ohn18_downloadExport

Authentification: bearerAuth

Paramètres

NomEmplacementTypeObligatoireDescription
tokenpathstringoui

Réponses

CodeDescriptionType de média
200CSV or PDF body with X-OHN-Signature header
text/csv: string (binary)
application/pdf: string (binary)
404not_found—

Autres opérations

GET/health/ohn-18

Identifiant d’opération: ohn18_health

Réponses

CodeDescriptionType de média
200Database reachable
application/json: JsonObject
503Database unavailable—
GET/api/ohn/v1/audit/health

Database and dependency modes (live / unavailable-fail-closed). Reachable through the platform's /api/ohn proxy.

Identifiant d’opération: ohn18_externalHealth

Réponses

CodeDescriptionType de média
200Healthy
application/json: JsonObject
503Database unavailable—
GET/api/ohn/v1/audit/jurisdictions

OHN-01 jurisdictions in force (status active or reinstated).

Identifiant d’opération: ohn18_listJurisdictions

Authentification: bearerAuth

Réponses

CodeDescriptionType de média
200Jurisdictions from OHN-01
application/json: JsonObject
503jurisdiction_unavailable, identity_provider_unavailable or dependency_unavailable; nothing written—

Schémas

JsonObject

object

AuditDecision

"permitted" | "denied"

RequestPurpose

"patient_rights_request" | "regulatory_audit" | "legal_disclosure" | "continuity_of_care"

AuditEventCommand

NomTypeObligatoireDescription
jurisdiction_idstring (uuid)oui
actor_idstring (uuid)oui
actor_rolestringoui
actionstringoui
resource_typestringoui
resource_idstring (uuid)oui
patient_idstring (uuid)non
facility_idstring (uuid)non
purposeRequestPurposeoui
decisionAuditDecisionoui
reasonstringnon
event_timestring (date-time)non

AuditInvestigationCommand

NomTypeObligatoireDescription
event_idstring (uuid)oui
investigation_reasonstringoui
investigator_idstring (uuid)oui
scopestringoui
case_refstring (uuid)non

IntegrityVerificationCommand

NomTypeObligatoireDescription
jurisdiction_idstring (uuid)oui
sequence_fromintegeroui
sequence_tointegerouiMust be >= sequence_from
expected_root_hashstringoui
verification_environment"production" | "staging" | "disaster_recovery"oui

DisclosureTraceCommand

NomTypeObligatoireDescription
patient_idstring (uuid)oui
date_fromstring (date)oui
date_tostring (date)oui
request_purposeRequestPurposeoui
recipient_scopestringnon

WorkflowTransitionCommand

NomTypeObligatoireDescription
expected_versionintegeroui
to_statestringoui
evidence_refstring (uuid)oui
reasonstringoui

ExportCommand

NomTypeObligatoireDescription
format"csv" | "pdf"oui
period_fromstring (date-time)non
period_tostring (date-time)non
facility_idstring (uuid)non
severity"low" | "medium" | "high" | "critical"non
patient_idstring (uuid)non
request_purposeRequestPurposenon