Skip to content
Vestcodes
All insights

Integration

HL7 v2 vs FHIR: integrating Indian hospital systems

HL7 v2 vs FHIR for Indian hospitals: how ADT, ORM and ORU messages work, where FHIR R4 fits, and integration patterns that link HMIS, LIS and EMR.

Author
Vestcodes team
Published
On this page

A modern Indian hospital runs several systems that have to agree on who the patient is: an HMIS for registration and billing, a LIS for the lab, an EMR for clinical notes, and often a RIS or PACS for imaging. HL7 v2 and FHIR are the two standards that get asked about when these systems must talk. This article compares HL7 v2 vs FHIR for Indian hospitals, explains the three v2 messages you will meet first (ADT, ORM and ORU), and sets out integration patterns that work in practice.

Two standards, two jobs

HL7 v2 is HL7's first information exchange standard. HL7's comparison with FHIR calls it one of its most widely adopted and notes how prominent it is in in-patient settings worldwide. Messages are built from segments, sent when an event happens, and usually travel between systems on the same network.

FHIR (Fast Healthcare Interoperability Resources) models health data as resources such as Patient, Encounter, Observation and DiagnosticReport, with a REST API. The current widely used release is R4, version 4.0.1, described by HL7 as mixed normative and trial-use content.

Two Indian reference points show where each sits:

So a hospital often has v2 on the inside and FHIR on the edge facing ABDM, patient apps and partners.

HL7 v2 in five minutes

A v2 message is plain text. Each line is a segment, named by three letters, with fields split by a pipe. The first segment, MSH, is the header, and its MSH-9 field names the message type and trigger event, such as ADT^A01 or ORU^R01. Over a network, v2 usually rides on MLLP, a thin framing in which the message is wrapped between a start byte (0x0B) and an end byte (0x1C) followed by a carriage return (0x0D), as in HL7's MLLP transport specification. The receiver answers with an ACK message.

ADT: patient administration

ADT messages tell other systems what happened to a patient's registration or visit. From the v2.5 patient administration chapter:

  • A01 admit or visit notification: the stay begins, with the patient assigned a bed.
  • A03 discharge or end of visit.
  • A04 register a patient who is not admitted, such as an emergency visitor.
  • A08 update patient information, for example a changed address or name.

The structure of an admit message is MSH, EVN (event), PID (patient identification) and PV1 (patient visit), with optional segments for next of kin and others. In an Indian hospital, the HMIS is usually the source of ADT, and the LIS, EMR and RIS are the receivers that need the patient and visit before they can accept an order.

ORM: orders

ORM^O01 is the classic general order message. It deserves a caution: the v2.5 ordering chapter marks it as left for backward compatibility only and recommends the OMG, OML, OMD, OMS, OMN, OMI and OMP triggers for new work. Many hospital interfaces still run ORM, so the practical rule is to ask which message the system at the other end actually supports. A lab order from HMIS to LIS commonly goes as an order message with ORC (order control) and OBR (observation request) segments.

ORU: results

ORU^R01 is the unsolicited observation message. The v2.5 observation reporting chapter describes it as the message for sending results such as lab values to other systems. It carries PID, optionally PV1 and ORC, then an OBR as the report header, and one OBX per result. Here is a synthetic example, with invented data, of a haemoglobin result:

MSH|^~\&|LIS|HOSPITAL_A|HMIS|HOSPITAL_A|20261129101500+0530||ORU^R01^ORU_R01|MSG00042|P|2.5
PID|1||UHID10045^^^HOSPITAL_A^MR||Test^Patient||19900101|F
OBR|1|ORD123|LAB456|718-7^Hemoglobin^LN
OBX|1|NM|718-7^Hemoglobin^LN||11.2|g/dL|12.0-15.5|L|||F

Read it top to bottom: who sent it, which patient, which order and which test, then the value, unit, reference range, an abnormal flag and a final status. Coded tests in a result should use a terminology both sides share, and India's EHR Standards name LOINC for tests and observations and SNOMED CT as the primary clinical terminology.

How FHIR R4 does the same work

FHIR replaces the pipe-delimited message with resources and a REST API. HL7's RESTful API page defines the core interactions your integration will use:

  • read: fetch one resource by its ID
  • search: query a resource type with parameters, which returns a Bundle of type searchset
  • create and update: POST and PUT, with a 201 Created response and a Location header on create
  • transaction and batch: one POST of a Bundle; a transaction succeeds or fails as a whole, and a batch treats entries separately
GET  [base]/Patient/12345
GET  [base]/Observation?patient=12345&code=718-7
POST [base]/Observation
POST [base]   (a Bundle of type transaction)

Payloads are JSON (application/fhir+json) or XML. HL7 also defines event-based FHIR messaging, similar to v2, and documents.

A typical map from the v2 messages above to FHIR resources looks like this. Treat it as a starting point:

v2 messageTypical FHIR resourcesNote
ADT (A01, A03, A04, A08)Patient, EncounterEvents become create or update of the same resources
ORM or OMG/OMLServiceRequestOrder status changes update the request
ORU^R01DiagnosticReport, Observation, SpecimenOne OBR maps to a report, each OBX to an observation

The ABDM guide includes profiles for Patient, Encounter, ServiceRequest, Observation, Specimen and lab diagnostic reports, among others, plus document types such as DiagnosticReportRecord and DischargeSummaryRecord. HL7's v2 to FHIR implementation guide provides concept maps from v2 to R4, and is at trial-use level. HL7's comparison page is candid about the limits: mappings vary by implementation, so they generally have to be done case by case, and unsupported elements need extensions.

Side by side

QuestionHL7 v2FHIR R4
Shape of dataSegments in a delimited messageResources in JSON or XML
Typical transportMLLP over TCP inside a networkHTTPS REST API
PatternEvent pushed when something happensRequest and response, plus messaging and documents
Extending itZ-segments, opaque without a manualExtensions with discoverable URIs
UpdatesUsually full snapshots, or action codesSnapshots by default, with a Patch operation
India contextListed in national EHR Standards (v2.8.2)Basis of ABDM's implementation guide

Where each still fits

Keep HL7 v2 when the HMIS, LIS or an instrument interface already speaks it and works. Rewriting a stable ADT feed to FHIR buys little and adds risk. v2 is also at home for real-time, one-way event feeds inside one hospital network.

Use FHIR R4 when you are exposing data to anything outside the building: a patient app, a partner, a state programme or ABDM. FHIR also suits new web and mobile products, where REST and JSON are what developers expect.

Use both when the hospital has legacy v2 systems and an ABDM obligation. This is the common case in India, and it is why an integration layer in the middle matters.

Integration patterns that work

  1. Interface engine as the hub. Every system connects once to the engine, which routes, transforms and logs. Point-to-point links between HMIS, LIS, EMR and RIS multiply quickly and are hard to change.
  2. A FHIR facade over v2 sources. The engine receives v2, converts to FHIR resources and serves them through an API. Apps and ABDM adapters talk only to the facade, so the legacy side can change without breaking them.
  3. One master patient identity. ADT is the natural place to create and update it. Map the hospital's UHID or MRN to the ABHA details described in ABHA number vs ABHA address, and handle merges explicitly. v2 has merge events, and FHIR needs a deliberate approach.
  4. ABDM export from the same record. Build the FHIR document bundles for health information exchange from the facade rather than a second extract; see ABDM integration: M1, M2 and M3 and the sandbox to production path. Facility and clinician identity ties to HFR and HPR.
  5. Terminology in one place. Keep a mapping table from local test and drug codes to LOINC, SNOMED CT or whatever the receiving profile asks for, owned by clinical informatics rather than buried in code.

Practical traps

  • Local dialects. Every v2 sender has quirks, from Z-segments to field use that differs from the standard. Collect sample messages from each system before design.
  • Time zones. A v2 timestamp without an offset is ambiguous. Agree that senders include one, such as +0530 for India.
  • Character sets. Patient names in Hindi or other scripts need agreed encoding on both sides.
  • Ordering and duplicates. An update can arrive before the admit, or twice. Make handlers idempotent and keep a dead-letter queue for messages that fail.
  • Acknowledgement discipline. Do not ACK a message until you have stored it. A false success is worse than a retry.
  • Medical device status. CDSCO's guidance treats information systems that only store and transfer data as outside the device rules, but adds that extra functions such as real-time monitoring can change that. See software as a medical device in India.
  • Personal data. Interface logs hold patient data. Mask them and set retention, as the DPDP Act and Rules expect of security and logging.

How Vestcodes helps

We build HMIS, LIS and EMR integration: interface engines, v2 and FHIR adapters, and test harnesses with synthetic messages. If you have a system that nobody wants to touch, contact us and bring a sample message.

Sources

Questions

Is HL7 v2 still used in Indian hospitals?

Yes. HL7 describes v2 as one of its most widely adopted standards, especially in in-patient settings, and India's EHR Standards list HL7 v2.8.2 for event and message exchange. ABDM's own exchange uses FHIR R4.

What do ADT, ORM and ORU messages do?

ADT messages announce patient administration events such as admit, discharge, register and update. ORM was the general order message, and ORU^R01 sends observation results such as lab values back to the requesting system.

Should a new hospital integration use HL7 v2 or FHIR?

It depends on the systems at each end. Use v2 where an existing HMIS, LIS or analyser interface already speaks it. Use FHIR R4 for new APIs, mobile apps and ABDM health record exchange, and expect to run both.

Does ABDM require HL7 v2?

No. ABDM's published implementation guide from NRCeS is based on FHIR R4. HL7 v2 matters only inside your own hospital interfaces.

Building something in healthcare?

Tell us what you need and which systems it has to work with.

Let's talk