Book a call

Choose who to talk to

Pick who you’d like to speak with and book a time that works for you.

Dima Blyshchyk, CEO & Founder at Mitrix

Dima Blyshchyk

CEO & Founder

Max Fedaraka, Head of Business Development at Mitrix

Max Fedaraka

Head of Business Development

By Dmitri Koteshov · Mitrix Technology
HealthcareSoftware development

EMR integration: HL7, flat files and the reconciliation gap

Mitrix's engineering team explains why EMR interfaces pass UAT and still fail in production, and what HL7, flat files, reconciliation and cutover actually require.

The interface passed UAT in March. In April the first production file arrived with a different column order, a blank provider NPI and two patients with the same name. Nobody owned the reconciliation report because the project plan ended at “interface live”.

EMR integration is usually sold as a mapping exercise. In practice it is an operations problem: files arrive late, codes change, patients get merged, and the same record exists in four systems with four identifiers. The teams that succeed plan for that from the first sprint.

An interface is a small part of the integration

Message mapping is the visible part of the work. The rest is discovery, identity, code systems, reconciliation, operations and cutover. Projects that budget only for mapping run out of time in the first month after go-live.

A realistic scope has six parts:

  1. Discovery: systems, senders, volumes, message versions, owners and current workarounds.
  2. Data contracts: fields, code systems, identifiers, required values and ownership.
  3. Build: ingestion, parsing, transformation, validation and publication.
  4. Reconciliation: source-of-truth matrix, crosswalks, counts and an exception queue.
  5. Operations: monitoring, alerts, replay, change control and on-call.
  6. Cutover: parallel run, final delta, rollback and hypercare.

HL7 v2 still carries the work

Most US healthcare interfaces still move HL7 v2 messages: ADT for admissions and discharges, ORU for results, ORM for orders, SIU for scheduling. The standard is flexible, which is another way of saying every sender implements it differently. Optional fields become required, Z-segments carry local data, and the same field can mean different things at two facilities.

A parser should log unknown segments and fields instead of dropping them. Store the raw message, the parsed version and the mapping version. When a sender changes a field, you want to replay the original message, not ask for a screenshot.

FHIR is the right choice for newer APIs, patient access and some payer exchange. US Core profiles and bulk FHIR give you a predictable shape. That does not make HL7 v2 disposable. Most hospitals will run both for years, and a rewrite for purity is rarely funded.

Flat files are interfaces too

Not every integration is a message. Labs, billing systems and legacy platforms still drop CSV, pipe-delimited or fixed-width files on an SFTP server. These interfaces fail in quieter ways: a header changes, a file arrives twice, a partial file looks complete, or a late file overwrites a newer one.

Define a contract for every file:

  • filename pattern and directory
  • schema version and column order
  • encoding and delimiter
  • row count and checksum
  • full or delta
  • expected arrival window
  • a manifest or control record when the sender supports one

Then make ingestion idempotent. The same file processed twice should not create duplicate orders or patients. Reject a file that fails validation and alert the owner. A partial import is harder to clean up than a rejected file.

Code systems are where good mappings go bad

Two systems can agree on a field name and disagree on its values. Diagnoses may arrive as ICD-10 or local codes, labs as LOINC or vendor codes, medications as NDC or a formulary ID. A mapping that ignores the code system produces data that looks complete and fails downstream.

Keep a code-system registry with the source, version and effective dates. Map to a canonical value where the business needs one, and preserve the original code alongside it. When a code is unknown, send it to an exception queue with the raw message attached. Silently mapping unknown codes to “other” hides the problem until a report is wrong.

Reconciliation is the actual project

Mapping is the visible work. Reconciliation is what keeps the interface alive.

Start with a source-of-truth matrix. For every field the business cares about, name the authoritative system, the matching key and the owner. Patient identity is the hard one. Build a crosswalk between EMR ID, payer member ID, facility ID and any legacy ID. Keep every source identifier. Never overwrite one with another.

Then build an exception queue that operations can use. Unmatched patients, missing providers, unknown codes, duplicate orders and negative balances should land in one place with enough context to fix them. A queue that only engineers can read will be ignored.

Finally, count. Every day, compare records sent, received and applied. If the numbers do not match, stop and fix the pipeline before adding the next interface. The three-number check catches more failures than any dashboard.

Working with the EMR vendor

Sandbox access, interface certification, rate limits and support queues shape the timeline more than your own backlog. Ask for the interface specification and a test patient set early. Confirm who can open a ticket when a message is rejected, and what the vendor’s response time looks like in production.

Some vendors require certification before go-live. Others charge for each interface or restrict which fields you can read. Put those constraints in the plan. A good integration design does not help if the vendor will not enable the endpoint for six weeks.

Do you need an interface engine?

An interface engine can help when you have many senders, several message versions and a team that wants a visual mapping tool. It centralizes parsing, routing and monitoring. It also adds a license, a runtime and another place to debug.

For two or three interfaces with stable senders, a well-structured ingestion service is often simpler and cheaper. The decision should follow the number of interfaces, the rate of change and the operations team’s ability to own the tool, not the vendor’s demo.

Architecture that survives production

Keep ingestion, transformation and publication separate. A message that fails transformation should not block the next 500 messages. Use a queue with a dead-letter path, store the raw payload, and make replay a first-class operation.

Add a schema registry or a versioned mapping file. When a sender changes a field, the new version should be reviewable and reversible. Log the interface name, message type, sender, version and correlation ID on every record.

PHI boundaries belong in the architecture, not in a policy document. The ingestion service should have access only to the buckets, queues and tables it needs. De-identified or synthetic data belongs in lower environments. Audit access to raw messages, because those messages contain the same PHI as the clinical record.

On Azure, this often means Functions or Container Apps for ingestion, Service Bus or RabbitMQ for queues, Blob Storage for raw payloads, Azure SQL for the operational store and a separate reporting layer. AWS equivalents work the same way. The cloud choice matters less than the separation of concerns.

Testing and cutover

Contract tests catch most interface regressions. For each sender, keep a set of real message samples and expected parsed output. Run them on every mapping change.

Then test the failure paths: duplicate file, out-of-order messages, missing patient, unknown code, expired authorization, sender downtime and a partial file. These are the cases that wake people up at night.

Before cutover, run a parallel period. Process production files into the new pipeline without publishing, then compare counts and key fields with the old process. Freeze changes, agree on the final delta, and write a rollback plan. Someone must own reconciliation during the first two weeks after go-live, and that person should not be the integration developer.

Questions to ask before you sign

Whether you are buying an interface engine or hiring a team, these questions expose the real scope:

  • Which interfaces, message types and versions are in scope?
  • Who owns the mapping when a sender changes a field?
  • What happens to unmatched patients and unknown codes?
  • How are mapping changes versioned and reviewed?
  • Can we replay a file or message without side effects?
  • What is the expected arrival window, and who is alerted when a file is late?
  • What does the daily reconciliation report contain?
  • Who is on call during the first month after go-live?

A vendor that cannot answer the reconciliation and replay questions has not run an interface in production.

How Mitrix handles EMR integration

Mitrix has integrated EMR systems for healthcare providers across facilities, including HL7 XML exchange, flat-file and third-party database ingestion, mapping, retries, monitoring and schema versioning. We build the reconciliation view alongside the pipeline, because the interface is not finished when the first message lands. The same approach covers cloud-native delivery on Azure and AWS.

Our healthcare work includes a DME network that connects hospitals, hospices and suppliers, with EMR integration, insurance checking and reporting. You can read the DME case study. If you are planning an EMR integration or fixing one that already hurts, talk to us.

A realistic 12-week plan

Weeks 1 to 3: discovery, source-of-truth matrix, interface inventory and access requests.

Weeks 4 to 7: build the first interface end to end, including raw storage, parsing, validation, reconciliation and replay.

Weeks 8 to 10: parallel run with production files, exception queue and daily counts. Fix mapping gaps.

Weeks 11 to 12: cutover, hypercare and the change process for the next interface.

Add interfaces only after the first one runs clean for two weeks. The second interface is easier when the operating model already exists.

A cutover checklist

Use this list before the next interface goes live:

  • Source-of-truth matrix signed off by operations and engineering.
  • Contract tests with real samples for every sender.
  • Idempotent ingestion and a tested replay path.
  • Dead-letter queue with an owner and an alert.
  • Daily sent, received and applied counts.
  • Exception queue that operations can work without engineering.
  • Parallel run with reconciled totals.
  • Rollback plan and an on-call owner for two weeks.
  • A documented mapping version and a change process.

If any line is blank, the interface is not ready. It may still pass UAT.



You might also like

FAQ

Frequently asked questions

What is the difference between HL7 and FHIR for EMR integration?

HL7 v2 is the message standard most US hospitals still use for ADT, orders, results and scheduling. FHIR is an API standard used for newer integrations, patient access and some payer exchange. Most healthcare systems run both for years.

Why do EMR interfaces fail after go-live?

Common causes are patient identity mismatches, late or partial flat files, unowned reconciliation, schema changes without versioning and no replay path. These are operational failures more than mapping failures.

How do you reconcile data between an EMR and another system?

Define a source-of-truth matrix per field, keep a crosswalk of all patient and provider identifiers, compare sent, received and applied counts daily, and give operations an exception queue for unmatched records.

Can you ingest flat files as well as HL7 messages?

Yes. Mitrix has built flat-file and third-party database ingestion alongside HL7 exchange, with validation, retries, monitoring and schema versioning.

How long does an EMR integration take?

A focused interface can be built in weeks. A production-ready integration with reconciliation, replay, exception handling and cutover usually takes a few months, depending on the number of senders and the quality of their data.