Comparing computable structured phenotype- versus large language model-identification of opioid use disorder using electronic health record data

Melanie F. Molina, Cynthia Fenton, Kathy T. LeSaint, Samuel D. Pimentel, Aaron E. KornblithmedRxiv 2025

Abstract

Both approaches demonstrated strong diagnostic performance. Although the structured phenotype showed slightly higher sensitivity, the LLM achieved higher specificity and PPV, suggesting potential to reduce false-positive alerts in ED workflows. Prospective validation in larger, representative populations is needed to guide clinical implementation.

Introduction

Opioid Use Disorder (OUD) remains a critical driver of the global overdose crisis. The Emergency Department (ED) often serves as a primary point of contact for individuals with OUD, offering a vital window for intervention and treatment initiation. However, identifying OUD at scale remains a challenge. Manual chart review is labor-intensive and impractical for real-time clinical workflows.

Existing automated identification methods typically rely on "computable phenotypes"—rule-based algorithms that search for specific ICD-10 codes, medications, or keywords in structured Electronic Health Record (EHR) data. While useful, these methods often lack the nuance required to distinguish between active OUD and other clinical contexts, such as chronic pain management or one-time procedural medication use. This leads to "alert fatigue" for clinicians. This study evaluates whether Large Language Models (LLMs), specifically GPT-4.1, can leverage narrative clinical notes to improve the accuracy of OUD identification.

Methods

This retrospective study analyzed 202 adult ED encounters at the University of California, San Francisco (UCSF). The researchers compared two automated identification strategies against a human-expert "gold standard":

  1. Computable Structured Phenotype: A site-adapted version of an established rule-based algorithm. It identified encounters based on ICD-10 codes, active prescriptions for buprenorphine or methadone, positive toxicology results, and specific keywords (e.g., "heroin," "COWS") within the EHR.
  2. Zero-Shot LLM (GPT-4.1): Clinical notes from each encounter (excluding student and procedure notes) were concatenated and processed by the model. Using a zero-shot approach—meaning the model was not fine-tuned or given specific examples—the model was prompted to determine the presence of OUD based on the narrative context.
  3. Human Reference Standard: Two board-certified emergency physicians independently reviewed the charts to establish a ground truth. Discrepancies were resolved through consensus.

The dataset was constructed using stratified random sampling from an initial pool of 70,880 encounters, resulting in a balanced set of 101 phenotype-positive and 101 phenotype-negative cases.

Results

The comparative analysis revealed a significant performance gap between the two automated methods, particularly regarding specificity. While the structured phenotype achieved a near-perfect sensitivity of 0.98, its specificity was only 0.54, leading to a high rate of false positives. In contrast, the LLM maintained a high sensitivity of 0.93 while achieving a much higher specificity of 0.90.

Table 2: Test characteristics of the computable structured phenotype versus the LLM identification method.

The Positive Likelihood Ratio (LR+) for the LLM was 8.9, compared to 2.13 for the structured phenotype, indicating that a positive result from the LLM is far more likely to represent a true case of OUD. McNemar’s tests confirmed that the difference in specificity was statistically significant ($p < 0.001$).

Discussion and Key Insights

The primary advantage of the LLM approach lies in its ability to interpret the context of clinical narratives. Structured data often fails to capture the "why" behind a clinical finding. For instance, a positive toxicology screen for fentanyl might trigger a structured phenotype alert, even if the drug was administered by a clinician during a procedure. The LLM can distinguish these scenarios by reading the surrounding text.

However, both methods faced challenges. A qualitative review of errors highlighted common pitfalls, such as the "Care Everywhere" blind spot. Because the automated tools only had access to local EHR data, they often missed OUD diagnoses documented in external health systems that were visible to human reviewers.

Qualitative analysis of false positive and false negative cases across identification methods.

The researchers suggest that a "tiered" approach might be most effective for clinical implementation: using the high-sensitivity structured phenotype as an initial screen, followed by an LLM "filter" to eliminate false positives before alerting a clinician. This could significantly reduce alert fatigue in high-pressure ED environments.

Limitations and Future Work

This study was limited by a relatively small sample size at a single academic institution. Furthermore, the LLM's performance was evaluated using a simple zero-shot prompt; future work could explore more advanced techniques like "chain-of-thought" prompting or few-shot learning. Additionally, the study did not address the integration of cross-system documentation (e.g., Epic’s Care Everywhere) or the real-world impact of these tools on clinical outcomes and cost-effectiveness.

Summary updated

BibTeX
@misc{molina2025comparing,
  author = {Melanie F. Molina and Cynthia Fenton and Kathy T. LeSaint and Samuel D. Pimentel and Aaron E. Kornblith and Aaron E. Kornblith},
  title = {{Comparing computable structured phenotype- versus large language model-identification of opioid use disorder using electronic health record data}},
  year = {2025},
  doi = {10.64898/2025.12.17.25342510},
  howpublished = {medRxiv},
}
Figure