ADT^A17 — Swap Patients
Two patients swap beds simultaneously: A17 is an atomic message with TWO PID/PV1 pairs, guaranteeing a coherent swap on the receiving side.
Purpose
Specific case: two hospitalised patients swap beds without an intermediate transfer (for example, family proximity, isolation, post-COVID/flu grouping). Two separate A02 messages do not suffice: there would be an instant during which both patients occupy the same bed (PV1-3 collision).
A17 resolves this by transmitting both new assignments in the same message. PID/PV1 are repeated twice: PID-1 = first occurrence, PV1-1 = first occurrence, then a second PID and PV1 for the second patient. The PV1-3 fields reflect the new destinations.
Segment structure
Structure ADT_A17: MSH, EVN, then (PID, PV1) ×2.
Real-world example
DOE John (room 205A) and ROY Marie (room 210B) swap their beds:
MSH|^~\&|HIS|HOSP01|EHR|CLINIC02|20260516143000||ADT^A17^ADT_A17|MSG00017001|P|2.5.1|||AL|NE
EVN|A17|20260516143000|||DRJONES^Jones^Sarah^^^DR.
PID|1||MRN567890^^^HOSP^MR||DOE^JOHN^A^^MR.||19720515|M
PV1|1|I|MED^205^A^HOSP01|EM|||DRSMITH^Smith^James^A^^DR.|||MED|||1|||DRSMITH|ADM|||||||||||||||||||HOSP01|||||20260514102530
PID|2||MRN445566^^^HOSP^MR||ROY^MARIE^^^MS.||19850320|F
PV1|2|I|MED^210^B^HOSP01|EM|||DRBROWN^Brown^Henry^^^DR.|||MED|||1|||DRBROWN|ADM|||||||||||||||||||HOSP01|||||20260515093000 Acknowledgment (ACK)
MSH|^~\&|EHR|CLINIC02|HIS|HOSP01|20260516143001||ACK^A17^ACK|ACK00017001|P|2.5.1
MSA|AA|MSG00017001 Common errors
- Only one PID/PV1 pair: invalid message. A17 requires exactly two occurrences.
- PV1-3 missing on 2nd pair: receiver does not know where to place the second patient.
- Emitting two A02 instead of one A17: transient PV1-3 collision; some EHRs reject.
Related ADT events
| Code | Trigger event | Description |
|---|---|---|
| A02 | Transfer a Patient | Simple transfer. |
| A12 | Cancel Transfer | Cancellation of A02. |
| A17 | Swap Patients | This page. |
See also: ADT^A02.