Abstract
Clinical narratives in electronic health records (EHRs) contain essential diagnostic, therapeutic, and temporal information that is often missing from structured fields, leaving manual chart review as the de facto standard for high-quality labels. However, manual review is slow, costly, and variable, constraining accurate cohort construction. We developed CLINES, a modular agentic pipeline that extracts and structures clinical concepts through semantic chunking, extraction by reasoning-capable large language models (LLMs), assignment of attributes, normalization to the Unified Medical Language System (UMLS), and resolution of temporal data. Zero-shot evaluation across MIMIC-III, 4CE, and CORAL datasets demonstrated that CLINES significantly outperforms rule-based systems, transformer encoders, and single-prompt LLM baselines, maintaining stable performance even as note length increases.
Introduction
Electronic Health Records (EHRs) are a gold mine of patient data, but the most valuable insights—clinical reasoning, nuanced symptoms, and temporal sequences—are buried in unstructured narrative notes. Currently, the "gold standard" for extracting this information is manual chart review by clinicians, which is prohibitively slow and difficult to scale. Existing automated solutions typically fall into two camps: brittle rule-based systems (e.g., cTAKES) or standard Transformer models with limited context windows and poor attribute capture. CLINES addresses these gaps by using a modular, agentic approach to mimic the thoroughness of a human reviewer.
Methods: The CLINES Pipeline
CLINES (Clinical LLM-based Information Extraction and Structuring Agent) is a four-step modular pipeline designed to transform messy clinical narratives into structured, ontology-grounded data.
- Semantic Chunking: Long notes are broken into ~768-token fragments using
SemChunkto preserve clinical meaning and semantic coherence. - Clinical Entity Extraction: An LLM identifies mentions of diseases, medications, and lab tests in narrative order.
- Concept & Attribute Enrichment: This reasoning core performs term normalization (mapping to UMLS), date processing (resolving relative dates like "three days post-admission"), and attribute extraction (assertion status, numerical values, and dosages).
- Aggregation & Schema Adaptation: Findings are deduplicated across chunks and exported into standard formats like i2b2, JSON, or SQL.
Detailed Extraction and Enrichment
Unlike monolithic "one-shot" prompts, CLINES breaks the extraction task into specialized sub-tasks. This modularity prevents hallucinations and ensures that complex attributes—such as whether a medication was actually administered or merely discussed—are captured accurately.
Results and Discussion
CLINES was evaluated in a zero-shot setting across diverse EHR corpora, including MIMIC-III (critical care), 4CE (COVID-19), and CORAL (oncology).
Key Performance Metrics
- Entity Extraction: Achieved F1 scores ranging from 0.69 (MIMIC-III) to 0.87 (4CE).
- Comparative Gains: CLINES showed an absolute F1 gain of +0.21 to +0.38 over the strongest single-prompt LLM baselines and outperformed specialized transformer encoders by +0.28 to +0.68 F1.
- Temporal Accuracy: In oncology and COVID-19 datasets, it achieved F1 scores of 0.73 to 0.79 for joint start-end date correctness, a task where traditional baselines often fail entirely.
Stability and Reasoning
A critical advantage of CLINES is its stability across scale; performance remains consistent regardless of note length, whereas traditional transformer baselines see sharp drops in recall as notes lengthen. Furthermore, the system demonstrates sophisticated reasoning, such as inferring missing units (e.g., knowing "Glic 617" refers to glucose in mg/dL) and resolving complex temporal chains.
Conclusion
CLINES translates narrative EHR text into ontology-grounded, auditable, and schema-ready data, offering a practical route to scale chart-review-like extraction for cohort discovery and real-world evidence. While risks like prompt sensitivity and rare abbreviation hallucinations remain, the model-agnostic nature of CLINES allows for future refinement through domain-specific fine-tuning and human-in-the-loop feedback.
Summary updated