Aller au contenu

← 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

NomEmplacementTypeObligatoireDescription
providerpath"mtn_momo" | "orange_money"oui
paymentIdpathstring (uuid)oui
signaturepathstringoui

Corps de la requête

  • application/json: object

Réponses

CodeDescriptionType de média
200Already final; no change—
202Accepted; the operator could not be reached and reconciliation will decide—
400Malformed—
401Signature or notification token does not match—
404Unknown payment—
503Provider not configured—
POST/api/ohn/v1/payment-callbacks/{provider}/{paymentId}/{signature}

Identifiant d’opération: paymentCallback

Paramètres

NomEmplacementTypeObligatoireDescription
providerpath"mtn_momo" | "orange_money"oui
paymentIdpathstring (uuid)oui
signaturepathstringoui

Corps de la requête

  • application/json: object

Réponses

CodeDescriptionType de média
200Already final; no change—
202Accepted; the operator could not be reached and reconciliation will decide—
400Malformed—
401Signature or notification token does not match—
404Unknown payment—
503Provider 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

CodeDescriptionType 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

NomEmplacementTypeObligatoireDescription
codepathstringoui

Réponses

CodeDescriptionType de média
200result
application/json: PublicVerification
404unknown or malformed code—
429rate limited—
503OHN-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

CodeDescriptionType 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}}—
401401 unauthenticated, or 403 denied_by_policy (role not listed or purpose not the role's)
application/json: Error
GET/api/ohn/v1/certificatesList (clinician own organisation; patient own certificates), newest first, at most 200.

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
kindquery"fitness" | "sick_leave"non
statusquery"active" | "revoked"non

Réponses

CodeDescriptionType de média
200{items}—
422422 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 `_`.
application/json: Error
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

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

Réponses

CodeDescriptionType de média
201issued
application/json: Certificate
403401 unauthenticated, or 403 denied_by_policy (role not listed or purpose not the role's)
application/json: Error
422domain_validation_failed (bad input, end before start, or a day not on the calendar), validity_too_long, backdated_too_far
application/json: Error
503503 not_configured (names `setting`, and `dependency` for OHN-45 and OHN-23) or dependency_unavailable; nothing was stored
application/json: Error
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

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui

Réponses

CodeDescriptionType de média
200ok
application/json: Certificate
404not found or out of scope—
POST/api/ohn/v1/certificates/{id}/revokeRevoke (clinician of the issuing organisation), with optimistic concurrency.

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

Réponses

CodeDescriptionType de média
200revoked—
404not found—
409version_conflict (with current_version) or already_revoked—
422422 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 `_`.
application/json: Error
GET/api/ohn/v1/certificates/reports/summaryOHN-58-R01 certificates issued and verified (clinician: own organisation; services_admin: the jurisdiction).

Authentification: bearer

Réponses

CodeDescriptionType 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

CodeDescriptionType de média
200ok—
404none yet—
PUT/api/ohn/v1/medicines/pharmacySet own pharmacy profile (pharmacist).

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

Réponses

CodeDescriptionType de média
200saved—
404the organisation belongs to another jurisdiction—
422422 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 `_`.
application/json: Error
GET/api/ohn/v1/medicines/stockOwn stock (pharmacist), with `level` (in_stock, low, out_of_stock)

Authentification: bearer

Réponses

CodeDescriptionType de média
200ok—
POST/api/ohn/v1/medicines/stockReport stock (pharmacist). Every product is validated by OHN-23 before anything is saved.

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

Réponses

CodeDescriptionType de média
201{items, new_stock_outs, receipt}—
404pharmacy profile missing—
422unknown_product (names `code`) or invalid
application/json: Error
503503 not_configured (names `setting`, and `dependency` for OHN-45 and OHN-23) or dependency_unavailable; nothing was stored
application/json: Error
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

NomEmplacementTypeObligatoireDescription
qquerystringnon
codequerystringnon
code_systemquerystringnon
districtquerystringnon
latquerynumbernonneeds lon
lonquerynumbernonneeds lat
radius_kmquerynumbernon
include_outquery"true" | "false"non

Réponses

CodeDescriptionType 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—
422422 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 `_`.
application/json: Error
GET/api/ohn/v1/medicines/stock-outsOHN-58-R02 (ministry_officer

Authentification: bearer

Réponses

CodeDescriptionType 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

CodeDescriptionType de média
200text/csv; charset=utf-8, attachment ohn58-stock-outs-yyyy-MM-dd.csv—
GET/api/ohn/v1/medicines/batchesRegistry (regulator)

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
qquerystringnon

Réponses

CodeDescriptionType de média
200ok—
422422 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 `_`.
application/json: Error
POST/api/ohn/v1/medicines/batches/importImport registry rows (regulator); rows are validated one by one.

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

Réponses

CodeDescriptionType de média
201{import_id, rows_accepted, rows_rejected, errors: [{row, message}], receipt}—
422invalid 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

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

Réponses

CodeDescriptionType de média
200recalled—
404not found—
409already_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

CodeDescriptionType de média
200{items: [{id, manufacturer, product_code, product_name, batch_number, expiry_date, status, recall_reason, updated_at, acknowledged_at}]}—
403401 unauthenticated, or 403 denied_by_policy (role not listed or purpose not the role's)
application/json: Error
GET/api/ohn/v1/medicines/distributor/recallsRecalls of batches this distributor supplied (distributor); never another supplier's

Authentification: bearer

Réponses

CodeDescriptionType de média
200{items: [... as distributor/batches, status recalled]}—
403401 unauthenticated, or 403 denied_by_policy (role not listed or purpose not the role's)
application/json: Error
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

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui
Idempotency-Keyheaderstringoui

Corps de la requête

Réponses

CodeDescriptionType de média
201{id, batch_id, acknowledged_at, receipt}—
403401 unauthenticated, or 403 denied_by_policy (role not listed or purpose not the role's)
application/json: Error
404not a recalled batch this distributor supplied (another supplier's, active or unknown)—
409already_acknowledged—
422422 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 `_`.
application/json: Error
GET/api/ohn/v1/medicines/authenticity/scansRecent scans (own organisation; regulator all)

Authentification: bearer

Réponses

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

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

  • application/json: Scan

Réponses

CodeDescriptionType de média
201result
application/json: ScanResult
GET/api/ohn/v1/medicines/regulator/reportsRegulator queue (regulator)

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
statequery"open" | "investigating" | "closed"non

Réponses

CodeDescriptionType de média
200ok—
422422 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 `_`.
application/json: Error
POST/api/ohn/v1/medicines/regulator/reports/{id}/transitionMove a report along its workflow (regulator), with optimistic concurrency.

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

Réponses

CodeDescriptionType de média
200{id, state, outcome, resolution, version, receipt}—
404not found—
409version_conflict or invalid_transition—
422422 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 `_`.
application/json: Error
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

CodeDescriptionType 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

CodeDescriptionType de média
200ok—
POST/api/ohn/v1/payments/mutuelle/schemesCreate a scheme (mutuelle_officer)

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

Réponses

CodeDescriptionType de média
201created—
409duplicate (same name in the organisation)—
422422 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 `_`.
application/json: Error
GET/api/ohn/v1/payments/mutuelle/membersMembers of own schemes (mutuelle_officer

Authentification: bearer

Réponses

CodeDescriptionType de média
200ok—
POST/api/ohn/v1/payments/mutuelle/membersEnrol (mutuelle_officer)

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

Réponses

CodeDescriptionType de média
201enrolled—
404scheme not found—
409duplicate or scheme_inactive—
422422 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 `_`.
application/json: Error
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

NomEmplacementTypeObligatoireDescription
patientIdpathstring (uuid)oui
onqueryDaynondefault today (UTC); a day not on the calendar is 422

Réponses

CodeDescriptionType de média
200ok
application/json: Eligibility
422422 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 `_`.
application/json: Error
GET/api/ohn/v1/payments/mutuelle/mePatient's own cover today and contributions

Authentification: bearer

Réponses

CodeDescriptionType de média
200Eligibility plus {contributions: [{id, amount_minor, currency, period_start, period_end, created_at}]}—
GET/api/ohn/v1/paymentsOwn organisation's payments

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
statusquery"pending" | "succeeded" | "failed" | "cancelled"non

Réponses

CodeDescriptionType de média
200ok—
422422 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 `_`.
application/json: Error
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

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

Réponses

CodeDescriptionType de média
201pending—
404member not found in your scheme—
409member_not_active—
422invalid, unknown_provider or amount_mismatch
application/json: Error
503provider_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

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui

Réponses

CodeDescriptionType de média
200ok—
404not found—
POST/api/ohn/v1/payments/{id}/sandbox/{outcome}Sandbox approve (complete) or decline (fail), with optimistic concurrency

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui
outcomepath"complete" | "fail"oui
Idempotency-Keyheaderstringoui

Corps de la requête (obligatoire)

Réponses

CodeDescriptionType de média
200the payment plus {contribution: {id, period_start, period_end} | null, receipt}—
404not found—
409not_sandbox—
422422 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 `_`.
application/json: Error
GET/api/ohn/v1/payments/auditAudit trail of the jurisdiction (services_admin)

Authentification: bearer

Réponses

CodeDescriptionType de média
200{items: [{receipt_id, at, actor_role, action, resource_type, resource_id, decision, reason}]}—

Schémas

Error

NomTypeObligatoireDescription
errorstringouimachine 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
messagestringoui
settingstringnonthe configuration property that is missing (503 not_configured)
dependency"OHN-45" | "OHN-23"non
current_versionintegernonversion_conflict
codestringnonunknown_product: the product code
providerstringnonprovider_unavailable
detailsobjectnon
typestringnon
titlestringnon
statusintegernon
detailstringnon
trace_idstringnon

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

NomTypeObligatoireDescription
reasonstringouitrimmed
expected_versionintegeroui

Certificate

NomTypeObligatoireDescription
idstring (uuid)non
kind"fitness" | "sick_leave"non
patient_idstring (uuid)non
issued_bystring (uuid)non
organization_idstring (uuid)non
outcome"fit" | "not_fit" | nullnon
valid_fromDaynonyyyy-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_toDaynonyyyy-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_codestringnon
status"active" | "revoked"non
standing"valid" | "revoked" | "expired" | "not_yet_valid"non
revoked_atstring | null (date-time)non
revoke_reasonstring | nullnon
versionintegernon
issued_atstring (date-time)non
ohn45_artifact_refstring (uuid)non
ohn45_signature_refstring (uuid)non
verify_pathstringnon
receiptstring (uuid)nonissue 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.

NomTypeObligatoireDescription
codestringnon
result"valid" | "revoked" | "expired" | "not_yet_valid" | "invalid_signature"non
kind"fitness" | "sick_leave"non
answer"fit" | "not_fit" | "unfit_for_work"non
valid_fromDaynonyyyy-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_toDaynonyyyy-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_onDay | nullnon
signature"verified_by_ohn45"non
messagestringnon

PharmacyProfile

NomTypeObligatoireDescription
namestringoui
districtstringoui
latitudenumber | nulloui
longitudenumber | nulloui
phonestring | nulloui

StockReport

NomTypeObligatoireDescription
itemsarray of StockReport.items.itemoui

BatchRow

NomTypeObligatoireDescription
manufacturerstringoui
product_codestringoui
product_namestringoui
batch_numberstringoui
expiry_dateDayouiyyyy-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_reasonstring | nullnonrequired (non-empty) when status is recalled
serialsarray of stringnon
supplier_org_idstring | null (uuid)nonthe distributor organisation that supplied the batch; only it sees the batch and its recall on the distributor routes (1.1.0)

RecallAcknowledgement

NomTypeObligatoireDescription
notestringnon

BatchImport

NomTypeObligatoireDescription
sourcestringoui
rowsarray of anyouieach 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

NomTypeObligatoireDescription
reasonstringoui

Scan

NomTypeObligatoireDescription
product_codestringoui
batch_numberstringoui
serialstring | nullnon
notestring | nullnon

ScanResult

NomTypeObligatoireDescription
idstring (uuid)non
result"genuine" | "unknown" | "recalled" | "duplicate_scan" | "expired"non
messagestringnon
product_codestringnon
batch_numberstringnon
serialstring | nullnon
product_namestring | nullnon
manufacturerstring | nullnon
expiry_datestring | nullnon
recall_reasonstring | nullnon
previous_scans_hereintegernongenuine and expired only
regulator_report_idstring | null (uuid)non
scanned_atstring (date-time)non
receiptstring (uuid)non

ReportTransition

closing needs an outcome and a resolution (422 otherwise); open -> investigating | closed, investigating -> closed, closed is final (409 invalid_transition)

NomTypeObligatoireDescription
to_state"investigating" | "closed"oui
expected_versionintegeroui
outcome"substantiated" | "unsubstantiated"non
resolutionstringnon

Scheme

NomTypeObligatoireDescription
namestringoui
contribution_minorintegerouiwhole minor units; the scheme's own configuration, never computed here
currencystringoui
period_monthsintegeroui
waiting_daysintegeroui

Enrol

NomTypeObligatoireDescription
scheme_idstring (uuid)oui
patient_idstring (uuid)oui
household_refstring | nullnon
enrolled_onDayouiyyyy-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

NomTypeObligatoireDescription
providerstringouisandbox, mtn_momo or orange_money; any other value is 422 unknown_provider
purpose"mutuelle_contribution" | "service_fee" | "medicine_purchase"oui
amount_minorintegerouiwhole minor units; a contribution must equal the scheme's contribution_minor and currency exactly (422 amount_mismatch)
currencystringoui
payer_msisdnstringouistored only as the last four digits and a keyed hash; never returned
member_idstring | null (uuid)nonrequired for mutuelle_contribution
referencestringoui

SandboxCallback

NomTypeObligatoireDescription
expected_versionintegeroui

Eligibility

NomTypeObligatoireDescription
patient_idstring (uuid)non
onDaynonyyyy-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.
eligiblebooleannon
membershipsarray of Eligibility.memberships.itemnon
reasonsarray of "no_membership"nonpresent only when there is no membership

StockReport.items.item défini sur place

NomTypeObligatoireDescription
code_systemstringoui
codestringoui
quantityintegeroui
reorder_levelintegernon
unitstringoui

Eligibility.memberships.item défini sur place

NomTypeObligatoireDescription
member_idstringnon
schemestringnon
scheme_org_idstringnon
enrolled_onDaynonyyyy-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_endsDaynonyyyy-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_untilstring | nullnon
eligiblebooleannon
reasonsarray of "membership_suspended" | "membership_ended" | "waiting_period" | "no_paid_contribution"non