Skip to main content

Stage 2 — ENRICH

What happens

Two parallel enrichment calls run at this stage:

  1. Facility resolutionFacilityCodeResolver calls JamFR via ITI-90 to map MSH-4 to a FHIR Organization reference
  2. Patient identityMpiClientService calls JamMPI via POST /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

GradeScoreMeaning
certain≥ 0.95National ID exact match
probable≥ 0.85Name + DOB similarity
possible≥ 0.70Partial 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