Design pharma integrations for duplicates, delays and conflicting records
For Integration architects and quality IT · Plan implementation
TL;DR — what you’ll learn
- Define the business event, its authoritative source and the meaning of each acknowledgement.
- Make retries safe using stable identities and explicit handling of revisions and event order.
- Reconcile source and receiving records so technical success does not hide a business discrepancy.
- Test recovery with operating owners and retain evidence of the affected records and resolution.
An API success response is not the whole outcome
A laboratory interface returns a success response, so the integration dashboard turns green. The receiving record contains the wrong unit, and the operating team discovers the error during review. The message arrived, but the business meaning did not survive the handover.
Pharma system integration exception handling should address both delivery and interpretation. The design needs to explain what event occurred, which record owns the truth and how the organisation detects and resolves uncertainty.
EU GMP Annex 11 addresses controls for data exchange and migration within its scope. The site's intended use and applicable requirements determine the necessary assurance and evidence. EU GMP Annex 11.
Define the event contract in business terms
Start with a specific event, such as a reviewed laboratory result, an inventory movement or an authorised status change. Identify the source record, receiving record and intended consequence. Avoid vague labels such as “sync batch” when several meanings are involved.
Specify identifiers, versions, units, relevant timestamps and required context. Distinguish when the underlying event occurred from when it was sent and received. Those times can differ legitimately and help explain delayed processing.
The architecture guide establishes record ownership across ERP, MES, LIMS and QMS. An interface should implement that ownership rather than create a new authority by accident.
Make acknowledgement states explicit
Describe what each response proves. A network response may confirm receipt by an endpoint; a later application response may confirm validation or business processing. The operating state should follow the agreed evidence, not an assumed meaning of a generic success code.
Keep rejected, pending and uncertain outcomes distinguishable. A timeout after submission is especially important: the receiver may have completed the action even though the sender did not receive confirmation. Retrying blindly can create a duplicate transaction.
Define how the sender queries or reconciles the outcome. The recovery path should use stable references and preserve the original event history rather than creating an unrelated new request every time.
Worked example: an older release arrives after a hold
Consider an illustrative material-status sequence. The authoritative system issues version 17 indicating release, then version 18 indicating a later hold. Because of a delay, the warehouse receives version 18 first and version 17 afterwards.
A receiver using “last message received wins” would incorrectly restore the older release state. A better design evaluates the event against the authoritative version and approved status model. The stale event remains traceable but does not overwrite the later state.
Suppose version 18 is delivered twice after a retry. The receiving system should recognise the same event identity and reconcile the existing outcome instead of treating the replay as a new business decision.
Now suppose version 19 arrives with an unrecognised status code. The interface should surface the uncertainty and follow the approved operating response. It should not convert an unknown value to “released” merely because that is the default in a mapping table.
This example illustrates ordering and replay controls. The authorised quality process determines actual disposition; the interface preserves and communicates that decision within its assessed intended use.
Distinguish identity from content similarity
Use a stable event or transaction identifier for safe retry handling. Two messages with identical text may represent different legitimate events, while two differently formatted messages may be retries of the same event. Content similarity alone is a weak basis for processing identity.
Define how corrections and revisions relate to earlier records. A revised laboratory result may need to update a relationship and trigger review, while a replay of the same version should not create another result. The LIMS instrument integration guide develops that distinction for laboratory records.
Retain the source reference and applied version in the receiver where needed for reconciliation. This allows the team to explain which event produced the current state and whether a later source change remains outstanding.
Reconcile meaning as well as counts
Compare the expected business outcomes with receiving records at an agreed cut-off. Counts can reveal missing messages, but they do not prove correct identifiers, units, quantities, statuses or relationships.
Scroll horizontally to see all columns.
| Reconciliation question | Example discrepancy |
|---|---|
| Did every expected event reach a resolved state? | Source event has no receiving outcome |
| Did it affect the correct record? | Correct result linked to the wrong sample |
| Did its meaning survive? | Unit or status mapping changed interpretation |
| Is the applied version current? | Later correction remains unapplied |
| Was a replay handled safely? | One event produced two movements |
| Can the outcome be explained? | Receiver changed state without a source reference |
Design the exception report for the business owner. It should identify the affected record, discrepancy, relevant evidence and responsible next action, while technical details remain available for diagnosis.
Give each exception an accountable route
Separate transport failures, invalid data, conflicting state and missing master-data relationships. They require different owners and remedies. A single retry queue can repeatedly resend a business error that will never succeed without review.
Define escalation according to the consequence and approved operating procedure. A blocked stock movement or uncertain quality status may require a different response from a delayed management report. The integration should expose the relevant impact rather than assign urgency solely from server error codes.
Retain the resolution decision and any approved correction. Editing a message in an administrator console without traceable authority can make the interface appear healthy while weakening the record of what happened.
Recover without overwriting newer work
Before replaying a backlog, assess the current source and receiving states. Some events may already be processed, superseded or require a controlled correction. Recovery should apply the defined rules rather than force the receiver to match an old export.
The offline warehouse guide shows why local work and central state can diverge. Reconnection needs a reconciliation process that preserves actual events and resolves conflicts through accountable decisions.
Test a partial recovery failure. If the first half of a batch of messages succeeds and the rest fails, the next attempt should identify completed outcomes safely. The operator should not need to guess which records can be resent.
Include evidence and access in the design
Log enough information to diagnose and reconstruct relevant processing without copying unnecessary sensitive content into broad technical logs. Use references and controlled access where possible, with retention aligned to the intended purpose.
Define who may inspect, retry, correct or cancel events. A support role that can replay an interface should not automatically have authority to change the underlying quality decision. Review service accounts and privileged tools alongside ordinary user permissions.
Keep configuration versions and mapping changes reviewable. When a unit conversion or status map changes, the team needs to know which events used the earlier version and whether any affected records require assessment.
Verify with business failure scenarios
Test duplicate delivery, delayed order, unknown codes, wrong units, missing identifiers, timeouts after processing and unavailable dependencies. Set expected outcomes with the business and quality owners before execution.
Measure unresolved business discrepancies and time to reach an evidenced resolution. Technical uptime and message throughput remain useful, but they should not hide a small queue of important records that never reconciled.
Summary and next actions
Reliable integrations preserve the identity, order and meaning of business events through failure and recovery. Clear authority and reconciliation make technical automation usable in the operating process.
- Define one event contract with source ownership, identity, version, units and acknowledgement meaning.
- Test safe retry and out-of-order delivery against the approved status model.
- Build a reconciliation queue that names affected records, owners and required decisions.
- Rehearse recovery and configuration changes before relying on the interface for wider operations.
Scope this automation around your operation
Tell us your current systems, transaction volume and the exception you need to resolve. We can discuss a focused first release, its review controls and how to measure the result.
About this guide
NextEdge Labs develops software, integrations and AI-assisted workflows. This guide presents practical workflow analysis with linked source references. Worked examples are illustrative, not client results.
Apply the sources within their stated market and scope, together with your approved procedures and the decisions of the responsible specialists.
Browse all Pharma & life sciences guides or explore our engineering capabilities.