The State of EHR Integration Today
Electronic Health Record systems are the backbone of modern healthcare IT. Yet integrating with them remains one of the most challenging tasks in health software development. This guide distils the patterns that work, and the mistakes to avoid, into practical advice.
This guide is for product owners and engineers who need their application to exchange data with Epic, Oracle Health (formerly Cerner) or any other EHR. It covers how to choose an integration model, the patterns that hold up in production, the pitfalls that delay go-lives, and a checklist you can use on your next project.
Start With the Clinical Workflow, Not the API
The most common reason integrations fail is not technical. It is building a data feed nobody asked for. Before choosing a protocol, answer these questions with the clinical and operational staff who will use the system:
- Which data is needed, and at what moment in the workflow (at admission, at order time, after results are signed)?
- Is the flow one-way (read from the EHR) or two-way (write results, notes or orders back)?
- How fresh must the data be: real-time, within minutes, or a nightly batch?
- Who is the source of truth for each field when systems disagree?
- Which hospital team owns the interface, approves changes and is on call when it fails?
The answers decide the integration model far more than any technical preference.
Understanding EHR Integration Models
Point-to-Point Integration
The simplest model: your application connects directly to the EHR's API. This works for small-scale integrations but becomes unmanageable as you add more systems. We recommend this only for MVPs or single-hospital deployments.
Interface Engine Approach
Enterprise hospitals typically use interface engines like Rhapsody, Mirth Connect, or InterSystems HealthShare to manage integrations. This centralizes message routing, transformation, and monitoring. If the hospital already runs an engine, plan to connect through it: their integration team knows it, monitors it and will expect your feed to live there.
FHIR-First Integration
The modern approach: use FHIR APIs as the primary integration method. Epic and Oracle Health both offer extensive FHIR R4 APIs. Start here if the EHR supports it, and confirm early which resources and operations are enabled at your specific hospital, because availability varies by customer and by version.
| Model | Best for | Main trade-off |
|---|---|---|
| Point-to-point | MVPs, one hospital, one system | Every new connection is new custom work |
| Interface engine | Hospitals with many systems and an integration team | Depends on the engine's licence, team and change process |
| FHIR APIs | Modern read/write access to clinical data | Coverage differs between vendors and installations |
| HL7v2 feeds | Real-time events: admissions, orders, results | Older format with site-specific variations |
HL7v2 Is Still Everywhere
Even in hospitals with strong FHIR support, real-time events usually still flow as HL7v2 messages over MLLP. You will commonly see:
- ADT messages for admissions, discharges, transfers and demographic updates (for example A01, A03, A04, A08).
- ORM / OML messages for orders.
- ORU messages for results such as lab values and reports.
- SIU messages for scheduling.
Every message must be acknowledged with an ACK. Treat the specification as a starting point: each site customises segments and fields, so always request real sample messages (de-identified) and the hospital's interface specification before building your parser.
Practical Patterns That Work
Patient Matching Algorithm
One of the hardest problems is patient matching. A robust approach combines several identifiers, such as MRN, name, and date of birth, with fuzzy matching, and links records automatically only above a confidence threshold tuned on your own data. Anything below it goes to a person for review.
The threshold alone is not enough. Link matches above it automatically, send matches just below it to a human review queue, and log every automatic link so it can be reviewed and undone. A wrong match puts one patient's data in another patient's record, so it is the single most important thing to get right.
Data Mapping Strategy
Every EHR uses slightly different coding systems. Create a mapping layer that translates between your internal model and the EHR's format. Store mappings in a configuration database, not in code.
Version your mappings, and record which mapping version processed each message. When a hospital changes a local code, you can then see exactly which records were affected.
Idempotent, Ordered Processing
Interfaces resend messages after timeouts and network failures. Use the message control ID or resource version to make processing idempotent, so receiving the same message twice never creates duplicate records. Where order matters, such as an update arriving before the admission it modifies, hold the message briefly or fetch the current state instead of applying events blindly.
Queues, Retries and Dead Letters
Never process inbound messages directly inside the receiving connection. Acknowledge, place the message on a durable queue, and process it asynchronously. Retry transient failures with exponential backoff, and move messages that keep failing to a dead-letter queue with a clear reason, so the support team can fix and replay them instead of losing data.
inbound message
-> validate structure, send ACK
-> durable queue
-> worker: map, match patient, apply idempotently
success -> audit log
transient error -> retry with backoff
permanent error -> dead-letter queue + alertSecurity and Compliance
- Use encrypted transport for every connection: TLS for APIs, and VPN or TLS-wrapped MLLP for HL7v2 feeds.
- Request the minimum scopes and data needed for the workflow.
- Keep patient data out of application logs; log message IDs and statuses instead.
- Sign a Business Associate Agreement (BAA) where HIPAA applies, and follow the hospital's own security review process.
Testing: Sandboxes Are Not Production
Vendor sandboxes are useful for learning the API, but they rarely match a real hospital's configuration, codes or data volume. Plan for a test environment connected to the hospital's own test system, test with realistic de-identified messages, and agree on a written test plan with the hospital's integration team before go-live. Run the new interface in parallel with the old process for a period where possible, and compare results.
Common Pitfalls to Avoid
- Don't ignore HL7v2: many systems still use it as their primary protocol
- Handle timezone issues: always store timestamps in UTC and convert on display
- Plan for data volume: hospitals generate millions of observations per month
- Build retry logic from day one: EHR APIs have rate limits and occasional downtime
- Don't assume vendor documentation matches the hospital's installation: confirm with real sample data
- Don't leave go-live monitoring undefined: agree who is alerted, and how fast, when a feed stops
EHR Integration Checklist
- Clinical workflow and data needs documented and signed off
- Integration model chosen (FHIR, HL7v2, interface engine, or a mix)
- Interface specification and de-identified sample messages received
- Patient matching rules and review process agreed
- Code mappings documented and versioned
- Security review completed and BAA in place where required
- Queueing, retries and dead-letter handling implemented
- Test plan executed against the hospital's test environment
- Monitoring, alerting and support contacts defined for go-live
Conclusion
EHR integration is complex but achievable with the right approach. Start by understanding the clinical workflows, then choose the integration model that matches your scale. Build for retries, duplicates and change from the first day, and treat patient matching and data mapping as core features, not details.
If you are building on FHIR, read how we approached it in building a FHIR-compliant healthcare platform. Need help with an EHR integration? Contact our healthcare team.