Skip to content

← All contracts

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)

Download the contract (YAML)

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

POST/mpi/match

Operation ID: matchPatient

Authentication: gatewayToken

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Identity stored and candidates evaluated
application/json: MatchResult
403application/problem+json with the legacy error code
application/problem+json: Problem
422application/problem+json with the legacy error code
application/problem+json: Problem
GET/mpi/candidates

Operation ID: listCandidates

Authentication: gatewayToken

Responses

CodeDescriptionMedia type
200Latest 50 pairs of the jurisdiction
application/json: CandidateList
POST/mpi/cases/{id}/decisions

Operation ID: decideCase

Authentication: gatewayToken

Parameters

NameInTypeRequiredDescription
idpathstringyes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Decision recorded
application/json: MatchDecision
404application/problem+json with the legacy error code
application/problem+json: Problem
422application/problem+json with the legacy error code
application/problem+json: Problem
GET/mpi/patients

Operation ID: searchPatients

Authentication: gatewayToken

Parameters

NameInTypeRequiredDescription
family_namequerystringno
given_namequerystringno
birth_datequerystringno

Responses

CodeDescriptionMedia type
200At most 25 identities
application/json: PatientList
422application/problem+json with the legacy error code
application/problem+json: Problem
GET/mpi/patients/{id}

Operation ID: getPatient

Authentication: gatewayToken

Parameters

NameInTypeRequiredDescription
idpathstringyes

Responses

CodeDescriptionMedia type
200Identity
application/json: PatientIdentity
404application/problem+json with the legacy error code
application/problem+json: Problem

governance

GET/mpi/candidates/{id}

Operation ID: getCandidate

Authentication: gatewayToken

Parameters

NameInTypeRequiredDescription
idpathstringyes

Responses

CodeDescriptionMedia type
200Pair with decision history
application/json: CandidateDetail
404application/problem+json with the legacy error code
application/problem+json: Problem
GET/mpi/rule-sets

Operation ID: listRuleSets

Authentication: gatewayToken

Responses

CodeDescriptionMedia type
200Rule sets and the active rule
application/json: RuleSetList
POST/mpi/rule-sets

Operation ID: submitRuleSet

Authentication: gatewayToken

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Submitted
application/json: RuleSet
422application/problem+json with the legacy error code
application/problem+json: Problem
GET/mpi/rule-sets/{id}

Operation ID: getRuleSet

Authentication: gatewayToken

Parameters

NameInTypeRequiredDescription
idpathstringyes

Responses

CodeDescriptionMedia type
200Rule set
application/json: RuleSet
404application/problem+json with the legacy error code
application/problem+json: Problem
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

NameInTypeRequiredDescription
idpathstringyes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Active
application/json: RuleSet
403application/problem+json with the legacy error code
application/problem+json: Problem
409application/problem+json with the legacy error code
application/problem+json: Problem
POST/mpi/rule-sets/{id}/reject

Operation ID: rejectRuleSet

Authentication: gatewayToken

Parameters

NameInTypeRequiredDescription
idpathstringyes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Rejected
application/json: RuleSet
409application/problem+json with the legacy error code
application/problem+json: Problem
POST/mpi/rule-sets/{id}/retire

Operation ID: retireRuleSet

Authentication: gatewayToken

Parameters

NameInTypeRequiredDescription
idpathstringyes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Retired
application/json: RuleSet
409application/problem+json with the legacy error code
application/problem+json: Problem
GET/mpi/investigations

Operation ID: listInvestigations

Authentication: gatewayToken

Parameters

NameInTypeRequiredDescription
statusquery"open" | "closed"no

Responses

CodeDescriptionMedia type
200Up to 200 newest first
application/json: InvestigationList
POST/mpi/investigations

Operation ID: openInvestigation

Authentication: gatewayToken

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Opened
application/json: Investigation
404application/problem+json with the legacy error code
application/problem+json: Problem
422application/problem+json with the legacy error code
application/problem+json: Problem
GET/mpi/investigations/{id}

Operation ID: getInvestigation

Authentication: gatewayToken

Parameters

NameInTypeRequiredDescription
idpathstringyes

Responses

CodeDescriptionMedia type
200Investigation
application/json: Investigation
404application/problem+json with the legacy error code
application/problem+json: Problem
POST/mpi/investigations/{id}/close

Operation ID: closeInvestigation

Authentication: gatewayToken

Parameters

NameInTypeRequiredDescription
idpathstringyes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Closed
application/json: Investigation
404application/problem+json with the legacy error code
application/problem+json: Problem
409application/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

NameInTypeRequiredDescription
reportIdpathstringyes
fromquerystringno
toquerystringno
formatquerystringno

Responses

CodeDescriptionMedia type
200Report json or csv
application/json: object
text/csv: string
404application/problem+json with the legacy error code
application/problem+json: Problem
422application/problem+json with the legacy error code
application/problem+json: Problem

Schemas

Problem

NameTypeRequiredDescription
errorstringyes
messagestringno
idstringno
detailsobjectno
trace_idstringno

ReasonCommand

NameTypeRequiredDescription
reasonstringyes

PatientIdentityCommand

NameTypeRequiredDescription
jurisdiction_idstring (uuid)yes
given_namestringno
family_namestringno
birth_datestring (date)no
sex_at_birth"male" | "female" | "unknown" | "other"no
local_identifierstringno
source_facilitystring (uuid)yes
purposestringyes

PatientIdentity

NameTypeRequiredDescription
idstring (uuid)no
jurisdiction_idstring (uuid)no
given_namestring | nullno
family_namestring | nullno
birth_datestring | nullno
sex_at_birthstring | nullno
local_identifierstring | nullno
source_facilitystring (uuid)no
purposestringno
match_status"unresolved" | "review_required" | "resolved"no
versionintegerno
created_atstring (date-time)no
updated_atstring (date-time)no

PatientList

NameTypeRequiredDescription
itemsarray of PatientIdentityno

MatchCandidate

NameTypeRequiredDescription
idstring (uuid)no
left_patient_idstring (uuid)no
right_patient_idstring (uuid)no
scorenumber (double)no
rule_set_idstring (uuid)no
statusstringno
reviewer_idstring | nullno
created_atstring (date-time)no
updated_atstring (date-time)no

CandidateList

NameTypeRequiredDescription
itemsarray of MatchCandidateno
totalintegerno

MatchResult

NameTypeRequiredDescription
patientPatientIdentityno
candidatesarray of MatchCandidateno

DecisionEntry

NameTypeRequiredDescription
idstring (uuid)no
decisionstringno
match_explanationstringno
reasonstringno
reviewer_idstringno
created_atstring (date-time)no

CandidateDetail

NameTypeRequiredDescription
idstring (uuid)no
left_patient_idstring (uuid)no
right_patient_idstring (uuid)no
scorenumber (double)no
rule_set_idstring (uuid)no
statusstringno
reviewer_idstring | nullno
created_atstring (date-time)no
updated_atstring (date-time)no
rule_versionstringno
decisionsarray of DecisionEntryno

MatchDecisionCommand

NameTypeRequiredDescription
candidate_pair_idstring (uuid)no
decision"link" | "non_link" | "needs_review"yes
evidence_refsarray of string (uuid)no
match_explanationstringyes
reasonstringyes
reviewer_idstring (uuid)yes

MatchDecision

NameTypeRequiredDescription
idstring (uuid)no
candidate_pair_idstring (uuid)no
decisionstringno
match_explanationstringno
reasonstringno
reviewer_idstringno
created_atstring (date-time)no

RuleSetDraft

NameTypeRequiredDescription
rule_versionstringyes
feature_weightsstringno
auto_link_thresholdnumber (double)yes
manual_review_thresholdnumber (double)yes
effective_fromstring (date)yes
reasonstringyes

RuleSet

NameTypeRequiredDescription
idstring (uuid)no
rule_versionstringno
feature_weightsstringno
auto_link_thresholdnumber (double)no
manual_review_thresholdnumber (double)no
effective_fromstringno
status"submitted" | "active" | "rejected" | "retired" | "superseded"no
submitted_bystring | nullno
approved_bystring | nullno
reasonstring | nullno
decided_atstring | nullno
created_atstring (date-time)no
updated_atstring (date-time)no

ActiveRule

NameTypeRequiredDescription
idstring | nullno
rule_versionstringno
auto_link_thresholdnumber (double)no
manual_review_thresholdnumber (double)no

RuleSetList

NameTypeRequiredDescription
itemsarray of RuleSetno
activeActiveRuleno

InvestigationCommand

NameTypeRequiredDescription
patient_refstring (uuid)yes
suspected_duplicate_refstring (uuid)yes
investigation_reasonstringyes
source_evidencestring (uuid)no

CloseCommand

NameTypeRequiredDescription
outcome"duplicate_confirmed" | "not_duplicate" | "inconclusive"yes
reasonstringyes

Investigation

NameTypeRequiredDescription
idstring (uuid)no
patient_refstring (uuid)no
suspected_duplicate_refstring (uuid)no
investigation_reasonstringno
source_evidencestring | nullno
status"open" | "closed"no
outcomestring | nullno
opened_bystring | nullno
closed_bystring | nullno
created_atstring (date-time)no
updated_atstring (date-time)no

InvestigationList

NameTypeRequiredDescription
itemsarray of Investigationno