HL7 ADT_A17 Swap Patients
ADT_A17 is used when two patients exchange beds. It is a rare event, but it is not complicated in concept: the message carries patient and visit data for both patients so receivers can update both locations as one coordinated change.
This is the kind of ADT event that deserves cautious handling. If only one side of the swap is applied, one patient can appear in two beds and the other can vanish from the board.
A small A17 example
What systems do with it
The sender is usually the PAS/EHR or bed management system. Receivers update bed boards, dietary routing, nurse station lists, medication delivery context, and any downstream application that keys active patient context from visit location.
Because the message represents one swap, receivers should process the two patient groups as a unit where possible. If one patient update succeeds and the other fails, the interface needs a clear operational alert.
How to read the structure
After MSH and EVN, the structure repeats the patient visit pattern twice: PID, optional PD1, PV1, optional PV2, and optional supporting segments. The first patient group and second patient group are both required in the local structure.
Implementation traps
Do not split A17 into two unrelated A02 updates unless your integration design intentionally does that and can recover cleanly. The safety problem is not syntax; it is preserving the pairwise nature of the bed exchange.
Reference notes
The HL7 v2+ ADT_A17 page describes A17 as an event where two patients exchange beds and the patient ID and visit data repeat for the two patients changing places.