
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.
For the broader MCP map, pair this with What Is MCP (Model Context Protocol)? A TypeScript Developer's Guide and The Complete Guide to MCP Servers; those pieces cover the concepts and server-selection layer behind this article.
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.
From the archive
Apr 28, 2026 • 8 min read
Apr 28, 2026 • 8 min read
Apr 28, 2026 • 11 min read
Apr 28, 2026 • 10 min read
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.
Read next
Claude Code is turning into an orchestration layer for agent teams. Here is how subagents, MCP, hooks, and long context fit together in 2026.
9 min readMCP servers connect AI agents to databases, APIs, and tools through a standard protocol. Here is how to configure and use them with Claude Code and Cursor.
11 min readCodeGraph builds a local SQLite index of your codebase so Claude Code, Cursor, and Codex CLI spend far fewer tokens exploring files - trending on GitHub with 12k stars and real benchmark numbers.
6 min readTechnical 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 ToolAnthropic's flagship reasoning model. Best-in-class for coding, long-context analysis, and agentic workflows. 1M token c...
View ToolMac app for running parallel Claude Code, Codex, and Cursor agents in isolated workspaces. Watch every agent work at onc...
View ToolInteractive TUI dashboard that shows exactly where your Claude Code and Cursor tokens are going, in real time.
View ToolEvery coding agent in one window. Stop alt-tabbing between Claude, Codex, and Cursor.
View AppTurn a one-liner into a working Claude Code skill. From idea to installed in a minute.
View AppDesign subagents visually instead of editing YAML by hand.
View AppConfigure 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
Nimbalyst Demo: A Visual Workspace for Codex + Claude Code with Kanban, Plans, and AI Commits Try it: https://nimbalyst.com/ Star Repo Here: https://github.com/Nimbalyst/nimbalyst This video demos N...

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...
CodeGraph builds a local SQLite index of your codebase so Claude Code, Cursor, and Codex CLI spend far fewer tokens expl...
CodeGraph hit 7,800+ stars with 1,900 added in a single day - a local MCP knowledge graph that lets Claude Code explore...
agentmemory is a self-hosted MCP server that gives Claude Code, Cursor, and Gemini CLI searchable long-term memory acros...
agentmemory gives AI coding agents a persistent brain - capturing session context automatically via 12 Claude Code hooks...

Claude Code 2.1.128 is full of small fixes around MCP, worktrees, OTEL, plugins, and permissions. That is exactly why it...
Ruflo crossed 37,700 GitHub stars this week, adding nearly 1,900 in a single day. It turns Claude Code into a coordinate...

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