← Tous les contrats
OHN-58 Certificates, Medicines Supply and Payments
- Version
- 1.1.0
- OpenAPI
- 3.1.0
- Source dans le dépôt
modules/OHN-58/api/openapi.yaml- Serveurs
https://opeshealthnetwork.com
- Authentification
bearer: http bearer (JWT (ES256, iss ohn-platform-gateway, aud ohn-58))
Télécharger le contrat (YAML)
Les contrats sont rédigés en anglais.
Synthetic data only. Reconciled with the observed TypeScript behaviour (see docs/program/java/ohn-58-contract-changes.md); served by the Java module `server/modules/ohn-58` in the portals deployable.
Authentication: a gateway token (ES256, issuer `ohn-platform-gateway`, audience `ohn-58`) with the claims `sub`, `jurisdiction`, `organization_id` (all UUIDs), `role` and `purpose`. Each role has exactly one purpose
(clinician `certification`, patient `patient_access`, pharmacist `medicine_supply`, ministry_officer `supply_oversight`, regulator `pharmacovigilance`, mutuelle_officer `mutuelle_administration`,
payments_officer `payments`, services_admin `services_administration`, cashier `facility_payments`, distributor `medicine_distribution`). A bad token or claim is 401; a role used with another purpose is 403; an unknown route (after sign-in) is 404 `not_found`; a route the role
is not listed for is 403 `denied_by_policy` (audited). The only unauthenticated routes are the health check and the employer's certificate check by code.
Every write needs an `Idempotency-Key` header (1 to 255 characters; 400 `missing_idempotency_key`); the same key and body replays the first answer (`Idempotent-Replay: true`); the same key with another body is 409
`idempotency_conflict`; a key still in flight is 409 `request_in_progress`. Request bodies are strict: an unknown field (for example a `diagnosis` on a certificate) is refused with 422 `domain_validation_failed`.
Errors are `{error, message, ...}` (problem+json superset: `type`, `title`, `status`, `detail`, `trace_id`). Configuration is never invented: with no certificate limit, signing key, payer-hash key or dependency the operation
is refused with 503 `not_configured` (names the `setting`; nothing is stored). There is no live payment provider: only the sandbox moves no money.
1.1.0 (2026-11-23, owner decision on the #88 questions 4 and 5): role `cashier` (a facility's cashier) may list providers and create, list, read, check and complete
(sandbox) payments of its own organisation only; a payment of another organisation is 404. It may not name a mutuelle member or take a `mutuelle_contribution`
(403 `denied_by_policy`), and the mutuelle schemes, members, eligibility, provider balance, certificates and medicines routes are 403. Role `distributor` (a
medicine distributor) has only the three `/medicines/distributor/...` routes: the batches whose `supplier_org_id` is its organisation, their recalls, and one
acknowledgement per recall; every other route, including all patient routes, is 403. The registry import accepts the optional `supplier_org_id` per row.
Opérations
Autres opérations
PUT/api/ohn/v1/payment-callbacks/{provider}/{paymentId}/{signature}
Identifiant d’opération: paymentCallback
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
provider | path | "mtn_momo" | "orange_money" | oui | |
paymentId | path | string (uuid) | oui | |
signature | path | string | oui | |
Corps de la requête
Réponses
| Code | Description | Type de média |
|---|
200 | Already final; no change | — |
202 | Accepted; the operator could not be reached and reconciliation will decide | — |
400 | Malformed | — |
401 | Signature or notification token does not match | — |
404 | Unknown payment | — |
503 | Provider not configured | — |
POST/api/ohn/v1/payment-callbacks/{provider}/{paymentId}/{signature}
Identifiant d’opération: paymentCallback
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
provider | path | "mtn_momo" | "orange_money" | oui | |
paymentId | path | string (uuid) | oui | |
signature | path | string | oui | |
Corps de la requête
Réponses
| Code | Description | Type de média |
|---|
200 | Already final; no change | — |
202 | Accepted; the operator could not be reached and reconciliation will decide | — |
400 | Malformed | — |
401 | Signature or notification token does not match | — |
404 | Unknown payment | — |
503 | Provider not configured | — |
GET/health/ohn-58Health. Public. Database ping, dependency modes (live or unconfigured), whether the signing key, the certificate limits and the payer-hash key are configured, the providers and whether writes are enabled.
Réponses
| Code | Description | Type de média |
|---|
200 | {status: ok, module: OHN-58, dependencies: {OHN-45, OHN-23}, signing_key_configured, auth_configured, synthetic_auth (always false), certificate_policy_configured, payments_configured, payment_providers: [{id, sandbox, available}], writes_enabled} | — |
503 | {status: unavailable, ...} the database does not answer | — |
GET/api/ohn/v1/certificates/verify/{code}Public verification by code (the employer's check). Case and separators are ignored. Rate-limited per client address (429). Fails closed (503) when OHN-45 cannot answer.
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
code | path | string | oui | |
Réponses
| Code | Description | Type de média |
|---|
200 | result | |
404 | unknown or malformed code | — |
429 | rate limited | — |
503 | OHN-45 unavailable or not configured | — |
GET/api/ohn/v1/certificates/contextRole, purpose, organisation, today, signing readiness and the configured limits (all roles). A limit that is not configured is null.
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | {role, purpose, organization_id, today, signing_ready, policy: {fitness_max_days, sick_leave_max_days, fitness_max_backdate_days, sick_leave_max_backdate_days}} | — |
401 | 401 unauthenticated, or 403 denied_by_policy (role not listed or purpose not the role's) | |
GET/api/ohn/v1/certificatesList (clinician own organisation; patient own certificates), newest first, at most 200.
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
kind | query | "fitness" | "sick_leave" | non | |
status | query | "active" | "revoked" | non | |
Réponses
| Code | Description | Type de média |
|---|
200 | {items} | — |
422 | 422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`. | |
POST/api/ohn/v1/certificatesIssue (clinician). Signed with the Ed25519 key and registered with OHN-45 before it is stored. Contains no diagnosis.
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
201 | issued | |
403 | 401 unauthenticated, or 403 denied_by_policy (role not listed or purpose not the role's) | |
422 | domain_validation_failed (bad input, end before start, or a day not on the calendar), validity_too_long, backdated_too_far | |
503 | 503 not_configured (names `setting`, and `dependency` for OHN-45 and OHN-23) or dependency_unavailable; nothing was stored | |
GET/api/ohn/v1/certificates/{id}Read (clinician of the issuing organisation, the patient). Another organisation, patient or jurisdiction is 404.
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
Réponses
| Code | Description | Type de média |
|---|
200 | ok | |
404 | not found or out of scope | — |
POST/api/ohn/v1/certificates/{id}/revokeRevoke (clinician of the issuing organisation), with optimistic concurrency.
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
200 | revoked | — |
404 | not found | — |
409 | version_conflict (with current_version) or already_revoked | — |
422 | 422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`. | |
GET/api/ohn/v1/certificates/reports/summaryOHN-58-R01 certificates issued and verified (clinician: own organisation; services_admin: the jurisdiction).
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | {id, title, certificates: [{kind, status, n}], verifications_30_days: [{result, n}], generated_at} | — |
GET/api/ohn/v1/medicines/pharmacyOwn pharmacy profile (pharmacist)
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | ok | — |
404 | none yet | — |
PUT/api/ohn/v1/medicines/pharmacySet own pharmacy profile (pharmacist).
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
200 | saved | — |
404 | the organisation belongs to another jurisdiction | — |
422 | 422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`. | |
GET/api/ohn/v1/medicines/stockOwn stock (pharmacist), with `level` (in_stock, low, out_of_stock)
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | ok | — |
POST/api/ohn/v1/medicines/stockReport stock (pharmacist). Every product is validated by OHN-23 before anything is saved.
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
201 | {items, new_stock_outs, receipt} | — |
404 | pharmacy profile missing | — |
422 | unknown_product (names `code`) or invalid | |
503 | 503 not_configured (names `setting`, and `dependency` for OHN-45 and OHN-23) or dependency_unavailable; nothing was stored | |
GET/api/ohn/v1/medicines/availabilitySearch pharmacies (clinician, patient, pharmacist, ministry). Needs q (2 to 100 characters) or code. Patients get availability without quantity or unit.
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
q | query | string | non | |
code | query | string | non | |
code_system | query | string | non | |
district | query | string | non | |
lat | query | number | non | needs lon |
lon | query | number | non | needs lat |
radius_km | query | number | non | |
include_out | query | "true" | "false" | non | |
Réponses
| Code | Description | Type de média |
|---|
200 | {items: [{id, pharmacy_id, pharmacy, district, phone, product, code_system, code, availability, quantity?, unit?, distance_km, reported_at, stale}]}, at most 100 | — |
422 | 422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`. | |
GET/api/ohn/v1/medicines/stock-outsOHN-58-R02 (ministry_officer
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | {id, title, items, by_product, generated_at} | — |
GET/api/ohn/v1/medicines/stock-outs/exportOHN-58-R02 as CSV (formula-injection guarded; audited)
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | text/csv; charset=utf-8, attachment ohn58-stock-outs-yyyy-MM-dd.csv | — |
GET/api/ohn/v1/medicines/batchesRegistry (regulator)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
q | query | string | non | |
Réponses
| Code | Description | Type de média |
|---|
200 | ok | — |
422 | 422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`. | |
POST/api/ohn/v1/medicines/batches/importImport registry rows (regulator); rows are validated one by one.
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
201 | {import_id, rows_accepted, rows_rejected, errors: [{row, message}], receipt} | — |
422 | invalid body, or a day the date check accepts but the calendar lacks (the whole import is refused and nothing is stored) | — |
POST/api/ohn/v1/medicines/batches/{id}/recallRecall (regulator)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
200 | recalled | — |
404 | not found | — |
409 | already_recalled | — |
GET/api/ohn/v1/medicines/distributor/batchesOwn supply list (distributor): batches whose supplier_org_id is the token organisation, with this distributor's acknowledgement. No patient, pharmacy or stock data.
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | {items: [{id, manufacturer, product_code, product_name, batch_number, expiry_date, status, recall_reason, updated_at, acknowledged_at}]} | — |
403 | 401 unauthenticated, or 403 denied_by_policy (role not listed or purpose not the role's) | |
GET/api/ohn/v1/medicines/distributor/recallsRecalls of batches this distributor supplied (distributor); never another supplier's
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | {items: [... as distributor/batches, status recalled]} | — |
403 | 401 unauthenticated, or 403 denied_by_policy (role not listed or purpose not the role's) | |
POST/api/ohn/v1/medicines/distributor/recalls/{id}/acknowledgeAcknowledge a recall of a batch this distributor supplied (distributor; audited, event medicine.recall_acknowledged)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | |
Corps de la requête
Réponses
| Code | Description | Type de média |
|---|
201 | {id, batch_id, acknowledged_at, receipt} | — |
403 | 401 unauthenticated, or 403 denied_by_policy (role not listed or purpose not the role's) | |
404 | not a recalled batch this distributor supplied (another supplier's, active or unknown) | — |
409 | already_acknowledged | — |
422 | 422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`. | |
GET/api/ohn/v1/medicines/authenticity/scansRecent scans (own organisation; regulator all)
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | ok | — |
POST/api/ohn/v1/medicines/authenticity/scansCheck a pack (pharmacist, clinician). Unknown, recalled and duplicate_scan results open a regulator report.
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
201 | result | |
GET/api/ohn/v1/medicines/regulator/reportsRegulator queue (regulator)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
state | query | "open" | "investigating" | "closed" | non | |
Réponses
| Code | Description | Type de média |
|---|
200 | ok | — |
422 | 422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`. | |
POST/api/ohn/v1/medicines/regulator/reports/{id}/transitionMove a report along its workflow (regulator), with optimistic concurrency.
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
200 | {id, state, outcome, resolution, version, receipt} | — |
404 | not found | — |
409 | version_conflict or invalid_transition | — |
422 | 422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`. | |
GET/api/ohn/v1/payments/providersProviders and availability (payments_officer, mutuelle_officer, pharmacist, services_admin). Only the sandbox can be available.
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | {items: [{id, label, sandbox, available, reason}]} | — |
GET/api/ohn/v1/payments/mutuelle/schemesOwn organisation's schemes (mutuelle_officer
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | ok | — |
POST/api/ohn/v1/payments/mutuelle/schemesCreate a scheme (mutuelle_officer)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
201 | created | — |
409 | duplicate (same name in the organisation) | — |
422 | 422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`. | |
GET/api/ohn/v1/payments/mutuelle/membersMembers of own schemes (mutuelle_officer
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | ok | — |
POST/api/ohn/v1/payments/mutuelle/membersEnrol (mutuelle_officer)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
201 | enrolled | — |
404 | scheme not found | — |
409 | duplicate or scheme_inactive | — |
422 | 422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`. | |
GET/api/ohn/v1/payments/mutuelle/members/{patientId}/eligibilityCover on a day (mutuelle_officer and payments_officer: own schemes; clinician: all schemes)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
patientId | path | string (uuid) | oui | |
on | query | Day | non | default today (UTC); a day not on the calendar is 422 |
Réponses
| Code | Description | Type de média |
|---|
200 | ok | |
422 | 422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`. | |
GET/api/ohn/v1/payments/mutuelle/mePatient's own cover today and contributions
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | Eligibility plus {contributions: [{id, amount_minor, currency, period_start, period_end, created_at}]} | — |
GET/api/ohn/v1/paymentsOwn organisation's payments
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
status | query | "pending" | "succeeded" | "failed" | "cancelled" | non | |
Réponses
| Code | Description | Type de média |
|---|
200 | ok | — |
422 | 422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`. | |
POST/api/ohn/v1/paymentsRequest a payment. Only the sandbox is available (records a simulated collection; no money moves). A live provider is 503 provider_unavailable.
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
201 | pending | — |
404 | member not found in your scheme | — |
409 | member_not_active | — |
422 | invalid, unknown_provider or amount_mismatch | |
503 | provider_unavailable (the sandbox is off in production; a live provider has no adapter) or not_configured (payer-hash key) | — |
GET/api/ohn/v1/payments/{id}Read (own organisation)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
Réponses
| Code | Description | Type de média |
|---|
200 | ok | — |
404 | not found | — |
POST/api/ohn/v1/payments/{id}/sandbox/{outcome}Sandbox approve (complete) or decline (fail), with optimistic concurrency
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
outcome | path | "complete" | "fail" | oui | |
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
200 | the payment plus {contribution: {id, period_start, period_end} | null, receipt} | — |
404 | not found | — |
409 | not_sandbox | — |
422 | 422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`. | |
GET/api/ohn/v1/payments/auditAudit trail of the jurisdiction (services_admin)
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | {items: [{receipt_id, at, actor_role, action, resource_type, resource_id, decision, reason}]} | — |
Schémas
Error
| Nom | Type | Obligatoire | Description |
|---|
error | string | oui | machine code, for example not_found, denied_by_policy, domain_validation_failed, version_conflict, invalid_transition, validity_too_long, backdated_too_far, unknown_product, amount_mismatch, provider_unavailable, not_configured, dependency_unavailable, duplicate, rate_limited |
message | string | oui | |
setting | string | non | the configuration property that is missing (503 not_configured) |
dependency | "OHN-45" | "OHN-23" | non | |
current_version | integer | non | version_conflict |
code | string | non | unknown_product: the product code |
provider | string | non | provider_unavailable |
details | object | non | |
type | string | non | |
title | string | non | |
status | integer | non | |
detail | string | non | |
trace_id | string | non | |
Day
yyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored.
string
IssueCertificate
object | object
RevokeCertificate
| Nom | Type | Obligatoire | Description |
|---|
reason | string | oui | trimmed |
expected_version | integer | oui | |
Certificate
| Nom | Type | Obligatoire | Description |
|---|
id | string (uuid) | non | |
kind | "fitness" | "sick_leave" | non | |
patient_id | string (uuid) | non | |
issued_by | string (uuid) | non | |
organization_id | string (uuid) | non | |
outcome | "fit" | "not_fit" | null | non | |
valid_from | Day | non | yyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored. |
valid_to | Day | non | yyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored. |
verify_code | string | non | |
status | "active" | "revoked" | non | |
standing | "valid" | "revoked" | "expired" | "not_yet_valid" | non | |
revoked_at | string | null (date-time) | non | |
revoke_reason | string | null | non | |
version | integer | non | |
issued_at | string (date-time) | non | |
ohn45_artifact_ref | string (uuid) | non | |
ohn45_signature_ref | string (uuid) | non | |
verify_path | string | non | |
receipt | string (uuid) | non | issue and revoke answers only |
PublicVerification
Only these members. A certificate whose signature, stored columns or OHN-45 verification do not agree answers {code, result: invalid_signature, message} and no certificate data.
| Nom | Type | Obligatoire | Description |
|---|
code | string | non | |
result | "valid" | "revoked" | "expired" | "not_yet_valid" | "invalid_signature" | non | |
kind | "fitness" | "sick_leave" | non | |
answer | "fit" | "not_fit" | "unfit_for_work" | non | |
valid_from | Day | non | yyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored. |
valid_to | Day | non | yyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored. |
revoked_on | Day | null | non | |
signature | "verified_by_ohn45" | non | |
message | string | non | |
PharmacyProfile
| Nom | Type | Obligatoire | Description |
|---|
name | string | oui | |
district | string | oui | |
latitude | number | null | oui | |
longitude | number | null | oui | |
phone | string | null | oui | |
BatchRow
| Nom | Type | Obligatoire | Description |
|---|
manufacturer | string | oui | |
product_code | string | oui | |
product_name | string | oui | |
batch_number | string | oui | |
expiry_date | Day | oui | yyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored. |
status | "active" | "recalled" | non | |
recall_reason | string | null | non | required (non-empty) when status is recalled |
serials | array of string | non | |
supplier_org_id | string | null (uuid) | non | the distributor organisation that supplied the batch; only it sees the batch and its recall on the distributor routes (1.1.0) |
RecallAcknowledgement
| Nom | Type | Obligatoire | Description |
|---|
note | string | non | |
BatchImport
| Nom | Type | Obligatoire | Description |
|---|
source | string | oui | |
rows | array of any | oui | each element is validated against BatchRow on its own; a bad row is reported in `errors` (row number from 1, message in the form `field: Required`) and the others are imported |
Recall
| Nom | Type | Obligatoire | Description |
|---|
reason | string | oui | |
Scan
| Nom | Type | Obligatoire | Description |
|---|
product_code | string | oui | |
batch_number | string | oui | |
serial | string | null | non | |
note | string | null | non | |
ScanResult
| Nom | Type | Obligatoire | Description |
|---|
id | string (uuid) | non | |
result | "genuine" | "unknown" | "recalled" | "duplicate_scan" | "expired" | non | |
message | string | non | |
product_code | string | non | |
batch_number | string | non | |
serial | string | null | non | |
product_name | string | null | non | |
manufacturer | string | null | non | |
expiry_date | string | null | non | |
recall_reason | string | null | non | |
previous_scans_here | integer | non | genuine and expired only |
regulator_report_id | string | null (uuid) | non | |
scanned_at | string (date-time) | non | |
receipt | string (uuid) | non | |
ReportTransition
closing needs an outcome and a resolution (422 otherwise); open -> investigating | closed, investigating -> closed, closed is final (409 invalid_transition)
| Nom | Type | Obligatoire | Description |
|---|
to_state | "investigating" | "closed" | oui | |
expected_version | integer | oui | |
outcome | "substantiated" | "unsubstantiated" | non | |
resolution | string | non | |
Scheme
| Nom | Type | Obligatoire | Description |
|---|
name | string | oui | |
contribution_minor | integer | oui | whole minor units; the scheme's own configuration, never computed here |
currency | string | oui | |
period_months | integer | oui | |
waiting_days | integer | oui | |
Enrol
| Nom | Type | Obligatoire | Description |
|---|
scheme_id | string (uuid) | oui | |
patient_id | string (uuid) | oui | |
household_ref | string | null | non | |
enrolled_on | Day | oui | yyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored. |
Payment
| Nom | Type | Obligatoire | Description |
|---|
provider | string | oui | sandbox, mtn_momo or orange_money; any other value is 422 unknown_provider |
purpose | "mutuelle_contribution" | "service_fee" | "medicine_purchase" | oui | |
amount_minor | integer | oui | whole minor units; a contribution must equal the scheme's contribution_minor and currency exactly (422 amount_mismatch) |
currency | string | oui | |
payer_msisdn | string | oui | stored only as the last four digits and a keyed hash; never returned |
member_id | string | null (uuid) | non | required for mutuelle_contribution |
reference | string | oui | |
SandboxCallback
| Nom | Type | Obligatoire | Description |
|---|
expected_version | integer | oui | |
Eligibility
| Nom | Type | Obligatoire | Description |
|---|
patient_id | string (uuid) | non | |
on | Day | non | yyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored. |
eligible | boolean | non | |
memberships | array of Eligibility.memberships.item | non | |
reasons | array of "no_membership" | non | present only when there is no membership |
StockReport.items.item défini sur place
| Nom | Type | Obligatoire | Description |
|---|
code_system | string | oui | |
code | string | oui | |
quantity | integer | oui | |
reorder_level | integer | non | |
unit | string | oui | |
Eligibility.memberships.item défini sur place
| Nom | Type | Obligatoire | Description |
|---|
member_id | string | non | |
scheme | string | non | |
scheme_org_id | string | non | |
enrolled_on | Day | non | yyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored. |
waiting_ends | Day | non | yyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored. |
paid_until | string | null | non | |
eligible | boolean | non | |
reasons | array of "membership_suspended" | "membership_ended" | "waiting_period" | "no_paid_contribution" | non | |