Blog

    Mirth Connect ADT Message Processing: Event Filters, A08 and A40 Handling, Duplicate Suppression, ACK Timing and Destination Queues

    By GauravNovember 28, 20269 mins read
    On this page

    An ADT feed is usually the busiest interface a hospital runs, and the one that breaks the most downstream systems when it misbehaves. A single duplicated admit, a merge applied out of order or a slow destination that blocks the sender can leave a bed board, a billing system and a care management tool disagreeing about where a patient is.

    This post is for interface analysts and engineers building ADT channels in Mirth Connect. It walks through filtering by trigger event, transformer steps for A08 updates and A40 merges, duplicate suppression, when to acknowledge and how to queue each destination.

    What does ADT message processing in Mirth Connect involve?

    Building or fixing Mirth channels?

    Our Mirth Connect page covers the channel design, migration and support work we do for hospital interface teams.

    ADT message processing in Mirth Connect is a channel that receives admit, discharge, transfer and update messages, keeps only the trigger events its consumers need, drops duplicates, reshapes A08 and A40 messages for each destination, acknowledges the sender at the right moment and delivers through separate queues. Agnotic Technologies builds these channels for hospital interface teams.

    Each of those steps lives in a specific place in the channel: the source filter, the source transformer, the response settings or a destination. Putting a step in the wrong place is the root of most ADT channel problems.

    Which ADT events should a channel accept?

    A channel should accept only the trigger events at least one destination uses, and let the rest through with a positive acknowledgment and no further work. Filtering at the source keeps destination queues short and message storage smaller.

    HL7's v2 event type table (0003) defines A01 as admit or visit notification, A03 as discharge or end visit, A08 as update patient information and A40 as merge patient by patient identifier list, each listed as an ADT message answered by an ACK.

    • Source filter rule: read MSH-9.2, the trigger event, and accept a listed set such as A01, A02, A03, A04, A08, A11, A13 and A40.
    • Destination filters: narrow further per consumer, so the bed board takes transfers while billing ignores them.
    • Unknown events: log them with a counter instead of failing, so a new event type from the sender is noticed, not lost.

    Keep the accepted list in a code template or configuration map rather than inside each filter. When a consumer asks for A31 next year, there is one place to change.

    How do you suppress duplicate messages?

    Suppress duplicates by recording the message control ID from MSH-10, together with the sending application and facility, and rejecting any message whose key was already processed within a retention window. Senders resend when an acknowledgment is lost, so duplicates are normal, not rare.

    • Key: MSH-3, MSH-4 and MSH-10 together, because two senders can use the same control number.
    • Store: a small database table with a unique constraint, not an in-memory map that empties on restart.
    • Window: long enough to cover the sender's retry behavior, then pruned on a schedule.
    • Outcome: a duplicate still gets a positive ACK, so the sender stops retrying, but nothing is forwarded.

    Check the key in the source filter and write it only after the message is accepted. Writing it too early means a message that later fails in the transformer can never be resent.

    Transformer steps for A08 updates

    A08 messages carry the patient's current demographic and visit data, usually the whole PID and PV1 segments, not just the fields that changed. The transformer's job is to make each destination receive what it expects.

    • Normalize identifiers: pick the medical record number from PID-3 by its assigning authority, not by position in the repetition.
    • Respect HL7 nulls: a field sent as two double quotes means clear the value, while an empty field means no change.
    • Map codes once: patient class, location and attending provider translated in a shared code template.
    • Shape per destination: some consumers want a full replacement, others want only the changed fields.

    Never convert the two-quote null into an empty string in a shared step. Destinations that apply updates field by field will then keep stale data the hospital meant to remove.

    How should a channel handle A40 merges?

    A channel should treat an A40 merge as a high-risk event: validate it, deliver it in strict order, and send it only to systems that can apply it. The PID segment carries the surviving identifier, and the MRG segment carries the identifier being retired.

    • Validate: reject merges where the MRG identifier is missing or equals the surviving identifier, and alert a person.
    • Order: route merges through the same single-threaded destination queue as the updates for that system.
    • Capability: for a destination that cannot merge, raise a task for its administrators instead of sending the message.
    • Record: log both identifiers and the time, so an unmerge request can be traced.

    An A40 applied before an earlier A08 for the retired record can leave orphaned data on the wrong patient. Ordering matters more here than anywhere else in the feed.

    When should the channel send its ACK?

    The channel should acknowledge once the message is safely stored and accepted, not after every destination finishes. Waiting for destinations ties the sender's throughput to the slowest consumer.

    Mirth's source response settings let the channel generate the acknowledgment before processing, after the source transformer, or after destinations complete, or return a response built in a script. For ADT feeds with queued destinations, generating it after the source filter and transformer is usually the right balance.

    Decide what a filtered or duplicate message receives. A positive acknowledgment tells the sender the message was handled; an error code makes most senders retry the same message indefinitely.

    Per-destination queues

    Give every destination its own queue, so one slow or unavailable consumer never delays the others. The bed board should not wait because the analytics database is in maintenance.

    ADT message flow through a Mirth Connect channel: the hospital ADT sender sends over MLLP to the channel source, which filters by trigger event, suppresses duplicates on MSH-10 and acknowledges, then the transformer reshapes A08 and A40 messages and each destination receives messages from its own queue
    • Queue on failure or always: so the channel keeps accepting messages while a destination is down.
    • One thread per ordered destination: patient events must reach each system in the order they happened.
    • Retry limits and alerts: a destination failing for an hour should page someone, not retry silently.
    • Separate channels for heavy consumers: a destination that needs its own scaling can sit behind a channel writer.

    Under 42 CFR 482.24(d), a hospital whose electronic records system conforms to the content exchange standard at 45 CFR 170.205(d)(2) must send patient event notifications, with at least the patient, treating practitioner and sending institution names, at emergency registration, inpatient admission, and discharge or transfer.

    Event notifications to community providers are often one of these destinations. Treat that queue with the same ordering and alerting as clinical consumers, because a late discharge notice defeats its purpose.

    What goes wrong in ADT channels?

    Most ADT channel failures come from steps placed at the wrong stage or from assumptions about the sender. They tend to show up as data problems in downstream systems, days later.

    • Duplicate admits: no control ID check, so a resend after a network blip creates a second encounter.
    • Out-of-order merges: multi-threaded queues let an A40 overtake an earlier update.
    • Blocked sender: the ACK waits for all destinations, and the sender's queue backs up during a slow night.
    • Lost nulls: a shared transformer drops the two-quote null, so cleared fields never clear downstream.
    • Retry storms: filtered messages get an error ACK, and the sender keeps resending them.

    A worked example: a feed for bed management and billing

    A hospital sends one ADT feed to Mirth for three consumers: a bed management system, a billing system and a community event notification service. The source accepts A01, A02, A03, A04, A08, A11, A13 and A40 and drops the rest with a positive ACK.

    Duplicate checks use sending facility and control ID in a database table. The bed board destination takes transfers, discharges and cancellations; billing takes admits, updates and merges; the notification destination takes admits, discharges and transfers.

    Each destination has its own single-threaded queue. When billing goes down for an upgrade, its queue grows while bed management carries on, and the backlog drains in order when billing returns.

    Who owns what?

    ADT channels sit between the registration team, the interface team and every consumer. Each decision needs one owner.

    • Registration and HIM: correct merges and unmerges at the source, and the rules for which identifiers survive.
    • Interface team: the channel, filters, transformers, duplicate store, queues and alerts.
    • Each consumer's application team: the events and fields they need, and whether they can apply merges.
    • Infrastructure: database and server capacity for message storage and pruning.

    How do you test an ADT channel?

    Test an ADT channel with replayed real-shaped messages, deliberate duplicates, out-of-order sequences and destination outages. A channel that passes clean single messages may still fail on the second day of production.

    • Duplicates: send the same message twice and confirm one delivery and two positive ACKs.
    • Merge order: send an A08 then an A40 for the same patient and confirm both destinations see them in order.
    • Nulls: send a field as two quotes and confirm the destination clears it.
    • Outage: stop one destination, send a batch, restart it and confirm the backlog drains in order.

    In production, watch queue depth per destination, error counts and the age of the oldest queued message. Those three numbers show trouble long before a ward calls.

    What are Mirth ADT channel best practices?

    Filter by trigger event at the source, suppress duplicates on sending facility and control ID in a durable store, and keep code mappings in shared templates. Preserve HL7 nulls and validate every merge.

    Acknowledge once the message is stored and accepted, give every destination its own ordered queue, and alert on queue age rather than waiting for users to report missing patients.

    How Agnotic can help

    Agnotic designs and builds ADT channels in Mirth Connect: event filters, duplicate stores, A08 and A40 handling, acknowledgment settings, destination queues and monitoring. We also review existing channels and fix ordering and duplicate problems without stopping the feed.

    Get help with your ADT channels

    We build and review Mirth Connect channels for hospital ADT feeds.

    Sources

    Frequently Asked Questions

    A source filter reads the trigger event in MSH-9.2 and accepts only the listed events. Destination filters can narrow the set further for each consumer.

    Talk to an engineer about your project

    Tell us about your ADT feed and its consumers. We will review the channel design and point out ordering or duplicate risks.