← All contracts
OHN-56 Public Health
- Version
- 1.0.0
- OpenAPI
- 3.1.0
- Source in the repository
modules/OHN-56/api/openapi.yaml- Servers
https://opeshealthnetwork.com
- Authentication
bearer: http bearer (JWT)
Download the contract (YAML)
Contracts are written in English.
Disease surveillance and outbreak alerts, civil registration links, pharmacovigilance, disease registries and national analytics. Every call except health needs a Bearer token (platform gateway, ES256, audience ohn-56) whose role and purpose match (each role has exactly one purpose). Every POST needs an Idempotency-Key header (1-255 characters, not blank). Request bodies are strict: unknown fields, wrong types or out-of-range values are 422 domain_validation_failed. Errors are {error, message, ...extra} (application/problem+json carrying the same fields plus type, title, status, detail, trace_id). Policy (small-cell k, ADR signal threshold, notifiable conditions and their thresholds) is configuration with no built-in defaults: unset policy refuses the dependent call (409 policy_not_configured). Synthetic data only.
Operations
config
GET/api/ohn/v1/public-health/settingsJurisdiction settings (admin, surveillance_officer, ministry_analyst, pv_reviewer)
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | |
POST/api/ohn/v1/public-health/settingsSet k and the ADR signal threshold (public_health_admin)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | Not blank, 1-255 characters. The same key with the same body replays the first answer (Idempotent-Replay: true); with another body it is 409 idempotency_conflict. |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | Saved | — |
409 | version_conflict | — |
422 | domain_validation_failed (details: first failing check per top-level field as a zod issue code, unknown fields under _) or a named refusal (patient_not_found, birth_event_not_linked, mother_mismatch, prescription_not_found, prescription_mismatch, medicine_mismatch, ...) | — |
GET/api/ohn/v1/public-health/surveillance/conditionsNotifiable conditions (surveillance_officer, admin, ministry_analyst)
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | |
POST/api/ohn/v1/public-health/surveillance/conditionsCreate or replace a condition by code (public_health_admin)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | Not blank, 1-255 characters. The same key with the same body replays the first answer (Idempotent-Replay: true); with another body it is 409 idempotency_conflict. |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | Saved | — |
422 | domain_validation_failed (details: first failing check per top-level field as a zod issue code, unknown fields under _) or a named refusal (patient_not_found, birth_event_not_linked, mother_mismatch, prescription_not_found, prescription_mismatch, medicine_mismatch, ...) | — |
GET/api/ohn/v1/public-health/surveillance/areasFacility to reporting area map (surveillance_officer, admin)
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | — |
POST/api/ohn/v1/public-health/surveillance/areasPlace a facility in an area (public_health_admin)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | Not blank, 1-255 characters. The same key with the same body replays the first answer (Idempotent-Replay: true); with another body it is 409 idempotency_conflict. |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | Saved | — |
422 | domain_validation_failed (details: first failing check per top-level field as a zod issue code, unknown fields under _) or a named refusal (patient_not_found, birth_event_not_linked, mother_mismatch, prescription_not_found, prescription_mismatch, medicine_mismatch, ...) | — |
surveillance
POST/api/ohn/v1/public-health/surveillance/syncCount cases from OHN-11 results and OHN-09/OHN-10 diagnoses; raise or update alerts (surveillance_officer, admin)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | Not blank, 1-255 characters. The same key with the same body replays the first answer (Idempotent-Replay: true); with another body it is 409 idempotency_conflict. |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | Completed run | |
409 | No active condition configured (policy_not_configured) | — |
422 | domain_validation_failed (details: first failing check per top-level field as a zod issue code, unknown fields under _) or a named refusal (patient_not_found, birth_event_not_linked, mother_mismatch, prescription_not_found, prescription_mismatch, medicine_mismatch, ...) | — |
503 | dependency_unavailable or not_configured (503; names the dependency; nothing stored). Also 503 not_configured with setting OHN56_WRITES_DISABLED while the operator kill switch is on. | — |
GET/api/ohn/v1/public-health/surveillance/sync-runsLast 50 counting runs
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | — |
GET/api/ohn/v1/public-health/surveillance/case-countsDistinct-patient case counts by condition, area and week (surveillance_officer)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
weeks | query | string | no | Weeks 1-52 (default 8; 0 means the default). |
condition | query | string | no | |
Responses
| Code | Description | Media type |
|---|
200 | OK | — |
404 | Unknown condition | — |
GET/api/ohn/v1/public-health/surveillance/alertsOutbreak alerts (surveillance_officer)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
state | query | string | no | Exact state; any string up to 32 characters is accepted (an unknown state matches nothing). |
Responses
| Code | Description | Media type |
|---|
200 | OK | |
GET/api/ohn/v1/public-health/surveillance/alerts/{id}
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Alert with history | — |
404 | Not found | — |
POST/api/ohn/v1/public-health/surveillance/alerts/{id}/transitionsTriage (open->investigating|dismissed, investigating->confirmed_outbreak|dismissed, confirmed_outbreak->closed)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | Not blank, 1-255 characters. The same key with the same body replays the first answer (Idempotent-Replay: true); with another body it is 409 idempotency_conflict. |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | Moved | — |
404 | Not found | — |
409 | version_conflict | — |
422 | domain_validation_failed (details: first failing check per top-level field as a zod issue code, unknown fields under _) or a named refusal (patient_not_found, birth_event_not_linked, mother_mismatch, prescription_not_found, prescription_mismatch, medicine_mismatch, ...) | — |
civil-registration
GET/api/ohn/v1/public-health/civil-registration/noticesNotices (reporter_clinician own organisation; surveillance_officer all)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
kind | query | string | no | |
state | query | string | no | |
Responses
| Code | Description | Media type |
|---|
200 | OK | — |
POST/api/ohn/v1/public-health/civil-registration/noticesRecord a birth or death notification (reporter_clinician). Subject and mother checked in OHN-03; birth event in OHN-12.
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | Not blank, 1-255 characters. The same key with the same body replays the first answer (Idempotent-Replay: true); with another body it is 409 idempotency_conflict. |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | Recorded | — |
409 | A live notice exists | — |
422 | domain_validation_failed (details: first failing check per top-level field as a zod issue code, unknown fields under _) or a named refusal (patient_not_found, birth_event_not_linked, mother_mismatch, prescription_not_found, prescription_mismatch, medicine_mismatch, ...) | — |
503 | dependency_unavailable or not_configured (503; names the dependency; nothing stored). Also 503 not_configured with setting OHN56_WRITES_DISABLED while the operator kill switch is on. | — |
GET/api/ohn/v1/public-health/civil-registration/notices/{id}
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Notice with history | — |
404 | Not found | — |
POST/api/ohn/v1/public-health/civil-registration/notices/{id}/outcomeRecord the civil registration answer
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | Not blank, 1-255 characters. The same key with the same body replays the first answer (Idempotent-Replay: true); with another body it is 409 idempotency_conflict. |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | Recorded | — |
404 | Not found | — |
409 | version_conflict | — |
422 | domain_validation_failed (details: first failing check per top-level field as a zod issue code, unknown fields under _) or a named refusal (patient_not_found, birth_event_not_linked, mother_mismatch, prescription_not_found, prescription_mismatch, medicine_mismatch, ...) | — |
pharmacovigilance
GET/api/ohn/v1/public-health/pharmacovigilance/reportsADR reports (patient own; clinician own organisation; pv_reviewer all)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
state | query | string | no | |
Responses
| Code | Description | Media type |
|---|
200 | OK | — |
POST/api/ohn/v1/public-health/pharmacovigilance/reportsReport an adverse drug reaction (reporter_clinician, patient). Optional OHN-50 prescription link must match patient and medicine.
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | Not blank, 1-255 characters. The same key with the same body replays the first answer (Idempotent-Replay: true); with another body it is 409 idempotency_conflict. |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | Recorded | — |
403 | Patient reporting for someone else | — |
422 | domain_validation_failed (details: first failing check per top-level field as a zod issue code, unknown fields under _) or a named refusal (patient_not_found, birth_event_not_linked, mother_mismatch, prescription_not_found, prescription_mismatch, medicine_mismatch, ...) | — |
503 | dependency_unavailable or not_configured (503; names the dependency; nothing stored). Also 503 not_configured with setting OHN56_WRITES_DISABLED while the operator kill switch is on. | — |
GET/api/ohn/v1/public-health/pharmacovigilance/reports/{id}
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Report with history | — |
404 | Not found | — |
POST/api/ohn/v1/public-health/pharmacovigilance/reports/{id}/reviewReview (pv_reviewer, not the reporter). assessed requires causality.
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | Not blank, 1-255 characters. The same key with the same body replays the first answer (Idempotent-Replay: true); with another body it is 409 idempotency_conflict. |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | Reviewed | — |
403 | Own report | — |
409 | version_conflict | — |
422 | domain_validation_failed (details: first failing check per top-level field as a zod issue code, unknown fields under _) or a named refusal (patient_not_found, birth_event_not_linked, mother_mismatch, prescription_not_found, prescription_mismatch, medicine_mismatch, ...) | — |
GET/api/ohn/v1/public-health/pharmacovigilance/signalsSignal counts per medicine and reaction (pv_reviewer)
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | — |
registries
GET/api/ohn/v1/public-health/registriesRegistry catalog with counts (sensitive counts hidden from surveillance_officer)
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | — |
GET/api/ohn/v1/public-health/registries/{registry}/entriesEntries. HIV/TB - 403 segmented_registry for surveillance_officer; consent re-checked per entry; withheld count returned.
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
registry | path | "sickle_cell" | "hiv" | "tb" | "cancer" | "maternal" | yes | |
status | query | string | no | |
Responses
| Code | Description | Media type |
|---|
200 | OK | — |
403 | Segmented | — |
503 | dependency_unavailable or not_configured (503; names the dependency; nothing stored). Also 503 not_configured with setting OHN56_WRITES_DISABLED while the operator kill switch is on. | — |
POST/api/ohn/v1/public-health/registries/{registry}/entriesEnrol (registry_steward, reporter_clinician). HIV/TB need an OHN-15 permit.
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
registry | path | "sickle_cell" | "hiv" | "tb" | "cancer" | "maternal" | yes | |
Idempotency-Key | header | string | yes | Not blank, 1-255 characters. The same key with the same body replays the first answer (Idempotent-Replay: true); with another body it is 409 idempotency_conflict. |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | Enrolled | — |
403 | consent_denied | — |
409 | Already enrolled | — |
422 | domain_validation_failed (details: first failing check per top-level field as a zod issue code, unknown fields under _) or a named refusal (patient_not_found, birth_event_not_linked, mother_mismatch, prescription_not_found, prescription_mismatch, medicine_mismatch, ...) | — |
GET/api/ohn/v1/public-health/registries/{registry}/entries/{id}
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
registry | path | "sickle_cell" | "hiv" | "tb" | "cancer" | "maternal" | yes | |
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Entry with history | — |
403 | Segmented or consent denied | — |
404 | Not found | — |
POST/api/ohn/v1/public-health/registries/{registry}/entries/{id}/statusChange status (deceased and closed are final)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
registry | path | "sickle_cell" | "hiv" | "tb" | "cancer" | "maternal" | yes | |
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | Not blank, 1-255 characters. The same key with the same body replays the first answer (Idempotent-Replay: true); with another body it is 409 idempotency_conflict. |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | Changed | — |
403 | Segmented or consent denied | — |
404 | Not found | — |
409 | version_conflict | — |
422 | domain_validation_failed (details: first failing check per top-level field as a zod issue code, unknown fields under _) or a named refusal (patient_not_found, birth_event_not_linked, mother_mismatch, prescription_not_found, prescription_mismatch, medicine_mismatch, ...) | — |
analytics
GET/api/ohn/v1/public-health/analytics/dashboardAggregates with small-cell suppression (ministry_analyst, admin). 409 when k is not configured.
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
weeks | query | string | no | Weeks 1-52 (default 12). |
Responses
| Code | Description | Media type |
|---|
200 | OK | |
409 | policy_not_configured | — |
GET/api/ohn/v1/public-health/analytics/{dataset}/exportCSV export of one dataset (ministry_analyst)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
dataset | path | "cases" | "alerts" | "registries" | "adr" | "civil" | yes | |
weeks | query | string | no | Weeks 1-52 (default 12). |
Responses
| Code | Description | Media type |
|---|
200 | CSV | text/csv: string
|
409 | policy_not_configured | — |
Other operations
GET/health/ohn-56Health and dependency modes
Responses
| Code | Description | Media type |
|---|
200 | OK: status, module, dependencies (mode per OHN-03, 09, 10, 11, 12, 15, 50), writes_enabled, auth_configured | |
503 | Database unavailable | — |
GET/api/ohn/v1/public-health/contextCaller role, purpose, dependency modes, settings and allowed actions (all roles)
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
401 | Missing or invalid token | — |
GET/api/ohn/v1/public-health/auditLast 200 audit records (public_health_admin)
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | — |
Schemas
Code
Trimmed before validation.
string
Health
| Name | Type | Required | Description |
|---|
status | string | no | |
module | "OHN-56" | no | |
dependencies | object | no | |
Settings
Unset values are null and version 0; configured is true once small_cell_k is set.
| Name | Type | Required | Description |
|---|
small_cell_k | integer | null | no | |
adr_signal_threshold | integer | null | no | |
version | integer | no | |
updated_at | string | null (date-time) | no | |
configured | boolean | no | |
SettingsCommand
| Name | Type | Required | Description |
|---|
small_cell_k | integer | null | yes | |
adr_signal_threshold | integer | null | yes | |
expected_version | integer | yes | |
ConditionCommand
At least one diagnosis code or result report type is required (422 on diagnosis_codes otherwise).
| Name | Type | Required | Description |
|---|
code | Code | yes | Trimmed before validation. |
name | string | yes | trimmed |
diagnosis_codes | array of Code | yes | |
result_report_types | array of Code | yes | |
positive_interpretations | array of string | yes | Stored lower-case; a result counts when its source_interpretation (lower-cased) is listed, or always when the list is empty. |
threshold_count | integer | null | yes | Distinct patients per area and ISO week that raise an alert; null means cases are counted but never alert. |
active | boolean | yes | |
Condition
| Name | Type | Required | Description |
|---|
code | Code | yes | Trimmed before validation. |
name | string | yes | trimmed |
diagnosis_codes | array of Code | yes | |
result_report_types | array of Code | yes | |
positive_interpretations | array of string | yes | Stored lower-case; a result counts when its source_interpretation (lower-cased) is listed, or always when the list is empty. |
threshold_count | integer | null | yes | Distinct patients per area and ISO week that raise an alert; null means cases are counted but never alert. |
active | boolean | yes | |
id | string (uuid) | no | |
version | integer | no | |
SyncResult
| Name | Type | Required | Description |
|---|
sync_run_id | string (uuid) | no | |
state | "completed" | no | |
since | string (date) | no | |
counts | object | no | |
AlertState
"open" | "investigating" | "confirmed_outbreak" | "dismissed" | "closed"
Alert
| Name | Type | Required | Description |
|---|
id | string (uuid) | no | |
condition_code | string | no | |
area_code | string | no | |
week_start | string (date) | no | |
case_count | integer | no | |
threshold | integer | no | |
state | AlertState | no | |
version | integer | no | |
allowed_transitions | array of string | no | |
CivilNoticeCommand
A death needs cause_of_death_code and takes no mother or birth event; a birth takes no cause. event_date cannot be in the future (422).
| Name | Type | Required | Description |
|---|
kind | "birth" | "death" | yes | |
subject_patient_id | string (uuid) | yes | |
mother_patient_id | string (uuid) | no | births only |
ohn12_birth_event_id | string (uuid) | no | births only |
event_date | string (date) | yes | |
place_facility_id | string (uuid) | yes | |
cause_of_death_code | Code | no | required for deaths |
notification_channel | "electronic" | "paper_form" | "courier" | yes | |
notification_ref | string | yes | |
AdrCommand
| Name | Type | Required | Description |
|---|
patient_id | string (uuid) | no | required for clinicians; a patient may only name themselves |
prescription_id | string (uuid) | no | |
medicine_code | Code | yes | Trimmed before validation. |
medicine_display | string | yes | |
reaction_code | Code | yes | Trimmed before validation. |
reaction_description | string | yes | |
onset_date | string (date) | yes | cannot be in the future |
seriousness | "non_serious" | "serious" | yes | |
outcome | "recovered" | "recovering" | "not_recovered" | "fatal" | "unknown" | yes | |
EnrolCommand
| Name | Type | Required | Description |
|---|
patient_id | string (uuid) | yes | |
diagnosis_date | string (date) | yes | cannot be in the future |
facility_id | string (uuid) | yes | |
details | object | yes | |
Dashboard
| Name | Type | Required | Description |
|---|
k | integer | no | |
weeks | integer | no | |
aggregates_only | true | no | |
datasets | object | no | |
get-api-ohn-v1-public-health-surveillance-conditions.response-200 defined inline
| Name | Type | Required | Description |
|---|
items | array of Condition | no | |
post-api-ohn-v1-public-health-surveillance-areas.request defined inline
| Name | Type | Required | Description |
|---|
facility_id | string (uuid) | yes | |
area_code | Code | yes | Trimmed before validation. |
area_name | string | yes | |
post-api-ohn-v1-public-health-surveillance-sync.request defined inline
| Name | Type | Required | Description |
|---|
since | string (date) | no | Default: the last OHN56 sync look-back (configuration, 56 days). |
get-api-ohn-v1-public-health-surveillance-alerts.response-200 defined inline
| Name | Type | Required | Description |
|---|
items | array of Alert | no | |
post-api-ohn-v1-public-health-surveillance-alerts-id-transitions.request defined inline
| Name | Type | Required | Description |
|---|
to_state | AlertState | yes | |
note | string | yes | |
expected_version | integer | yes | |
post-api-ohn-v1-public-health-civil-registration-notices-id-outcome.request.option-1 defined inline
| Name | Type | Required | Description |
|---|
outcome | "registered" | yes | |
civil_registration_ref | string | yes | |
expected_version | integer | yes | |
post-api-ohn-v1-public-health-civil-registration-notices-id-outcome.request.option-2 defined inline
| Name | Type | Required | Description |
|---|
outcome | "rejected" | yes | |
reason | string | yes | |
expected_version | integer | yes | |
post-api-ohn-v1-public-health-pharmacovigilance-reports-id-review.request defined inline
| Name | Type | Required | Description |
|---|
to_state | "under_review" | "assessed" | "rejected" | yes | |
causality | "certain" | "probable" | "possible" | "unlikely" | "unclassifiable" | no | required when to_state is assessed |
note | string | yes | |
expected_version | integer | yes | |
post-api-ohn-v1-public-health-registries-registry-entries-id-status.request defined inline
| Name | Type | Required | Description |
|---|
status | "active" | "in_remission" | "transferred_out" | "lost_to_follow_up" | "deceased" | "closed" | yes | |
note | string | yes | |
expected_version | integer | yes | |