← All contracts
OHN-55 Care Programmes and Family Health
- Version
- 1.0.1
- OpenAPI
- 3.1.0
- Source in the repository
modules/OHN-55/api/openapi.yaml- Servers
https://opeshealthnetwork.com/api/ohn/v1/care
- Authentication
bearer: http bearer (JWT)
Download the contract (YAML)
Contracts are written in English.
Decision support, chronic programmes, family links, carrier screening support and family history: 35 operations under /api/ohn/v1/care plus GET /health/ohn-55.
Request bodies and query strings are strict (unknown fields are rejected): 422 domain_validation_failed, message "One or more fields are invalid.", details = {formErrors: [...], fieldErrors: {field: [messages]}} with zod's English messages;
an issue inside a nested object or array is listed under its top-level field (the care configuration document: fieldErrors.document). Unreadable JSON is 400 malformed_request.
Every write needs Idempotency-Key (1-255 characters, not blank): 400 missing_idempotency_key; the same key and body replays the first answer (Idempotent-Replay: true), another body is 409 idempotency_conflict, a request still running is 409 request_in_progress.
Tokens are issued by the platform gateway (ES256, issuer ohn-platform-gateway, audience ohn-55) with sub, role, jurisdiction, organization_id and purpose; a role that does not fit the purpose is 403 denied_by_policy, an unknown route 404 not_found, a role not listed for a route 403 denied_by_policy (audited as denied).
Roles and purposes: clinician/care_programmes, care_governance_admin/care_governance, patient/patient_access, cds_service/decision_support. The TypeScript-only synthetic sign-in (POST /synthetic-token) is not part of this contract.
Errors are {error, message, ...extra}: not_configured (503, setting names the missing configuration), dependency_unavailable (503, dependency names the upstream, nothing was stored), consent_required (403, consents), consent_denied (403), version_conflict and invalid_transition and duplicate (409), rate_limited (429).
Events are CloudEvents in the platform outbox (care.config.activated, care.alert.raised, care.alert.decided, care.enrolment.created, care.enrolment.changed, care.family_link.changed, care.counselling.changed, care.family_history.changed); see events/events.schema.json.
Operations
Other operations
GET/configActive care configuration
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
GET/config/versionsList configuration versions (care_governance_admin)
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
POST/config/versionsCreate a draft configuration
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | OK | application/json: object
|
422 | Error | |
POST/config/versions/load-demoLoad the SYNTHETIC demo configuration as a draft (non-production only)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
201 | OK | application/json: object
|
404 | Error | |
POST/config/versions/{id}/activateActivate a draft (retires the current one)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
409 | Error | |
422 | Error | |
POST/cds/evaluateEvaluate the active rules for one patient (clinician
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | Result | |
503 | Error | |
GET/cds/alertsFacility alerts
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
state | query | "open" | "acknowledged" | "dismissed" | no | |
patient_id | query | string (uuid) | no | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
POST/cds/alerts/{id}/decisionAcknowledge or dismiss
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
409 | Error | |
GET/programmes/registryRegistry for this facility (sensitive rows only for the care team)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
programme_code | query | "hypertension" | "diabetes" | "hiv" | "tb" | no | |
state | query | string | no | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
GET/programmes/tracingMissed-visit tracing list
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
GET/programmes/indicatorsOutcome indicators
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
POST/programmes/enrolmentsEnrol (sensitive programmes need an OHN-15 permit)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Request body (required)
Responses
| Code | Description | Media type |
|---|
201 | OK | application/json: object
|
403 | Error | |
GET/programmes/enrolments/{id}Care plan and history
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
404 | Error | |
POST/programmes/enrolments/{id}/visitsRecord a visit (VisitSchema)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
201 | OK | application/json: object
|
POST/programmes/enrolments/{id}/adherenceAdherence note (AdherenceSchema)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
201 | OK | application/json: object
|
POST/programmes/enrolments/{id}/tracingTracing attempt (TracingSchema)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
201 | OK | application/json: object
|
POST/programmes/enrolments/{id}/transitionsChange state (EnrolmentTransitionSchema)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
409 | Error | |
POST/programmes/enrolments/{id}/care-teamAdd a care-team member
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
GET/me/programmesThe patient's own enrolments
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
GET/family/linksLinks of a patient (patients see their own)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
patient_id | query | string (uuid) | no | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
POST/family/linksPropose a link with evidence (ProposeLinkSchema)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
201 | OK | application/json: object
|
409 | Error | |
POST/family/links/{id}/consentsGrant
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
404 | Error | |
GET/family/historyFamily history (own; a relative's only with their sharing consent)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
patient_id | query | string (uuid) | no | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
404 | Error | |
POST/family/historyAdd an entry coded via OHN-23 (FamilyHistorySchema)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
201 | OK | application/json: object
|
422 | Error | |
POST/family/history/{id}/retractMark entered in error (source only)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
403 | Error | |
GET/genetic/consentsLatest carrier-screening consent per partner
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
POST/genetic/consentsPatient grants or withdraws consent with a named partner (GeneticConsentSchema)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
201 | OK | application/json: object
|
GET/genetic/couples/{a}/{b}/riskInheritance explanation for two mutually consenting partners (lab-verified genotypes only)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
a | path | string (uuid) | yes | |
b | path | string (uuid) | yes | |
Responses
| Code | Description | Media type |
|---|
200 | Result | |
403 | consent_required; nothing computed or fetched | — |
GET/genetic/counsellingCounselling sessions at this facility
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
POST/genetic/counsellingBook counselling (needs both consents)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
201 | OK | application/json: object
|
403 | Error | |
POST/genetic/counselling/{id}/transitionsCompleted (with summary) or cancelled
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
GET/reports/{reportId}OHN-55-R001 or R002
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
reportId | path | "OHN-55-R001" | "OHN-55-R002" | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
GET/reports/{reportId}/exportSigned CSV (X-OHN55-Signature)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
reportId | path | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | CSV | text/csv
|
GET/auditAudit records (care_governance_admin)
Authentication: bearer
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
POST/admin/outbox/relayRelay pending events to OHN-24
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|
Idempotency-Key | header | string | yes | |
Responses
| Code | Description | Media type |
|---|
200 | OK | application/json: object
|
GET/health/ohn-55Public liveness with the wiring of every dependency (live, unconfigured, test_fake; OHN-24 is platform_outbox)
Responses
| Code | Description | Media type |
|---|
200 | ok | |
503 | database unavailable | |
Schemas
Error
| Name | Type | Required | Description |
|---|
error | string | yes | |
message | string | no | |
CodeRef
| Name | Type | Required | Description |
|---|
system | string | yes | |
code | string | yes | |
Evaluate
| Name | Type | Required | Description |
|---|
patient_id | string (uuid) | yes | |
proposed_medications | array of CodeRef | no | |
rule_types | array of "drug_allergy" | "overdue_vaccination" | "abnormal_result_unacknowledged" | "missed_chronic_followup" | no | |
persist | boolean | no | |
post-config-versions.request defined inline
| Name | Type | Required | Description |
|---|
document | object | yes | |
post-config-versions-id-activate.request defined inline
| Name | Type | Required | Description |
|---|
approval_ref | string | yes | |
expected_version | integer | yes | |
post-cds-alerts-id-decision.request defined inline
| Name | Type | Required | Description |
|---|
decision | "acknowledge" | "dismiss" | yes | |
reason | string | yes | |
expected_version | integer | yes | |
post-programmes-enrolments.request defined inline
| Name | Type | Required | Description |
|---|
programme_code | "hypertension" | "diabetes" | "hiv" | "tb" | yes | |
patient_id | string (uuid) | yes | |
enrolled_on | string (date) | yes | |
get-health-ohn-55.response-200 defined inline
| Name | Type | Required | Description |
|---|
status | "ok" | no | |
module | "OHN-55" | no | |
dependencies | object | no | |
writes_enabled | boolean | no | |
export_signing_configured | boolean | no | |
auth_configured | boolean | no | |
synthetic_auth | boolean | no | |
demo_config_loadable | boolean | no | |
get-health-ohn-55.response-503 defined inline
| Name | Type | Required | Description |
|---|
status | "unavailable" | no | |
module | string | no | |
dependencies | object | no | |
EvaluateResult.rules.item defined inline
| Name | Type | Required | Description |
|---|
rule_id | string | no | |
status | "evaluated" | "not_evaluated" | no | |
reason | string | no | |
EvaluateResult.config defined inline
| Name | Type | Required | Description |
|---|
version | integer | no | |
synthetic_demo | boolean | no | |
Risk.explanation defined inline
Risk.explanation.outcomes.item defined inline
| Name | Type | Required | Description |
|---|
genotype | string | no | |
label | string | no | |
percent | string | no | |