Extracting OPQRST in Electronic Health Records using Large Language Models with Reasoning

He Daqing, Zhimeng Luo, Abhibha Gupta, Adam Frisch, Daqing HearXiv 2025 · DOI

Introduction

Electronic Health Records (EHRs) are essential repositories of patient information, yet much of the clinical nuance is trapped within unstructured "History of Present Illness" (HPI) notes. Clinicians traditionally use the OPQRST mnemonic—Onset, Provocation, Quality, Region, Severity, and Timing (often including Radiation and Palliation)—to systematically evaluate symptoms. Automating the extraction of these features is critical for large-scale clinical research and decision support, yet traditional methods often fall short.

The Limitations of Traditional NER

Standard Machine Learning approaches typically treat symptom extraction as a Named Entity Recognition (NER) task. However, traditional NER faces significant hurdles in the clinical domain:

  1. Data Scarcity: High-quality, human-labeled medical data is expensive and rare, making it difficult to train robust supervised models.
  2. Interpretability: "Black box" models offer no explanation for their extractions, which is a major barrier to clinical trust.
  3. Rigid Evaluation: Metrics like F1-score often require exact character-level matches, penalizing semantically correct paraphrases (e.g., marking "started 2 hours ago" as a failure if the ground truth is "2 hours prior").

Methodology: Reasoning-Based Extraction

This research proposes a shift from simple sequence labeling to reasoning-based text generation. By leveraging Large Language Models (LLMs) like Llama-2-13B, the authors developed a specialized prompting strategy that mimics a physician's cognitive workflow.

The core of the approach is a six-part prompt designed to guide the model through a structured thought process:

  • Task and Entity Definitions: Establishing clear medical context and definitions for each OPQRST category.
  • Cognitive Mimicry: Instructing the model to identify specific linguistic markers and placeholder phrases commonly used by clinicians.
  • Reasoning Steps: Requiring the model to articulate its logic and identify relevant context before extracting the final answer.
  • Self-Verification: A secondary internal check where the model reviews its own reasoning to minimize hallucinations and errors.
  • Few-Shot Learning: Providing a small set of high-quality examples to ground the model's output format.

To address evaluation rigidity, the team introduced PromptLLM and BERTScore, using a secondary LLM to judge semantic equivalence between the model's output and the expert-annotated ground truth.

Key Results and Performance

The reasoning-based method demonstrated significant performance gains over standard prompting techniques. Using Llama-2-13B-chat, the system achieved an F1 score of 0.944 for "Onset," significantly outperforming simple prefix prompting (0.424) and standard Chain of Thought (0.488).

Confusion matrices for OPQRST categories using the reasoning-based extraction method.

As shown in the confusion matrices above, the model maintains high accuracy across diverse clinical categories. The diagonal density indicates strong alignment between the predicted and true categories for Onset, Provocation, Quality, Palliation, Severity, Radiation, and Region. Notably, the "Self-Verification" step alone contributed to an 8% improvement in F1 scores, suggesting that LLMs often possess the correct internal logic but require structured prompts to consolidate that logic into accurate outputs.

Conclusion

By reframing clinical extraction as a reasoning task rather than a labeling task, this approach achieves high accuracy in low-resource settings while providing interpretable logic for its extractions. The high agreement between the automated PromptLLM evaluation and human experts (Kappa > 0.7) suggests this is a scalable pathway for evaluating clinical AI. Future work will focus on fine-tuning models on clinical corpora and developing interfaces that allow clinicians to verify the model's reasoning in real-time.

Summary updated

BibTeX
@misc{daqing2025extracting,
  author = {He Daqing and Zhimeng Luo and Abhibha Gupta and Adam Frisch and Daqing He},
  title = {{Extracting OPQRST in Electronic Health Records using Large Language Models with Reasoning}},
  year = {2025},
  eprint = {2509.01885},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.01885},
}
Figure