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

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

In-depth guide

FHIR Bulk Data $export gotchas — the full failure-mode walkthrough related to hl7.org, checked against official docs, with linked verified routes.

Steps

  1. Parse the HL7 v2 ADT A01 message into its segment components using a v2 parsing library, extracting fields by segment name and field position according to the HL7 v2 message structure for ADT events
  2. Map PID segment fields to a FHIR Patient resource: PID-3 patient identifiers to Patient.identifier, PID-5 name to Patient.name, PID-7 date of birth to Patient.birthDate, PID-8 sex to Patient.gender, and PID-11 address to Patient.address
  3. Map PV1 segment fields to a FHIR Encounter resource: PV1-2 patient class to Encounter.class, PV1-3 assigned patient location to Encounter.location, PV1-7 attending physician to Encounter.participant, and PV1-44 admit date to Encounter.period.start
  4. Map DG1 segments to FHIR Condition resources using DG1-3 diagnosis code (ICD-10) for Condition.code, DG1-6 diagnosis type to Condition.category, and link each Condition to the Encounter via Condition.encounter reference
  5. Map AL1 segments to FHIR AllergyIntolerance resources using AL1-3 allergy code for AllergyIntolerance.code, AL1-2 allergy type for AllergyIntolerance.category, and AL1-4 allergy severity for AllergyIntolerance.reaction.severity

Known gotchas

Related routes

parse HL7v2 ADT messages and map fields to FHIR R4 resources
hl7v2-fhir · 6 steps · unrated
Map HL7 v2 message fields to FHIR R4 resources for interoperability translation
hl7v2 · 6 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,600+ 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