Map HL7 v2 message fields to FHIR R4 resources for interoperability translation

domain: hl7v2 · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Reference the HL7 v2 to FHIR mapping tables published in the HL7 FHIR specification (https://hl7.org/fhir/v2maps.html) and the HL7 v2 to FHIR Implementation Guide for validated field-level mappings.
  2. Map the PID segment to a FHIR Patient resource: PID-3 → Patient.identifier[], PID-5 → Patient.name[], PID-7 → Patient.birthDate (reformatted), PID-8 → Patient.gender (with value translation: M→male, F→female, U→unknown).
  3. Map the PV1 segment to a FHIR Encounter resource: PV1-2 patient class → Encounter.class (using HL7 v3 ActCode system), PV1-44 → Encounter.period.start, PV1-45 → Encounter.period.end.
  4. Map OBX segments (observation results) to FHIR Observation resources: OBX-3 (observation identifier, usually LOINC) → Observation.code, OBX-5 (value) → Observation.value[x] (type based on OBX-2), OBX-11 (result status) → Observation.status.
  5. Handle data type translation explicitly: CWE/CE (coded with exceptions) components map to FHIR CodeableConcept with coding[]; NM (numeric) maps to valueQuantity; TX/FT (text) maps to valueString.
  6. Validate the mapped FHIR resources against the relevant profiles (US Core where applicable) and check for required fields that have no corresponding v2 source field.

Known gotchas

Related routes

parse HL7v2 ADT messages and map fields to FHIR R4 resources
hl7v2-fhir · 6 steps · unrated
Handle non-standard Z-segments and repeating-field quirks when mapping HL7v2 messages to FHIR resources
healthcare · 6 steps · unrated
Build an HL7 v2 to FHIR R4 translation pipeline for ADT A01 (admit) messages, mapping all relevant PID, PV1, DG1, and AL1 segments to corresponding FHIR resources
hl7.org · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans