Aller au contenu

← 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

CodeDescriptionType de média
200OK
application/json: Settings
POST/api/ohn/v1/public-health/settingsSet k and the ADR signal threshold (public_health_admin)

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-KeyheaderstringouiNot 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

CodeDescriptionType de média
200Saved—
409version_conflict—
422domain_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

CodeDescriptionType de média
200OK
POST/api/ohn/v1/public-health/surveillance/conditionsCreate or replace a condition by code (public_health_admin)

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-KeyheaderstringouiNot 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

CodeDescriptionType de média
200Saved—
422domain_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

CodeDescriptionType de média
200OK—
POST/api/ohn/v1/public-health/surveillance/areasPlace a facility in an area (public_health_admin)

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-KeyheaderstringouiNot 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

CodeDescriptionType de média
200Saved—
422domain_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

NomEmplacementTypeObligatoireDescription
Idempotency-KeyheaderstringouiNot 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

CodeDescriptionType de média
200Completed run
application/json: SyncResult
409No active condition configured (policy_not_configured)—
422domain_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, ...)—
503dependency_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

CodeDescriptionType de média
200OK—
GET/api/ohn/v1/public-health/surveillance/case-countsDistinct-patient case counts by condition, area and week (surveillance_officer)

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
weeksquerystringnonWeeks 1-52 (default 8; 0 means the default).
conditionquerystringnon

Réponses

CodeDescriptionType de média
200OK—
404Unknown condition—
GET/api/ohn/v1/public-health/surveillance/alertsOutbreak alerts (surveillance_officer)

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
statequerystringnonExact state; any string up to 32 characters is accepted (an unknown state matches nothing).

Réponses

CodeDescriptionType de média
200OK
GET/api/ohn/v1/public-health/surveillance/alerts/{id}

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui

Réponses

CodeDescriptionType de média
200Alert with history—
404Not 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

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui
Idempotency-KeyheaderstringouiNot 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

CodeDescriptionType de média
200Moved—
404Not found—
409version_conflict—
422domain_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

NomEmplacementTypeObligatoireDescription
kindquerystringnon
statequerystringnon

Réponses

CodeDescriptionType de média
200OK—
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

NomEmplacementTypeObligatoireDescription
Idempotency-KeyheaderstringouiNot 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

CodeDescriptionType de média
201Recorded—
409A live notice exists—
422domain_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, ...)—
503dependency_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

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui

Réponses

CodeDescriptionType de média
200Notice with history—
404Not found—
POST/api/ohn/v1/public-health/civil-registration/notices/{id}/outcomeRecord the civil registration answer

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui
Idempotency-KeyheaderstringouiNot 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

CodeDescriptionType de média
200Recorded—
404Not found—
409version_conflict—
422domain_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

NomEmplacementTypeObligatoireDescription
statequerystringnon

Réponses

CodeDescriptionType de média
200OK—
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

NomEmplacementTypeObligatoireDescription
Idempotency-KeyheaderstringouiNot 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

CodeDescriptionType de média
201Recorded—
403Patient reporting for someone else—
422domain_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, ...)—
503dependency_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

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui

Réponses

CodeDescriptionType de média
200Report with history—
404Not found—
POST/api/ohn/v1/public-health/pharmacovigilance/reports/{id}/reviewReview (pv_reviewer, not the reporter). assessed requires causality.

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui
Idempotency-KeyheaderstringouiNot 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

CodeDescriptionType de média
200Reviewed—
403Own report—
409version_conflict—
422domain_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

CodeDescriptionType de média
200OK—

registries

GET/api/ohn/v1/public-health/registriesRegistry catalog with counts (sensitive counts hidden from surveillance_officer)

Authentification: bearer

Réponses

CodeDescriptionType de média
200OK—
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

NomEmplacementTypeObligatoireDescription
registrypath"sickle_cell" | "hiv" | "tb" | "cancer" | "maternal"oui
statusquerystringnon

Réponses

CodeDescriptionType de média
200OK—
403Segmented—
503dependency_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

NomEmplacementTypeObligatoireDescription
registrypath"sickle_cell" | "hiv" | "tb" | "cancer" | "maternal"oui
Idempotency-KeyheaderstringouiNot 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

CodeDescriptionType de média
201Enrolled—
403consent_denied—
409Already enrolled—
422domain_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

NomEmplacementTypeObligatoireDescription
registrypath"sickle_cell" | "hiv" | "tb" | "cancer" | "maternal"oui
idpathstring (uuid)oui

Réponses

CodeDescriptionType de média
200Entry with history—
403Segmented or consent denied—
404Not found—
POST/api/ohn/v1/public-health/registries/{registry}/entries/{id}/statusChange status (deceased and closed are final)

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
registrypath"sickle_cell" | "hiv" | "tb" | "cancer" | "maternal"oui
idpathstring (uuid)oui
Idempotency-KeyheaderstringouiNot 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

CodeDescriptionType de média
200Changed—
403Segmented or consent denied—
404Not found—
409version_conflict—
422domain_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

NomEmplacementTypeObligatoireDescription
weeksquerystringnonWeeks 1-52 (default 12).

Réponses

CodeDescriptionType de média
200OK
application/json: Dashboard
409policy_not_configured—
GET/api/ohn/v1/public-health/analytics/{dataset}/exportCSV export of one dataset (ministry_analyst)

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
datasetpath"cases" | "alerts" | "registries" | "adr" | "civil"oui
weeksquerystringnonWeeks 1-52 (default 12).

Réponses

CodeDescriptionType de média
200CSV
text/csv: string
409policy_not_configured—

Autres opérations

GET/health/ohn-56Health and dependency modes

Réponses

CodeDescriptionType de média
200OK: status, module, dependencies (mode per OHN-03, 09, 10, 11, 12, 15, 50), writes_enabled, auth_configured
application/json: Health
503Database unavailable—
GET/api/ohn/v1/public-health/contextCaller role, purpose, dependency modes, settings and allowed actions (all roles)

Authentification: bearer

Réponses

CodeDescriptionType de média
200OK
application/json: object
401Missing or invalid token—
GET/api/ohn/v1/public-health/auditLast 200 audit records (public_health_admin)

Authentification: bearer

Réponses

CodeDescriptionType de média
200OK—

Schémas

Code

Trimmed before validation.

string

Health

NomTypeObligatoireDescription
statusstringnon
module"OHN-56"non
dependenciesobjectnon

Settings

Unset values are null and version 0; configured is true once small_cell_k is set.

NomTypeObligatoireDescription
small_cell_kinteger | nullnon
adr_signal_thresholdinteger | nullnon
versionintegernon
updated_atstring | null (date-time)non
configuredbooleannon

SettingsCommand

NomTypeObligatoireDescription
small_cell_kinteger | nulloui
adr_signal_thresholdinteger | nulloui
expected_versionintegeroui

ConditionCommand

At least one diagnosis code or result report type is required (422 on diagnosis_codes otherwise).

NomTypeObligatoireDescription
codeCodeouiTrimmed before validation.
namestringouitrimmed
diagnosis_codesarray of Codeoui
result_report_typesarray of Codeoui
positive_interpretationsarray of stringouiStored lower-case; a result counts when its source_interpretation (lower-cased) is listed, or always when the list is empty.
threshold_countinteger | nullouiDistinct patients per area and ISO week that raise an alert; null means cases are counted but never alert.
activebooleanoui

Condition

NomTypeObligatoireDescription
codeCodeouiTrimmed before validation.
namestringouitrimmed
diagnosis_codesarray of Codeoui
result_report_typesarray of Codeoui
positive_interpretationsarray of stringouiStored lower-case; a result counts when its source_interpretation (lower-cased) is listed, or always when the list is empty.
threshold_countinteger | nullouiDistinct patients per area and ISO week that raise an alert; null means cases are counted but never alert.
activebooleanoui
idstring (uuid)non
versionintegernon

SyncResult

NomTypeObligatoireDescription
sync_run_idstring (uuid)non
state"completed"non
sincestring (date)non
countsobjectnon

AlertState

"open" | "investigating" | "confirmed_outbreak" | "dismissed" | "closed"

Alert

NomTypeObligatoireDescription
idstring (uuid)non
condition_codestringnon
area_codestringnon
week_startstring (date)non
case_countintegernon
thresholdintegernon
stateAlertStatenon
versionintegernon
allowed_transitionsarray of stringnon

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).

NomTypeObligatoireDescription
kind"birth" | "death"oui
subject_patient_idstring (uuid)oui
mother_patient_idstring (uuid)nonbirths only
ohn12_birth_event_idstring (uuid)nonbirths only
event_datestring (date)oui
place_facility_idstring (uuid)oui
cause_of_death_codeCodenonrequired for deaths
notification_channel"electronic" | "paper_form" | "courier"oui
notification_refstringoui

AdrCommand

NomTypeObligatoireDescription
patient_idstring (uuid)nonrequired for clinicians; a patient may only name themselves
prescription_idstring (uuid)non
medicine_codeCodeouiTrimmed before validation.
medicine_displaystringoui
reaction_codeCodeouiTrimmed before validation.
reaction_descriptionstringoui
onset_datestring (date)ouicannot be in the future
seriousness"non_serious" | "serious"oui
outcome"recovered" | "recovering" | "not_recovered" | "fatal" | "unknown"oui

EnrolCommand

NomTypeObligatoireDescription
patient_idstring (uuid)oui
diagnosis_datestring (date)ouicannot be in the future
facility_idstring (uuid)oui
detailsobjectoui

Dashboard

NomTypeObligatoireDescription
kintegernon
weeksintegernon
aggregates_onlytruenon
datasetsobjectnon

get-api-ohn-v1-public-health-surveillance-conditions.response-200 défini sur place

NomTypeObligatoireDescription
itemsarray of Conditionnon

post-api-ohn-v1-public-health-surveillance-areas.request défini sur place

NomTypeObligatoireDescription
facility_idstring (uuid)oui
area_codeCodeouiTrimmed before validation.
area_namestringoui

post-api-ohn-v1-public-health-surveillance-sync.request défini sur place

NomTypeObligatoireDescription
sincestring (date)nonDefault: the last OHN56 sync look-back (configuration, 56 days).

get-api-ohn-v1-public-health-surveillance-alerts.response-200 défini sur place

NomTypeObligatoireDescription
itemsarray of Alertnon

post-api-ohn-v1-public-health-surveillance-alerts-id-transitions.request défini sur place

NomTypeObligatoireDescription
to_stateAlertStateoui
notestringoui
expected_versionintegeroui

post-api-ohn-v1-public-health-civil-registration-notices-id-outcome.request.option-1 défini sur place

NomTypeObligatoireDescription
outcome"registered"oui
civil_registration_refstringoui
expected_versionintegeroui

post-api-ohn-v1-public-health-civil-registration-notices-id-outcome.request.option-2 défini sur place

NomTypeObligatoireDescription
outcome"rejected"oui
reasonstringoui
expected_versionintegeroui

post-api-ohn-v1-public-health-pharmacovigilance-reports-id-review.request défini sur place

NomTypeObligatoireDescription
to_state"under_review" | "assessed" | "rejected"oui
causality"certain" | "probable" | "possible" | "unlikely" | "unclassifiable"nonrequired when to_state is assessed
notestringoui
expected_versionintegeroui

post-api-ohn-v1-public-health-registries-registry-entries-id-status.request défini sur place

NomTypeObligatoireDescription
status"active" | "in_remission" | "transferred_out" | "lost_to_follow_up" | "deceased" | "closed"oui
notestringoui
expected_versionintegeroui