EUVIMEDEUVIMED entdecken
Open Access · CC BY 4.0

EC2Seq2Sql: Patient-trial matching with LLM agents

Liu Yang, Yongzhong Han, Liang Liu, Xiaoyan Jiang, Ying Li, Jihan Huang, Qianmin Su iD

PLOS One · 12.02.2026 · 21 (2) · e0341827

DOI: 10.1371/journal.pone.0341827 ↗

Kurz gefasst

Fachartikel in der Zeitschrift PLOS One, online erschienen am 12.02.2026. Verfasst von Liu Yang und 6 weiteren Autor:innen. Beteiligte Einrichtung: School of Electronic and Electrical Engineering, Shanghai University of Engineering Science, Shanghai, China. Hauptthemen laut MEDLINE: Clinical Trials as Topic, Natural Language Processing, Patient Selection. Die Arbeit wurde bisher 4-mal zitiert (Crossref) und nennt 46 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0). Gefördert von: Longhua Hospital Shanghai University of Traditional Chinese Medicine.

AbstractSchlagwörterBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

Timely identification of patients who meet clinical trial eligibility criteria is a persistent bottleneck in trial recruitment because the criteria are written in flexible natural language, while hospital EHRs are stored in structured schemas. To bridge this gap, we propose EC2Seq2Sql, an end-to-end, two-stage framework that automatically converts narrative eligibility criteria into executable SQL queries for EHR-based patient screening. In the first stage, a BART-based semantic parser transforms free-text trial criteria into lightweight structured pattern sequences defined over seven common clinical domains. In the second stage, an LLM-based agent, guided by system- and human-designed prompts, grounds these structured patterns to the target database schema and generates syntactically valid and logically coherent SQL statements. We evaluated the framework on the ClinicalTrials.gov eligibility-criteria dataset and further validated it on a de-identified real-world hepatocellular carcinoma EHR cohort from Zhongshan Hospital, Fudan University. The BART parser outperformed representative Seq2Seq baselines, achieving ROUGE_L 0.8067 and BLEU 0.8427, while the SQL generation stage reached an exact-match accuracy of 0.84 and an execution accuracy of 0.91 after SQL normalization. On the real-world cohort, the generated queries achieved a clinical match accuracy of 0.88 after expert review, indicating that the proposed pipeline can retrieve trial-eligible patients from operational EHR data. These results suggest that EC2Seq2Sql can substantially reduce manual screening effort and provide a reproducible path from narrative criteria to database-level cohort identification, although broader multi-center validation and ontology-based normalization will be needed for large-scale deployment.

Schlagwörter

MeSH-Schlagwörter (MEDLINE)

Clinical Trials as TopicNatural Language ProcessingPatient SelectionHumansElectronic Health RecordsLarge Language Models

Autor:innen und Institutionen

  • School of Electronic and Electrical Engineering, Shanghai University of Engineering Science, Shanghai, China.
  • Clinical Research Unit, Institute of Clinical Science, Zhongshan Hospital, Fudan University, Shanghai, China.
  • Leiden Institute of Advanced Computer Science, Leiden University, Leiden, Netherlands.
  • Department of Hepatology Longhua Hospital, Shanghai University of Traditional Chinese Medicine, Shanghai, China.
  • Center for Drug Clinical Research, Shanghai University of Traditional Chinese Medicine, Shanghai, China.

ORCID-Profile: Qianmin Su

Förderung

  • Longhua Hospital Shanghai University of Traditional Chinese Medicine

Zitieren

APA

Yang, L., Han, Y., Liu, L., Jiang, X., Li, Y., Huang, J., & Su, Q. (2026). EC2Seq2Sql: Patient-trial matching with LLM agents. PLOS One, 21(2), e0341827. https://doi.org/10.1371/journal.pone.0341827

Vancouver

Yang L, Han Y, Liu L, Jiang X, Li Y, Huang J, et al. EC2Seq2Sql: Patient-trial matching with LLM agents. PLOS One. 2026;21(2):e0341827. doi:10.1371/journal.pone.0341827

BibTeX
@article{Yang2026,
  author = {Yang, Liu and Han, Yongzhong and Liu, Liang and Jiang, Xiaoyan and Li, Ying and Huang, Jihan and Su, Qianmin},
  title = {EC2Seq2Sql: Patient-trial matching with LLM agents},
  journal = {PLOS One},
  year = {2026},
  volume = {21},
  number = {2},
  pages = {e0341827},
  doi = {10.1371/journal.pone.0341827}
}
Kostenlos starten →