Abstract
While large language models (LLMs) can support clinical documentation needs, standalone tools struggle with "workflow friction" from manual data entry. We developed ChatEHR, a system that enables the use of LLMs with the entire patient timeline spanning several years. ChatEHR enables automations - which are static combinations of prompts and data that perform a fixed task - and interactive use in the electronic health record (EHR) via a user interface (UI). The resulting ability to sift through patient medical records for diverse use-cases such as pre-visit chart review, screening for transfer eligibility, monitoring for surgical site infections, and chart abstraction, redefines LLM use as an institutional capability. This system, accessible after user-training, enables continuous monitoring and evaluation of LLM use. In 1.5 years, we built 7 automations and 1075 users have trained to become routine users of the UI, engaging in 23,000 sessions in the first 3 months of launch. For automations, being model-agnostic and accessing multiple types of data was essential for matching specific clinical or administrative tasks with the most appropriate LLM. Benchmark-based evaluations proved insufficient for monitoring and evaluation of the UI, requiring new methods to monitor performance. Generation of summaries was the most frequent task in the UI, with an estimated 0.73 hallucinations and 1.60 inaccuracies per generation. The resulting mix of cost savings, time savings, and revenue growth required a value assessment framework to prioritize work as well as quantify the impact of using LLMs. Initial estimates are $6M savings in the first year of use, without quantifying the benefit of the better care offered. Such a "build-from-within" strategy provides an opportunity for health systems to maintain agency via a vendor-agnostic, internally governed LLM platform.
Introduction
Generative AI holds transformative potential for healthcare, yet current adoption often relies on standalone tools that introduce significant "workflow friction." Clinicians are frequently forced to manually transfer sensitive patient data into external applications, a process that is inefficient, poses privacy risks, and lacks the longitudinal context of a patient's full history. Furthermore, heavy reliance on third-party vendors can erode "institutional agency," limiting a hospital's ability to customize AI tools or switch models as technology advances.
To address these challenges, we developed ChatEHR, a vendor-agnostic platform integrated directly into the Electronic Health Record (EHR). ChatEHR leverages a patient’s entire multi-year medical history to support both automated clinical tasks and interactive chat interfaces, achieving significant operational savings while maintaining institutional governance.
System Architecture
The ChatEHR Platform is built upon three core technical pillars designed to bridge the gap between raw clinical data and advanced language models.
- Data Orchestration: This layer extracts real-time clinical data, primarily in HL7 FHIR format, filtered by specific time ranges and encounter types.
- Context Management: This component processes queries and patient data efficiently, ensuring that the most relevant information is presented to the model within token limits.
- LLM Routing: A model-agnostic layer that selects the optimal LLM for a given task. The platform currently supports 18 different models from providers including OpenAI, Anthropic, Google, Meta, and DeepSeek, and manages "chunking" for records that exceed standard context windows.
The system facilitates two primary interaction modes: Automations, which are fixed, repetitive tasks like screening for surgical site infections, and an Interactive UI, which allows clinicians to query a patient’s record directly within the EHR.
Evaluation and Datasets
The platform operates on real-time patient data from Stanford Medicine. To ensure performance and safety, we utilized several evaluation frameworks:
- MedHELM: A task-based framework with 37 benchmarks covering clinical decision support and administrative workflows.
- VeriFact & FactScore: Methods used to decompose LLM-generated summaries into "atomic facts" for verification against source records.
- Internal Logs: Analysis of a one-month sample of 1,137 clinician-ChatEHR conversations (1,796 generations) to monitor real-world performance.
Key Findings
Our implementation revealed several critical insights into the deployment of LLMs in a clinical setting:
- Longitudinal Context: ChatEHR’s ability to ingest the entire patient timeline—up to 20 million tokens—is vital for synthesizing complex histories that span multiple years.
- Model Agnosticism: Different clinical tasks require different underlying models. High-reasoning tasks like hospice eligibility screening benefit from more advanced models, while simple summarization can be handled by faster, more cost-effective ones.
- Dynamic Evaluation: Traditional pre-deployment benchmarks proved insufficient for an interactive UI. We transitioned to a continuous monitoring model, analyzing interaction logs to identify specific failure modes and common tasks.
- Economic Impact: Initial estimates suggest $6M in annual savings, primarily driven by reduced manual chart review time and improved patient throughput. While many of these are "soft" savings—time repurposed for patient care—they represent a significant increase in institutional efficiency.
Results and Clinical Utility
Within 1.5 years, the platform deployed 7 automations and trained 1,075 users. The interactive UI saw 23,000 sessions in its first three months. Clinician feedback was overwhelmingly positive for specific tasks: "Identify barriers to clinical discharge" received 95.6% positive feedback, and "Summarize patient clinical history" received 72.6%.
In terms of accuracy, summarization tasks averaged 0.73 hallucinations and 1.60 inaccuracies per generation. While these figures indicate a need for continued refinement, 44% of generations contained one or zero unsupported claims, demonstrating substantial utility.
Discussion and Future Directions
Despite its success, ChatEHR faces ongoing challenges. LLMs still struggle with precise temporal reasoning and the interpretation of complex numeric values like lab results. There is also a risk of "automation bias," where clinicians might over-rely on AI summaries without verifying source documents.
Future development focuses on implementing automated citations to link every AI-generated fact to its specific location in the medical record. Additionally, we are developing "uncertainty guardrails" to flag responses where the model's confidence is low, further enhancing the safety and reliability of the platform. By building from within, health systems can maintain control over their AI strategy, ensuring it remains vendor-agnostic and internally governed.
Summary updated