← Tous les contrats
OHN-56 Public Health
- Version
- 1.0.0
- OpenAPI
- 3.1.0
- Source dans le dépôt
modules/OHN-56/api/openapi.yaml- Serveurs
https://opeshealthnetwork.com
- Authentification
bearer: http bearer (JWT)
Télécharger le contrat (YAML)
Les contrats sont rédigés en anglais.
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.
Opérations
config
GET/api/ohn/v1/public-health/settingsJurisdiction settings (admin, surveillance_officer, ministry_analyst, pv_reviewer)
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | OK | |
POST/api/ohn/v1/public-health/settingsSet k and the ADR signal threshold (public_health_admin)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | 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. |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
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)
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | OK | |
POST/api/ohn/v1/public-health/surveillance/conditionsCreate or replace a condition by code (public_health_admin)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | 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. |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
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)
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | OK | — |
POST/api/ohn/v1/public-health/surveillance/areasPlace a facility in an area (public_health_admin)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | 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. |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
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)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | 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. |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
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
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | OK | — |
GET/api/ohn/v1/public-health/surveillance/case-countsDistinct-patient case counts by condition, area and week (surveillance_officer)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
weeks | query | string | non | Weeks 1-52 (default 8; 0 means the default). |
condition | query | string | non | |
Réponses
| Code | Description | Type de média |
|---|
200 | OK | — |
404 | Unknown condition | — |
GET/api/ohn/v1/public-health/surveillance/alertsOutbreak alerts (surveillance_officer)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
state | query | string | non | Exact state; any string up to 32 characters is accepted (an unknown state matches nothing). |
Réponses
| Code | Description | Type de média |
|---|
200 | OK | |
GET/api/ohn/v1/public-health/surveillance/alerts/{id}
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
Réponses
| Code | Description | Type de média |
|---|
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)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | 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. |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
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)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
kind | query | string | non | |
state | query | string | non | |
Réponses
| Code | Description | Type de média |
|---|
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.
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | 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. |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
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}
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
Réponses
| Code | Description | Type de média |
|---|
200 | Notice with history | — |
404 | Not found | — |
POST/api/ohn/v1/public-health/civil-registration/notices/{id}/outcomeRecord the civil registration answer
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | 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. |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
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)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
state | query | string | non | |
Réponses
| Code | Description | Type de média |
|---|
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.
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | 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. |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
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}
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
Réponses
| Code | Description | Type de média |
|---|
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.
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | 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. |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
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)
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | OK | — |
registries
GET/api/ohn/v1/public-health/registriesRegistry catalog with counts (sensitive counts hidden from surveillance_officer)
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
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.
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
registry | path | "sickle_cell" | "hiv" | "tb" | "cancer" | "maternal" | oui | |
status | query | string | non | |
Réponses
| Code | Description | Type de média |
|---|
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.
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
registry | path | "sickle_cell" | "hiv" | "tb" | "cancer" | "maternal" | oui | |
Idempotency-Key | header | string | oui | 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. |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
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}
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
registry | path | "sickle_cell" | "hiv" | "tb" | "cancer" | "maternal" | oui | |
id | path | string (uuid) | oui | |
Réponses
| Code | Description | Type de média |
|---|
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)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
registry | path | "sickle_cell" | "hiv" | "tb" | "cancer" | "maternal" | oui | |
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | 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. |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
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.
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
weeks | query | string | non | Weeks 1-52 (default 12). |
Réponses
| Code | Description | Type de média |
|---|
200 | OK | |
409 | policy_not_configured | — |
GET/api/ohn/v1/public-health/analytics/{dataset}/exportCSV export of one dataset (ministry_analyst)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
dataset | path | "cases" | "alerts" | "registries" | "adr" | "civil" | oui | |
weeks | query | string | non | Weeks 1-52 (default 12). |
Réponses
| Code | Description | Type de média |
|---|
200 | CSV | text/csv: string
|
409 | policy_not_configured | — |
Autres opérations
GET/health/ohn-56Health and dependency modes
Réponses
| Code | Description | Type de média |
|---|
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)
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | OK | application/json: object
|
401 | Missing or invalid token | — |
GET/api/ohn/v1/public-health/auditLast 200 audit records (public_health_admin)
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | OK | — |
Schémas
Code
Trimmed before validation.
string
Health
| Nom | Type | Obligatoire | Description |
|---|
status | string | non | |
module | "OHN-56" | non | |
dependencies | object | non | |
Settings
Unset values are null and version 0; configured is true once small_cell_k is set.
| Nom | Type | Obligatoire | Description |
|---|
small_cell_k | integer | null | non | |
adr_signal_threshold | integer | null | non | |
version | integer | non | |
updated_at | string | null (date-time) | non | |
configured | boolean | non | |
SettingsCommand
| Nom | Type | Obligatoire | Description |
|---|
small_cell_k | integer | null | oui | |
adr_signal_threshold | integer | null | oui | |
expected_version | integer | oui | |
ConditionCommand
At least one diagnosis code or result report type is required (422 on diagnosis_codes otherwise).
| Nom | Type | Obligatoire | Description |
|---|
code | Code | oui | Trimmed before validation. |
name | string | oui | trimmed |
diagnosis_codes | array of Code | oui | |
result_report_types | array of Code | oui | |
positive_interpretations | array of string | oui | 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 | oui | Distinct patients per area and ISO week that raise an alert; null means cases are counted but never alert. |
active | boolean | oui | |
Condition
| Nom | Type | Obligatoire | Description |
|---|
code | Code | oui | Trimmed before validation. |
name | string | oui | trimmed |
diagnosis_codes | array of Code | oui | |
result_report_types | array of Code | oui | |
positive_interpretations | array of string | oui | 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 | oui | Distinct patients per area and ISO week that raise an alert; null means cases are counted but never alert. |
active | boolean | oui | |
id | string (uuid) | non | |
version | integer | non | |
SyncResult
| Nom | Type | Obligatoire | Description |
|---|
sync_run_id | string (uuid) | non | |
state | "completed" | non | |
since | string (date) | non | |
counts | object | non | |
AlertState
"open" | "investigating" | "confirmed_outbreak" | "dismissed" | "closed"
Alert
| Nom | Type | Obligatoire | Description |
|---|
id | string (uuid) | non | |
condition_code | string | non | |
area_code | string | non | |
week_start | string (date) | non | |
case_count | integer | non | |
threshold | integer | non | |
state | AlertState | non | |
version | integer | non | |
allowed_transitions | array of string | non | |
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).
| Nom | Type | Obligatoire | Description |
|---|
kind | "birth" | "death" | oui | |
subject_patient_id | string (uuid) | oui | |
mother_patient_id | string (uuid) | non | births only |
ohn12_birth_event_id | string (uuid) | non | births only |
event_date | string (date) | oui | |
place_facility_id | string (uuid) | oui | |
cause_of_death_code | Code | non | required for deaths |
notification_channel | "electronic" | "paper_form" | "courier" | oui | |
notification_ref | string | oui | |
AdrCommand
| Nom | Type | Obligatoire | Description |
|---|
patient_id | string (uuid) | non | required for clinicians; a patient may only name themselves |
prescription_id | string (uuid) | non | |
medicine_code | Code | oui | Trimmed before validation. |
medicine_display | string | oui | |
reaction_code | Code | oui | Trimmed before validation. |
reaction_description | string | oui | |
onset_date | string (date) | oui | cannot be in the future |
seriousness | "non_serious" | "serious" | oui | |
outcome | "recovered" | "recovering" | "not_recovered" | "fatal" | "unknown" | oui | |
EnrolCommand
| Nom | Type | Obligatoire | Description |
|---|
patient_id | string (uuid) | oui | |
diagnosis_date | string (date) | oui | cannot be in the future |
facility_id | string (uuid) | oui | |
details | object | oui | |
Dashboard
| Nom | Type | Obligatoire | Description |
|---|
k | integer | non | |
weeks | integer | non | |
aggregates_only | true | non | |
datasets | object | non | |
get-api-ohn-v1-public-health-surveillance-conditions.response-200 défini sur place
| Nom | Type | Obligatoire | Description |
|---|
items | array of Condition | non | |
post-api-ohn-v1-public-health-surveillance-areas.request défini sur place
| Nom | Type | Obligatoire | Description |
|---|
facility_id | string (uuid) | oui | |
area_code | Code | oui | Trimmed before validation. |
area_name | string | oui | |
post-api-ohn-v1-public-health-surveillance-sync.request défini sur place
| Nom | Type | Obligatoire | Description |
|---|
since | string (date) | non | Default: the last OHN56 sync look-back (configuration, 56 days). |
get-api-ohn-v1-public-health-surveillance-alerts.response-200 défini sur place
| Nom | Type | Obligatoire | Description |
|---|
items | array of Alert | non | |
post-api-ohn-v1-public-health-surveillance-alerts-id-transitions.request défini sur place
| Nom | Type | Obligatoire | Description |
|---|
to_state | AlertState | oui | |
note | string | oui | |
expected_version | integer | oui | |
post-api-ohn-v1-public-health-civil-registration-notices-id-outcome.request.option-1 défini sur place
| Nom | Type | Obligatoire | Description |
|---|
outcome | "registered" | oui | |
civil_registration_ref | string | oui | |
expected_version | integer | oui | |
post-api-ohn-v1-public-health-civil-registration-notices-id-outcome.request.option-2 défini sur place
| Nom | Type | Obligatoire | Description |
|---|
outcome | "rejected" | oui | |
reason | string | oui | |
expected_version | integer | oui | |
post-api-ohn-v1-public-health-pharmacovigilance-reports-id-review.request défini sur place
| Nom | Type | Obligatoire | Description |
|---|
to_state | "under_review" | "assessed" | "rejected" | oui | |
causality | "certain" | "probable" | "possible" | "unlikely" | "unclassifiable" | non | required when to_state is assessed |
note | string | oui | |
expected_version | integer | oui | |
post-api-ohn-v1-public-health-registries-registry-entries-id-status.request défini sur place
| Nom | Type | Obligatoire | Description |
|---|
status | "active" | "in_remission" | "transferred_out" | "lost_to_follow_up" | "deceased" | "closed" | oui | |
note | string | oui | |
expected_version | integer | oui | |