Part 2: Interoperability

4 Messaging and FHIR

How does one registration reach twenty systems?

About 75 minutesDraft, awaiting expert reviewLast checked 2026-11-30

One registration, twenty systems

When the front desk registers Mira at 09:12, the registration system knows she has arrived. The lab system, the pharmacy, radiology, the bed board, the billing system and the ED tracking screen also need to know, within seconds. None of them share a database. They learn about her from messages.

If every system sent messages directly to every other system, 12 systems would need 66 separate interfaces, and each one would break whenever either end was upgraded. Hospitals instead route messages through an interface engine: a hub that receives each message once, translates it, and forwards it to every system that subscribed. Most integration work in a hospital is done there.

Reading HL7 version 2

HL7 v2 dates from the late 1980s and still carries most of the messages inside hospitals. A message is plain text. Each line is a segment, named by three letters. Fields are separated by |, components within a field by ^, and repeats by ~. The first segment is always MSH, the header, which says who sent the message, to whom, when, and what type it is.

The message type has two parts. In ADT^A04, ADT means admit, discharge or transfer, and A04 is the trigger event: a patient was registered. The same event model runs through all of v2. ORU^R01 carries a result, and VXU^V04 reports a vaccination.

Try it below. Select any field to see what it means, edit the message to break it, and switch to the FHIR view to see the same data as resources.

Edit the message: the parse and the FHIR output update as you type. One segment per line.

  1. MSH Message header
  2. EVN Event type
  3. PID Patient identification
  4. PV1 Patient visit

Notice what the broken sample does. A date written as 14/05/1968 and a sex written as female are both readable to a person, and both invalid to a machine. v2 is permissive enough that many systems send messages like this, and every receiving interface has to handle the variations. That flexibility is why v2 spread so widely, and it is also why v2 interfaces cost so much to maintain.

FHIR: resources on the web

FHIR (Fast Healthcare Interoperability Resources) keeps v2’s lessons and borrows the design of the modern web. Data is split into resources, such as Patient, Encounter, Observation and Condition. Each resource has an id and a URL, and resources point to each other with references. Mira’s creatinine result is an Observation whose subject is Patient/mira.

Because resources live at URLs, systems can use ordinary HTTP. GET Patient/mira reads one resource. GET Observation?subject=Patient/mira searches and returns a Bundle of matches. Search parameters have types. A token such as code=http://loinc.org|2160-0 matches a code within its system. A date or number can take a prefix such as lt or gt. A reference such as subject=Patient/mira links one resource to another.

FHIR became the basis for health data regulation. In the United States, the 21st Century Cures Act rules require certified EHRs to offer standard FHIR APIs. In Europe, the International Patient Summary and the European Health Data Space build on FHIR. SMART on FHIR adds secure sign-in, so an app can plug into any EHR that supports it.

Use the playground below. It is a small FHIR server running in your browser, with 41 synthetic patients. Mira is one of them.

HTTP 200 · 1 match

{
  "resourceType": "Bundle",
  "type": "searchset",
  "total": 1,
  "link": [
    {
      "relation": "self",
      "url": "[base]/Patient?name=novak"
    }
  ],
  "entry": [
    {
      "fullUrl": "[base]/Patient/mira",
      "resource": {
        "resourceType": "Patient",
        "id": "mira",
        "identifier": [
          {
            "system": "urn:oid:cityhosp",
            "value": "MRN44871"
          }
        ],
        "name": [
          {
            "family": "Novak",
            "given": [
              "Mira"
            ]
          }
        ],
        "gender": "female",
        "birthDate": "1968-05-14",
        "address": [
          {
            "city": "Riverton"
          }
        ]
      },
      "search": {
        "mode": "match"
      }
    }
  ]
}

Syntax is not meaning

A message can be perfectly formed and still be misunderstood. Syntactic interoperability means the receiver can parse the structure. Semantic interoperability means the receiver understands the content the way the sender meant it. If one lab codes creatinine as 2160-0 in LOINC and another sends a local code CRE, both messages parse, but only one can be safely pooled, trended or used to fire a decision rule. FHIR does not solve this on its own. It needs shared terminologies, which are the subject of the next module.

There is a quieter version of the same problem in the v2 samples above. The timestamps carry no time-zone offset. Within one hospital that rarely matters. Across a health system that spans time zones, or when daylight saving time changes, it can reorder events in a patient’s record.

From the Failure Museum: two departments, one veteran

In the United States, people leaving military service move from the Department of Defense health system to the Department of Veterans Affairs. For decades their records did not move cleanly with them. In 2013, after years of work and large spending, the two departments abandoned their plan for a single joint integrated record and chose to connect their separate systems instead. Government auditors repeatedly found that the departments had not defined what “interoperable” should achieve for patients. Both departments later bought the same commercial EHR, and data sharing still required years of further work.

Lesson: interoperability is a goal about patients and clinicians, not only a technology choice. Projects that cannot say what a clinician should be able to see, and when, tend to deliver interfaces without delivering care.

Check your understanding

Answer every question, then check. Each answer comes with an explanation. Score 80% or more to mark the module complete. Your progress is saved only in this browser.

1. In the message line PID|1||MRN44871^^^CITYHOSP^MR||Novak^Mira, what is PID-5?
2. What does the trigger event in ADT^A04 tell a receiving system?
3. Which request returns Mira's creatinine results?
4. Two systems exchange a valid ORU message, but the sender codes creatinine with a local code CRE and the receiver cannot recognise it. Which kind of interoperability failed?
5. A hospital has 12 systems that must all exchange data. Roughly how many interfaces does point-to-point integration need, compared with routing through an interface engine?
6. Why is HL7 v2 still so widely used inside hospitals, despite FHIR?
0 of 6 answered

Sources

  1. HL7 FHIR Release 4 specification
  2. HL7 FHIR R4: Search
  3. HL7 Version 2 product suite
  4. Mandel JC, Kreda DA, Mandl KD, Kohane IS, Ramoni RB. SMART on FHIR: a standards-based, interoperable apps platform for electronic health records. J Am Med Inform Assoc. 2016;23(5):899-908.
  5. Benson T, Grieve G. Principles of Health Interoperability: FHIR, HL7 and SNOMED CT. 4th ed. Springer; 2021.
  6. US Office of the National Coordinator for Health IT: 21st Century Cures Act final rule
  7. US Government Accountability Office. Electronic Health Records: Outcome-Oriented Metrics and Goals Needed to Gauge DOD's and VA's Progress in Achieving Interoperability. GAO-15-530; 2015. Citation details to be verified by a reviewer.