← Tous les contrats
OHN-52 Paper Health Record Digitisation
- Version
- 1.0.0
- OpenAPI
- 3.1.0
- Source dans le dépôt
modules/OHN-52/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.
Digitise patient-held paper health booklets. Every mutation needs `Idempotency-Key` (any non-empty value up to 255 characters); every request a Bearer token
(role, jurisdiction, organization_id, purpose; subject, jurisdiction and organization are UUIDs, otherwise 401). Default deny: an unknown route is 404 after authentication, a role that is not listed for
the route is 403 `denied_by_policy` (audited), and a purpose that is not the role's own is 403. Digitised items are never verified. Page images are kept as originals in OHN-13 (required: no original, no upload);
recognition proposes items only when an extraction engine is configured, and every proposal needs a person's decision. Without an engine every page fails closed (`failure_reason: not_configured`) and the reviewer
transcribes by hand (`POST /jobs/{id}/items`). 503 `not_configured` (with `dependency` and `setting`) means a required dependency or key is not configured and nothing was stored.
Opérations
jobs
GET/api/ohn/v1/digitisation/jobsList jobs in scope
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
state | query | string | non | Any state name up to 32 characters; an unknown name lists nothing. |
patient_id | query | string (uuid) | non | |
Réponses
| Code | Description | Type de média |
|---|
200 | OK | |
POST/api/ohn/v1/digitisation/jobsUpload booklet pages with consent (F001, W001)
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 | Job created | |
400 | Missing idempotency key or malformed body | — |
403 | patient_self_only, consent_denied (OHN-15), or role not permitted | — |
409 | Idempotency key reused with another payload | — |
413 | Body larger than OHN52_MAX_UPLOAD_BODY | — |
422 | domain_validation_failed, consent_method_invalid, type_mismatch, page_too_large, unsupported_type, image_too_many_pixels, pdf_active_content, image_corrupt | — |
429 | Rate limited | — |
503 | OHN-13 or OHN-15 unavailable or unconfigured; nothing stored | — |
GET/api/ohn/v1/digitisation/jobs/{id}Job detail (patients see items only after completion, never OCR text)
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 in scope | — |
GET/api/ohn/v1/digitisation/jobs/{id}/pages/{pageId}/imagePage image (metadata stripped); viewing is audited
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
pageId | path | string (uuid) | oui | |
Réponses
| Code | Description | Type de média |
|---|
200 | Image | image/png
image/jpeg
application/pdf
|
404 | Not in scope | — |
review
POST/api/ohn/v1/digitisation/jobs/{id}/itemsAdd an item the engine missed (F003)
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 |
|---|
201 | Added | — |
409 | Job not reviewable | — |
422 | domain_validation_failed; details maps each top-level field to the first failing check as a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value, invalid_literal, invalid_union, custom), unknown keys under _ as unrecognized_keys; the reference returned zod flatten() (formErrors, fieldErrors) instead | — |
POST/api/ohn/v1/digitisation/jobs/{id}/items/{itemId}/decisionAccept, edit or reject an item (F002, W003)
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
itemId | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
200 | Decided | — |
409 | Stale version or job not reviewable | — |
422 | domain_validation_failed; details maps each top-level field to the first failing check as a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value, invalid_literal, invalid_union, custom), unknown keys under _ as unrecognized_keys; the reference returned zod flatten() (formErrors, fieldErrors) instead | — |
POST/api/ohn/v1/digitisation/jobs/{id}/sign-offSign off and write accepted items as unverified (F004, W004)
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 | Completed; `writes` counts per write_status (written, held_no_code, refused, pending_retry, kept_in_ohn52) | — |
403 | clinician_signoff_required | — |
409 | Stale version or job not reviewable | — |
422 | items_undecided | — |
POST/api/ohn/v1/digitisation/jobs/{id}/rejectReject the job (F005)
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 | Rejected | — |
409 | Invalid transition or stale | — |
POST/api/ohn/v1/digitisation/jobs/{id}/retry-writesRetry pending OHN-10 writes
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 |
|---|
200 | Retried | — |
record
GET/api/ohn/v1/digitisation/patients/{patientId}/digitised-itemsAccepted items of signed-off jobs, each with paper provenance
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
patientId | path | string (uuid) | oui | |
Réponses
| Code | Description | Type de média |
|---|
200 | OK | |
reports
GET/api/ohn/v1/digitisation/reportsReport catalogue
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | OK | — |
GET/api/ohn/v1/digitisation/reports/{reportId}Run a report
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
reportId | path | "OHN-52-R001" | "OHN-52-R002" | "OHN-52-R003" | oui | |
days | query | integer | non | |
Réponses
| Code | Description | Type de média |
|---|
200 | OK | — |
GET/api/ohn/v1/digitisation/reports/{reportId}/exportSigned CSV export
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
reportId | path | "OHN-52-R001" | "OHN-52-R002" | "OHN-52-R003" | oui | |
days | query | integer | non | |
Réponses
| Code | Description | Type de média |
|---|
200 | CSV | text/csv
|
503 | OHN52_EXPORT_SIGNING_KEY not configured | — |
ops
GET/health/ohn-52Health, recognition engine and dependency modes
Réponses
| Code | Description | Type de média |
|---|
200 | OK | |
503 | Database unavailable | — |
GET/api/ohn/v1/digitisation/contextCaller context and engine status
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | OK | — |
POST/api/ohn/v1/digitisation/jobs/{id}/reprocessRecognise again before any decision (admin)
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 |
|---|
200 | Queued | — |
409 | Review started | — |
GET/api/ohn/v1/digitisation/auditLatest audit receipts (digitisation_admin)
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | OK | — |
POST/api/ohn/v1/digitisation/admin/outbox/relayRelay pending events to OHN-24
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | |
Réponses
| Code | Description | Type de média |
|---|
200 | Relay result | — |
Schémas
JobState
"uploaded" | "processing" | "ready_for_review" | "partially_reviewed" | "completed" | "rejected"
ItemType
"date" | "vaccination" | "diagnosis" | "medication" | "allergy" | "blood_group" | "genotype" | "vital_sign" | "visit"
Consent
| Nom | Type | Obligatoire | Description |
|---|
method | "patient_self_upload" | "verbal_witnessed" | "written_signed" | oui | |
statement_version | string | oui | |
patient_agrees | true | oui | |
ai_processing_allowed | boolean | non | |
witness_name | string | non | Required for verbal_witnessed |
CreateJob
| Nom | Type | Obligatoire | Description |
|---|
patient_id | string (uuid) | non | Required for clinic capture; must be absent or own id for patients |
review_org_id | string (uuid) | non | Required for patient uploads: the care site (OHN-05 facility id) whose queue reviews the pages; ignored for staff, whose job belongs to their own organization |
title | string | non | |
consent | Consent | oui | |
pages | array of CreateJob.pages.item | oui | |
Bbox
Fractions (0..1) of page width/height
| Nom | Type | Obligatoire | Description |
|---|
x | number | non | |
y | number | non | |
w | number | non | |
h | number | non | |
Item
| Nom | Type | Obligatoire | Description |
|---|
id | string (uuid) | non | |
page_id | string (uuid) | non | |
item_type | ItemType | non | |
origin | "engine" | "reviewer_added" | non | |
source_text | string | non | |
proposed | object | non | |
final | object | null | non | |
confidence | number | non | |
low_confidence | boolean | non | |
bbox | Bbox | non | Fractions (0..1) of page width/height |
state | "proposed" | "accepted" | "edited" | "rejected" | non | |
version | integer | non | |
verification_status | "unverified_patient_held" | non | |
lab_verified | false | non | |
target | "ohn10_problem" | "ohn10_medication" | "ohn10_allergy" | "ohn52_record" | non | |
target_gap | string | null | non | |
write_status | "not_applicable" | "written" | "held_no_code" | "refused" | "pending_retry" | "kept_in_ohn52" | non | |
provenance | Provenance | non | |
Provenance
| Nom | Type | Obligatoire | Description |
|---|
source | "digitised_from_paper" | non | |
label_en | string | non | |
label_fr | string | non | |
verification_status | "unverified_patient_held" | non | |
reviewer_id | string (uuid) | non | |
reviewed_at | string (date-time) | non | |
page_image_ref | Provenance.page_image_ref | non | |
lab_verified | false | non | |
transfusion_verified | false | non | blood_group only |
caveat_en | string | non | blood_group: Reported in paper booklet, not verified for transfusion. |
RecordItem
| Nom | Type | Obligatoire | Description |
|---|
id | string | non | |
item_type | ItemType | non | |
value | object | non | |
write_status | string | non | |
lab_verified | false | non | |
provenance | Provenance | non | |
JobSummary
| Nom | Type | Obligatoire | Description |
|---|
id | string | non | |
state | JobState | non | |
source | "patient_upload" | "clinic_capture" | non | |
page_count | integer | non | |
item_count | integer | non | |
open_items | integer | non | |
low_confidence_open | integer | non | |
engines | array of string | non | |
images_left_platform | boolean | non | |
version | integer | non | |
Job
| Nom | Type | Obligatoire | Description |
|---|
id | string | non | |
state | JobState | non | |
source | "patient_upload" | "clinic_capture" | non | |
page_count | integer | non | |
item_count | integer | non | |
open_items | integer | non | |
low_confidence_open | integer | non | |
engines | array of string | non | |
images_left_platform | boolean | non | |
version | integer | non | |
allowed_actions | array of "decide_item" | "add_item" | "sign_off" | "reject" | "reprocess" | "retry_writes" | non | |
engine_requested | "tesseract-local" | "anthropic-vision" | non | |
ai_authorisation_ref | string | null | non | |
pages | array of object | non | |
items | array of Item | non | |
history | array of object | non | |
engine_runs | array of Job.engine_runs.item | non | |
receipt | object | non | |
AddItem
| Nom | Type | Obligatoire | Description |
|---|
page_id | string (uuid) | oui | |
item_type | ItemType | oui | |
source_text | string | oui | |
value | object | oui | Values are strings of at most 500 characters, numbers, booleans or null; any key containing "verif" is dropped |
Decision
| Nom | Type | Obligatoire | Description |
|---|
expected_version | integer | oui | |
decision | "accept" | "edit" | "reject" | oui | |
value | object | non | Required for edit |
reason | string | non | Required for reject (at least 3 characters) |
SignOff
| Nom | Type | Obligatoire | Description |
|---|
expected_version | integer | oui | |
attestation | true | oui | |
note | string | non | |
Health
| Nom | Type | Obligatoire | Description |
|---|
status | string | non | |
module | "OHN-52" | non | |
engine | Health.engine | non | |
dependencies | object | non | |
writes_enabled | boolean | non | False when the operator kill switch is on (every write 503 not_configured) |
export_signing_configured | boolean | non | |
auth_configured | boolean | non | |
synthetic_auth | boolean | non | Always false in the Java service |
get-api-ohn-v1-digitisation-jobs.response-200 défini sur place
| Nom | Type | Obligatoire | Description |
|---|
items | array of JobSummary | non | |
post-api-ohn-v1-digitisation-jobs.request.form-data défini sur place
| Nom | Type | Obligatoire | Description |
|---|
patient_id | string (uuid) | non | |
review_org_id | string (uuid) | non | Patient uploads only: the care site that reviews the pages (the Java service reads it; the TypeScript reference ignored this multipart field) |
title | string | non | |
consent | string | oui | JSON-encoded Consent |
pages | array of string (binary) | oui | |
post-api-ohn-v1-digitisation-jobs-id-reject.request défini sur place
| Nom | Type | Obligatoire | Description |
|---|
expected_version | integer | oui | |
reason | string | oui | |
get-api-ohn-v1-digitisation-patients-patientid-digitised-items.response-200 défini sur place
| Nom | Type | Obligatoire | Description |
|---|
verification_status | "unverified_patient_held" | non | |
items | array of RecordItem | non | |
CreateJob.pages.item défini sur place
| Nom | Type | Obligatoire | Description |
|---|
media_type | "image/jpeg" | "image/png" | "application/pdf" | oui | |
content_base64 | string | oui | |
Provenance.page_image_ref défini sur place
| Nom | Type | Obligatoire | Description |
|---|
job_id | string | non | |
page_id | string | non | |
ohn13_document_id | string | non | |
Job.engine_runs.item défini sur place
| Nom | Type | Obligatoire | Description |
|---|
engine | string | non | |
model | string | non | |
left_platform | boolean | non | |
authorisation_ref | string | null | non | |
outcome | string | non | |
duration_ms | integer | non | |
Health.engine défini sur place
| Nom | Type | Obligatoire | Description |
|---|
default | "tesseract-local" | non | |
local_ocr_data | "present" | "missing" | non | |
ai | "disabled" | "enabled" | "refused_incomplete_configuration" | non | |
ai_model | string | null | non | |
worker | "running" | "stopped" | non | |
adapter | "none" | "wired" | non | Java only: none while no OCR adapter is wired (B820); local_ocr_data is then missing |
worker_stats | object | non | |