Stage 3 — TRANSFORM
What happens
Hl7v2ToFhirMapper converts the parsed HL7v2 object to FHIR R4 resources. The golden record ID from Stage 2 is stamped on every resource via Patient.link[refer].
PID → Patient
| HL7v2 field | FHIR field | Notes |
|---|---|---|
| PID-3.1 | identifier[].value | Local MRN |
| PID-3.4 | identifier[].system | Facility URN |
| PID-5.1 | name[].family | Family name |
| PID-5.2 | name[].given[] | Given name |
| PID-7 | birthDate | YYYYMMDD → YYYY-MM-DD |
| PID-8 | gender | M/F/U → male/female/unknown |
| PID-11 | address[] | Street, city, state, zip |
| PID-13 | telecom[] | Phone |
| MSH-4 (via JamFR) | managingOrganization | Resolved Organization ref |
| Golden ID (via MPI) | link[type=refer] | Golden patient reference |
PV1 → Encounter
| HL7v2 field | FHIR field |
|---|---|
| PV1-2 | class (IMP/AMB/ER) |
| PV1-3.1 | location[].location (ward) |
| PV1-3.2 | location[].location (room/bed) |
| PV1-7 | participant[] (attending provider) |
| EVN-2 | period.start |
| PV1-45 | period.end (if discharge) |
OBX → Observation
| HL7v2 field | FHIR field |
|---|---|
| OBX-3 | code (LOINC code) |
| OBX-5 | value[x] (numeric, string, coded) |
| OBX-6 | valueQuantity.unit |
| OBX-8 | interpretation (H/L/N/A/AA/LL/HH) |
| OBX-11 | status (F=final, P=preliminary) |
| OBR-7 | effectiveDateTime |
Terminology translation
When terminology.enabled: true, JamTS translates local codes to canonical systems:
GET /fhir/ConceptMap/$translate?system=urn:br01.local&code=GLU&target=loinc
Host: jamts:8085
This is especially important for OBX-3 local lab codes — most hospital lab systems use internal code systems. Without translation, observations are not queryable by standard LOINC code.
Translation targets configured:
- Local lab codes → LOINC
- Local diagnosis codes → ICD-10-CM / ICD-10-WHO
- Local drug codes → RxNorm / SNOMED CT