MajwareMAJWARE
ADT
^A17
ADT5 required / 1 optional segments

ADT^A17Swap Patients

Sent when two patients exchange beds or locations simultaneously. A17 carries information for both patients in a single message — it is one of the few ADT messages that contains PID and PV1 segments for two patients.

When Is This Sent?

When two patients are swapped between beds or rooms — for example, to move a patient closer to the nursing station while simultaneously filling the vacated bed. Both patients' location records must update atomically.

Real-World Usage

A17 is an unusual message type with a non-standard structure — it contains two sets of PID and PV1 segments. Many interface engines and downstream systems do not fully support A17. In practice, some facilities instead send two sequential A02 (transfer) messages, one for each patient. If your downstream system cannot handle A17, implement a transformation that converts it into two A02 messages.

Message Structure

Segment names link to their field-level reference pages.

#SegmentPurpose in this messageReqRepeat
1MSHMessage header with ADT^A17 in MSH.9R
2EVNEvent type with A17 triggerR
3PIDDemographics for the first patientR
4PV1Visit and new location for the first patientR
5MRGIdentifier for the second patient being swappedR
6PD1Additional demographics for first patientO

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|BED_MGT|20260310170000||ADT^A17^ADT_A17|MSG00080|P|2.5.1
2EVN||A17|20260310170000
3PID||1||123456^^^HOSP_A^MR||Smith^John^M^^Mr.||19850315|M
4PV1||1|I|4A^202^1^^^HOSP_A||||1234^Ahmed^Dr.^Khalid|||MED|||||||||IP||||||||||||||||||||||||||20260310143000
5MRG||234567^^^HOSP_A^MR
6PID||2||234567^^^HOSP_A^MR||Johnson^Sarah^L||19920601|F
7PV1||2|I|4A^201^1^^^HOSP_A||||5678^Wilson^Dr.^Sarah|||MED|||||||||IP||||||||||||||||||||||||||20260310090000

Troubleshooting Scenarios

Only one patient's location is updated after a swap

Cause

The interface engine or downstream system only processes the first PID/PV1 pair in the A17 and ignores the second patient's segments.

Fix

If the downstream system cannot handle two patients in one A17, transform A17 into two separate A02 messages in the interface engine — one for each patient with their respective new locations.

Interface engine rejects A17 due to unexpected duplicate PID segments

Cause

The interface engine is configured to expect only one PID per message and flags A17 as malformed.

Fix

Configure the interface engine to allow multiple PID/PV1 segment groups for A17 messages. Most modern engines have a message definition setting for this. Alternatively, pre-process A17 into two A02 messages upstream.

Common Confusions

ADT^A17 (Swap Patients) vs two sequential ADT^A02 (Transfer) messages. A17 atomically swaps two patients and should be processed as a unit. Two A02 messages processed separately may leave a brief window where both patients are in the same location if the second A02 is delayed. Use A17 when atomicity matters; use two A02s when downstream systems can't handle A17.

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^A17.

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