Skip to content
Healthcare SoftwareEngineering

Guide · Interoperability

EHR Integration Guide: Choosing Patterns, Running the Project, and Going Live

Most EHR integration problems are decided before anyone writes code: which pattern you pick, who owns the interface on the hospital side, and how you will prove it works without real patients. This guide walks through those decisions in the order they come up.

11 min read Updated

What 'integrating with the EHR' actually means

An EHR integration is rarely one connection. A scheduling product might need inbound ADT events to know who is admitted, outbound SIU messages to push appointments back, a FHIR read of the patient's active medication list, and a launch point inside the clinician's workflow so nobody has to log in twice. Each of those is a different interface with different owners, different failure modes, and often a different approval path at the health system.

The useful first step is to write the integration down as a list of data flows rather than a single requirement. For each flow, record direction (into the EHR, out of the EHR, or both), trigger (event, user action, schedule), latency tolerance, the data elements involved, and what happens clinically if it is late or wrong. That list becomes the basis for pattern selection, scoping, test planning, and the conversation with the hospital's integration team.

Two flows that look similar on a slide can behave very differently in production. A lab result written back as an ORU message lands in a results inbox that clinicians already watch; the same result posted as a FHIR Observation may be stored but never surfaced unless the site configures it. Knowing where data will appear in the clinician's screen is as important as knowing that the API returned 201.

The six integration patterns and when each fits

Modern EHRs expose several integration surfaces at once. The right answer for most products is a mix: event feeds for timeliness, APIs for on-demand reads, and an embedded app for clinician workflow. The table below compares the patterns you will meet most often in US health systems.

Common EHR integration patterns compared
PatternBest forStrengthsWatch out for
HL7 v2 feeds (ADT, ORM/OMG, ORU, SIU, MDM, DFT)Real-time events and orders/results inside a hospital networkUniversally supported, event-driven, mature tooling in interface enginesSite-specific Z-segments, out-of-order delivery, VPN or MLLP connectivity, every site configured slightly differently
FHIR REST APIs (US Core)On-demand reads and targeted writes of clinical resourcesStandard resource model, OAuth 2.0 security, ONC-certified endpoints required for certified EHRsWrite support varies by vendor and resource; rate limits; search parameter support differs from the spec
SMART on FHIR appsUser-facing tools launched inside the EHR or patient portalSingle sign-on context (patient, encounter, user), standard OAuth scopesIframe and browser constraints, per-site app registration, scope approval by the health system
CDS HooksDecision support shown at a specific workflow moment (order-select, order-sign, patient-view)Workflow-native cards, prefetch reduces round tripsStrict response latency budgets, vendor-specific hook support, alert fatigue if poorly tuned
FHIR Bulk Data ($export)Population-level extracts for analytics, quality, and payer exchangeAsynchronous NDJSON export, backend services authorizationLarge files, long-running jobs, incremental _since semantics differ by implementation
Vendor marketplace or proprietary APIsCapabilities not covered by standards (scheduling slots, in-basket messages, billing)Deeper functionality than standards aloneAccess governed by vendor programs and contracts; proprietary lock-in; fees and review cycles

Pattern details that bite in production

HL7 v2 event feeds

v2 feeds are where timing problems hide. An ADT A08 update can arrive before the A01 admit if the sending system queues by thread; an A40 merge can rewrite the identity of a patient you already stored. Your receiving service needs idempotent processing, a clear policy for messages that reference unknown patients, and storage of the raw message for replay.

Plan for the interface engine on the hospital side. Many sites route everything through an engine such as Rhapsody, Cloverleaf, or Mirth Connect, and the analyst who owns it will map fields to your specification. Give them a precise message specification with required segments, field-level examples, and acknowledgment behavior (AA, AE, AR) rather than pointing at the HL7 standard.

FHIR APIs and SMART launch

The 21st Century Cures Act and ONC certification criterion 170.315(g)(10) mean certified EHRs expose a standardized FHIR API based on US Core with SMART authorization. That gives you a predictable floor for reads, but not for writes, and not for every search parameter. Read each vendor's published capability statement and test against their sandbox before committing to a design that depends on a particular query.

For SMART apps, design around the launch context. An EHR launch gives you the patient and often the encounter; a standalone launch does not. Token lifetimes, refresh token availability, and whether offline_access is granted vary by site configuration, so build graceful re-authentication into the UX.

CDS Hooks and bulk export

CDS Hooks services sit in the clinician's critical path. Treat the response time budget as a hard requirement, cache reference data, use prefetch templates so the EHR sends what you need, and return no cards rather than a slow card. Measure how often cards are accepted or dismissed and review that with clinical stakeholders.

Bulk $export jobs can run for hours on a large population. Build polling with backoff, resumable downloads, schema validation of each NDJSON line, and reconciliation counts so a partial export is caught before it feeds a quality report.

Vendor programs, marketplaces, and access

Every major EHR vendor runs developer programs, sandboxes, and app marketplaces with their own terms, review processes, and fees. Access to production APIs is usually granted per customer: the health system must approve and activate your app, and some capabilities are available only under specific contractual arrangements between the vendor, the health system, and you.

Build that into the plan. Identify early which capabilities you need from public, standards-based endpoints and which require a vendor program. Ask the health system's integration team which pathway they prefer; many have a standard intake process for third-party apps, including security review and a BAA.

We engineer integrations as an independent firm. We are not affiliated with or endorsed by any EHR vendor, and access to vendor APIs, sandboxes, and marketplaces is governed by each vendor's own programs and the client's agreements. Epic, Oracle Health, athenahealth, MEDITECH, eClinicalWorks, and other names are trademarks of their respective owners.

Project phases for an EHR integration

A focused single-interface integration at one site typically lands in weeks once access is granted; a multi-site program with several flows and an embedded app usually runs over a few quarters. Most of the calendar time goes to access, configuration, and validation rather than coding.

Typical phases and what each produces
PhaseKey activitiesExit criteria
1. DiscoveryData flow inventory, workflow walkthroughs with clinicians, pattern selection, site technical contactsSigned-off interface list with direction, trigger, latency, and owner per flow
2. Access and agreementsBAA, security questionnaire, vendor program enrollment where needed, network connectivity (VPN, MLLP over TLS, or API gateway)Credentials for a non-production environment; connectivity tested end to end
3. SpecificationMessage and API specifications, field mappings, terminology mapping (LOINC, SNOMED CT, RxNorm), error handling and ack rulesMapping document approved by the site interface analyst
4. Build and sandbox testingAdapters, transformation, retries, dead-letter queues, monitoring; vendor sandbox and synthetic data testsAutomated test suite passes; known limitations documented
5. Site validationIntegrated testing in the health system's test environment with realistic scenariosClinical and IT sign-off on test scripts
6. Go-live and hypercareCutover plan, interface monitoring, on-call rota, daily defect triageStable error rates, no open severity-one issues, handoff to support

Testing with vendor sandboxes and synthetic data

Vendor sandboxes are good for confirming authentication, resource shapes, and basic behavior. They are rarely good at reproducing a specific hospital's configuration: custom order codes, local result formats, or the way a site uses encounter types. Plan two layers of testing: sandbox and synthetic data for the logic you control, then site test environments for configuration you do not.

Never use real patient data in development or sandbox testing unless the organization has explicitly authorized it under its HIPAA policies. Generate synthetic patients with a tool such as Synthea, and build a library of synthetic HL7 messages that cover the ugly cases.

Checklist

  • ADT A08 arriving before A01 for the same visit
  • A40 merge of two patient records you already hold
  • ORU with a corrected result (result status C) replacing a final result
  • Messages with unexpected Z-segments or repeating fields
  • FHIR search returning paged results with a next link
  • Expired access token mid-session in a SMART app
  • CDS Hooks request where prefetch data is missing
  • Bulk export job that fails partway and must resume
  • Downstream outage: queue depth, retry, and replay behavior

Go-live, monitoring, and long-term ownership

Interfaces fail quietly. A FHIR Subscription that silently stops firing or an MLLP connection that reconnects but drops a message will not raise an error unless you look for it. Monitor message volume against expected baselines per hour and per message type, track acknowledgment latency, alert on queue depth, and keep raw payloads long enough to replay a day of traffic.

Agree on ownership before go-live. Who gets paged when the hospital's engine stops sending? Who approves a mapping change when the site adds a new order code? Write a runbook that covers both sides, and schedule a review after the first EHR upgrade, because vendor upgrades are the most common cause of interfaces that worked yesterday and fail today.

  • Volume and gap alerts per interface, not just error alerts
  • Correlation IDs that link an inbound message to every downstream write
  • Audit logs of who accessed which patient's data through your app
  • A tested replay procedure for missed messages
  • A change calendar aligned with the site's EHR upgrade schedule

Common mistakes to avoid

  • Promising a go-live date before the health system has granted non-production access
  • Assuming one site's mapping will work unchanged at the next site
  • Writing to the chart through an API without confirming where clinicians will see the data
  • Building on a proprietary API when a certified FHIR endpoint would have covered the need
  • Treating the vendor sandbox as proof of production readiness
  • Skipping terminology mapping and storing free-text codes that analytics cannot use later
  • Leaving monitoring until after go-live

References

This guide is educational and is not legal or regulatory advice.

Frequently asked questions

Should I use HL7 v2 or FHIR for an EHR integration?

Usually both. HL7 v2 remains the dominant way hospitals publish real-time events such as admissions, orders, and results, and nearly every site supports it through an interface engine. FHIR is better for on-demand reads, patient-facing access, and embedded SMART apps. Pick v2 for event timeliness inside the hospital network and FHIR for targeted queries and app launch, then confirm what the specific site and EHR version actually support.

How long does an EHR integration take?

A single, well-defined interface at one site often lands in weeks once access and agreements are in place. A multi-flow program across several sites with an embedded app commonly runs over several quarters. The schedule is driven less by coding than by security review, vendor program steps, connectivity setup, mapping sign-off, and site validation windows, so start those early and in parallel.

Do I need to join an EHR vendor's developer program?

It depends on what you need. Standards-based FHIR APIs on certified EHRs are available for many read use cases, but some capabilities, sandboxes, and marketplace listings are available only through vendor programs with their own terms and fees. Production access is typically activated per health system. Confirm the pathway with both the vendor's published documentation and the health system's integration team.

Can we test an EHR integration with real patient data?

Only if the covered entity has authorized it under its HIPAA policies and appropriate agreements, such as a BAA, are in place. For development and most testing, use synthetic patients and synthetic HL7 and FHIR messages. Real data belongs in controlled site validation environments operated under the health system's rules, not in developer laptops or vendor sandboxes.

What is the most common cause of EHR interface failures after go-live?

Unannounced change. EHR upgrades, new order codes, revised result formats, and certificate or network changes break interfaces far more often than code defects do. Volume-based monitoring, payload retention for replay, and a change calendar coordinated with the site's upgrade schedule catch these failures quickly instead of weeks later when someone notices missing data.

Discuss your healthcare engineering project

Tell us about the system, the integrations it depends on, and the constraints you are working within. A senior engineer will review it and reply with questions, not a sales script.