Language models read doctors' notes to reveal why patients discontinue medication

· Medical Xpress

by Estonian Research Council

edited by Gaby Clark, reviewed by Andrew Zinin

Gaby Clark

Scientific Editor

Meet our editorial team
Behind our editorial process

Andrew Zinin

Chief Editor

Meet our editorial team
Behind our editorial process Editors' notes

This article has been reviewed according to Science X's editorial process and policies. Editors have highlighted the following attributes while ensuring the content's credibility:

fact-checked

peer-reviewed publication

trusted source

proofread

The GIST Add as preferred source


Members of the Health Informatics Research Group of the University of Tartu: Hendrik Šuvalov, Maria Malk and Raivo Kolde. Credit: University of Tartu, Marianne Liiv

Researchers at the University of Tartu showed that large language models can identify with high accuracy why patients stop using antidiabetic medications or statins based on doctors' electronic clinical notes. The study opens new possibilities for using clinical information that has so far been difficult to analyze in health research.

The study, carried out by the Health Informatics Research Group at the Institute of Computer Science of the University of Tartu, combined prescription data from a 10% representative sample of the Estonian population from 2012 to 2019 with clinical notes. The paper is published in the Journal of Medical Internet Research.

"Prescription data show us that a medicine was no longer purchased, but the reason is often written in the doctor's notes instead. Until now, this information could only be used to a very limited extent because manually reviewing medical records is extremely time-consuming," said Hendrik Šuvalov, junior research fellow in health informatics at the University of Tartu.

First, the researchers identified patients who had not purchased a medication for at least one year. They then used large language models to identify references to treatment discontinuation in doctors' notes and, where possible, determine whether the decision had been initiated by the patient or the physician.

Most of the analysis was carried out using the Llama 3.1-70B language model in a secure local environment. For comparison, GPT-4o was used only on manually reviewed text that had been stripped of sensitive information. Medical experts confirmed that the language model running on the university server was highly accurate in identifying phrases and reasons related to medication discontinuation: Accuracy was 93%–98% for extracting discontinuation phrases and 95%–96% for extracting reasons.

According to Šuvalov, the study shows that health data contain far more information than what is reflected in diagnoses, laboratory results or prescription records.

"Health data also provide insight into how treatment actually unfolds in everyday clinical care. Patients' experiences, side effects and reasons for changing treatment often make their way into doctors' notes, but remain unused in conventional data analyses," Šuvalov said.

The study found that treatment was most often discontinued because of adverse reactions. Among statins, adverse reactions accounted for approximately 70% of documented reasons for discontinuation, while among antidiabetics they accounted for nearly 45% of cases. Compared with statins, discontinuation of antidiabetic medications was also more often linked to insufficient treatment effect and contraindications.

The greatest value of the study, however, lies in the methodology: using language models to transform clinical free text, which has previously been difficult to use, into analyzable data. This can help researchers better understand treatment pathways and support evidence-based decision-making in health policy.

Publication details

Hendrik Šuvalov et al, Extracting and Classifying Drug Discontinuations From Estonian Electronic Health Records: Development and Validation Study, Journal of Medical Internet Research (2026). DOI: 10.2196/86183

Journal information: Journal of Medical Internet Research

Key medical concepts

StatinsAgent, AntidiabeticDrug Reactions

Clinical categories

Clinical pharmacology Provided by Estonian Research Council Who's behind this story?

Gaby Clark

MA in English, copy editor since 2021 with experience in higher education and health content. Dedicated to trustworthy science news. Full profile →

Andrew Zinin

Master's in physics with research experience. Long-time science news enthusiast. Plays key role in Science X's editorial success. Full profile →

Citation: Language models read doctors' notes to reveal why patients discontinue medication (2026, June 25) retrieved 25 June 2026 from https://medicalxpress.com/news/2026-06-language-doctors-reveal-patients-discontinue.html This document is subject to copyright. Apart from any fair dealing for the purpose of private study or research, no part may be reproduced without the written permission. The content is provided for information purposes only.