Skip to content

← All contracts

OHN-28 Clinical Notification and Alert Routing

Version
1.0.1
OpenAPI
3.1.0
Source in the repository
modules/OHN-28/api/openapi.json
Servers
https://opeshealthnetwork.com/api/ohn/v1
Authentication
bearer: http bearer

Download the contract (JSON)

Contracts are written in English.

Safety-critical alert routing with verified receipt, escalation and retry. Default-deny; every POST needs an Idempotency-Key (8-128 characters of [A-Za-z0-9_.:-]); mutations use expected_version. Alert text and events carry codes and identifiers only. Authentication: a platform-gateway bearer token (Java: ES256, iss ohn-platform-gateway, aud ohn-28; the TypeScript baseline also accepts its own HS256 development token, iss ohn-28-notification, aud ohn-28-api) whose sub, jurisdiction and organization_id are UUIDs; role licensed_clinician or on_call_supervisor and purpose clinical_notification are both required (an unknown role or another purpose is an audited 403). The TypeScript-only development sign-in POST /clinical-notifications/synthetic-token is not part of this contract. Errors are JSON {error, message, details?} (Java: application/problem+json with the same fields plus type, title, status, detail, trace_id); a body that is not JSON is 400 malformed_request, one that is not application/json is 415 unsupported_media_type. Fail-closed rules: an alert is stored before it is routed and is never dropped; an unavailable dependency (OHN-06 standing, OHN-16 access decision, the delivery channel) leaves the alert open and pending (routing_blocked_reason) and the sweep retries it; an alert nobody can be paged for is needs_supervisor and raises clinical-notification.needs-supervisor.

Operations

Other operations

GET/health/ohn-28Health (public, served at /health/ohn-28 outside the /api/ohn/v1 prefix)

Authentication: bearer

Responses

CodeDescriptionMedia type
200ok
application/json: Health
503database unavailable
GET/clinical-notificationsOHN-28-API-002 List alerts visible to the caller

Authentication: bearer

Parameters

NameInTypeRequiredDescription
statequerystringno
severityquerystringno
needs_supervisorquery"true" | "false"no
cursorquerystringnoOpaque; pages of 50. An unreadable cursor restarts at the first page.

Responses

CodeDescriptionMedia type
200Success
application/json: NotificationList
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
422Validation failed—
429Rate limited—
503Dependency unavailable—
POST/clinical-notificationsOHN-28-API-001 Route a clinical alert (W001)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Success
application/json: NotificationResult
400Idempotency-Key missing or malformed (idempotency_key_required), or the body is not valid JSON (malformed_request)—
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
409version_conflict (details.current_version), idempotency_key_reused, request_in_progress, illegal_transition, already_acknowledged, not_acknowledgeable, duplicate_event, conflict—
415unsupported_media_type: send application/json—
422Validation failed—
429Rate limited—
503Dependency unavailable—
GET/clinical-notifications/policiesList routing policies

Authentication: bearer

Responses

CodeDescriptionMedia type
200Success
application/json: PolicyList
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
422Validation failed—
429Rate limited—
503Dependency unavailable—
POST/clinical-notifications/policiesOHN-28-F001 Create a routing policy

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Success
application/json: PolicyResult
400Idempotency-Key missing or malformed (idempotency_key_required), or the body is not valid JSON (malformed_request)—
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
409version_conflict (details.current_version), idempotency_key_reused, request_in_progress, illegal_transition, already_acknowledged, not_acknowledgeable, duplicate_event, conflict—
415unsupported_media_type: send application/json—
422Validation failed—
429Rate limited—
503Dependency unavailable—
POST/clinical-notifications/policies/{id}/updateUpdate a routing policy (expected_version)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Success
application/json: PolicyResult
400Idempotency-Key missing or malformed (idempotency_key_required), or the body is not valid JSON (malformed_request)—
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
409version_conflict (details.current_version), idempotency_key_reused, request_in_progress, illegal_transition, already_acknowledged, not_acknowledgeable, duplicate_event, conflict—
415unsupported_media_type: send application/json—
422Validation failed—
429Rate limited—
503Dependency unavailable—
GET/clinical-notifications/code-lists/{list}Read a controlled code list

Authentication: bearer

Parameters

NameInTypeRequiredDescription
listpath"trigger_type" | "severity" | "target_role" | "channel"yes

Responses

CodeDescriptionMedia type
200Success
application/json: CodeList
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
422Validation failed—
429Rate limited—
503Dependency unavailable—
POST/clinical-notifications/code-lists/{list}Upsert code list entries

Authentication: bearer

Parameters

NameInTypeRequiredDescription
listpath"trigger_type" | "severity" | "target_role" | "channel"yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Success
application/json: CodeListUpsertResult
400Idempotency-Key missing or malformed (idempotency_key_required), or the body is not valid JSON (malformed_request)—
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
409version_conflict (details.current_version), idempotency_key_reused, request_in_progress, illegal_transition, already_acknowledged, not_acknowledgeable, duplicate_event, conflict—
415unsupported_media_type: send application/json—
422Validation failed—
429Rate limited—
503Dependency unavailable—
POST/clinical-notifications/maintenance/escalation-sweepOHN-28-W002 Run the escalation sweep (schedule every minute)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200Success
application/json: SweepResult
400Idempotency-Key missing or malformed (idempotency_key_required), or the body is not valid JSON (malformed_request)—
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
409version_conflict (details.current_version), idempotency_key_reused, request_in_progress, illegal_transition, already_acknowledged, not_acknowledgeable, duplicate_event, conflict—
415unsupported_media_type: send application/json—
422Validation failed—
429Rate limited—
503Dependency unavailable—
POST/clinical-notifications/maintenance/drain-outboxRelay outbox events to OHN-24 (stay pending without a sink)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200Success
application/json: OutboxResult
400Idempotency-Key missing or malformed (idempotency_key_required), or the body is not valid JSON (malformed_request)—
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
409version_conflict (details.current_version), idempotency_key_reused, request_in_progress, illegal_transition, already_acknowledged, not_acknowledgeable, duplicate_event, conflict—
415unsupported_media_type: send application/json—
422Validation failed—
429Rate limited—
503Dependency unavailable—
GET/clinical-notifications/report-catalogList reports

Authentication: bearer

Responses

CodeDescriptionMedia type
200Success
application/json: ReportCatalog
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
422Validation failed—
429Rate limited—
503Dependency unavailable—
GET/clinical-notifications/reports/{reportId}Run OHN-28-R001..R003

Authentication: bearer

Parameters

NameInTypeRequiredDescription
reportIdpathstringyes
facilityquerystring (uuid)no
organizationquerystring (uuid)no
period_fromquerystring (date)no
period_toquerystring (date)no
severityquerystringno
channelquerystringno
cursorquerystringno

Responses

CodeDescriptionMedia type
200Success
application/json: Report
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
422Validation failed: message "Report filter is not valid." (details keep the LAST issue per field) or "period_from is after period_to." (details.period_from after_period_to)—
429Rate limited—
503Dependency unavailable—
POST/clinical-notifications/reports/{reportId}/exportCreate a signed, single-use, 5-minute export (supervisors)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
reportIdpathstringyes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Success
application/json: ExportReceipt
400Idempotency-Key missing or malformed (idempotency_key_required), or the body is not valid JSON (malformed_request)—
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
409version_conflict (details.current_version), idempotency_key_reused, request_in_progress, illegal_transition, already_acknowledged, not_acknowledgeable, duplicate_event, conflict—
415unsupported_media_type: send application/json—
422Validation failed—
429Rate limited—
503dependency_unavailable: the export signing key is not configured (or shorter than 32 characters)—
GET/clinical-notifications/exports/{token}Download an export once

Authentication: bearer

Parameters

NameInTypeRequiredDescription
tokenpathstringyes

Responses

CodeDescriptionMedia type
200The export once (CSV or PDF); the link is single use, bound to the requesting principal, expires after five minutes and is checked against its HMAC-SHA256 signature
text/csv: string
application/pdf: string (binary)
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
410export_expired or export_consumed—
422Validation failed—
429Rate limited—
500export_integrity_failed: the stored export no longer matches its signature—
503Dependency unavailable—
GET/clinical-notifications/{id}Alert detail with provenance, deliveries, overrides and acknowledgment

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Success
application/json: NotificationDetail
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
422Validation failed—
429Rate limited—
503Dependency unavailable—
GET/clinical-notifications/{id}/historyWorkflow history (append-only)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Success
application/json: HistoryList
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
422Validation failed—
429Rate limited—
503Dependency unavailable—
GET/clinical-notifications/{id}/deliveriesDelivery attempts

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Success
application/json: DeliveryList
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
422Validation failed—
429Rate limited—
503Dependency unavailable—
POST/clinical-notifications/{id}/ackOHN-28-API-003 Acknowledge with read-back (F002)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Success
application/json: AckResult
400Idempotency-Key missing or malformed (idempotency_key_required), or the body is not valid JSON (malformed_request)—
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
409version_conflict (details.current_version), idempotency_key_reused, request_in_progress, illegal_transition, already_acknowledged, not_acknowledgeable, duplicate_event, conflict—
415unsupported_media_type: send application/json—
422Validation failed—
429Rate limited—
503Dependency unavailable—
POST/clinical-notifications/{id}/overrideOHN-28-F003 Supervisor escalation override

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Success
application/json: AckResult
400Idempotency-Key missing or malformed (idempotency_key_required), or the body is not valid JSON (malformed_request)—
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
409version_conflict (details.current_version), idempotency_key_reused, request_in_progress, illegal_transition, already_acknowledged, not_acknowledgeable, duplicate_event, conflict—
415unsupported_media_type: send application/json—
422Validation failed—
429Rate limited—
503Dependency unavailable—
POST/clinical-notifications/{id}/closeOHN-28-W003 Close an acknowledged alert

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Success
application/json: AckResult
400Idempotency-Key missing or malformed (idempotency_key_required), or the body is not valid JSON (malformed_request)—
401Unauthenticated—
403Denied by policy (audited)—
404Not found or not visible—
409version_conflict (details.current_version), idempotency_key_reused, request_in_progress, illegal_transition, already_acknowledged, not_acknowledgeable, duplicate_event, conflict—
415unsupported_media_type: send application/json—
422Validation failed—
429Rate limited—
503Dependency unavailable—

Schemas

NotificationCommand

NameTypeRequiredDescription
patient_refstring (uuid)yes
trigger_typestringyes
severitystringyes
target_rolestringyes
source_refstring (uuid)yes

PolicyCommand

NameTypeRequiredDescription
trigger_typestringyes
severitystringyes
target_rolestringyes
channelstringyes
ack_deadline_minutesintegeryes
escalation_chainarray of string (uuid)yes

PolicyUpdateCommand

NameTypeRequiredDescription
channelstringyes
ack_deadline_minutesintegeryes
escalation_chainarray of string (uuid)yes
expected_versionintegeryes
reasonstringyes

AckCommand

NameTypeRequiredDescription
recipient_idstring (uuid)yes
readback_confirmationbooleanyes
acknowledged_atstring (date-time)yes
notesstringyes
expected_versionintegeryes

OverrideCommand

NameTypeRequiredDescription
reasonstringyes
alternate_recipientstring (uuid)yes
expirationstring (date-time)yes
expected_versionintegeryes

CloseCommand

NameTypeRequiredDescription
reasonstringyes
expected_versionintegeryes

CodeListCommand

NameTypeRequiredDescription
entriesarray of CodeListCommand.entries.itemyes

ExportCommand

NameTypeRequiredDescription
format"csv" | "pdf"yes
filtersReportFiltersno

Receipt

NameTypeRequiredDescription
receipt_idstring (uuid)no
committed_atstring (date-time)no
aggregate_idstring (uuid)no
versionintegerno
status"committed" | "denied"no

Notification

NameTypeRequiredDescription
idstring (uuid)no
state"received" | "target_resolved" | "sent" | "acknowledged" | "escalated" | "escalation_exhausted" | "unroutable" | "closed"no
severitystringno
trigger_typestringno
target_rolestringno
channelstringno
criticalbooleanno
levelintegerno
ack_deadline_minutesintegerno
current_recipientstring | null (uuid)no
deadline_atstring | null (date-time)no
first_sent_atstring | null (date-time)no
acked_atstring | null (date-time)no
acked_bystring | null (uuid)no
closed_atstring | null (date-time)no
source_refstring (uuid)no
versionintegerno
created_atstring (date-time)no
updated_atstring (date-time)no
jurisdiction_idstring (uuid)no
organization_idstring (uuid)no
pending_reconciliationbooleannotrue while the alert has not reached a recipient (received, target_resolved) or its next page is blocked by a dependency outage
routing_blocked_reasonstring | nullno1.0.1: dependency_unavailable:OHN-06 | OHN-16 | channel while a dependency outage blocks routing or escalation; null otherwise. An alert somebody holds keeps its state, level and holder during the outage.
needs_supervisorbooleannoescalation_exhausted or unroutable: nobody could be paged; supervisors must act
patient_ref_maskedstringnopresent in lists, intake and mutation answers and in the detail view; the detail view adds patient_ref only when OHN-16 permits
provenanceNotification.provenanceno

NotificationResult

NameTypeRequiredDescription
notificationNotificationno
delivery_attemptsintegerno
skipped_recipientsintegerno
receiptReceiptno

NotificationList

NameTypeRequiredDescription
itemsarray of Notificationno
next_cursorstring | nullno
as_ofstringno

NotificationDetail

NameTypeRequiredDescription
idstring (uuid)no
state"received" | "target_resolved" | "sent" | "acknowledged" | "escalated" | "escalation_exhausted" | "unroutable" | "closed"no
severitystringno
trigger_typestringno
target_rolestringno
channelstringno
criticalbooleanno
levelintegerno
ack_deadline_minutesintegerno
current_recipientstring | null (uuid)no
deadline_atstring | null (date-time)no
first_sent_atstring | null (date-time)no
acked_atstring | null (date-time)no
acked_bystring | null (uuid)no
closed_atstring | null (date-time)no
source_refstring (uuid)no
versionintegerno
created_atstring (date-time)no
updated_atstring (date-time)no
jurisdiction_idstring (uuid)no
organization_idstring (uuid)no
pending_reconciliationbooleannotrue while the alert has not reached a recipient (received, target_resolved) or its next page is blocked by a dependency outage
routing_blocked_reasonstring | nullno1.0.1: dependency_unavailable:OHN-06 | OHN-16 | channel while a dependency outage blocks routing or escalation; null otherwise. An alert somebody holds keeps its state, level and holder during the outage.
needs_supervisorbooleannoescalation_exhausted or unroutable: nobody could be paged; supervisors must act
patient_ref_maskedstringnopresent in lists, intake and mutation answers and in the detail view; the detail view adds patient_ref only when OHN-16 permits
provenanceNotificationDetail.provenanceno
patient_refstring | null (uuid)no
patient_access"permitted" | "withheld" | "unavailable"no
readback_requiredbooleanno
recipients_chainarray of string (uuid)no
deliveriesarray of Deliveryno
overridesarray of NotificationDetail.overrides.itemno
acknowledgementNotificationDetail.acknowledgementno

AckResult

NameTypeRequiredDescription
notificationNotificationno
receiptReceiptno

Policy

NameTypeRequiredDescription
idstring (uuid)no
trigger_typestringno
severitystringno
target_rolestringno
channelstringno
ack_deadline_minutesintegerno
escalation_chainarray of string (uuid)no
versionintegerno
updated_bystring (uuid)no
updated_atstring (date-time)no
jurisdiction_idstring (uuid)no
organization_idstring (uuid)no

PolicyResult

NameTypeRequiredDescription
policyPolicyno
receiptReceiptno

PolicyList

NameTypeRequiredDescription
itemsarray of Policyno

CodeList

NameTypeRequiredDescription
liststringno
itemsarray of objectno

CodeListUpsertResult

NameTypeRequiredDescription
liststringno
upsertedintegerno
receiptReceiptno

SweepResult

still_pending counts alerts the sweep could not route because a dependency is unavailable (or could not process); they stay open and are retried

NameTypeRequiredDescription
examinedintegerno
escalatedintegerno
retriedintegerno
exhaustedintegerno
skipped_conflictintegerno
still_pendingintegerno

OutboxResult

NameTypeRequiredDescription
deliveredintegerno
pendingintegerno

HistoryList

NameTypeRequiredDescription
itemsarray of HistoryList.items.itemno

DeliveryList

NameTypeRequiredDescription
itemsarray of Deliveryno

ReportCatalog

NameTypeRequiredDescription
reportsarray of objectno

Report

NameTypeRequiredDescription
report_idstringno
titlestringno
columnsarray of stringno
rowsarray of objectno
summaryobjectno
state"rendered" | "no_authorized_data"no
generated_atstringno
next_cursorstring | nullno

ExportReceipt

NameTypeRequiredDescription
export_idstring (uuid)no
report_idstringno
formatstringno
rowsintegerno
expires_atstringno
single_usebooleanno
download_pathstringno

ExportFile

string (binary)

Delivery

NameTypeRequiredDescription
idstring (uuid)no
recipient_idstring (uuid)no
channelstringno
levelintegerno
status"sent" | "failed" | "undeliverable" | "stale_contact"no
error_codestring | nullno
transport_refstring | nullno
atstring (date-time)no

ReportFilters

NameTypeRequiredDescription
facilitystring (uuid)no
organizationstring (uuid)no
period_fromstring (date)no
period_tostring (date)no
severitystringno
channelstringno

Health

NameTypeRequiredDescription
status"ok"no
module"OHN-28"no
dependenciesHealth.dependenciesno
overdue_unsweptintegerno1.0.1 (Java): open alerts whose deadline passed more than sweep_grace_minutes ago without the sweep reaching them; above zero means the sweep scheduler has stopped
sweep_grace_minutesintegerno

Error

NameTypeRequiredDescription
errorstringyes
messagestringno
detailsobjectnovalidation: {field: zod issue code} (first issue per field; a refinement reports its message; unknown keys under "_"); version_conflict: {current_version}; duplicate_event: {notification_id}

get-health-ohn-28.response-503 defined inline

NameTypeRequiredDescription
status"unavailable"no

CodeListCommand.entries.item defined inline

NameTypeRequiredDescription
codestringyes
label_enstringyes
label_frstringyes
activebooleanno
criticalbooleannoa severity flagged critical needs read-back to be acknowledged

Notification.provenance defined inline

NameTypeRequiredDescription
source_system_idstring (uuid)no
provenance_refstring (uuid)no
source_versionintegerno
as_ofstring (date-time)no

NotificationDetail.provenance defined inline

NameTypeRequiredDescription
source_system_idstring (uuid)no
provenance_refstring (uuid)no
source_versionintegerno
as_ofstring (date-time)no

NotificationDetail.overrides.item defined inline

NameTypeRequiredDescription
idstring (uuid)no
alternate_recipientstring (uuid)no
expirationstring (date-time)no
created_bystring (uuid)no
created_atstring (date-time)no

NotificationDetail.acknowledgement defined inline

NameTypeRequiredDescription
recipient_idstring (uuid)no
readback_confirmationbooleanno
acknowledged_atstring (date-time)no
notesstring | nullnoonly for the acknowledger and supervisors

HistoryList.items.item defined inline

NameTypeRequiredDescription
workflow"OHN-28-W001" | "OHN-28-W002" | "OHN-28-W003"no
from_statestring | nullno
to_statestringno
versionintegerno
actor_idstring (uuid)no
reasonstringno
atstring (date-time)no

Health.dependencies defined inline

NameTypeRequiredDescription
worker"live" | "unconfigured" | "synthetic"no
access"live" | "unconfigured" | "synthetic"no
channel"live" | "unconfigured" | "synthetic"no