parse HL7v2 ADT messages and map fields to FHIR R4 resources

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

Steps

  1. Use a well-tested HL7v2 parsing library for your language (e.g. hl7apy for Python, HAPI for Java, or nHapi for .NET) to deserialize the pipe-delimited message into a structured object model.
  2. Extract the MSH segment to determine message type (e.g. ADT^A01 for admit, ADT^A08 for update) and use this to decide which FHIR operation to perform (create vs. update).
  3. Map PID segment fields to a FHIR Patient resource: PID-3 to identifier, PID-5 to name, PID-7 to birthDate, PID-8 to gender, PID-11 to address.
  4. Map PV1 segment fields to a FHIR Encounter resource: PV1-2 to Encounter.status, PV1-3 to Encounter.location, PV1-44/45 to Encounter.period.
  5. Use a FHIR transaction Bundle to POST both the Patient and Encounter in a single atomic request, referencing the Patient via a conditional URL or fullUrl.
  6. Validate the resulting FHIR resources against US Core or relevant profiles using a FHIR validator before persisting.

Known gotchas

Related routes

Map HL7 v2 message fields to FHIR R4 resources for interoperability translation
hl7v2 · 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
Handle non-standard Z-segments and repeating-field quirks when mapping HL7v2 messages to FHIR resources
healthcare · 6 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