What Is HL7 v2 MRG-5? Prior Patient ID, Explained for Testers
MRG-5 looks like it should hold the same thing as MRG-1, and in older feeds sometimes it's the only one populated — which is exactly why it can't be safely ignored.
MRG-5 is a legacy identifier field carried in the MRG segment mainly for backward compatibility with older HL7 v2 implementations that predated the repeating identifier structure now used in MRG-1. Newer interfaces are expected to read MRG-1 instead, but some sending systems — particularly ones running interface engines configured years ago — still populate MRG-5 and leave MRG-1 sparse or empty.
What this field contains
Example
This synthetic example leaves MRG-5 blank, reflecting the modern pattern where MRG-1 alone carries the retiring identifier.
Where this trips people up
Integrations built exclusively against modern feeds sometimes skip MRG-5 entirely, on the assumption that MRG-1 always carries the retiring ID. That assumption fails the first time a merge message arrives from an older interface engine that still only populates MRG-5. The safer pattern is to check MRG-1 first and fall back to MRG-5 when MRG-1 is empty, and test fixtures should include a message that exercises exactly that fallback case.