OHN-03 Master Patient Index (MPI)
- Version
- 1.0.0
- OpenAPI
- 3.1.0
- Source in the repository
modules/OHN-03/api/openapi.yaml- Servers
https://opeshealthnetwork.com/api/ohn/v1- Authentication
gatewayToken: http bearer (JWT)
Contracts are written in English.
Written from the observed behaviour of the TypeScript reference (backend/modules/ohn-03, 2026-11-17). Every route requires a token scoped to ONE jurisdiction (UUID claim); the wildcard is refused (403 forbidden). A different x-ohn-purpose header than the token purpose is refused (403 purpose_mismatch). A record of another jurisdiction is reported as not found.
Operations
- mpi (5)
- governance (12)
mpi
POST/mpi/match
Operation ID: matchPatient
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:PatientIdentityCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Identity stored and candidates evaluated | application/json: MatchResult |
403 | application/problem+json with the legacy error code | application/problem+json: Problem |
422 | application/problem+json with the legacy error code | application/problem+json: Problem |
GET/mpi/candidates
Operation ID: listCandidates
Authentication: gatewayToken
Responses
| Code | Description | Media type |
|---|---|---|
200 | Latest 50 pairs of the jurisdiction | application/json: CandidateList |
POST/mpi/cases/{id}/decisions
Operation ID: decideCase
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:MatchDecisionCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Decision recorded | application/json: MatchDecision |
404 | application/problem+json with the legacy error code | application/problem+json: Problem |
422 | application/problem+json with the legacy error code | application/problem+json: Problem |
GET/mpi/patients
Operation ID: searchPatients
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
family_name | query | string | no | |
given_name | query | string | no | |
birth_date | query | string | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | At most 25 identities | application/json: PatientList |
422 | application/problem+json with the legacy error code | application/problem+json: Problem |
GET/mpi/patients/{id}
Operation ID: getPatient
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Identity | application/json: PatientIdentity |
404 | application/problem+json with the legacy error code | application/problem+json: Problem |
governance
GET/mpi/candidates/{id}
Operation ID: getCandidate
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Pair with decision history | application/json: CandidateDetail |
404 | application/problem+json with the legacy error code | application/problem+json: Problem |
GET/mpi/rule-sets
Operation ID: listRuleSets
Authentication: gatewayToken
Responses
| Code | Description | Media type |
|---|---|---|
200 | Rule sets and the active rule | application/json: RuleSetList |
POST/mpi/rule-sets
Operation ID: submitRuleSet
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:RuleSetDraft
Responses
GET/mpi/rule-sets/{id}
POST/mpi/rule-sets/{id}/approve
A different person than the submitter must approve (403 second_approver_required). The previous active rule becomes superseded.
Operation ID: approveRuleSet
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:ReasonCommand
Responses
POST/mpi/rule-sets/{id}/reject
Operation ID: rejectRuleSet
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:ReasonCommand
Responses
POST/mpi/rule-sets/{id}/retire
Operation ID: retireRuleSet
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:ReasonCommand
Responses
GET/mpi/investigations
Operation ID: listInvestigations
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
status | query | "open" | "closed" | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Up to 200 newest first | application/json: InvestigationList |
POST/mpi/investigations
Operation ID: openInvestigation
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:InvestigationCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Opened | application/json: Investigation |
404 | application/problem+json with the legacy error code | application/problem+json: Problem |
422 | application/problem+json with the legacy error code | application/problem+json: Problem |
GET/mpi/investigations/{id}
Operation ID: getInvestigation
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Investigation | application/json: Investigation |
404 | application/problem+json with the legacy error code | application/problem+json: Problem |
POST/mpi/investigations/{id}/close
Operation ID: closeInvestigation
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:CloseCommand
Responses
| Code | Description | Media type |
|---|---|---|
200 | Closed | application/json: Investigation |
404 | application/problem+json with the legacy error code | application/problem+json: Problem |
409 | application/problem+json with the legacy error code | application/problem+json: Problem |
GET/mpi/reports/{reportId}
OHN-03-R001..R003. format=csv downloads and records an export event.
Operation ID: runMpiReport
Authentication: gatewayToken
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
reportId | path | string | yes | |
from | query | string | no | |
to | query | string | no | |
format | query | string | no |
Responses
Schemas
Problem
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes | |
message | string | no | |
id | string | no | |
details | object | no | |
trace_id | string | no |
ReasonCommand
| Name | Type | Required | Description |
|---|---|---|---|
reason | string | yes |
PatientIdentityCommand
| Name | Type | Required | Description |
|---|---|---|---|
jurisdiction_id | string (uuid) | yes | |
given_name | string | no | |
family_name | string | no | |
birth_date | string (date) | no | |
sex_at_birth | "male" | "female" | "unknown" | "other" | no | |
local_identifier | string | no | |
source_facility | string (uuid) | yes | |
purpose | string | yes |
PatientIdentity
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | no | |
jurisdiction_id | string (uuid) | no | |
given_name | string | null | no | |
family_name | string | null | no | |
birth_date | string | null | no | |
sex_at_birth | string | null | no | |
local_identifier | string | null | no | |
source_facility | string (uuid) | no | |
purpose | string | no | |
match_status | "unresolved" | "review_required" | "resolved" | no | |
version | integer | no | |
created_at | string (date-time) | no | |
updated_at | string (date-time) | no |
PatientList
| Name | Type | Required | Description |
|---|---|---|---|
items | array of PatientIdentity | no |
MatchCandidate
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | no | |
left_patient_id | string (uuid) | no | |
right_patient_id | string (uuid) | no | |
score | number (double) | no | |
rule_set_id | string (uuid) | no | |
status | string | no | |
reviewer_id | string | null | no | |
created_at | string (date-time) | no | |
updated_at | string (date-time) | no |
CandidateList
| Name | Type | Required | Description |
|---|---|---|---|
items | array of MatchCandidate | no | |
total | integer | no |
MatchResult
| Name | Type | Required | Description |
|---|---|---|---|
patient | PatientIdentity | no | |
candidates | array of MatchCandidate | no |
DecisionEntry
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | no | |
decision | string | no | |
match_explanation | string | no | |
reason | string | no | |
reviewer_id | string | no | |
created_at | string (date-time) | no |
CandidateDetail
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | no | |
left_patient_id | string (uuid) | no | |
right_patient_id | string (uuid) | no | |
score | number (double) | no | |
rule_set_id | string (uuid) | no | |
status | string | no | |
reviewer_id | string | null | no | |
created_at | string (date-time) | no | |
updated_at | string (date-time) | no | |
rule_version | string | no | |
decisions | array of DecisionEntry | no |
MatchDecisionCommand
| Name | Type | Required | Description |
|---|---|---|---|
candidate_pair_id | string (uuid) | no | |
decision | "link" | "non_link" | "needs_review" | yes | |
evidence_refs | array of string (uuid) | no | |
match_explanation | string | yes | |
reason | string | yes | |
reviewer_id | string (uuid) | yes |
MatchDecision
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | no | |
candidate_pair_id | string (uuid) | no | |
decision | string | no | |
match_explanation | string | no | |
reason | string | no | |
reviewer_id | string | no | |
created_at | string (date-time) | no |
RuleSetDraft
| Name | Type | Required | Description |
|---|---|---|---|
rule_version | string | yes | |
feature_weights | string | no | |
auto_link_threshold | number (double) | yes | |
manual_review_threshold | number (double) | yes | |
effective_from | string (date) | yes | |
reason | string | yes |
RuleSet
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | no | |
rule_version | string | no | |
feature_weights | string | no | |
auto_link_threshold | number (double) | no | |
manual_review_threshold | number (double) | no | |
effective_from | string | no | |
status | "submitted" | "active" | "rejected" | "retired" | "superseded" | no | |
submitted_by | string | null | no | |
approved_by | string | null | no | |
reason | string | null | no | |
decided_at | string | null | no | |
created_at | string (date-time) | no | |
updated_at | string (date-time) | no |
ActiveRule
| Name | Type | Required | Description |
|---|---|---|---|
id | string | null | no | |
rule_version | string | no | |
auto_link_threshold | number (double) | no | |
manual_review_threshold | number (double) | no |
RuleSetList
| Name | Type | Required | Description |
|---|---|---|---|
items | array of RuleSet | no | |
active | ActiveRule | no |
InvestigationCommand
| Name | Type | Required | Description |
|---|---|---|---|
patient_ref | string (uuid) | yes | |
suspected_duplicate_ref | string (uuid) | yes | |
investigation_reason | string | yes | |
source_evidence | string (uuid) | no |
CloseCommand
| Name | Type | Required | Description |
|---|---|---|---|
outcome | "duplicate_confirmed" | "not_duplicate" | "inconclusive" | yes | |
reason | string | yes |
Investigation
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | no | |
patient_ref | string (uuid) | no | |
suspected_duplicate_ref | string (uuid) | no | |
investigation_reason | string | no | |
source_evidence | string | null | no | |
status | "open" | "closed" | no | |
outcome | string | null | no | |
opened_by | string | null | no | |
closed_by | string | null | no | |
created_at | string (date-time) | no | |
updated_at | string (date-time) | no |
InvestigationList
| Name | Type | Required | Description |
|---|---|---|---|
items | array of Investigation | no |