Thalix Health

Interoperability

HL7 merge messages: A18, A34, A40 and why merges are risky

Short answer

HL7 v2 merge events tell other systems that two patient identifiers belong to one person. A40 (merge patient: patient identifier list) is the current one: the surviving identifier is in the PID segment and the one being retired in the MRG segment. The older merge events A18, A30, A34, A35, A36 and A39 are marked deprecated in HL7 table 0003. A24 and A37 link and unlink records without merging, and A43 to A45 move information between records.

Sources checked November 2026 · General information, not legal, regulatory or clinical safety advice

Illustration of the Thalix audit view: a verified hash chain, entries by people, agents and workflows, and the policy that hid a patient's name from a porter
Audit — every read and action, by people, agents and workflows, in a hash-chained log. Pick an entry and the kernel names the rules it applied, such as why a porter saw the bed but not the patient. Illustration with synthetic data.

The merge, link and move family

EventHL7 nameStatus
A18Merge patient informationDeprecated
A30Merge person informationDeprecated
A34Merge patient information: patient ID onlyDeprecated
A35Merge patient information: account number onlyDeprecated
A36Merge patient information: patient ID and account numberDeprecated
A39Merge person: patient IDDeprecated
A40Merge patient: patient identifier listActive
A41 / A42Merge account / merge visitActive
A24 / A37Link / unlink patient informationActive
A43 / A44 / A45Move patient / account / visit informationActive
A47 / A49 / A50Change patient identifier list / account number / visit numberActive

With the older patient-level merges deprecated, A40 is the active one. An A40 message carries the identifier that survives in the PID segment and the prior identifier in the MRG segment; each receiver then has to re-point what it holds under the old identifier to the surviving one.

Merge versus link

A merge says "these are the same person; keep one record". A link (A24) says "these records relate to the same person" while keeping both, and A37 undoes a link. FHIR draws the same line. Its Patient resource uses link with types replaced-by and replaces for duplicates, refer for a pointer to a master index record, and seealso for separate systems' records of the same person, which it says aren't duplicates. FHIR deliberately doesn't specify merge behaviour: servers may migrate data on a merge but aren't required to, and HL7 notes that what linking, merging and unlinking should do to searches and other operations is still being worked out.

Why merges are risky

  • A wrong merge mixes two people's records. Results, allergies and alerts from one patient appear on another's.
  • A missed merge splits one person's record. HL7's Patient page warns that not checking for a potential link can mean related clinical records aren't found, potentially affecting patient safety.
  • Merges don't travel by themselves. Each downstream system has to act on the event. If one ignores it, systems disagree about who is who.
  • Unmerging is hard. Once records have been combined and new data filed against the survivor, separating them again needs to know which item came from where.
  • Order matters. A result filed against the old identifier after the merge has already been processed has to be re-pointed too.

Nationally, NHS England's Personal Demographics Service has a National Back Office that resolves duplicate records and confusion cases; local systems still have to follow the merges their own PAS makes.

Handling merges safely downstream

  • Treat merges as a reviewed, audited event, not a silent update.
  • Keep the history: which identifiers were combined, when, by whom and why, so a merge can be investigated or reversed.
  • Re-point late-arriving messages filed under a retired identifier.
  • Flag deprecated merge events from older interfaces rather than dropping them.

What it does not mean

  • A40 doesn't merge visits or accounts. A41 and A42 do that; A40 is about patient identifiers.
  • A link isn't a merge. A24 keeps both records and says they relate.
  • A merge in the PAS isn't a merge everywhere. It only reaches systems that process the event.

Where Thalix fits

Thalix receives A40, and the deprecated A34–A36 and A39, as a patient.merged event carrying the surviving patient with a replaces link to the MRG identifiers. It doesn't apply the merge to its identity index automatically: an administrator reviews it and applies it with an explicit, audited API call that records who merged what and why. After a merge, every object of the retired patient is re-pointed to the survivor, and events filed under the old id are judged as the survivor's. Identifiers that already belong to different patients raise a conflict for a person to review instead of being merged on a guess.

Thalix is at pilot stage. Demos run on synthetic data, and a hospital deployment needs its own clinical safety case, information governance approval and security review. We don't claim any certification or assessment result the product doesn't have.

Thalix walkthrough video poster See Thalix workingA three-minute walkthrough on synthetic data: the console, agents, workflows and the audit trail →

Questions people ask

What is an HL7 A40 message?

A40 is "merge patient: patient identifier list". It tells receiving systems that the identifier in the MRG segment should be merged into the surviving identifier in the PID segment.

Is HL7 A18 still used?

HL7 table 0003 marks A18 (merge patient information) as deprecated, along with A30, A34, A35, A36 and A39. Older interfaces may still send them, so receivers should handle or flag them.

What is the difference between A34 and A40?

A34 is the older "merge patient information: patient ID only" event, now deprecated. A40 merges using the patient identifier list and is the active event.

Sources

Each source below is an official page, read and checked in November 2026. Where a page and this guide differ, the official page wins.

General information only, written for hospital digital, IT, operations and clinical safety teams. It isn't legal, regulatory, information governance or clinical safety advice, and it doesn't replace your own organisation's processes or the official guidance linked above.

Thalix Health

See Thalix on a demo hospital.

A conversation with us is 45 minutes and free: the work you want to hand to agents, the systems involved, and where Thalix would and wouldn't fit. Demos run on synthetic patients.