Skip to content

← 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

CodeDescriptionMedia type
200OK
application/json: object
GET/config/versionsList configuration versions (care_governance_admin)

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK
application/json: object
POST/config/versionsCreate a draft configuration

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201OK
application/json: object
422Error
application/json: Error
POST/config/versions/load-demoLoad the SYNTHETIC demo configuration as a draft (non-production only)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
201OK
application/json: object
404Error
application/json: Error
POST/config/versions/{id}/activateActivate a draft (retires the current one)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200OK
application/json: object
409Error
application/json: Error
422Error
application/json: Error
POST/cds/evaluateEvaluate the active rules for one patient (clinician

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Result
application/json: EvaluateResult
503Error
application/json: Error
GET/cds/alertsFacility alerts

Authentication: bearer

Parameters

NameInTypeRequiredDescription
statequery"open" | "acknowledged" | "dismissed"no
patient_idquerystring (uuid)no

Responses

CodeDescriptionMedia type
200OK
application/json: object
POST/cds/alerts/{id}/decisionAcknowledge or dismiss

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200OK
application/json: object
409Error
application/json: Error
GET/programmes/registryRegistry for this facility (sensitive rows only for the care team)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
programme_codequery"hypertension" | "diabetes" | "hiv" | "tb"no
statequerystringno

Responses

CodeDescriptionMedia type
200OK
application/json: object
GET/programmes/tracingMissed-visit tracing list

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK
application/json: object
GET/programmes/indicatorsOutcome indicators

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK
application/json: object
POST/programmes/enrolmentsEnrol (sensitive programmes need an OHN-15 permit)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201OK
application/json: object
403Error
application/json: Error
GET/programmes/enrolments/{id}Care plan and history

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200OK
application/json: object
404Error
application/json: Error
POST/programmes/enrolments/{id}/visitsRecord a visit (VisitSchema)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
201OK
application/json: object
POST/programmes/enrolments/{id}/adherenceAdherence note (AdherenceSchema)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
201OK
application/json: object
POST/programmes/enrolments/{id}/tracingTracing attempt (TracingSchema)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
201OK
application/json: object
POST/programmes/enrolments/{id}/transitionsChange state (EnrolmentTransitionSchema)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200OK
application/json: object
409Error
application/json: Error
POST/programmes/enrolments/{id}/care-teamAdd a care-team member

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200OK
application/json: object
GET/me/programmesThe patient's own enrolments

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK
application/json: object
POST/family/linksPropose a link with evidence (ProposeLinkSchema)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
201OK
application/json: object
409Error
application/json: Error
POST/family/links/{id}/consentsGrant

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200OK
application/json: object
404Error
application/json: Error
GET/family/historyFamily history (own; a relative's only with their sharing consent)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
patient_idquerystring (uuid)no

Responses

CodeDescriptionMedia type
200OK
application/json: object
404Error
application/json: Error
POST/family/historyAdd an entry coded via OHN-23 (FamilyHistorySchema)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
201OK
application/json: object
422Error
application/json: Error
POST/family/history/{id}/retractMark entered in error (source only)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200OK
application/json: object
403Error
application/json: Error
GET/genetic/consentsLatest carrier-screening consent per partner

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK
application/json: object
POST/genetic/consentsPatient grants or withdraws consent with a named partner (GeneticConsentSchema)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
201OK
application/json: object
GET/genetic/couples/{a}/{b}/riskInheritance explanation for two mutually consenting partners (lab-verified genotypes only)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
apathstring (uuid)yes
bpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Result
application/json: Risk
403consent_required; nothing computed or fetched—
GET/genetic/counsellingCounselling sessions at this facility

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK
application/json: object
POST/genetic/counsellingBook counselling (needs both consents)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
201OK
application/json: object
403Error
application/json: Error
POST/genetic/counselling/{id}/transitionsCompleted (with summary) or cancelled

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200OK
application/json: object
GET/reports/{reportId}OHN-55-R001 or R002

Authentication: bearer

Parameters

NameInTypeRequiredDescription
reportIdpath"OHN-55-R001" | "OHN-55-R002"yes

Responses

CodeDescriptionMedia type
200OK
application/json: object
GET/reports/{reportId}/exportSigned CSV (X-OHN55-Signature)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
reportIdpathstringyes

Responses

CodeDescriptionMedia type
200CSV
text/csv
GET/auditAudit records (care_governance_admin)

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK
application/json: object
POST/admin/outbox/relayRelay pending events to OHN-24

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200OK
application/json: object
GET/health/ohn-55Public liveness with the wiring of every dependency (live, unconfigured, test_fake; OHN-24 is platform_outbox)

Responses

CodeDescriptionMedia type
200ok
503database unavailable

Schemas

Error

NameTypeRequiredDescription
errorstringyes
messagestringno

CodeRef

NameTypeRequiredDescription
systemstringyes
codestringyes

Evaluate

NameTypeRequiredDescription
patient_idstring (uuid)yes
proposed_medicationsarray of CodeRefno
rule_typesarray of "drug_allergy" | "overdue_vaccination" | "abnormal_result_unacknowledged" | "missed_chronic_followup"no
persistbooleanno

EvaluateResult

NameTypeRequiredDescription
completebooleannofalse when any rule could not be evaluated
findingsarray of objectno
rulesarray of EvaluateResult.rules.itemno
sourcesobjectno
configEvaluateResult.configno

Risk

NameTypeRequiredDescription
availablebooleanno
explanationRisk.explanationno

post-config-versions.request defined inline

NameTypeRequiredDescription
documentobjectyes

post-config-versions-id-activate.request defined inline

NameTypeRequiredDescription
approval_refstringyes
expected_versionintegeryes

post-cds-alerts-id-decision.request defined inline

NameTypeRequiredDescription
decision"acknowledge" | "dismiss"yes
reasonstringyes
expected_versionintegeryes

post-programmes-enrolments.request defined inline

NameTypeRequiredDescription
programme_code"hypertension" | "diabetes" | "hiv" | "tb"yes
patient_idstring (uuid)yes
enrolled_onstring (date)yes

get-health-ohn-55.response-200 defined inline

NameTypeRequiredDescription
status"ok"no
module"OHN-55"no
dependenciesobjectno
writes_enabledbooleanno
export_signing_configuredbooleanno
auth_configuredbooleanno
synthetic_authbooleanno
demo_config_loadablebooleanno

get-health-ohn-55.response-503 defined inline

NameTypeRequiredDescription
status"unavailable"no
modulestringno
dependenciesobjectno

EvaluateResult.rules.item defined inline

NameTypeRequiredDescription
rule_idstringno
status"evaluated" | "not_evaluated"no
reasonstringno

EvaluateResult.config defined inline

NameTypeRequiredDescription
versionintegerno
synthetic_demobooleanno

Risk.explanation defined inline

NameTypeRequiredDescription
outcomesarray of Risk.explanation.outcomes.itemno
counselling_requiredtrueno

Risk.explanation.outcomes.item defined inline

NameTypeRequiredDescription
genotypestringno
labelstringno
percentstringno