D ia LLM s: EHR -Enhanced Clinical Conversational System for Clinical Test Recommendation and Diagnosis Prediction (2025)

Abstract: Recent advances in Large Language Models (LLMs) have led to remarkable progresses in medical consultation.However, existing medical LLMs overlook the essential role of Electronic Health Records (EHR) and focus primarily on diagnosis recommendation, limiting their clinical applicability. We propose DiaLLM, the first medical LLM that integrates heterogeneous EHR data into clinically grounded dialogues, enabling clinical test recommendation, result interpretation, and diagnosis prediction to better align with real-world medical practice. To construct clinically grounded dialogues from EHR, we design a Clinical Test Reference (CTR) strategy that maps each clinical code to its corresponding description and classifies test results as “normal” or “abnormal”. Additionally, DiaLLM employs a reinforcement learning framework for evidence acquisition and automated diagnosis. To handle the large action space, we introduce a reject sampling strategy to reduce redundancy and improve exploration efficiency. Furthermore, a confirmation reward and a class-sensitive diagnosis reward are designed to guide accurate diagnosis prediction.Extensive experimental results demonstrate that DiaLLM outperforms baselines in clinical test recommendation and diagnosis prediction. Our code is available at Github.

## introduction rapid advancements in llms @xcite expanded opportunities to improve diagnostic assistance and patient interactions in the healthcare domain @xcite @xcite , and clinical conversational systems @xcite have emerged as a promising approach to enhance clinical reasoning and assist doctors with diagnosis. however, as shown in how to learn from ehr data? ehr data is a comprehensive digital record encompassing a patient's medical history, treatments, test results, and clinical decisions. as shown in figure 1 , ehr captures multiple clinical visits and can be structured as a dialogue for clinical conversational systems. however, its heterogeneity and domain-specific nature pose a fundamental challenge, limiting compatibility with existing llms @xcite . unlike general nlp tasks, ehr data includes nu- ## conclusion in this work, we introduced diallm, a clinical dialogue model that enhances medical conversational systems through a combination of clinicalgrounded ehr transformation and ppo optimization. experimental results consistently show that diallm outperforms existing models across a variety of metrics, demonstrating its superior prediction ability. by integrating domain-specific knowledge and a structured decision-making process, diallm offers a significant improvement over both general-purpose and medical-specific llms in complex medical dialogues.