Skip to content
The Path

Module 4 · Transport and acknowledgements·9 min

Security and privacy

Encryption, networks, logs, GDPR and anonymous test data.

An HL7 v2 message is a slice of a medical record. Name, date of birth, record number, test result, diagnosis. And by default, it travels in clear text.

Look at this result. Everything you can read here, someone listening on the network can read too.

A sleep study report. The lab sends the hospital record an AHI of 28.5/h, flagged “high”: moderate sleep apnea.

ORU^R01^ORU_R01· Observation result (unsolicited)
||||||||||
|||||||||||
|||||||
|||||||||||||||||||||||||
|||||||||||
|||||||||||
|||||||||||
|||||||||||

In a few seconds, you learn that Marie Dubois, born in 1985, has moderate sleep apnea. This is exactly the kind of information the law protects most.

MLLP protects nothing

MLLP adds one byte in front of the message and two after it. That is all. No encryption, no password, no check on who is sending.

The MSH segment does have an MSH-8 field called “Security”. Do not rely on it: it is just a text field inside the message. Filling it in encrypts nothing.

So security is built around the message, in layers.

The layers of protection

Layer What it does
TLS encrypts the TCP connection; certificates prove who is on each side
VPN builds an encrypted tunnel between two sites, for example the clinic and an external lab
Network segmentation keeps interface servers in a network zone that few machines can reach
Access control limits who can open the interface engine and see message content
Logging records who viewed or resent which message, and when

TLS is the same technology as the padlock in your browser. The IHE ATNA profile (Audit Trail and Node Authentication) asks two things of the systems that implement it: both sides authenticate each other with certificates before they exchange data, HL7 connections included, and a central audit log records who accessed what. That is the “Logging” row of the table.

Many older systems cannot do TLS at all. You then terminate encryption in the interface engine, or go through a tunnel (a VPN, or a small TLS relay placed in front of the system). In FHIR, the standard recommends TLS (HTTPS) for every exchange of real data.

The interface engine, a vault to watch

An engine can keep a copy of every message so it can reprocess it. That is precious when something breaks. But it also means the engine holds thousands of records in clear text.

  • Give access to the engine by name, not through a shared account.
  • Set a retention period for messages, then purge.
  • Log every view and every reprocessing.
  • No message content in email alerts. Watch the engine’s debug logs and backups too: real leaks go through there more often than through the network.

The GDPR in a few points

In Europe, the GDPR puts health data among the sensitive categories. Processing it is prohibited in principle, except in the specific cases the regulation allows. And when you do process it, you need security measures that match the risk. Article 32 names pseudonymisation and encryption among them.

Two words not to mix up:

  • Pseudonymising means replacing the name and identifiers with a code, while keeping the lookup key somewhere else. The data stays personal.
  • Anonymising means making it impossible, by any reasonable means, to find the person again. Only that data falls outside the GDPR.

Deleting the name is almost never enough: a date of birth, a postcode and a rare test can be enough to find someone.

The GDPR is only a baseline. Each country adds its own rules for health data: in France, for example, a provider hosting health data on behalf of a facility must hold the HDS certification. Outside Europe, other frameworks apply, such as HIPAA in the United States. For your project, the data protection officer of your organisation is the right person to ask.

Test data

To test, train or ask for help on a forum, use fictional data. That is what this whole site does: Clinique Leleux and Marie Dubois do not exist.

A result built for testing: fictional patient, test identifier, same structure as a real message.

ORU^R01^ORU_R01· Observation result (unsolicited)
||||||||||
||||||||
|||||||
|||||||||||

Notice MSH-11 too: it is T (training) rather than P (production). It tells the receiver not to treat this message as production. Careful: it guarantees nothing about the data. A test environment filled with copies of production sends messages marked T that hold real patients.

Check your understanding

1 of 4

Does MLLP encrypt the messages it carries?

+50 XPPass the quiz (3 correct answers) to complete the lesson.

Reviewed and checked on 27 September 2026