HL7 Integration Solutions — Taction Software
Home/Blog/HL7 ADT A12 Message
HL7 MessagingADT · A12 Cancel Transfer

HL7 ADT A12 Message: Cancel Transfer, Structure, Segments & Examples

By Taction Software·October 12, 2026·16 min read
750+
HL7 integrations delivered
12+
Years in healthcare IT
30+
EHR platforms integrated
100%
HIPAA-compliant delivery

The HL7 A12 message is an Admit, Discharge, Transfer (ADT) notification used to cancel a previously recorded patient transfer. Also known as ADT A12 or Cancel Transfer, this HL7 Version 2 event helps EHRs, hospital administration systems, bed management platforms, and connected clinical applications correct patient location information when an earlier transfer is reversed. Unlike a new transfer notification, A12 communicates that a previously recorded transfer should be canceled. This guide explains the HL7 ADT A12 message structure, PV1 and PV2 fields, practical HL7 examples, Mirth Connect JavaScript, acknowledgment handling, and troubleshooting.

What Is an HL7 ADT A12 Message?

An HL7 ADT A12 message communicates cancellation of a previously recorded patient transfer. It belongs to the HL7 v2 patient administration message family and is used when an earlier transfer notification must be reversed. Receiving applications use A12 to correct encounter location and transfer-related information according to their supported workflows. The event differs from a new transfer because it does not represent another movement to a different location. Understanding A12 alongside other HL7 ADT messages helps integration teams maintain accurate patient locations and prevent inconsistent bed management information.

Purpose of the HL7 A12 Event

The A12 event communicates that an earlier transfer notification has been canceled. Receiving systems use it to reverse or correct the associated transfer information without creating another transfer event.

When Is an ADT A12 Message Generated?

An A12 notification may be generated when a transfer was entered incorrectly, canceled administratively, or requires reversal. The specific conditions depend on hospital workflows and application configuration.

Which Healthcare Systems Receive A12 Messages?

EHRs, bed management platforms, laboratory systems, pharmacy applications, and hospital information systems may receive A12 notifications. Each destination processes the cancellation according to its encounter and location management requirements.

How A12 Supports Patient Location Accuracy

A12 helps connected applications correct the effects of an earlier transfer. Accurate visit matching and location handling prevent canceled movements from leaving inconsistent patient location information.

Why Accurate A12 Processing Matters

Incorrect A12 processing can restore the wrong location, affect bed availability, or create inconsistent transfer histories. Reliable integration requires accurate encounter identification, cancellation rules, and event sequencing.

HL7 ADT A12 Message Structure and Segments

An HL7 ADT A12 message follows the segment-based format defined by HL7 Version 2. Common segments include MSH, EVN, PID, and PV1, with additional segments depending on the interface profile. MSH identifies the sender, receiver, message type, and version. EVN records event information, PID identifies the patient, and PV1 communicates visit and location details. PV1-3 contains the assigned patient location, while PV1-6 can contain the prior patient location. In HL7 v2.5, A12 uses the ADT_A12 message structure. Developers should validate actual segment requirements against the applicable interface specification.

MSH Segment: Message Header

MSH identifies the sending and receiving applications, message timestamp, control identifier, and HL7 version. MSH-9 identifies the A12 cancellation event and ADT_A12 message structure.

EVN Segment: Event Information

EVN records metadata about the canceled transfer, including the event timestamp. Receiving applications may use this information for auditing and investigating delayed cancellation notifications.

PID Segment: Patient Identification

PID contains patient identifiers and demographic information. Receiving systems use these values to locate the correct patient before modifying transfer-related encounter information.

PV1 Segment: Patient Visit Information

PV1 provides encounter and location information. PV1-3 identifies the assigned patient location, PV1-6 can communicate the prior location, and PV1-19 identifies the visit.

Optional Segments in A12 Messages

Additional segments may contain supplementary visit or clinical information, depending on the HL7 version and implementation profile. Receiving systems should follow documented requirements for optional data.

HL7 ADT A12 Message Example With Field Explanation

The following HL7 ADT A12 example illustrates cancellation of a fictional patient's previously recorded transfer. The message uses HL7 v2.5 conventions and includes event metadata, patient identification, and visit location information. MSH-9 identifies the cancellation as ADT^A12^ADT_A12. PID-3 identifies the patient, PV1-3 contains the assigned location after cancellation, and PV1-19 identifies the encounter. PV1-6 can provide prior location context. This example is intended for technical learning and testing. Production implementations must follow the source and destination applications' interface specifications.

Complete HL7 ADT A12 Sample Message

MSH|^~\&|ADT_SYSTEM|HOSPITAL|EHR|MAIN|20261012180000||ADT^A12^ADT_A12|MSG12001|P|2.5
EVN|A12|20261012175500
PID|1||P456789^^^HOSPITAL^MR||WILSON^SARAH||19820125|F
PV1|1|I|WARD1^110^A|||WARD2^220^B|4321^LEE^ANNA||||||||||||V80001

All patient information is fictional. The sample assumes the canceled transfer had moved the patient from WARD1 to WARD2, and the cancellation restores the earlier assigned location.

Explore each segment and its key fields:

Illustrative ADT^A12 — HL7 v2.5 (fictional data)

Select a segment to see what it carries

MSH — Message Header

Required

MSH identifies ADT_SYSTEM as the sending application and EHR as the receiver. ADT^A12^ADT_A12 identifies the cancellation event and message structure, while MSG12001 supports message tracking.

FieldMeaningValue in this message
MSH-3Sending applicationADT_SYSTEM
MSH-5Receiving applicationEHR
MSH-7Message creation time20261012180000
MSH-9Message typeADT^A12^ADT_A12
MSH-10Message control IDMSG12001
MSH-12HL7 version2.5

MSH Segment Explained

MSH identifies ADT_SYSTEM as the sending application and EHR as the receiver. ADT^A12^ADT_A12 identifies the cancellation event and message structure, while MSG12001 supports message tracking.

EVN Segment Explained

EVN identifies A12 as the event and records the cancellation timestamp. Integration teams may use this information to investigate delayed notifications and transfer history discrepancies.

PID-3: Patient Identifier Explained

PID-3 identifies fictional patient Sarah Wilson through identifier P456789. Receiving applications should validate the identifier and assigning authority before modifying the patient's location information.

PV1-3: Assigned Patient Location Explained

PV1-3 identifies the assigned patient location. In this example, WARD1 represents the restored location after cancellation, subject to the agreed interface and application workflow.

PV1-6: Prior Patient Location Explained

PV1-6 contains prior location information when populated. Its interpretation during transfer cancellation should follow the sending system's interface specification and documented location reversal rules.

Important HL7 ADT A12 Fields and Mapping

Reliable HL7 A12 integration depends on accurate patient identification, visit matching, and location mapping. Important fields include MSH-9 for event identification, PID-3 for patient matching, PV1-3 for assigned location, PV1-6 for prior location context, and PV1-19 for visit identification. Receiving systems should determine the location to restore using the agreed cancellation workflow rather than assuming that any individual field always contains the correct historical location. Developers should document bed management behavior, location component mapping, and exception handling before implementing HL7 v2 integration.

FieldDescriptionExampleIntegration Purpose
MSH-3Sending ApplicationADT_SYSTEMIdentifies source
MSH-5Receiving ApplicationEHRIdentifies destination
MSH-9Message TypeADT^A12^ADT_A12Cancel transfer event
MSH-10Message Control IDMSG12001Message tracking
MSH-12Version ID2.5HL7 parsing
EVN-2Recorded Date/Time20261012175500Cancellation timestamp
PID-3Patient Identifier ListP456789Patient matching
PID-5Patient NameWILSON^SARAHDemographic context
PV1-2Patient ClassIVisit classification
PV1-3Assigned Patient LocationWARD1^110^AAssigned location
PV1-6Prior Patient LocationWARD2^220^BLocation context
PV1-19Visit NumberV80001Encounter matching

MSH-9: Identifying the Cancellation Event

MSH-9 identifies the A12 event. Integration engines use this field to apply transfer cancellation logic rather than new transfer, admission, discharge, or routine update processing.

PID-3: Matching the Correct Patient

PID-3 contains patient identifiers and assigning authorities. Receiving applications should use the complete identifier context to locate the correct patient before modifying transfer-related information.

PV1-3: Assigned Patient Location

PV1-3 contains the assigned patient location. Receiving systems should interpret its components according to the interface specification and avoid assuming the location is always identical to the original transfer destination.

PV1-6: Prior Patient Location

PV1-6 can contain prior patient location information. During A12 processing, its meaning should be confirmed against the sending application's cancellation rules and location history.

PV1-19: Encounter Identification

PV1-19 identifies the visit associated with the canceled transfer. Accurate encounter matching helps receiving applications reverse the correct movement without changing unrelated patient encounters.

How HL7 ADT A12 Messages Work in Healthcare Integration

An HL7 ADT A12 workflow begins when a healthcare organization cancels a previously recorded patient transfer. The source application generates an A12 notification containing patient identifiers, visit information, and location context. An integration engine receives the message, validates its structure, and routes it to connected systems. Receiving applications locate the affected encounter and apply the supported transfer cancellation behavior. This may involve restoring the previous location, correcting transfer history, or updating bed management information. Reliable processing requires accurate matching, acknowledgment handling, duplicate prevention, and monitoring to maintain consistent location data.

Step 1: Transfer Cancellation Is Recorded

The patient administration system records cancellation of an earlier transfer. The source application generates an A12 notification containing the patient and visit identifiers required by receiving systems.

Step 2: Message Validation

The integration engine validates the HL7 structure, A12 event, patient identifiers, and visit information. Invalid notifications should enter a controlled exception workflow instead of modifying locations.

Step 3: Identify the Original Transfer

Receiving applications locate the patient, encounter, and original transfer associated with the cancellation. Matching rules should prevent unrelated movements from being reversed.

Step 4: Apply Location Reversal Rules

The destination applies its supported cancellation workflow. This may restore the earlier assigned location, correct transfer history, or update related bed management records.

Step 5: Acknowledgment and Monitoring

The receiving application returns an acknowledgment under the configured HL7 processing mode. Integration teams monitor failures, delays, and reconciliation exceptions to maintain consistent patient location information.

How to Implement HL7 ADT A12 Messages Using Mirth Connect

Mirth Connect supports HL7 ADT A12 integration through configurable channels, filters, transformers, and destination connectors. Developers can receive cancellation notifications through MLLP, identify the A12 trigger event, extract patient and visit identifiers, and route the message to receiving applications. JavaScript transformers can validate required values and prepare destination-specific cancellation requests. Production implementations should also handle duplicate notifications, acknowledgments, and cases where the original transfer cannot be located. Organizations with complex interfaces can use Mirth Connect development services to support channel development and ongoing maintenance.

Configure an HL7 Source Connector

Create a Mirth Connect channel using an MLLP listener or another supported transport connector. Configure the expected HL7 version, network endpoint, security requirements, and message data type.

Filter ADT A12 Messages

Configure a source filter that checks MSH-9 and accepts the A12 event. This prevents unrelated admission, discharge, and transfer messages from entering cancellation processing.

Mirth Connect JavaScript filter:

var messageType = msg['MSH']['MSH.9']['MSH.9.1'].toString();
var triggerEvent = msg['MSH']['MSH.9']['MSH.9.2'].toString();

return messageType === 'ADT' && triggerEvent === 'A12';

Extract Patient and Location Information

Use a JavaScript transformer to extract the patient identifier, visit number, assigned location, and prior location. Validate required identifiers before forwarding the cancellation.

Mirth Connect JavaScript transformer:

var patientId =
    msg['PID']['PID.3']['PID.3.1'].toString();

var visitNumber =
    msg['PV1']['PV1.19']['PV1.19.1'].toString();

var assignedLocation =
    msg['PV1']['PV1.3']['PV1.3.1'].toString();

var assignedRoom =
    msg['PV1']['PV1.3']['PV1.3.2'].toString();

var priorLocation =
    msg['PV1']['PV1.6']['PV1.6.1'].toString();

var priorRoom =
    msg['PV1']['PV1.6']['PV1.6.2'].toString();

if (!patientId || !visitNumber) {
    throw new Error(
        'Missing patient identifier or visit number'
    );
}

channelMap.put('patientId', patientId);
channelMap.put('visitNumber', visitNumber);
channelMap.put('assignedLocation', assignedLocation);
channelMap.put('assignedRoom', assignedRoom);
channelMap.put('priorLocation', priorLocation);
channelMap.put('priorRoom', priorRoom);

The example assumes an HL7 v2 message parsed into Mirth Connect's XML representation. Production implementations should account for assigning authorities, repeated identifiers, and destination-specific location reversal rules.

Transform A12 Data for Destination Systems

Use a transformer to prepare the receiving application's cancellation payload. Preserve patient and visit identifiers and include location information required to reverse the correct transfer.

Example JSON transformation:

var cancellationData = {
    eventType: 'A12',
    action: 'cancelTransfer',
    patientId: channelMap.get('patientId'),
    visitNumber: channelMap.get('visitNumber'),
    assignedLocation: {
        unit: channelMap.get('assignedLocation'),
        room: channelMap.get('assignedRoom')
    },
    priorLocation: {
        unit: channelMap.get('priorLocation'),
        room: channelMap.get('priorRoom')
    }
};

var jsonPayload = JSON.stringify(cancellationData);

channelMap.put('jsonPayload', jsonPayload);

The JSON structure is illustrative. The receiving application must define how to identify the original transfer and determine the correct location after cancellation.

Test and Monitor A12 Processing

Test valid cancellations, missing original transfers, incorrect locations, duplicate messages, and destination failures. Monitor acknowledgments and reconciliation exceptions to detect incomplete transfer reversals.

HL7 ADT A12 ACK Message Examples and Error Handling

HL7 acknowledgment messages help sending applications determine whether A12 cancellation notifications were accepted or rejected under the configured acknowledgment mode. An ACK response includes an acknowledgment code and the original message control identifier. Common application acknowledgment codes include AA for acceptance, AE for application error, and AR for rejection. These responses support message tracking and controlled recovery. However, successful acknowledgment does not always confirm completion of every downstream location update. Integration teams should document acknowledgment semantics, retry behavior, and reconciliation procedures to prevent inconsistent transfer records.

Successful ACK Response: AA

An AA acknowledgment indicates application-level acceptance under the configured acknowledgment mode. MSA-2 contains the original A12 message control identifier for correlation.

MSH|^~\&|EHR|MAIN|ADT_SYSTEM|HOSPITAL|20261012180001||ACK^A12^ACK|ACK12001|P|2.5
MSA|AA|MSG12001

Application Error Response: AE

An AE acknowledgment indicates an application error during cancellation processing. Additional error information may identify missing transfers, invalid identifiers, or unsupported location values.

MSH|^~\&|EHR|MAIN|ADT_SYSTEM|HOSPITAL|20261012180002||ACK^A12^ACK|ACK12002|P|2.5
MSA|AE|MSG12001
ERR|||204^Unknown Key Identifier^HL70357|E

Application Rejection Response: AR

An AR acknowledgment indicates that the receiving application rejected the cancellation notification. The sender should investigate the rejection before correcting or retransmitting the message.

MSH|^~\&|EHR|MAIN|ADT_SYSTEM|HOSPITAL|20261012180003||ACK^A12^ACK|ACK12003|P|2.5
MSA|AR|MSG12001

How to Correlate ACK Responses

MSA-2 identifies the A12 message being acknowledged. Sending applications use this value to associate the response with the correct cancellation notification and support reliable message tracking.

How to Handle Failed Acknowledgments

Failed acknowledgments require controlled recovery procedures. Integration teams should distinguish temporary transport failures from validation errors and prevent retries from repeatedly reversing the same transfer.

Common HL7 ADT A12 Integration Errors and Troubleshooting

HL7 A12 integration problems commonly involve incorrect location restoration, missing original transfers, duplicate cancellations, and out-of-sequence messages. These issues can affect patient tracking, bed management, clinical workflows, and downstream administrative applications. Vendor-specific cancellation rules may introduce additional validation failures. Troubleshooting should begin with the original A02 transfer notification, the A12 message, acknowledgment responses, and destination location history. A documented HL7 parsing and data mapping process helps teams identify inconsistencies and improve cancellation reliability.

Original Transfer Cannot Be Found

A receiving application may reject A12 when it cannot locate the original transfer. Validate patient and visit identifiers and investigate whether the earlier A02 notification was received.

Incorrect Location Is Restored

Incorrect mapping of PV1-3 or PV1-6 can restore the wrong location. Validate the original transfer history and destination-specific cancellation rules before applying the reversal.

Duplicate A12 Notifications

Repeated cancellation notifications can cause errors when the original transfer has already been reversed. Implement idempotent processing and track previously handled cancellation events.

Out-of-Sequence Transfer Messages

An A12 message may arrive before its corresponding A02 notification due to interface delays. Establish reconciliation rules for cancellations received before the original transfer.

Failed ACK and Message Delivery

Network interruptions and destination validation failures can prevent successful processing. Review acknowledgment codes, transport logs, and retry configuration before safely replaying cancellation messages.

HL7 ADT A12 vs A02, A11, A13, and A08

HL7 ADT trigger events represent different patient administration activities. A12 cancels a previously recorded transfer, while A02 communicates a new transfer. A11 cancels an admission, A13 cancels a discharge, and A08 communicates updates to existing patient information. Although these events may share patient and visit segments, their workflow meanings differ. Receiving applications should distinguish cancellation events from routine updates to avoid incorrect patient locations, encounter states, and downstream administrative records.

EventMeaningPrimary Action
A02Transfer a PatientRecord new location
A08Update Patient InformationUpdate existing information
A11Cancel Admit/Visit NotificationCancel earlier admission
A12Cancel TransferReverse earlier transfer
A13Cancel DischargeReverse earlier discharge

A12 vs A02: Transfer and Cancellation

A02 communicates a patient transfer, while A12 cancels an earlier transfer. Receiving systems should match the cancellation to the original movement rather than process it as another transfer.

A12 vs A11: Transfer and Admission Cancellation

A11 cancels an admission, while A12 cancels a transfer. Integration engines should identify the original event and apply the correct encounter or location reversal workflow.

A12 vs A13: Transfer and Discharge Cancellation

A13 cancels an earlier discharge, while A12 cancels a transfer. Receiving systems should distinguish these events to maintain accurate encounter histories and patient locations.

A12 vs A08: Cancellation and Information Updates

A08 communicates updates to existing patient information, while A12 reverses a previously recorded transfer. Receiving applications should use event-specific logic rather than treat cancellations as routine demographic updates.

Best Practices for Reliable HL7 A12 Integration

Reliable HL7 A12 integration depends on accurate transfer matching, consistent location mapping, and clear cancellation rules. Healthcare organizations should document how receiving applications identify and reverse canceled transfers, including the handling of duplicate and out-of-sequence notifications. Interface specifications should define required identifiers, location components, acknowledgment behavior, exception handling, and reconciliation procedures. Because A12 messages may contain protected health information, secure transport and controlled access are essential. Combining validation, monitoring, and auditing helps integration teams maintain accurate patient locations across connected healthcare systems.

Match Cancellations to the Original Transfer

Use patient and visit identifiers with available transfer history to identify the original movement. Investigate ambiguous matches before applying location changes.

Validate Assigned and Prior Locations

Document how PV1-3 and PV1-6 are populated during cancellation. Validate destination-specific mapping rules before restoring patient locations or updating bed management records.

Implement Idempotent Cancellation Processing

Ensure repeated A12 notifications do not repeatedly reverse the same transfer. Track processed events and apply controlled retry rules to prevent inconsistent location histories.

Secure Patient and Location Information

Protect HL7 message transmission, restrict interface access, and minimize sensitive information in operational logs. Apply appropriate healthcare privacy and security controls throughout processing.

Monitor Transfer Cancellation Failures

Track failed acknowledgments, unmatched transfers, incorrect location mappings, and processing delays. Establish alerts and reconciliation procedures to identify incomplete transfer reversals.

Frequently Asked Questions About HL7 ADT A12 Messages

HL7 A12 integration involves transfer cancellation, patient location correction, and encounter matching. Healthcare developers and IT teams often need to understand how A12 differs from a new transfer, which fields identify patient locations, and how receiving applications reverse earlier movements. The following questions address common implementation concerns using general HL7 v2 conventions. Actual processing requirements depend on the healthcare organization, HL7 version, vendor, and interface implementation guide.

What does A12 mean in HL7?

A12 is the HL7 v2 trigger event for Cancel Transfer. It communicates that a previously recorded patient transfer has been canceled. Receiving applications use the event to correct transfer-related encounter information and patient location according to their supported cancellation workflows.

What is the difference between HL7 A02 and A12?

A02 communicates a patient transfer, while A12 cancels an earlier transfer notification. A02 records a movement to another location, whereas A12 reverses or corrects the effects of a previously recorded movement. Receiving systems should match A12 to the correct transfer event.

Which HL7 fields contain patient location information?

PV1-3 contains the assigned patient location, while PV1-6 can contain prior patient location information. Receiving applications should interpret these fields according to the sending system's interface specification and the relevant cancellation workflow.

Does an HL7 A12 message restore the previous patient location?

An A12 message communicates cancellation of a previously recorded transfer. A receiving application may restore the earlier patient location or correct its transfer history. The exact behavior depends on destination capabilities, original transfer information, and agreed interface requirements.

Can Mirth Connect process HL7 A12 messages?

Yes. Mirth Connect can receive, validate, transform, and route HL7 ADT A12 notifications. Developers can configure event filters, extract patient and visit identifiers, map location fields, and deliver cancellation requests to connected applications. Production implementations should include acknowledgment handling, duplicate prevention, monitoring, and recovery procedures.

How do you troubleshoot a failed HL7 A12 message?

Check MSH-9 for the A12 event, PID-3 for patient identification, PV1-3 and PV1-6 for location information, and PV1-19 for visit matching. Review the original transfer, acknowledgment responses, and destination cancellation rules. Investigate incorrect locations, unmatched transfers, duplicates, and out-of-sequence notifications.

Need Help With HL7 ADT A12 Integration?

Reliable transfer cancellation messaging helps healthcare organizations maintain accurate patient locations across EHRs, hospital administration systems, bed management platforms, and connected clinical applications. Taction Software supports HL7 interface development, Mirth Connect configuration, location mapping, and production troubleshooting. Our engineers can help organizations implement controlled transfer cancellation workflows, prevent duplicate processing, and establish dependable acknowledgment and recovery procedures. Whether an organization is developing a new interface or improving existing HL7 channels, careful validation and monitoring support consistent patient location information across connected healthcare systems.

Custom HL7 Transfer Cancellation Interfaces

We develop HL7 A12 interfaces based on source and destination requirements. Implementation includes encounter identification, location mapping, message validation, routing, and acknowledgment handling.

Mirth Connect Channel Development

Our engineers configure Mirth Connect channels to receive, filter, transform, and deliver transfer cancellation notifications. We address destination connectivity, field mapping, and error handling during implementation.

Patient Location and Transfer Mapping

We help organizations improve transfer cancellation processing through patient identifier validation, visit matching, and location mapping. These controls support accurate reversal of earlier transfer notifications.

Production Monitoring and Support

We support HL7 interfaces through monitoring, failure alerts, mapping updates, and recovery procedures. These services help maintain dependable transfer cancellation messaging as connected healthcare applications evolve.

Need help with HL7 transfer cancellation integration? Explore our HL7 interface messaging services to discuss your requirements.

ShareLinkedInXEmail

Need an HL7 ADT A12 Interface Built or Fixed?

Tell us your ADT system, receiving applications, HL7 version, and transport method. Our engineers will scope transfer matching, location reversal rules, Mirth Connect channels, acknowledgments, and monitoring for your transfer cancellation workflow.

  • Free 30-minute technical consultation
  • A12 mapping and ACK review
  • NDA available upon request
  • Response within 24 hours

Talk to an HL7 Expert

Share your ADT^A12 interface requirements and our team will respond within 24 hours.

Loading verification…