Book a free call

HL7 Integration for Healthcare Businesses: How It Works

HL7 integration connects hospital systems so patient data moves between them without retyping. Here is how it works and what it takes to build.

Hertiv engineering teamReviewed by a senior engineer
6 min read
HL7 Integration for Healthcare Businesses: How It Works
On this page

Short answer

HL7 integration is the work of connecting healthcare software so that patient records, lab results, appointments and billing data move between systems in the HL7 standard formats. HL7 is a set of standards for health data, and integration means making different systems speak it.

What is HL7 integration?

HL7 integration is the work of connecting healthcare software so that patient records, lab results, appointments and billing data move between systems in the HL7 standard formats. HL7 is a set of standards for health data, and integration means making different systems speak it.

HL7 stands for Health Level Seven, the name of the standards body. Its two main standards are HL7 v2, a message format that hospitals have used for decades, and FHIR, a newer standard that moves health data over web APIs. Most integration work today touches one or both.

The problem it solves is simple: a hospital runs many systems that do not share data by default. The lab system, the radiology system, the electronic health record and the billing system each hold part of a patient's story, and staff retype data between them unless the systems are connected.

Integration removes that retyping. When a lab result arrives, it flows into the patient record automatically, and when a patient is admitted, the billing system learns about it without anyone copying details by hand.

How does HL7 v2 work?

HL7 v2 works by sending text messages between systems. Each message is a set of segments, and each segment holds fields separated by special characters. A common message type is ADT, which reports admissions, discharges and transfers, while ORU carries lab results and ORM carries orders.

A message looks like a block of short lines, each starting with a three-letter code. The receiving system reads the segments, pulls out the patient, the test and the result, and stores them in its own database. The format is old and plain, which is why so many systems still support it.

Messages usually travel through an integration engine, a piece of software that sits between systems, receives messages, changes them if needed, and passes them on. The engine also logs every message, which matters when a result goes missing and someone needs to find out why.

The weakness of HL7 v2 is that each hospital uses it slightly differently. Fields are used in local ways, so two systems that both speak HL7 v2 still need mapping work before they understand each other. A data engineering team usually owns that mapping.

What is FHIR, and how is it different?

FHIR, pronounced "fire", is the newer HL7 standard. It moves health data over web APIs using the same ideas as modern web software: resources, JSON and REST calls. A patient, an observation and a medication are each a resource with a web address, and a system fetches them with a normal web request.

FeatureHL7 v2FHIR
FormatPlain text messagesJSON over web APIs
TransportMessage queues and enginesWeb requests
Data modelSegments and fieldsResources with links
Typical useLab results, admissionsApps, portals, new systems
Learning curveNeeds message knowledgeFamiliar to web developers
Where it runsInside hospitalsInside and outside hospitals

FHIR is easier for web developers because it uses tools they already know, and it is the standard new health apps are built on. HL7 v2 is not going away, though: most hospital lab and radiology systems still send v2 messages, so integration work usually covers both.

The two standards often work together. A FHIR API can sit in front of older systems, translating their v2 messages into FHIR resources for new apps. That pattern lets a hospital add modern tools without replacing its core systems.

What data moves through an HL7 integration?

The data that moves through an HL7 integration covers the main events of care: admissions, lab results, imaging orders, prescriptions, appointments and billing. Each event becomes a message or a resource that other systems can read.

Admissions data tells other systems that a patient has arrived, moved wards or gone home. Lab results carry the test, the value and the reference range. Imaging orders carry the scan requested and the reason, while the report comes back as a result message.

Prescriptions and medication lists move between the record and the pharmacy, and appointment data moves between scheduling and the clinic. Billing data follows the same path, since a charge needs the patient, the service and the date.

Not all data is equally sensitive. Patient identity and clinical notes need the strongest protection, while appointment times are less so. A good integration treats each data type by its risk, not all the same way.

How do you plan an HL7 integration?

You plan an HL7 integration by listing the systems, the data each one holds, and the events that must flow between them. Work through these steps before you write any code.

  1. List the systems. Record, lab, radiology, pharmacy, scheduling and billing, with the vendor and version of each.
  2. Pick the standard per link. Use FHIR where a system supports it, and HL7 v2 where it does not. Most projects need both.
  3. Map the data. For each field, write down what it means in the source system and what it must mean in the target.
  4. Set up the engine. Put an integration engine or FHIR server between the systems so messages are logged and can be replayed.
  5. Test with real messages. Use sample messages from the real systems, not made-up ones, and check every field lands correctly.
  6. Plan for failure. Decide what happens when a message fails, who is told, and how it is fixed and resent.

Consent and access rules belong in the plan too. Health data is sensitive, so the integration must check who may see what, and log every access. An healthcare software partner can advise on the rules that apply in your country.

Example (hypothetical): connecting a lab to a patient record

Example (hypothetical): a 200-bed hospital wants lab results to appear in its patient record without retyping. The lab system sends HL7 v2 ORU messages, and the record system accepts FHIR resources, so the team builds a small integration between them.

The lab sends 1,200 results a day. Each result message has 8 fields the team must map: patient, test, value, unit, reference range, status, time and lab. The integration engine receives the v2 message, maps the fields to a FHIR Observation resource, and posts it to the record system.

Testing takes three weeks. The team sends 200 sample results through the flow and checks each one lands in the right patient's record with the right value. It finds 12 mapping errors in the first week, fixes them, and the second week passes clean.

After launch, results appear in the record within two minutes of the lab finishing them, instead of the four hours the old retyping process took. The team keeps the message log, so if a result ever goes missing, it can find the exact message and replay it.

What are the common mistakes?

The most common mistakes are skipping the data mapping, trusting the standard to do the work, and forgetting failure handling.

  • Skipping the mapping. Two systems that both speak HL7 still use fields differently, and unmapped fields become wrong data.
  • Assuming the standard fixes everything. HL7 defines the format, not the meaning. Local codes and habits still need mapping.
  • No message log. Without a log, a missing result is a mystery instead of a message you can replay.
  • Ignoring consent and access. Health data needs access rules and audit logs from day one, not as an afterthought.
  • Testing with made-up data. Sample messages from the real systems catch errors that invented examples never show.

A good integration is boring in the best way: messages flow, errors are logged and fixed, and nobody retypes data. If the integration needs heroics to keep running, the design is wrong.

Key takeaways

  • HL7 integration connects healthcare systems so patient data moves without retyping
  • HL7 v2 sends text messages; FHIR moves data over web APIs
  • Most projects need both standards, since older systems still use v2
  • Data mapping is the real work: the standard defines format, not meaning
  • Log every message so a missing result can be found and replayed
  • Consent, access rules and audit logs belong in the plan from day one

Frequently asked questions

What is the difference between HL7 and FHIR?

HL7 is the standards body, and FHIR is its newest standard. HL7 v2 is the older message format that hospitals have used for decades, while FHIR moves health data over web APIs using JSON. Most integration work today touches both.

Do all hospital systems support HL7?

Most do, but not in the same way. Lab, radiology and record systems usually support HL7 v2, while newer apps and portals support FHIR. Each hospital uses fields slightly differently, so mapping work is needed even when both sides speak the standard.

How long does an HL7 integration take?

A single link, such as lab results to a patient record, usually takes a few weeks of mapping and testing. A hospital-wide integration with many systems takes months, since each link needs its own mapping, testing and failure plan.

Is patient data safe in an HL7 integration?

It is as safe as the access rules around it. The integration should encrypt data in transit, limit access by role, and log every view. Health data rules vary by country, so check local law before connecting any system that holds patient records.

What is an integration engine?

An integration engine is software that sits between healthcare systems, receives messages, changes them if needed, and passes them on. It also logs every message, which matters when a result goes missing and someone needs to find out why.

Can small clinics use HL7 integration too?

Yes. A small clinic usually needs one or two links, such as lab results into the record or appointments into scheduling. A single integration engine or a FHIR API can cover that without a hospital-wide project.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: software products in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Connecting hospital systems with HL7? Talk to Hertiv.

A senior engineer replies within one business day. Or see our Data Engineering service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call