MajwareMAJWARE
ADT
^A40
Patient Administration4 required / 1 optional segments

ADT^A40Merge Patient - Patient Identifier List

Sent to merge two patient records. The surviving patient (in PID.3) absorbs the information from the prior patient (in MRG.1). All clinical data associated with the prior patient identifier should be reassigned to the surviving patient.

When Is This Sent?

When a duplicate patient record is identified and needs to be merged into the correct record. This is the standard merge message in HL7 2.3.1 and later, replacing the deprecated A18 and A34.

Real-World Usage

Patient merges are one of the most high-risk operations in healthcare IT. A failed or partial merge can result in split patient records — some clinical data under one MRN, other data under another. Every downstream system that stores patient data must handle A40 messages. Test merge scenarios thoroughly, including reversals if the merge was done in error.

Message Structure

Segment names link to their field-level reference pages.

#SegmentPurpose in this messageReqRepeat
1MSHMessage header with ADT^A40 in MSH.9R
2EVNEvent type with A40 triggerR
3PIDThe surviving patient record — demographics and identifiers that will persistR
4MRGThe prior patient identifier(s) being merged into the surviving record (MRG.1)R
5PV1Visit information if this is an encounter-specific mergeO

Example Message

Realistic example with fake patient data. Paste into the HL7 Message Viewer to explore interactively.

HL7 v2.x Message
1MSH||^~\&|EPIC|HOSPITAL_A|MIRTH_PROD|PACS|20260312100000||ADT^A40^ADT_A40|MSG00025|P|2.5.1
2EVN||A40|20260312100000
3PID||1||123456^^^HOSP_A^MR||Smith^John^M^^Mr.||19850315|M
4MRG||999999^^^HOSP_A^MR

Troubleshooting Scenarios

Merge creates duplicate records instead of merging

Cause

MRG.1 identifier format doesn't match how the receiving system stores the old patient's MRN. Assigning authority or ID type mismatch is the most common cause.

Fix

Compare MRG.1 format against how the receiving system stores patient identifiers. Check: (1) assigning authority matches exactly, (2) ID type code (MR) matches, (3) no leading/trailing spaces.

Only some downstream systems process the merge

Cause

A40 isn't being distributed to all downstream systems. The merge occurs in PACS but not in the pharmacy system.

Fix

Verify A40 is included in the distribution list for every downstream system that stores patient identifiers. Create a merge event checklist and test each system.

Common Confusions

ADT^A40 (Merge patient identifier list) vs ADT^A34 (Merge patient - patient ID only) vs ADT^A44 (Move account). A40 is the standard modern merge — use this. A34 is an older version that only merges patient IDs. A44 moves an account/encounter from one patient to another without merging the patient records themselves.

Related Message Types

Segment Reference

Paste this message into our viewer

Interactive HL7 parser. Decodes every field, validates structure, highlights errors. Free, no signup.

Open HL7 Message Viewer →

Need mapping templates?

The HL7 Integration Toolkit includes field mapping worksheets and interface spec templates for every major HL7 message type including ADT^A40.

View HL7 Integration Toolkit →
← Back to HL7 Message Types Reference