
TL;DR
Hospitals still ship HL7 v2 pipes between systems in 2026. Here is how to wire Claude Code as a careful, HIPAA-aware migration agent that takes them to FHIR.
Walk into any mid-sized hospital integration team in 2026 and you will still find HL7 v2 messages flowing over MLLP between an old Epic interface, a lab system from a vendor that was acquired twice, and a homegrown bed-management app that nobody wants to touch. The org has a five-year FHIR mandate, a Mirth or Rhapsody engine in the middle, and one or two analysts who can read pipe-and-hat encoding without flinching. Everything else is tribal knowledge written into channel filters and JavaScript transformers.
This is the kind of work that looks tedious from the outside and terrifying from the inside. A wrong field map can put an allergy on the wrong patient. A dropped segment can lose a discharge time. The reason these migrations stall is not that FHIR is hard. It is that the existing v2 messages encode twenty years of local conventions that the spec never had opinions about, and nobody has the bandwidth to chase them all down.
Agentic coding tools change the math. Claude Code, scoped properly, is unusually good at this kind of grinding, well-bounded, high-context translation work. The trick is wiring it so it never sees PHI it should not see, never writes to a production interface engine, and always produces a diff that a human integrator can sign off on.
The non-obvious wedge is not "use AI to write FHIR resources." Half the FHIR community has tried that and bounced off the spec. The wedge is "use a coding agent to migrate the transformer code, not the data." The transformer is just JavaScript or Python. The agent reads the v2 sample, reads the channel transformer, reads the FHIR profile the org has standardized on (US Core, Carin BB, Da Vinci, whatever), and proposes a new transformer plus a test fixture. PHI never leaves the synthetic-fixture loop. The output is a pull request, not a live deploy.
A workable repo for this looks like:
hl7-fhir-migration/
CLAUDE.md
channels/
adt-a08-bedboard/
v2-sample.hl7 # synthetic, Synthea-derived
current-transformer.js # exported from Mirth
target-profile.md # which FHIR profile + must-support fields
tests/
encounter.expected.json
patient.expected.json
skills/
fhir-validate/
SKILL.md
scripts/validate.sh # wraps HAPI validator
hl7-parse/
SKILL.md
scripts/parse.py # uses python-hl7
.claude/
settings.json # hooks, allowlist, deny PHI paths
mcp/
fhir-server.ts # local HAPI FHIR proxy, MCP wrapper
The CLAUDE.md does the heavy lifting. It tells the agent the org's profile choices, the deterministic ID strategy (almost always a hash of MRN plus assigning authority), the timezone rules, and the list of fields the compliance team cares about most: allergies, medications, code status, advance directives. Everything else is "best effort, flag for review."
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools - delivered free every week.
The prompt pattern that works is two-pass.
Pass one is discovery. You point Claude Code at one channel folder and ask:
Read
v2-sample.hl7andcurrent-transformer.js. Produce a table of every v2 field the transformer touches, the FHIR resource and element it maps to under ourtarget-profile.md, and a confidence score. Flag anything where the source field is being parsed with a regex or a custom date format. Do not write code yet.
Pass two is implementation, scoped to one resource at a time:
Implement the Encounter mapping only. Write a new transformer in
channels/adt-a08-bedboard/transformer.ts. For every must-support field intarget-profile.md, write a passing test intests/encounter.expected.json. Use thefhir-validateskill on the output. If validation fails, fix the transformer, not the expected fixture.
The reason to split is cost and review. Discovery passes are cheap and make the human-readable artifact that the integration analyst actually wants. Implementation passes are bigger but bounded.
The single highest-leverage piece of glue is a local FHIR MCP server. It wraps a HAPI FHIR validator running in Docker and exposes three tools: validate_resource, search_profile, and diff_against_baseline. The agent calls validate_resource on every artifact it produces and gets back the same OperationOutcome a human would see in HAPI. Because the server is local and the fixtures are synthetic, no PHI ever crosses a network boundary.
A minimal server in TypeScript is around 120 lines using the official MCP SDK. It runs as a stdio child process of Claude Code, started from .mcp.json. The same server doubles as a skill backend if you prefer SKILL.md style invocations.
The non-negotiable piece is a PreToolUse hook in .claude/settings.json that blocks any read of files matching real PHI patterns. It looks for the org's MRN format, the v2 magic numbers in non-fixture directories, and any path under production/. If the agent tries to read a file outside channels/*/ or the synthetic fixtures, the hook exits non-zero and Claude Code refuses the tool call.
A second hook on PostToolUse runs git diff --stat after every Write and rejects diffs that touch the production Mirth export directory. Belt and suspenders, but in healthcare you wear both.
The honest risks are these. First, synthetic data does not capture every local convention. Synthea will not produce the OBX-5 quirks a particular lab uses. Mitigation: keep a "weird messages" library, scrubbed and de-identified by a human, that the agent can train its mappings against. Second, FHIR profiles drift. US Core 7.0 broke things US Core 6.1 allowed. Pin the profile version in CLAUDE.md and bump deliberately. Third, audit. Anything the agent touches needs a paper trail that a HIPAA auditor can read. The PR-only output, combined with hook logs written to an append-only file, satisfies most audit asks.
SOC2 and HITRUST add one more requirement: the agent's transcripts themselves are records. Claude Code's --output-format jsonl plus a hook that ships transcripts to your existing SIEM closes that gap.
You can run the smallest version of this today, before talking to compliance, on synthetic data only.
mkdir hl7-fhir-migration && cd hl7-fhir-migrationchannels/adt-a08-bedboard/v2-sample.hl7current-transformer.jsCLAUDE.md that names US Core 7.0 as the target profileclaude and paste the discovery prompt aboveYou will get back a field-by-field mapping table in about ninety seconds. That table, on its own, is more documentation than most channels have today. Show it to the integration lead. The conversation about whether to let an agent write the next transformer goes very differently once they have read the first one.
The hospitals that win the FHIR transition will not be the ones with the biggest integration teams. They will be the ones whose teams stop hand-typing transformers and start reviewing them.
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
Anthropic's agentic coding CLI. Runs in your terminal, edits files autonomously, spawns sub-agents, and maintains memory...
View ToolInteractive TUI dashboard that shows exactly where your Claude Code and Cursor tokens are going, in real time.
View ToolOpenAI's cloud coding agent. Runs in a sandboxed container, reads your repo, executes tasks, and submits PRs. Uses GPT-5...
View ToolCodeium's AI-native IDE. Cascade agent mode handles multi-file edits autonomously. Free tier with generous limits. Stron...
View ToolConfigure Claude Code for maximum productivity -- CLAUDE.md, sub-agents, MCP servers, and autonomous workflows.
AI AgentsConfigure model, tools, MCP, skills, memory, and scoping.
Claude CodeRoute specific MCP servers only to specific subagents.
Claude Code
Composio: Connect AI Agents to 1,000+ Apps via CLI (Gmail, Google Docs/Sheets, Hacker News Workflows) Check out Composio here: http://dashboard.composio.dev/?utm_source=Youtube&utm_channel=0426&utm_...

Anthropic has released Channels for Claude Code, enabling external events (CI alerts, production errors, PR comments, Discord/Telegram messages, webhooks, cron jobs, logs, and monitoring signals) to b...

Claude Code “Loop” Scheduling: Recurring AI Tasks in Your Session The script explains Claude Code’s new “Loop” feature (an evolution of the Ralph Wiggins technique) for running recurring prompts that...

The second half of our agent tooling release: distribution, validation, and ergonomics layered on top of the first six....

Ten private tools shipped overnight - observability, skills, hooks, prompts, and evals - aimed at the agent infrastructu...

From Claude Opus 4.7 and GPT-5.5 to Andrej-karpathy-skills and EvoMap - the AI dev tools actually shipping the last 30 d...

New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.