Integrations/Healthcare

Healthcare in Python

Receive HL7 v2 messages over MLLP, access their fields as typed Python objects, connect to FHIR servers, and build healthcare integration workflows in Python.

194
v2.9 segments
R4
FHIR client
MLLP
in and out
35
guides and docs
healthcare_service.py

Both standards, one platform

Receive HL7 v2 over MLLP or call FHIR servers over REST, all with the same Python services.

Everything for healthcare integrations

HL7 v2 and FHIR, with the production features clinical traffic needs.

MLLP channels
Receive and send HL7 v2 messages over MLLP with automatic acknowledgments. Zato handles the framing protocol so you focus on business logic.
All v2.9 segments
Every v2.9 segment as a typed Python class with full autocompletion and type checking.
Built-in validation
Validate field lengths, cardinality, required fields, datatypes, and terminology bindings.
FHIR client
Connect to any FHIR server with self.fhir - typed searches, bundles, references and path access, with OAuth tokens managed for you.
HL7 v2 to FHIR
Transform HL7 v2 messages into FHIR resources with regular Python services.
FHIR security
Basic Auth and OAuth with automatic token acquisition and refresh, plus TLS.

Learn by building

Step-by-step guides for HL7 v2 and FHIR integration patterns.

Healthcare integration guides

Platform comparisons, regulatory scoping and national FHIR programs, each with working Python code.

AI
AI agents and clinical interfaces
How agents reach clinical data through a governed gateway and what guards patient data
Reference
HL7 v2 to FHIR mapping reference
Segment-to-resource and field-to-field tables with Python code for ADT and ORU
Guide
How to receive HL7 v2 messages in Python
Library comparison and a production MLLP listener with acknowledgments
EDIFACT
EDIFACT messaging in healthcare
Where EDIFACT remains in use in healthcare and how to parse it from Python
USA
TEFCA and information blocking
QHINs, penalties and what your integration layer must be able to do
Europe
EHDS compliance checklist
The 2027-2031 deadlines, the EEHRxF format and the engineering checklist
Germany
gematik ISiK FHIR integration
Query the FHIR interface German hospitals are required to expose
USA
CMS-0057-F prior authorization APIs
The four payer FHIR APIs due by January 2027 and the integration pattern
EHR
Epic and Oracle Health FHIR APIs
SMART on FHIR authorization and R4 queries from Python
UK
NHS FHIR integration
UK Core on R4, GP Connect on STU3 and how to call both from Python
Pattern
FHIR facade over legacy HL7 v2
Expose a FHIR-style REST API while the legacy system stays unchanged
Australia
My Health Record and AU Core
Sparked, AUCDI and Australian FHIR endpoints from Python
Canada
Pan-Canadian Patient Summary and CA:FeX
PS-CA document bundles and the pan-Canadian exchange from Python
Nordics
Finland's Kanta and Nordic FHIR migration
Kanta, MedCom and the Nordic legacy-to-FHIR bridges
Glossary
HL7 vs FHIR vs MLLP - definitions
The healthcare integration vocabulary, each term with a Python example

Healthcare developer guides

In-depth documentation for HL7 v2, FHIR and EDIFACT in Python.

MLLP
Receiving HL7 v2 over MLLP
Routing, acknowledgments, deduplication, and REST bridge
MLLP
Sending HL7 v2 over MLLP
Outgoing connections, self.mllp, acknowledgments, and TLS
MLLP
MLLP channel configuration
Encoding, tolerance, batch mode, and all channel settings
Parsing
HL7 v2 message parsing
Parse ER7-encoded messages into typed Python objects
API
HL7 v2 field access
Access segment fields by name using typed Python objects
API
HL7 v2 path expressions
Navigate nested fields and components with dot-path syntax
Validation
HL7 v2 message validation
Validate messages against schema definitions
JSON
HL7 v2 parsing and serialization
Convert messages between ER7, dicts and JSON
Batch
HL7 v2 batch processing
Process multiple messages in batch mode
FHIR
FHIR connections and self.fhir
Configure outgoing FHIR connections and use them from Python
FHIR
Working with FHIR resources
Create, read, update and delete resources, follow references
FHIR
Searches and bundles
Typed search parameters, result iteration and raw bundles
FHIR
Path access to FHIR data
Navigate nested FHIR structures with dotted paths and matchers
FHIR
FHIR extensions
Read and write extensions, including nested ones, with matchers
Security
FHIR security
Basic Auth and OAuth with tokens managed automatically
Trends
FHIR versions in 2026 and 2027
R4 now, R6 next - which version new projects should build on
Europe
FHIR in European healthcare projects
EHDS, MyHealth@EU and national programs in 2026-2027
Transform
Automatic HL7 v2 to FHIR conversion
One call, msg.to_fhir(), turns whole messages into FHIR bundles
Transform
HL7 v2 to FHIR configuration
Identifier systems, local code values and bundle types in one .ini file
Transform
Z-segments and extensions
How custom segments are preserved as FHIR extensions
Transform
HL7 v2 to FHIR transformation
Receive HL7 v2 over MLLP and turn it into FHIR resources
EDIFACT
EDIFACT integration
Parse interchanges into typed Python objects, define dialects, pick a transport
EDIFACT
EDIFACT message parsing
Interchanges, envelopes, separators, and round trips
EDIFACT
EDIFACT field access
Typed segments, composites, repeating groups, and lists
EDIFACT
EDIFACT dialects and profiles
Define your own message types and register them
EDIFACT
EDIFACT transport patterns
Mailboxes, file drops, REST and SOAP carriers

Frequently asked questions

Create an MLLP channel pointing to your Python service. Zato handles the MLLP framing and acknowledgements, and your service receives a parsed message object.

Use attribute-based field access or path expressions to read segments, fields and components as Python data.

Configure an outgoing FHIR connection in Dashboard, then use client = self.fhir['FHIR.Sample'] in your service to work with resources on that server.

With Basic Auth or OAuth - you attach a security definition to the connection and Zato obtains and refreshes tokens for you.

Use searches and bundles - client.resources('Patient').search(...) builds FHIR search queries with typed parameters and returns matching resources.

Call msg.to_fhir() - one call maps the whole message to a FHIR bundle ready to post to a server. When you need full control over every element, follow the manual transformation example instead.

Yes - message validation checks incoming messages against HL7 v2 rules before your service logic runs.

Create an outgoing MLLP connection and invoke it from your service - Zato takes care of framing, delivery and acknowledgements.

R4 - it is the most widely deployed version in production and US Core does not include R5, with R6 arriving in 2027. See FHIR versions in 2026 and 2027 for the details and for how to keep services version-independent.

FHIR becomes the mandated exchange standard, with patient summaries and e-prescriptions mandatory by March 2029. See FHIR in European healthcare projects for the deadlines and the code that implements each scenario.

Yes - the EDIFACT engine parses interchanges into typed Python objects with the same access model as HL7 v2, and EDIFACT messaging in healthcare covers where that traffic remains in use.

Ready to build healthcare integrations?

Get started with Zato and connect your clinical systems with HL7 v2 and FHIR in minutes.

Open source In Python