Stage 2 — ENRICH
What happens
Two parallel enrichment calls run at this stage:
- Facility resolution —
FacilityCodeResolvercalls JamFR via ITI-90 to map MSH-4 to a FHIR Organization reference - Patient identity —
MpiClientServicecalls JamMPI viaPOST /fhir/Patient/$match(ITI-119) to resolve the patient to a golden record
Facility resolution
GET /fhir/Organization?identifier=BRANCH-01
Host: jamfr:8089
Response:
{
"id": "org-br01-001",
"name": "Apollo Chain Branch 01",
"identifier": [{"system": "urn:chain.internal", "value": "BRANCH-01"}]
}
The facility Organization reference is attached to every FHIR resource written by this message (Patient.managingOrganization, Encounter.serviceProvider).
If the facility code is unknown and auto-provision: true, JamFR creates a new Organization automatically.
Patient identity — MPI $match
POST /fhir/Patient/$match
Host: jammpi:8081
Content-Type: application/fhir+json
{
"resourceType": "Parameters",
"parameter": [
{"name": "resource", "resource": {
"resourceType": "Patient",
"name": [{"family": "FERNANDO", "given": ["KAMAL"]}],
"birthDate": "1985-03-14",
"identifier": [{"system": "urn:br01.mrn", "value": "MRN123456"}]
}}
]
}
Response includes the golden record ID and match grade:
{
"id": "GOLDEN-00441",
"extension": [
{"url": "match-grade", "valueString": "certain"},
{"url": "match-score", "valueDecimal": 0.97},
{"url": "seen-at", "valueString": "BR01,BR03,BR07"}
]
}
Match grades
| Grade | Score | Meaning |
|---|---|---|
certain | ≥ 0.95 | National ID exact match |
probable | ≥ 0.85 | Name + DOB similarity |
possible | ≥ 0.70 | Partial match |
If no match meets min-grade, a new patient record is created (no golden link).
Cache behaviour
Both facility and patient results are cached:
- Facility: 5-minute TTL (configurable)
- Patient: not cached — patient demographics can change between messages