EMR automation guide
EMR automation is three layers. Most articles only cover one.
Most published material on EMR automation answers the integration-engine question: which messages flow through Mirth, Rhapsody, or Cloverleaf, how FHIR R4 has expanded what HL7 v2 used to cover, and which transactions your trading-partner agreements should support. That is the protocol layer. It is one of three layers an honest EMR-automation stack has to touch, and on a per-workflow basis it is the smaller one. The other two are the UI layer (the work the protocol does not cover, which is most clinical and registration tasks) and the vendor stack (Epic Cosmos, Cerner MPages, athena rules). This piece walks all three, names what belongs where, and shows the audit-grade tool list that lets a chart-read workflow clear compliance.
Direct answer (verified 2026-05-06)
EMR automation is unattended software that types, clicks, reads, and validates inside an electronic medical record application (Epic Hyperspace and Hyperdrive, Cerner PowerChart, eClinicalWorks, athenaClinicals, NextGen, Allscripts Sunrise, Meditech Expanse, Greenway) instead of asking a human to do it. It runs across three layers: a protocol layer (HL7 v2 and FHIR over an integration engine), a UI layer (agents that drive the EMR through the operating system's accessibility tree, for the workflows the protocol does not cover), and the vendor stack (Epic Cosmos, Cerner MPages, athena rules). The published case studies all sit in the UI layer. The published vendor marketing all sits in the protocol layer. The point of this guide is to draw the line.
The three layers
A workflow that pulls a referral document, drops the discrete data into the registration shell, runs eligibility against the payer, and routes the abnormal flag back into the In Basket touches all three. The mistake most teams make is to scope a project as if it lives in only one.
- 1
Protocol layer
HL7 v2 messages, FHIR resources, X12 270/271 eligibility. Structured data exchange between systems.
- 2
UI layer
Chart navigation, in-basket triage, SmartList completion, prior auth screens, refill queues. The work the protocol does not cover.
- 3
Vendor stack
Epic Cosmos, Cerner MPages, athena rules engine. Workflow logic that lives inside the EMR vendor's own runtime.
Layer one: the protocol surface
The protocol layer is the surface most published material describes well. A lab posts an ORU^R01. The integration engine routes it. The EMR inbound queue files the discrete result against the order. The provider opens the chart and sees the value in the flowsheet. For high-volume structured exchange this layer is the right answer, because the per-message cost is low, the latency is bounded, and the audit trail is end-to-end at the protocol layer.
Protocol path: a lab result lands in the chart
Lab system
ORU^R01 result message
Integration engine
Mirth, Rhapsody, Cloverleaf
EMR inbound queue
Cerner OPENLink, Epic Bridges
Discrete result
Filed to flowsheet row
FHIR R4 has expanded what this layer can do. The Bulk Data spec covers population pulls. SMART on FHIR covers in-context launch of a third-party app from inside the chart. CDS Hooks covers vendor-side rules that fire on order entry. None of those changes the boundary: the protocol carries data, not workflow. When the workflow demands that a clinician see the chart, decide on a SmartList option, and co-sign, the protocol stops at the discrete value and the rest is on the UI.
Layer two: the UI surface (where most of the work actually is)
The same lab result, once it is in the chart, sits inside a workflow that is not in HL7 or FHIR. The provider opens the In Basket. Routes the abnormal flag. Picks a SmartList option for the follow-up. Co-signs with F4. None of those four steps is a protocol message. None has a FHIR Bundle. They are UI affordances because the workflow is about routing a decision through the chart, not moving a row between two databases.
UI path: the part HL7 and FHIR do not cover
Result lands in chart
Discrete value visible
Provider opens chart
In Hyperspace or PowerChart
SmartList completion
Pick from picklist
Order signed
Co-sign workflow, F4 to attest
This is the surface a UI agent reaches. Epic Hyperspace is a WPF application built on top of Microsoft UI Automation, the same framework NVDA and JAWS use. Cerner PowerChart is a mix of WPF and MFC, mostly reachable through the same tree. eClinicalWorks and Meditech Expanse serve some of the chart through a browser pane and the rest through a desktop client. Each of those surfaces exposes a node tree where every field a clinician sees has a role and an accessible name. A selector of the form role:Edit|name:HPI addresses the field directly. No pixel matching, no template image. When Epic ships an upgrade that moves the field two columns over, the rendered position changes; the role and name do not.
The audit story: a tool list a chart-read workflow cannot escape
The reason a UI agent is even allowed near a chart is the audit story, not the technology. The vendor marketing for AI agents tends to elide this part. Mediar publishes the list as a compile-time constant in the desktop runtime, named ASK_MODE_ALLOWED_TOOLS, defined in the file apps/desktop/src/lib/ask-mode-tools.ts. It contains twelve names. The state-changing primitives (click_element, type_into_element, press_key, set_value, run_command, the file writers) live in a separate constant. A workflow whose tool set imports only the read list literally cannot type, click, or write a file, regardless of what the workflow author asked the agent to do. That is the property a HIPAA reviewer wants to read with their own eyes before a chart-abstraction pass goes anywhere near a live patient identifier.
ASK_MODE_ALLOWED_TOOLS, the read-only audit barrier
- get_window_tree, dump the full UI Automation tree of a focused window. The integration surface, captured.
- get_applications_and_windows_list, enumerate Hyperspace, PowerChart, Citrix Workspace processes that are currently up.
- validate_element, does this selector resolve, and optionally does its rendered text match a literal.
- wait_for_element, block until a node is visible, enabled, focused, or merely exists. The condition is not a sleep.
- capture_screenshot, pixel snapshot for the audit log, side by side with the tree dump.
- highlight_element, visual debugging while a workflow author confirms the selector resolved to the field they meant.
- hide_inspect_overlay, clear the overlay before re-running, so the next read sees the chart, not Mediar's own pane.
- delay, explicit pause when a downstream system is slower than wait_for_element can express.
- activate_element, bring a window to the front. The only mode-allowed action; it does not type, click, or modify state.
- read_file, load a workflow file or a reference document from disk.
- glob_files and grep_files, locate workflow definitions by pattern or content.
- search_similar_workflow_steps, server-side knowledge lookup, no patient data passes through it.
Two properties of this list matter. It is a list, not a flag. A flag guarding state-changing tools can be flipped in a config file mid-run; a list constant in source cannot be extended without a code change that shows up in a diff and goes through review. And the split is enforced by tool registration, not by prompt. An LLM agent told to read a chart and then type a result back gets a hard refusal at the registration layer when it tries to call a tool that is not in the list, regardless of the natural-language framing it received. That is the difference between a policy and an enforcement.
“Patient intake and billing automation across Epic, Cerner, eClinicalWorks, Veridigm, and Greenway. The number is published on the Mediar healthcare solution page, anchored to the workflow it came from rather than a press-release headline.”
mediar.ai/solutions/healthcare
Layer three: the vendor stack
Each EMR vendor ships a workflow runtime inside their own product. Epic has Cosmos for cohort definition and a stack of Best Practice Advisories, SmartLinks, and SmartPhrases for in-chart logic. Cerner has MPages and the PowerChart workflow viewer. athena has its rules engine. The right answer for a workflow the vendor already exposes a primitive for is to configure the vendor primitive, not to drive the UI from the outside. A common failure mode of an outside-in automation project is to re-implement a Best Practice Advisory by reading the screen and deciding, when the BPA system inside Epic was waiting to be configured. The UI layer is for what the vendor does not expose. It is not a shortcut around what the vendor does.
What this looks like across the EMR vendor surface
The same selector grammar (role plus accessible name, with optional structural qualifiers) addresses the WPF surfaces, the MFC surfaces, and the browser-served surfaces. The integration shape changes per vendor; the selector vocabulary does not.
EMR coverage
Where the same approach reaches
Epic Hyperspace / Hyperdrive
Microsoft UI Automation tree exposed end-to-end. F-key heavy. Hyperdrive (Chromium) makes capture cleaner.
Cerner PowerChart
PowerChart, FirstNet, SurgiNet. WPF + MFC mix. Accessibility coverage is uneven by module.
eClinicalWorks
Mostly desktop client (eCW desktop) with a browser-served chart pane. Selectors split between AX tree and DOM.
athenaClinicals
Browser-based. Driven by DOM selectors, not the desktop accessibility API. Same selector grammar.
NextGen Enterprise
Windows desktop client. Template-driven encounter notes are reachable through the AX tree.
Allscripts Sunrise
Sunrise Clinical Manager. Heavy use of WPF, mostly readable through UI Automation directly.
Meditech Expanse
Browser-served. Long sessions, framed pages. Selectors target the Expanse iframe DOM.
Greenway / Veridigm
Mixed desktop and web. Common in mid-market ambulatory. Same role+name selector pattern works.
Where the line should sit on a real project
A useful working rule: if the workflow has a published HL7 message or a published FHIR resource that already covers the data, and the volume justifies the build, route it through the protocol layer. If the workflow has a vendor-side primitive (Best Practice Advisory, MPage rule, athena rules engine), configure the vendor primitive. Everything else (the long tail of registration, refill, prior auth, in-basket triage, chart abstraction for quality measures, the manual rekey from a referral document) is the UI layer. That is where a guide on EMR automation should spend its words, and where most published material spends almost none.
The reason to put the read-only tool list constant in the same conversation is that the UI layer earns its place only when the audit story holds. A chart-read workflow that can be proven to never have written into the chart is a different governance category from a full-bidirectional automation that has both read and write tools in its set. The split between the two lists is what lets a rollout move read workflows first, write workflows second, and keep the audit shape coherent through both phases.
See the read-only tool list applied to a chart workflow you actually run
Bring a workflow currently waiting on the integration team. We will draft the read pass against it, show the selector dump, and walk the audit shape end to end.
Common questions about EMR automation
What does 'EMR automation' actually mean in 2026?
Unattended software that types, clicks, reads, and validates inside an electronic medical record application instead of asking a human to do it. The work splits across three layers. Protocol layer handles structured data exchange between systems and is served by HL7 v2 and FHIR over an integration engine like Mirth Connect, Rhapsody, or Cloverleaf. UI layer handles the work the protocol does not cover, which is most clinical and registration workflows, and is served by RPA and AI desktop agents that drive Hyperspace, PowerChart, eClinicalWorks, athenaClinicals, NextGen, Sunrise, Meditech, or Greenway through the operating system's accessibility tree. Vendor stack handles workflow logic that lives inside the EMR vendor's own runtime: Epic Cosmos, Cerner MPages, athena rules. Most published material on this topic stops at the protocol layer; the published case studies all sit in the UI layer.
Why does HL7 or FHIR not solve the problem on its own?
Because the protocol describes the data, not the workflow. An ORU^R01 lab message can land discretely in the chart, and the order it ties back to can still need a human to open Hyperspace, click into the In Basket, route the abnormal flag, pick a SmartList option for the follow-up, and co-sign with F4. None of those four steps is an HL7 message. None of them has a FHIR Bundle. The EMR vendor expresses them as UI affordances because the workflow is about clinician judgment routing through the chart, not about moving a row between two databases. FHIR R4 covers a much wider workflow surface than v2 ever did and the gap is still wide enough that Epic's published list of workflow extensions still grows every Specialty Steering Board cycle.
How does a UI agent drive Epic Hyperspace, exactly?
Hyperspace is a WPF application built on top of the Microsoft UI Automation framework, the same surface JAWS and NVDA use. Mediar reads that tree directly. A field that a clinician sees as 'HPI' on screen is exposed as a node with role:Edit and name:HPI, and Mediar's selector vocabulary addresses it as role:Edit|name:HPI. No pixel matching, no template image, no screen scraping. When Epic ships an upgrade that moves the field two columns to the right, the rendered position changes; the role and name do not. The selector still resolves. This is the same reason NVDA keeps working across Hyperspace point releases: the surface is contractually exposed, not visually inferred.
What about Hyperdrive and Citrix?
Hyperdrive is Epic's Chromium-based replacement for the WPF Hyperspace client. When Hyperdrive runs locally on the endpoint, the accessibility tree is even cleaner because it is rendered through Chromium's accessibility layer, which exposes ARIA roles and names. When either Hyperspace or Hyperdrive runs inside a Citrix session, the ICA protocol crosses pixels and synthetic input but not the UIA tree. There are two honest answers: install a runtime on the Citrix VDA so the tree is read inside the session and proxied back (UiPath, Blue Prism), or run vision plus keyboard-first navigation on the client side and treat Citrix-rendered Epic the way a screen-reader user with no VDA permissions has to (Mediar's client-side mode for the Community Connect case). For most direct Hyperspace and locally installed Hyperdrive deployments neither is necessary.
How do I prove to compliance that an EMR-read workflow never wrote into the chart?
Build the workflow against a tool list that does not contain a write primitive, and show the list to the auditor. Mediar publishes that list in apps/desktop/src/lib/ask-mode-tools.ts as the constant ASK_MODE_ALLOWED_TOOLS. It contains twelve names. Nine are read-only desktop primitives (get_window_tree, get_applications_and_windows_list, validate_element, wait_for_element, capture_screenshot, highlight_element, hide_inspect_overlay, delay, activate_element). Two are read-only file tools (read_file plus glob_files and grep_files). One is a server-side knowledge lookup (search_similar_workflow_steps). The state-changing primitives (click_element, type_into_element, press_key, set_value, run_command, write_file and the rest) live in a separate constant called ASK_MODE_BLOCKED_TOOLS. The split is enforced at compile time as two list constants, not as a runtime flag, which is the part that matters for an audit: a workflow that imports only ASK_MODE_ALLOWED_TOOLS literally cannot have written into the chart, regardless of what its prompt said.
What workflows in an EMR are the right candidates for this kind of automation?
Repetitive, structured-input, low-judgment work that lives across multiple panes. Patient registration: pull demographics from the scheduling source, type into the registration shell, run eligibility, file the response. Refill queues: read the in-basket message, pull the active medication record, draft the refill, route to the prescriber. Prior auth: read the order, fill the payer portal, file the auth number back to the order. Chart abstraction for quality measures: read structured fields, copy to a registry submission. Order entry from outside referrals: parse the inbound document, file the discrete order. The wrong candidates are anything that requires a clinician to decide whether to act, anything where a wrong action could harm the patient if the verification step fails, and anything the EMR vendor already has a first-class workflow primitive for (those should run inside the vendor stack).
How does this approach handle PHI?
Mediar runs SOC 2 Type II and HIPAA-covered. The runtime can deploy on-premises so PHI never leaves the provider network. Every primitive call is logged with the selector, the resolved element, the result, and a screenshot at the moment of the call. The split between read and write tool lists means a chart-read workflow has a paper trail an audit can verify against the read-only constant. A self-hosted vision option exists for workflows that need to look at unstructured chart documents without sending pixels off the endpoint.
What is the per-workflow economics versus an HL7 interface build?
An HL7 interface build for a new system pair (say, a referral source to your EMR) is typically a six-figure project that takes one to two quarters from scoping to go-live, owned by the integration team and the vendor's interface group. A UI workflow that does the equivalent of typing the referral into the chart by hand is days to author and tens of cents per run on Mediar's $0.75-per-minute meter. The protocol build wins for high-volume, structured, every-day flows where the latency and throughput justify the up-front cost. The UI workflow wins for the long tail (the regional plan with no clearinghouse, the once-a-week feed from a small specialty group, the manual prior auth that does not have a payer-side API) and for the cases where the protocol team's backlog is already two quarters out.
Is the runtime open source?
The Terminator runtime, which is the selector vocabulary, the wait-condition primitives, and the accessibility-tree readers, is published as an SDK at github.com/mediar-ai/terminator with TypeScript bindings on a Rust core. The closed-source layer is the no-code workflow recorder, the cloud executor, and the workflow-synthesis pipeline that turns a recording into a typed workflow file. The split matters specifically for healthcare buyers: the layer that touches PHI is the runtime, and the runtime is the layer an audit can read end-to-end.
Where does this approach refuse to be the answer?
Three places. First, anywhere the EMR vendor publishes a clean first-class workflow primitive the customer is not using yet. Configure the vendor surface; do not screen-drive what the vendor already exposes. Second, decisions that require a clinician's clinical judgment. The runtime can prep the screen, surface the candidate options, and stop. It should not pick. Third, very high-volume structured exchange where a real HL7 v2 or FHIR pipe is going to be cheaper per message and more observable end-to-end. The UI layer extends the integration team's reach into the long tail; it does not replace the integration team.
Adjacent reading
Same runtime, different surfaces
Patient verification automation, framed as a read-back loop
The eligibility half of the same workflow, with the four wait_for_element conditions and why a verification flow stops on a denied result instead of retrying.
Automating Epic in Citrix without VDA access
Why UI Automation selectors do not cross the Citrix ICA boundary, and the client-side approach for Community Connect tenants who cannot install on the parent IDN's gold image.
AI agents replacing UiPath RPA
The architecture argument behind the same runtime. Where the model lives at authoring time, why the workflow file is the audit artifact, and what changes for healthcare workloads.