<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.0 20040830//EN" "journalpublishing.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="2.0" xml:lang="en" article-type="research-article"><front><journal-meta><journal-id journal-id-type="nlm-ta">J Med Internet Res</journal-id><journal-id journal-id-type="publisher-id">jmir</journal-id><journal-id journal-id-type="index">1</journal-id><journal-title>Journal of Medical Internet Research</journal-title><abbrev-journal-title>J Med Internet Res</abbrev-journal-title><issn pub-type="epub">1438-8871</issn><publisher><publisher-name>JMIR Publications</publisher-name><publisher-loc>Toronto, Canada</publisher-loc></publisher></journal-meta><article-meta><article-id pub-id-type="publisher-id">v28i1e97485</article-id><article-id pub-id-type="doi">10.2196/97485</article-id><article-categories><subj-group subj-group-type="heading"><subject>Original Paper</subject></subj-group></article-categories><title-group><article-title>Natural Language Processing Identification of Nonprescribed Fentanyl Use in Electronic Health Records: Algorithm Development and Validation Study</article-title></title-group><contrib-group><contrib contrib-type="author" corresp="yes"><name name-style="western"><surname>Trujeque</surname><given-names>Joshua</given-names></name><degrees>MD</degrees><xref ref-type="aff" rid="aff1">1</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Simonetti</surname><given-names>Joseph A</given-names></name><degrees>MD, MPH</degrees><xref ref-type="aff" rid="aff2">2</xref><xref ref-type="aff" rid="aff3">3</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Ortiz</surname><given-names>Isai</given-names></name><degrees>MD</degrees><xref ref-type="aff" rid="aff4">4</xref><xref ref-type="aff" rid="aff5">5</xref><xref ref-type="aff" rid="aff6">6</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Ingraham</surname><given-names>Nicholas E</given-names></name><degrees>MD, MS</degrees><xref ref-type="aff" rid="aff7">7</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Mesfin</surname><given-names>Nathan</given-names></name><degrees>MD</degrees><xref ref-type="aff" rid="aff7">7</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Yeung</surname><given-names>Jeremy</given-names></name><degrees>MIDS</degrees><xref ref-type="aff" rid="aff8">8</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Zhang</surname><given-names>Rui</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff9">9</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Brenner</surname><given-names>Lisa A</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff10">10</xref><xref ref-type="aff" rid="aff11">11</xref><xref ref-type="aff" rid="aff12">12</xref><xref ref-type="aff" rid="aff13">13</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Dudley</surname><given-names>R Adams</given-names></name><degrees>MD, MBA</degrees><xref ref-type="aff" rid="aff7">7</xref><xref ref-type="aff" rid="aff8">8</xref><xref ref-type="aff" rid="aff14">14</xref><xref ref-type="aff" rid="aff15">15</xref></contrib></contrib-group><aff id="aff1"><institution>Minneapolis Veterans Affairs Healthcare System, Center for Care Delivery and Outcomes Research</institution><addr-line>One Veterans Drive</addr-line><addr-line>Minneapolis</addr-line><addr-line>MN</addr-line><country>United States</country></aff><aff id="aff2"><institution>Rocky Mountain Mental Illness Research, Education, and Clinical Center for Suicide Prevention, Rocky Mountain Regional VA Medical Center</institution><addr-line>Aurora</addr-line><addr-line>CO</addr-line><country>United States</country></aff><aff id="aff3"><institution>Injury and Violence Prevention Center, Colorado School of Public Health, University of Colorado Anschutz Medical Campus</institution><addr-line>Aurora</addr-line><addr-line>CO</addr-line><country>United States</country></aff><aff id="aff4"><institution>Center for Veterans Research and Education</institution><addr-line>Minneapolis</addr-line><addr-line>MN</addr-line><country>United States</country></aff><aff id="aff5"><institution>Northwell Health</institution><addr-line>New Hyde Park</addr-line><addr-line>NY</addr-line><country>United States</country></aff><aff id="aff6"><institution>Department of Psychiatry, Zucker Hillside Hospital</institution><addr-line>Glen Oaks</addr-line><addr-line>NY</addr-line><country>United States</country></aff><aff id="aff7"><institution>Division of Pulmonary, Allergy, and Critical Care Medicine, Department of Medicine, University of Minnesota Medical School</institution><addr-line>Minneapolis</addr-line><addr-line>MN</addr-line><country>United States</country></aff><aff id="aff8"><institution>Institute for Health Informatics, University of Minnesota</institution><addr-line>Minneapolis</addr-line><addr-line>MN</addr-line><country>United States</country></aff><aff id="aff9"><institution>Department of Surgery, University of Minnesota</institution><addr-line>Minneapolis</addr-line><addr-line>MN</addr-line><country>United States</country></aff><aff id="aff10"><institution>Brain Health Coordinating Center, Rocky Mountain VA Regional Medical Center</institution><addr-line>Aurora</addr-line><addr-line>MN</addr-line><country>United States</country></aff><aff id="aff11"><institution>Department of Physical Medicine and Rehabilitation, University of Colorado Anschutz Medical Campus</institution><addr-line>Aurora</addr-line><addr-line>CO</addr-line><country>United States</country></aff><aff id="aff12"><institution>Department of Psychiatry, University of Colorado Anschutz Medical Campus</institution><addr-line>Aurora</addr-line><addr-line>CO</addr-line><country>United States</country></aff><aff id="aff13"><institution>Department of Neurology, University of Colorado Anschutz Medical Campus</institution><addr-line>Aurora</addr-line><addr-line>CO</addr-line><country>United States</country></aff><aff id="aff14"><institution>Center for Care Delivery and Outcomes Research, Minneapolis VA Health Care System</institution><addr-line>Minneapolis</addr-line><addr-line>MN</addr-line><country>United States</country></aff><aff id="aff15"><institution>School of Public Health, University of Minnesota</institution><addr-line>Minneapolis</addr-line><addr-line>MN</addr-line><country>United States</country></aff><contrib-group><contrib contrib-type="editor"><name name-style="western"><surname>Steenstra</surname><given-names>Ivan</given-names></name></contrib></contrib-group><contrib-group><contrib contrib-type="reviewer"><name name-style="western"><surname>Chakit</surname><given-names>Miloud</given-names></name></contrib><contrib contrib-type="reviewer"><name name-style="western"><surname>Gevorgyan</surname><given-names>Natalya</given-names></name></contrib><contrib contrib-type="reviewer"><name name-style="western"><surname>Ravilla</surname><given-names>Reshma</given-names></name></contrib><contrib contrib-type="reviewer"><name name-style="western"><surname>Hu</surname><given-names>Yihan</given-names></name></contrib></contrib-group><author-notes><corresp>Correspondence to Joshua Trujeque, MD, Minneapolis Veterans Affairs Healthcare System, Center for Care Delivery and Outcomes Research, One Veterans Drive, Minneapolis, MN, 55417, United States; <email>Joshua.trujeque@va.gov</email></corresp></author-notes><pub-date pub-type="collection"><year>2026</year></pub-date><pub-date pub-type="epub"><day>9</day><month>9</month><year>2026</year></pub-date><volume>28</volume><elocation-id>e97485</elocation-id><history><date date-type="received"><day>07</day><month>04</month><year>2026</year></date><date date-type="rev-recd"><day>20</day><month>07</month><year>2026</year></date><date date-type="accepted"><day>20</day><month>07</month><year>2026</year></date></history><copyright-statement>&#x00A9; Joshua Trujeque, Joseph A Simonetti, Isai Ortiz, Nicholas E Ingraham, Nathan Mesfin, Jeremy Yeung, Rui Zhang, Lisa A Brenner, R Adams Dudley. Originally published in the Journal of Medical Internet Research (<ext-link ext-link-type="uri" xlink:href="https://www.jmir.org">https://www.jmir.org</ext-link>), 9.9.2026. </copyright-statement><copyright-year>2026</copyright-year><license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by/4.0/"><p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (<ext-link ext-link-type="uri" xlink:href="https://creativecommons.org/licenses/by/4.0/">https://creativecommons.org/licenses/by/4.0/</ext-link>), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work, first published in the Journal of Medical Internet Research (ISSN 1438-8871), is properly cited. The complete bibliographic information, a link to the original publication on <ext-link ext-link-type="uri" xlink:href="https://www.jmir.org/">https://www.jmir.org/</ext-link>, as well as this copyright and license information must be included.</p></license><self-uri xlink:type="simple" xlink:href="https://www.jmir.org/2026/1/e97485"/><abstract><sec><title>Background</title><p>Overdose and suicide due to nonprescribed fentanyl use have increased significantly, yet health care systems lack reliable methods to identify patients who use nonprescribed fentanyl. <italic>International Classification of Diseases</italic> codes are inconsistent and do not specify nonprescribed fentanyl use.</p></sec><sec><title>Objective</title><p>This study aimed to develop natural language processing approaches to identifying nonprescribed fentanyl use in electronic health record (EHR) documentation.</p></sec><sec sec-type="methods"><title>Methods</title><p>This retrospective study included Veterans Health Administration patients seen between April 5, 2023, and December 23, 2024. A term list was developed to identify fentanyl-related mentions in clinical text, and 250-character snippets surrounding identified mentions were extracted. Veterans (n=3878) were randomly sampled from 5 predefined groups based on the presence of 1 of 4 terms (&#x201C;fent,&#x201D; &#x201C;blues,&#x201D; &#x201C;M30s,&#x201D; and &#x201C;tranq&#x201D;) in their EHR documentation. Physician annotators classified snippets into &#x201C;nonprescribed fentanyl use,&#x201D; &#x201C;prescribed fentanyl use,&#x201D; or &#x201C;other,&#x201D; with interannotator agreement evaluated using the mean pairwise Cohen &#x03BA;. Cross-validation folds were constructed at the patient level between training and test sets. Penalized logistic regression, Bio-ClinicalBERT, Llama 3-8B, and Mistral-7B were trained on labeled data and compared. Model performance was evaluated using precision, recall, and <italic>F</italic><sub>1</sub>-scores for each class, with a focus on the nonprescribed fentanyl use class as the primary label of clinical interest using bootstrapped 95% CIs. A fairness analysis and Shapley additive explanations analysis were performed using Bio-ClinicalBERT. External validation was performed using Bio-ClinicalBERT on an independent sample of 200 snippets, each representing a unique patient from January 2025 to June 2026, with precision reported as the primary validation metric.</p></sec><sec sec-type="results"><title>Results</title><p>Of 7389 snippets, 9.6% (n=709) were classified as &#x201C;nonprescribed fentanyl use,&#x201D; 40.3% (n=2981) were classified as &#x201C;prescribed fentanyl use,&#x201D; and 50% (n=3699) were classified as &#x201C;other.&#x201D; Interannotator agreement was high (&#x03BA;=0.822). Llama 3-8B achieved the highest <italic>F</italic><sub>1</sub>-score for nonprescribed fentanyl use (0.87, 95% CI 0.83-0.92), followed by Mistral-7B (0.80, 95% CI 0.75-0.84), Bio-ClinicalBERT (0.80, 95% CI 0.74-0.85), and penalized logistic regression (0.74, 95% CI 0.73-0.75). Performance was consistent across demographic subgroups, with lower performance for the nonprescribed fentanyl use class observed in female and Hispanic subgroups. Shapley additive explanations analysis revealed clinically meaningful discriminating terms for each class, although subword tokens required contextual interpretation. External validation of Bio-ClinicalBERT demonstrated a precision of 0.79 for nonprescribed fentanyl use.</p></sec><sec sec-type="conclusions"><title>Conclusions</title><p>Natural language processing can identify nonprescribed fentanyl use in EHR documentation, although model performance for this class was lower than overall model performance, reflecting the clinical complexity of identifying nonprescribed use and the variable ways in which clinicians document this problem. This approach may support risk prediction and targeting of interventions to patients exposed to nonprescribed fentanyl.</p></sec></abstract><kwd-group><kwd>fentanyl</kwd><kwd>natural language processing</kwd><kwd>opioid</kwd><kwd>overdose</kwd><kwd>veteran</kwd></kwd-group></article-meta></front><body><sec id="s1" sec-type="intro"><title>Introduction</title><p>From 2003 to 2023, the United States age-adjusted drug overdose death rate increased from 8.9 to 31.3 per 100,000, largely attributed to nonprescribed use of fentanyl and fentanyl analogues, with 72,000 overdose deaths associated with nonprescribed fentanyl in 2023 [<xref ref-type="bibr" rid="ref1">1</xref>,<xref ref-type="bibr" rid="ref2">2</xref>]. Despite a recent reduction in US overdoses, nonprescribed fentanyl overdoses and related harms remain common across many populations [<xref ref-type="bibr" rid="ref3">3</xref>,<xref ref-type="bibr" rid="ref4">4</xref>].</p><p>Health care systems are critical intervention points for patients with nonprescribed fentanyl use. Patients who use nonprescribed fentanyl are at risk of developing opioid use disorder (OUD) and complications stemming from use, such as unintentional and intentional (eg, suicide) overdoses and skin wounds from adulterated drugs. The ability to identify patients who use nonprescribed fentanyl could enable health care systems and clinicians to identify opportunities to expand opioid-specific care, including counseling and initiation of medications for OUD. Furthermore, identifying individuals using nonprescribed fentanyl could support the development of system-level interventions focused on harm reduction, such as risk prediction models and distribution of naloxone and xylazine adulterant testing materials.</p><p>Efforts to address nonprescribed fentanyl use are hindered by the lack of reliable methods to identify patients. While there are <italic>International Classification of Diseases</italic> (<italic>ICD</italic>) codes for OUD, they are underused, do not distinguish between types of opioids used, and may not be applied by a clinician if they do not believe that a patient meets the criteria for OUD at that time (thus, information about opioid use is not captured in structured data) [<xref ref-type="bibr" rid="ref5">5</xref>-<xref ref-type="bibr" rid="ref7">7</xref>]. Discerning between patients who use fentanyl rather than other opioids is also important because risk of overdose and treatment strategies are dependent on the type of opioid used [<xref ref-type="bibr" rid="ref8">8</xref>-<xref ref-type="bibr" rid="ref10">10</xref>]. Understanding which specific substances (eg, fentanyl vs other opioids) contribute to opioid use, OUD, and related complications is also informative for policymakers. Furthermore, because fentanyl is commonly prescribed in health care settings, many text mentions reflect prescribed use (eg, procedural sedation), requiring scalable electronic health record (EHR) methods to distinguish between prescribed and nonprescribed use.</p><p>Natural language processing (NLP) is a potential solution to identify patients who use nonprescribed fentanyl. However, there is no published research describing NLP approaches to identify nonprescribed fentanyl use. Rather, NLP and other machine learning approaches have been developed to identify opioid overdose, misuse, and OUD for any kind of opioid rather than fentanyl specifically [<xref ref-type="bibr" rid="ref11">11</xref>-<xref ref-type="bibr" rid="ref14">14</xref>].</p><p>The Veterans Health Administration (VHA), the largest US health system with over 9 million enrollees, offers extensive EHR data for developing NLP methods to identify nonprescribed fentanyl use [<xref ref-type="bibr" rid="ref15">15</xref>]. This is highly relevant to veterans as overdose mortality among them rose 53% from 2010 to 2019, with 93% of those deaths attributed to opioids [<xref ref-type="bibr" rid="ref16">16</xref>]. In response, the VHA has developed and implemented a variety of interventions for OUD, including but not limited to distribution of naloxone and fentanyl testing strips and sterile syringe programs, as well as efforts to expand access to OUD counseling and medication treatment (eg, buprenorphine and methadone) [<xref ref-type="bibr" rid="ref17">17</xref>-<xref ref-type="bibr" rid="ref19">19</xref>]. Thus, clinicians may be prompted or encouraged to document fentanyl use across a variety of settings, and the texts they generate may be useful training data for building classifiers intended to identify a high-risk subset of patients with OUD. In addition, including data on nonprescribed fentanyl use may improve VHA overdose and suicide risk models [<xref ref-type="bibr" rid="ref20">20</xref>]. Our aim was to describe the development and performance of different NLP approaches to identify nonprescribed fentanyl use through EHR data.</p></sec><sec id="s2" sec-type="methods"><title>Methods</title><p>We conducted a retrospective cross-sectional analysis of notes on patients who received VHA care from April 5, 2023, to December 23, 2024.</p><sec id="s2-1"><title>Ethical Considerations</title><p>This study was approved by the Minneapolis VA Health Care System Institutional Review Board (number 1594855). We used the STROBE (Strengthening the Reporting of Observational Studies in Epidemiology) guidelines to describe study procedures and findings [<xref ref-type="bibr" rid="ref21">21</xref>].</p></sec><sec id="s2-2"><title>Term Identification</title><p>We identified an initial list of 8 terms that clinicians might use to document fentanyl use through a combination of literature review; input from subject matter experts; and manual review of 100 EHR notes from patients with an <italic>ICD</italic>, <italic>10th Revision</italic> (<italic>ICD-10</italic>), code for OUD. These terms included &#x201C;fentanyl,&#x201D; &#x201C;fent,&#x201D; &#x201C;blues,&#x201D; &#x201C;M30s,&#x201D; &#x201C;tranq,&#x201D; &#x201C;tranq dope,&#x201D; &#x201C;sleep dope,&#x201D; and &#x201C;fetty.&#x201D; This list was narrowed down to 4 terms (&#x201C;fent,&#x201D; &#x201C;tranq,&#x201D; &#x201C;M30s,&#x201D; and &#x201C;blues&#x201D;) that appeared at least once in our sample.</p></sec><sec id="s2-3"><title>Study Population and Note Processing</title><p>We identified all patients whose EHR documentation included at least one mention of any fentanyl term. For note sampling, we stratified patient encounters a priori into 5 groups based on the expected context in which fentanyl was mentioned, such as addressing OUD (eg, during mental health encounters), prescribed use of fentanyl (eg, during a procedure), or other clinical scenarios. We selected these settings because we hypothesized that terms and documentation styles may differ across these settings. Groups included (1) OUD-related encounters (patients with notes that included a fentanyl term and whose notes were associated with a clinical encounter with an <italic>ICD-10</italic> code for OUD), (2) suicide or overdose event encounters (patients with a Suicide Behavior and Overdose Report [SBOR; a report created by VHA staff for all patients identified as having a suicide or overdose event] in which a fentanyl term was present in any note on or up to 90 days before the most recent SBOR entry), (3) non-OUD and noncrisis event clinical care setting encounters (patients with no SBOR or <italic>ICD-10</italic> code for OUD who nonetheless had at least one fentanyl term in an inpatient or outpatient encounter in the following care settings: primary care, mental health, inpatient medicine, medical intensive care unit, inpatient surgery, social work, chronic pain and wellness, or homeless care team), (4) periprocedure encounters (patients with a Current Procedural Terminology code for 1 of the 10 most frequent procedures performed at the VHA [eg, tissue exam by a pathologist] within 24 hours of a fentanyl term mention), and (5) a bias mitigation sample (a random sample of patients&#x2019; notes from any encounter or note type with a fentanyl term to address potential sources of bias). We initially sampled approximately 200 notes per group randomly and without replacement. Because the low prevalence of the target class limited performance, we added 1000 notes per group to improve model performance. For each identified fentanyl term, we extracted a 250-character snippet of surrounding text, a text length selected based on prior work [<xref ref-type="bibr" rid="ref22">22</xref>] demonstrating sufficient context for classification while maintaining computational efficiency. These snippets were then labeled using a Microsoft Azure machine learning text data labeling project [<xref ref-type="bibr" rid="ref23">23</xref>].</p></sec><sec id="s2-4"><title>Fentanyl Classification</title><p>We developed 3 classification labels for snippets containing fentanyl mentions: &#x201C;nonprescribed fentanyl use,&#x201D; &#x201C;prescribed fentanyl use,&#x201D; and &#x201C;other.&#x201D; &#x201C;Nonprescribed fentanyl use&#x201D; included mentions of fentanyl obtained and used without a prescription both currently and in the past. &#x201C;Prescribed fentanyl use&#x201D; included mentions of fentanyl that was prescribed for medical indications, including procedural sedation and transdermal pain treatment. The &#x201C;other&#x201D; category captured fentanyl mentions that did not meet the criteria for prescribed or nonprescribed use. This included concepts such as unspecified OUD; misuse; potential accidental exposure to fentanyl when consuming other nonprescribed drugs (eg, methamphetamines laced with fentanyl); fentanyl testing; fentanyl allergy documentation; uncertain or not enough context; negation of fentanyl use; fentanyl use by another person; standardized or templated clinical language about fentanyl, such as education materials about fentanyl risk that might be addended to a clinical note; and terms with alternative meanings unrelated to fentanyl use (eg, &#x201C;blues&#x201D; documented to describe depression). These subcategories were combined for modeling development because our primary objective was to identify individuals whose snippets contained reasonable clinical documentation of nonprescribed fentanyl use. Prior to annotation, a group of 6 physician annotators with experience treating patients with prescribed and nonprescribed fentanyl use created a conceptual classification schema and refined it over several sessions, in which annotators independently reviewed snippets and then met as a group to align on classification, developing consensus regarding the classification rules and definitions for each class. During annotation, each snippet was classified independently by at least 3 physicians prior to reaching a consensus classification or determining the need for further review. Interannotator agreement was assessed among the 6 physician annotators on approximately 30% of the snippets before consensus using mean pairwise unweighted Cohen &#x03BA; values [<xref ref-type="bibr" rid="ref24">24</xref>]. For snippets where annotators did not reach consensus, classification was determined through group discussion to prioritize precision over recall to minimize false positives, recognizing that in a clinical application, false positives could lead to unnecessary interventions. Snippets with consensus were used as the final dataset for training, validation, and testing of the NLP models.</p></sec><sec id="s2-5"><title>Development of NLP Models</title><p>On the basis of model performance in prior work [<xref ref-type="bibr" rid="ref22">22</xref>], we reused the same nonneural and neural models and applied the same modeling framework: ridge-penalized logistic regression and Bio-ClinicalBERT. We also compared these 2 previously useful models to 2 other large language models (Mistral-7B [Mistral AI] and Llama 3-8B [Meta AI]) using instruction tuning, 10-fold cross-validation with 90% of data used for training and 10% held out for testing, and fixed random seeds to choose the initial value for parameters in each model to ensure reproducibility [<xref ref-type="bibr" rid="ref25">25</xref>,<xref ref-type="bibr" rid="ref26">26</xref>]. Cross-validation folds were split at the patient level to prevent overlap between training and test sets.</p><p>Model performance was evaluated using precision, recall, and <italic>F</italic><sub>1</sub>-scores for each class. To estimate the uncertainty in model performance, the test set was bootstrapped 100 times by resampling snippets with replacement. Performance metrics were calculated for each bootstrap sample, and the mean and corresponding 95% CIs were reported. To interpret model predictions, we implemented Shapley additive explanations (SHAP) [<xref ref-type="bibr" rid="ref27">27</xref>]. The highest overall <italic>F</italic><sub>1</sub>-score from all folds was used to calculate SHAP values for the Bio-ClinicalBERT model. To address algorithmic bias, particularly in relation to demographic differences, a fairness analysis was performed on the Bio-ClinicalBERT model by stratifying each bootstrapped test set according to patient demographic characteristics, including sex (male or female), race (White or non-White), and ethnicity (Hispanic or non-Hispanic). Performance metrics were calculated separately for each subgroup, and the mean and 95% CIs were reported across the 100 bootstrap samples.</p></sec><sec id="s2-6"><title>External Validation</title><p>External validation was conducted to assess the real-world performance on identifying nonprescribed fentanyl use using data that were both temporally and patient independent from the original training and test sets. Using the same term-based snippet extraction method, we identified fentanyl mentions among VHA patients from January 2025 to June 2026, excluding all patients included in the original dataset. The fine-tuned Bio-ClinicalBERT model classified the extracted snippets, and 200 snippets classified as nonprescribed fentanyl use were randomly sampled, retaining the first snippet from the first note per patient so that each snippet referred to a unique patient to translate snippets into a patient-level identification. Each snippet was annotated using the same classification criteria. As identifying nonprescribed fentanyl use was the primary clinical objective, only model-positive cases were reviewed. Thus, only precision was calculated based on the proportion of confirmed patients upon manual review.</p></sec></sec><sec id="s3" sec-type="results"><title>Results</title><p>The demographics of the study sample are shown in <xref ref-type="table" rid="table1">Table 1</xref>. A total of 3878 patients were identified, including 847 (21.8%) in group 1, 908 (23.4%) in group 2, 678 (17.5%) in group 3, 784 (20.2%) in group 4, and 661 (17%) in group 5. The mean age, sex, race, and ethnicity of the 5 groups were comparable to those of the general VHA population [<xref ref-type="bibr" rid="ref28">28</xref>]. Among the 7389 annotated snippets, the most common classification was &#x201C;other&#x201D; (n=3699, 50%), followed by &#x201C;prescribed fentanyl use&#x201D; (n=2981, 40.3%) and &#x201C;nonprescribed fentanyl use&#x201D; (n=709, 9.6%; <xref ref-type="table" rid="table1">Table 1</xref>). The most common term used to identify snippets was &#x201C;fent&#x201D; ( 7310/7403, 98.7%), followed by &#x201C;blues&#x201D; (176/7403%), &#x201C;tranq&#x201D; (14/7403, 0.2%), and &#x201C;M30s&#x201D; (0% 3/7403), indicating that these alternative terms to &#x201C;fent&#x201D; contributed minimally to overall yield. For all 15 pairwise physician annotator combinations, the mean pairwise &#x03BA; was 0.822 (SD 0.074), indicating high agreement.</p><p>Following patient-level splitting, the training and test sets comprised 3610 and 881 unique patients, respectively, with no overlap. <xref ref-type="table" rid="table2">Table 2</xref> shows model performance for classifying snippets as &#x201C;nonprescribed fentanyl use,&#x201D; &#x201C;prescribed fentanyl use,&#x201D; or &#x201C;other.&#x201D;</p><table-wrap id="t1" position="float"><label>Table 1.</label><caption><p>Patient demographics and snippet classification by annotators for each patient group.</p></caption><table id="table1" frame="hsides" rules="groups"><thead><tr><td align="left" valign="top">Demographics</td><td align="left" valign="top">Group 1 (<italic>ICD-10</italic><sup><xref ref-type="table-fn" rid="table1fn1">a</xref></sup> code for OUD<sup><xref ref-type="table-fn" rid="table1fn2">b</xref></sup> and fentanyl term)</td><td align="left" valign="top">Group 2 (SBOR<sup><xref ref-type="table-fn" rid="table1fn3">c</xref></sup> in previous year and fentanyl term)</td><td align="left" valign="top">Group 3 (various encounter types without <italic>ICD-10</italic> codes for OUD or SBOR and fentanyl term)</td><td align="left" valign="top">Group 4 (encounter with top 10 CPT<sup><xref ref-type="table-fn" rid="table1fn4">d</xref></sup> codes within 24 h of a fentanyl term)</td><td align="left" valign="top">Group 5 (random sample of notes and fentanyl term)</td></tr></thead><tbody><tr><td align="left" valign="top">Patients (n=3878), n (%)</td><td align="left" valign="top">847 (21.8)</td><td align="left" valign="top">908 (23.4)</td><td align="left" valign="top">678 (17.5)</td><td align="left" valign="top">784 (20.2)</td><td align="left" valign="top">661 (17)</td></tr><tr><td align="left" valign="top">Age (y), mean (SD)</td><td align="left" valign="top">56 (14.4)</td><td align="left" valign="top">54 (15.9)</td><td align="left" valign="top">63 (15.5)</td><td align="left" valign="top">60 (14.7)</td><td align="left" valign="top">60 (15.9)</td></tr><tr><td align="left" valign="top" colspan="6">Sex, n/N (%)</td></tr><tr><td align="left" valign="top">&#x2003;Female</td><td align="left" valign="top">67/847 (7.9)</td><td align="left" valign="top">135/908 (14.9)</td><td align="left" valign="top">72/678 (10.6)</td><td align="left" valign="top">101/784 (12.9)</td><td align="left" valign="top">93/661 (14.1)</td></tr><tr><td align="left" valign="top">&#x2003;Male</td><td align="left" valign="top">780/847 (92.1)</td><td align="left" valign="top">773/908 (85.1)</td><td align="left" valign="top">606/678 (89.4)</td><td align="left" valign="top">683/784 (87.1)</td><td align="left" valign="top">568/661 (85.9)</td></tr><tr><td align="left" valign="top" colspan="6">Race, n/N (%)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>American Indian</td><td align="left" valign="top">6/847 (0.7)</td><td align="left" valign="top">11/908 (1.2)</td><td align="left" valign="top">5/678 (0.7)</td><td align="left" valign="top">8/784 (1)</td><td align="left" valign="top">3/661 (0.5)</td></tr><tr><td align="left" valign="top">&#x2003;Asian</td><td align="left" valign="top">4/847 (0.5)</td><td align="left" valign="top">12/908 (1.3)</td><td align="left" valign="top">4/678 (0.6)</td><td align="left" valign="top">8/784 (1)</td><td align="left" valign="top">7/661 (1.1)</td></tr><tr><td align="left" valign="top">&#x2003;Black</td><td align="left" valign="top">169/847 (20)</td><td align="left" valign="top">222/908 (24.4)</td><td align="left" valign="top">110/678 (16.2)</td><td align="left" valign="top">166/784 (21.2)</td><td align="left" valign="top">124/661 (18.8)</td></tr><tr><td align="left" valign="top">&#x2003;Hawaiian</td><td align="left" valign="top">14/847 (1.7)</td><td align="left" valign="top">7/908 (0.8)</td><td align="left" valign="top">7/678 (1.0)</td><td align="left" valign="top">11/784 (1.4)</td><td align="left" valign="top">12/661 (1.8)</td></tr><tr><td align="left" valign="top">&#x2003;Multiracial</td><td align="left" valign="top">5/847 (0.6)</td><td align="left" valign="top">10/908 (1.1)</td><td align="left" valign="top">5/678 (0.7)</td><td align="left" valign="top">9/784 (1.1)</td><td align="left" valign="top">7/661 (1.1)</td></tr><tr><td align="left" valign="top">&#x2003;Unknown</td><td align="left" valign="top">83/847 (9.8)</td><td align="left" valign="top">91/908 (10)</td><td align="left" valign="top">59/678 (8.7)</td><td align="left" valign="top">74/784 (9.4)</td><td align="left" valign="top">70/661 (10.6)</td></tr><tr><td align="left" valign="top">&#x2003;White</td><td align="left" valign="top">567/847 (66.9)</td><td align="left" valign="top">555/908 (61.1)</td><td align="left" valign="top">488/678 (72)</td><td align="left" valign="top">508/784 (64.8)</td><td align="left" valign="top">438/661 (66.3)</td></tr><tr><td align="left" valign="top" colspan="6">Ethnicity, n/N (%)</td></tr><tr><td align="left" valign="top">&#x2003;Hispanic</td><td align="left" valign="top">51/847 (6)</td><td align="left" valign="top">86/908 (9.5)</td><td align="left" valign="top">65/678 (9.6)</td><td align="left" valign="top">69/784 (8.8)</td><td align="left" valign="top">69/661 (10.4)</td></tr><tr><td align="left" valign="top">&#x2003;Not Hispanic</td><td align="left" valign="top">729/847 (86.1)</td><td align="left" valign="top">748/908 (82.4)</td><td align="left" valign="top">574/678 (84.7)</td><td align="left" valign="top">661/784 (84.3)</td><td align="left" valign="top">550/661 (83.2)</td></tr><tr><td align="left" valign="top">&#x2003;Unknown</td><td align="left" valign="top">68/847 (8)</td><td align="left" valign="top">74/908 (8.1)</td><td align="left" valign="top">39/678 (5.8)</td><td align="left" valign="top">54/784 (6.9)</td><td align="left" valign="top">42/661 (6.4)</td></tr><tr><td align="left" valign="top" colspan="6">Fentanyl term prevalence, n (%)</td></tr><tr><td align="left" valign="top">&#x2003;Notes (n=4496)</td><td align="left" valign="top">1092 (24.3)</td><td align="left" valign="top">996 (22.2)</td><td align="left" valign="top">910 (20.2)</td><td align="left" valign="top">832 (18.5)</td><td align="left" valign="top">666 (14.8)</td></tr><tr><td align="left" valign="top">&#x2003;Snippets (n=7389)<sup><xref ref-type="table-fn" rid="table1fn5">e</xref></sup></td><td align="left" valign="top">2153 (29.1)</td><td align="left" valign="top">1493 (20.2)</td><td align="left" valign="top">1467 (19.9)</td><td align="left" valign="top">1265 (17.1)</td><td align="left" valign="top">1011 (13.7)</td></tr><tr><td align="left" valign="top" colspan="6">Snippet classification, n/N (%)</td></tr><tr><td align="left" valign="top">&#x2003;Nonprescribed</td><td align="left" valign="top">493/2153 (22.9)</td><td align="left" valign="top">182/1493 (12.2)</td><td align="left" valign="top">12/1467 (0.8)</td><td align="left" valign="top">7/1265 (0.6)</td><td align="left" valign="top">15/1011 (1.5)</td></tr><tr><td align="left" valign="top">&#x2003;Prescribed</td><td align="left" valign="top">506/2153 (23.5)</td><td align="left" valign="top">372/1493 (24.9)</td><td align="left" valign="top">880/1467 (60)</td><td align="left" valign="top">685/1265 (54.2)</td><td align="left" valign="top">538/1011 (53.2)</td></tr><tr><td align="left" valign="top">&#x2003;Other</td><td align="left" valign="top">1154/2153 (53.6)</td><td align="left" valign="top">939/1493 (62.9)</td><td align="left" valign="top">575/1467 (39.2)</td><td align="left" valign="top">573/1265 (45.3)</td><td align="left" valign="top">458/1011 (45.3)</td></tr></tbody></table><table-wrap-foot><fn id="table1fn1"><p><sup>a</sup><italic>ICD-10</italic>: <italic>International Classification of Diseases, 10th Revision</italic>.</p></fn><fn id="table1fn2"><p><sup>b</sup>OUD: opioid use disorder.</p></fn><fn id="table1fn3"><p><sup>c</sup>SBOR: Suicide Behavior and Overdose Report.</p></fn><fn id="table1fn4"><p><sup>d</sup>CPT: Current Procedural Terminology.</p></fn><fn id="table1fn5"><p><sup>e</sup>Counts represent the number of generated snippets that included a fentanyl-related term. Snippets may include more than one term.</p></fn></table-wrap-foot></table-wrap><table-wrap id="t2" position="float"><label>Table 2.</label><caption><p>Comparison of model performance for classifying snippets as &#x201C;nonprescribed fentanyl use,&#x201D; &#x201C;prescribed fentanyl use,&#x201D; and &#x201C;other.&#x201D;</p></caption><table id="table2" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Models</td><td align="left" valign="bottom" colspan="3">Nonprescribed</td><td align="left" valign="bottom" colspan="3">Prescribed</td><td align="left" valign="bottom" colspan="3">Other</td></tr><tr><td align="left" valign="top"/><td align="left" valign="top"><italic>F</italic><sub>1</sub>-score (95% CI)</td><td align="left" valign="top">Precision (95% CI)</td><td align="left" valign="top">Recall (95% CI)</td><td align="left" valign="top"><italic>F</italic><sub>1</sub>-score (95% CI)</td><td align="left" valign="top">Precision (95% CI)</td><td align="left" valign="top">Recall (95% CI)</td><td align="left" valign="top"><italic>F</italic><sub>1</sub>-score (95% CI)</td><td align="left" valign="top">Precision (95% CI)</td><td align="left" valign="top">Recall (95% CI)</td></tr></thead><tbody><tr><td align="left" valign="top">Llama 3-8B</td><td align="left" valign="top">0.87 (0.83&#x2010;0.92)</td><td align="left" valign="top">0.88 (0.82&#x2010;0.93)</td><td align="left" valign="top">0.87 (0.80&#x2010;0.93)</td><td align="left" valign="top">0.96 (0.95&#x2010;0.97)</td><td align="left" valign="top">0.99 (0.98&#x2010;1.00)</td><td align="left" valign="top">0.94 (0.91&#x2010;0.95)</td><td align="left" valign="top">0.95 (0.94&#x2010;0.96)</td><td align="left" valign="top">0.93 (0.91&#x2010;0.95)</td><td align="left" valign="top">0.97 (0.96&#x2010;0.98)</td></tr><tr><td align="left" valign="top">Mistral-7B</td><td align="left" valign="top">0.80 (0.75&#x2010;0.84)</td><td align="left" valign="top">0.90 (0.82&#x2010;0.96)</td><td align="left" valign="top">0.72 (0.65&#x2010;0.79)</td><td align="left" valign="top">0.96 (0.95&#x2010;0.97)</td><td align="left" valign="top">0.99 (0.99&#x2010;1.00)</td><td align="left" valign="top">0.93 (0.92&#x2010;0.95)</td><td align="left" valign="top">0.95 (0.94&#x2010;0.96)</td><td align="left" valign="top">0.92 (0.90&#x2010;0.93)</td><td align="left" valign="top">0.98 (0.97&#x2010;0.99)</td></tr><tr><td align="left" valign="top">Bio-ClinicalBERT</td><td align="left" valign="top">0.80 (0.74&#x2010;0.85)</td><td align="left" valign="top">0.80 (0.72&#x2010;0.85)</td><td align="left" valign="top">0.80 (0.72&#x2010;0.89)</td><td align="left" valign="top">0.97 (0.96&#x2010;0.98)</td><td align="left" valign="top">0.97 (0.96&#x2010;0.98)</td><td align="left" valign="top">0.97 (0.96&#x2010;0.98)</td><td align="left" valign="top">0.94 (0.93&#x2010;0.96)</td><td align="left" valign="top">0.94 (0.93&#x2010;0.97)</td><td align="left" valign="top">0.94 (0.92&#x2010;0.97)</td></tr><tr><td align="left" valign="top">Penalized logistic regression</td><td align="left" valign="top">0.74 (0.73&#x2010;0.75)</td><td align="left" valign="top">0.75 (0.74&#x2010;0.76)</td><td align="left" valign="top">0.73 (0.72&#x2010;0.74)</td><td align="left" valign="top">0.97 (0.97&#x2010;0.97)</td><td align="left" valign="top">0.96 (0.96&#x2010;0.97)</td><td align="left" valign="top">0.97 (0.97&#x2010;0.97)</td><td align="left" valign="top">0.93 (0.93&#x2010;0.94)</td><td align="left" valign="top">0.94 (0.93&#x2010;0.94)</td><td align="left" valign="top">0.93 (0.93&#x2010;0.94)</td></tr></tbody></table></table-wrap><p>Among the 4 models, the Llama 3-8B model demonstrated the best performance for nonprescribed fentanyl use (<italic>F</italic><sub>1</sub>-score=0.87, 95% CI 0.83-0.92), followed by Mistral-7B (<italic>F</italic><sub>1</sub>-score=0.80, 95% CI 0.75-0.84), Bio-ClinicalBERT (<italic>F</italic><sub>1</sub>-score=0.80, 95% CI 0.74-0.85), and penalized logistic regression (<italic>F</italic><sub>1</sub>-score=0.74, 95% CI 0.73-0.75). The CIs for Llama 3-8B and penalized logistic regression did not overlap, suggesting a meaningful performance difference. The CIs for Llama 3-8B, Mistral-7B, and Bio-ClinicalBERT overlapped substantially.</p><p>The precision-recall curve (<xref ref-type="fig" rid="figure1">Figure 1</xref>) for the nonprescribed fentanyl use class showed mean precision remaining above 0.80 across recall values up to approximately 0.6, after which precision declined as recall approached 1.0.</p><fig position="float" id="figure1"><label>Figure 1.</label><caption><p>Bio-ClinicalBERT precision-recall (PR) curve for nonprescribed fentanyl use.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="jmir_v28i1e97485_fig01.png"/></fig><p>The top 3 features (<xref ref-type="fig" rid="figure2">Figure 2</xref>) in the &#x201C;nonprescribed fentanyl use&#x201D; classification were &#x201C;consumption,&#x201D; &#x201C;purchased,&#x201D; and &#x201C;streets.&#x201D; The top 3 features in the &#x201C;prescribed fentanyl use&#x201D; classification were &#x201C;dressing,&#x201D; &#x201C;patch(es),&#x201D; and &#x201C;1500,&#x201D; and the top 3 features in the &#x201C;other&#x201D; classification were &#x201C;laced,&#x201D; &#x201C;testing,&#x201D; and &#x201C;fears.&#x201D; <xref ref-type="table" rid="table3">Table 3</xref> shows additional features positively associated with each predicted classification in example snippets in various clinical contexts.</p><fig position="float" id="figure2"><label>Figure 2.</label><caption><p>The top 20 features that include words or phrases most positively associated with each predicted classification based on the mean absolute Shapley additive explanations (SHAP) values from the Bio-ClinicalBERT model. Positive SHAP values are indicative of the predicted classification by the model.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="jmir_v28i1e97485_fig02.png"/></fig><table-wrap id="t3" position="float"><label>Table 3.</label><caption><p>Example snippets with features positively correlated with model classifications. Example snippets were adapted from a force plot of Shapley additive explanations [<xref ref-type="bibr" rid="ref27">27</xref>] values from the Bio-ClinicalBERT model depicting the approximate majority of features that accounted for the total prediction value of each fentanyl classification.</p></caption><table id="table3" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Fentanyl classification and example context</td><td align="left" valign="bottom">250-character fentanyl snippet<sup><xref ref-type="table-fn" rid="table3fn1">a</xref></sup></td></tr></thead><tbody><tr><td align="left" valign="top" colspan="2">Nonprescribed fentanyl use</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Current use</td><td align="left" valign="top">&#x201C;patient engagement &#x2013; Other conditions contributing to risk: history of TBI, opioid dependence (street fentanyl 10 pills/d), tobacco use disorder (smokes tobacco and vapes), PTSD, obesity, OSA &#x2013; UDS results reviewed&#x201D;</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Current use</td><td align="left" valign="top">&#x201C;enies, quit ~6 months ago -Illicit substances: Denies any illicit substances, or prescription drug misuse/abuse. Last used fentanyl ~24H prior to Suboxone induction SUICIDE ROS: Veteran denied any suicide attempts or self-injurious behaviors recently.&#x201D;</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Historical use</td><td align="left" valign="top">&#x201C;ndence, tobacco dependence, and cannabis dependence. Veteran admitted many years ago for accidental drug overdose (fentanyl) with hypoxia. Veteran shortly after received vivitrol monthly injection with success of abstinence from opioid use.&#x201D;</td></tr><tr><td align="left" valign="top" colspan="2">Prescribed fentanyl use</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Procedural sedation</td><td align="left" valign="top">&#x201C;ny adjunctive medications given during procedure and any reversal agents required. time:11:29 midazolam: 2 mg iv push fentanyl: 75 mcg iv push vital signs monitored and recorded every 5 minutes: time: bp: hr: rr: spo2 %: 11:34&#x201D;</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Medication list</td><td align="left" valign="top">&#x201C;xime proxetil 200mg tab 200mg 1 tablet oral bid Diclofenac na 1% top gel 4 gm (dosing card line) 4.5 inches topical qid Fentanyl tts--75mcg/hr patch 1 patch transdermal q48h Fluconazole 200mg tab 200mg 1 tablet oral qday Lidoca-alum/mag hydrox sus&#x201D;</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Inpatient administration</td><td align="left" valign="top">&#x201C;infusion dopamine epinephrine (adrenalin) 2,000 mcg in sodium chloride 0.9 % 250 ml infusion 30 mcg/min (11/02/23 0125) fentanyl fentanyl lactated ringers 100 ml/hr at 11/02/23 0315 lidocaine norepinephrine 30 mcg/min (11/02/23 0015) phenylephrine&#x201D;</td></tr><tr><td align="left" valign="top" colspan="2">Other</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Drug testing</td><td align="left" valign="top">&#x201C;OXYCODONE Positive ng/mL Ref: NEGATIVE &#x003C;100 ng/mL ***Reminder: Several opioids including fentanyl, methadone, buprenorphine, and tramadol are not included in the standard Urine Drug Screen testing. Please order&#x201D;</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Possible exposure due to other drug</td><td align="left" valign="top">&#x201C;with RUL area of consolidation significant for pneumonia. Suspect patient could have possibly used cocaine (laced with fentanyl?) and passed out, leading to possible aspiration event given location of infiltrate. Patient normotensive and mildly tac&#x201D;</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Allergy</td><td align="left" valign="top">&#x201C;allergy/adr -------- ----------- name name fentanyl name name morphine name name oxybutynin chloride iron mountai&#x201D;</td></tr></tbody></table><table-wrap-foot><fn id="table3fn1"><p><sup>a</sup>Some snippets were altered if they contained identifying information.</p></fn></table-wrap-foot></table-wrap><p>Model performance was similar across demographic subgroups for the &#x201C;prescribed fentanyl use&#x201D; and &#x201C;other&#x201D; classes (<xref ref-type="table" rid="table4">Table 4</xref>). For the &#x201C;nonprescribed fentanyl use&#x201D; class, <italic>F</italic><sub>1</sub>-scores were comparable across demographic subgroups except in the female subgroup, which showed wider CIs (0.76, 95% CI 0.43-0.94) than the male subgroup (0.8, 95% CI 0.75-0.85). Similarly, the Hispanic subgroup demonstrated lower performance (<italic>F</italic><sub>1</sub>-score=0.71, 95% CI 0.50-0.84) than the non-Hispanic subgroup (<italic>F</italic><sub>1</sub>-score=0.82, 95% CI 0.77-0.86). External validation of Bio-ClinicalBERT on an independent sample of 200 snippets, each representing a unique patient, from January 2025 to June 2026 demonstrated a precision of 0.79 (158/200, 79%), consistent with test set precision (0.80, 95% CI 0.72-0.85).</p><table-wrap id="t4" position="float"><label>Table 4.</label><caption><p>Fairness analysis of model performance for nonprescribed fentanyl use.</p></caption><table id="table4" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Subgroup</td><td align="left" valign="bottom">Patients, n</td><td align="left" valign="bottom">Nonprescribed, <italic>F</italic><sub>1</sub>-score (95% CI)</td><td align="left" valign="bottom">Prescribed, <italic>F</italic><sub>1</sub>-score (95% CI)</td><td align="left" valign="bottom">Other, <italic>F</italic><sub>1</sub>-score (95% CI)</td></tr></thead><tbody><tr><td align="left" valign="top">Overall</td><td align="left" valign="top">1482</td><td align="left" valign="top">0.80 (0.74&#x2010;0.85)</td><td align="left" valign="top">0.97 (0.96&#x2010;0.98)</td><td align="left" valign="top">0.94 (0.93&#x2010;0.96)</td></tr><tr><td align="left" valign="top" colspan="5">Sex</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Male</td><td align="left" valign="top">1344</td><td align="left" valign="top">0.80 (0.75&#x2010;0.85)</td><td align="left" valign="top">0.97 (0.96&#x2010;0.98)</td><td align="left" valign="top">0.94 (0.92&#x2010;0.95)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Female</td><td align="left" valign="top">138</td><td align="left" valign="top">0.76 (0.43&#x2010;0.94)</td><td align="left" valign="top">0.98 (0.96&#x2010;1.00)</td><td align="left" valign="top">0.97 (0.94&#x2010;0.99)</td></tr><tr><td align="left" valign="top" colspan="5">Race</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>White</td><td align="left" valign="top">943</td><td align="left" valign="top">0.82 (0.75&#x2010;0.87)</td><td align="left" valign="top">0.96 (0.95&#x2010;0.98)</td><td align="left" valign="top">0.94 (0.93&#x2010;0.96)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Non-White</td><td align="left" valign="top">539</td><td align="left" valign="top">0.78 (0.68&#x2010;0.87)</td><td align="left" valign="top">0.98 (0.97&#x2010;0.99)</td><td align="left" valign="top">0.94 (0.92&#x2010;0.96)</td></tr><tr><td align="left" valign="top" colspan="5">Ethnicity</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Hispanic</td><td align="left" valign="top">231</td><td align="left" valign="top">0.71 (0.50&#x2010;0.84)</td><td align="left" valign="top">0.99 (0.98&#x2010;1.00)</td><td align="left" valign="top">0.94 (0.90&#x2010;0.97)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Non-Hispanic</td><td align="left" valign="top">1251</td><td align="left" valign="top">0.82 (0.77&#x2010;0.86)</td><td align="left" valign="top">0.97 (0.96&#x2010;0.98)</td><td align="left" valign="top">0.94 (0.93&#x2010;0.96)</td></tr></tbody></table></table-wrap></sec><sec id="s4" sec-type="discussion"><title>Discussion</title><sec id="s4-1"><title>Principal Findings</title><p>Despite recent declines in US overdose mortality, use of nonprescribed fentanyl remains a major driver of unintentional and intentional (eg, suicide) overdose deaths. An important challenge impeding clinical and research efforts is that health care systems lack methods to identify patients who use nonprescribed fentanyl. Using VHA clinical notes, we developed and validated NLP models to classify mentions as &#x201C;nonprescribed use,&#x201D; &#x201C;prescribed use,&#x201D; and &#x201C;other.&#x201D; Our fine-tuned models demonstrated strong performance, achieving <italic>F</italic><sub>1</sub>-scores above 0.8, indicating that all models tested in this study were largely comparable overall.</p><p>Although Llama 3-8B achieved the highest nonprescribed fentanyl use <italic>F</italic><sub>1</sub>-score (0.87), the substantially overlapping CIs among Llama 3-8B, Mistral-7B, and Bio-ClinicalBERT suggest comparable performance among these models, whereas the nonoverlapping CIs between Llama 3-8B and penalized logistic regression suggest a significant performance difference. Although external validation demonstrated comparable precision for identifying nonprescribed fentanyl use, this finding should be interpreted as preliminary because it did not validate full model performance. Each approach comes with trade-offs in terms of computation effort and cost, ability to identify patients across the health care system, and the certainty with which automated identification is truly indicative of nonprescribed fentanyl use. Our findings suggest that health systems with limited computational infrastructure or programming staff could reasonably implement penalized logistic regression or Bio-ClinicalBERT, which may provide improved identification compared with approaches relying solely on <italic>ICD-10</italic> codes [<xref ref-type="bibr" rid="ref29">29</xref>]. We used Bio-ClinicalBERT for supplementary analyses given its lower computational cost and comparable performance to that of larger large language models, making it pragmatic for real-world deployment. Conversely, if a health system aimed to conduct targeted outreach for patients with nonprescribed fentanyl use but lacked resources to contact all identified patients, choosing a model with higher precision (positive predictive value) may be preferred to maximize the probability that contacted patients truly have nonprescribed fentanyl use. In this scenario, Mistral-7B may be favored despite its lower <italic>F</italic><sub>1</sub>-score for nonprescribed fentanyl use (<xref ref-type="table" rid="table2">Table 2</xref>) as its reduced <italic>F</italic><sub>1</sub>-score performance was due to lower recall (0.72), whereas its precision was higher than that of Bio-ClinicalBERT or Llama 3-8B. However, this trade-off deserves careful consideration because potentially missing 28% of patients with non-prescribed fentanyl use may be detrimental to clinical applications aimed at identifying and treating at-risk patients. In these contexts, a missed identification represents a missed clinical opportunity to prevent the harms associated with nonprescribed fentanyl use.</p><p>Overall, model performance was comparable across subgroups, with the exception of female and Hispanic subgroups for the &#x201C;nonprescribed fentanyl use&#x201D; class, where performance was somewhat lower. This finding is likely due to the smaller sample sizes among these groups, as suggested by the wider CIs (n=138 female vs n=1344 male; n=231 Hispanic vs n=1251 non-Hispanic). These findings should be interpreted as preliminary given the small subgroup sample sizes and wide CIs and warrants further investigation in larger samples. Future work should explore approaches to improve performance in underrepresented groups, such as oversampling these subgroups during training or subgroup-specific model fine-tuning.</p><p>The &#x201C;other&#x201D; category was the most common classification, accounting for half (3699/7389, 50%) of the annotated snippets, highlighting the diverse ways in which fentanyl is referenced in clinical text. This heterogeneity included drug testing results, allergy documentation, fentanyl use by another person, and often ambiguous fentanyl mentions. A notable subset included incidental or unintentional exposure to nonprescribed fentanyl through the intentional use of other substances such as methamphetamine or cocaine that were laced with fentanyl, which highlights the clinical complexity of this domain. Although consolidating these subcategories into a single &#x201C;other&#x201D; label may bias the model by obscuring clinically relevant distinctions, such as unintentional exposure and diagnostic uncertainty, this decision was made to avoid additional class imbalance that would have precluded model convergence. Future work could explore the classification of these clinically relevant concepts.</p><p>The methods we describe could be applied to support clinical, operational, and research efforts to reduce the harms associated with nonprescribed fentanyl use among VHA patients. Our approach could also be adapted in other health systems to identify high-risk patients and inform the targeting of other interventions. For example, this information could be incorporated into risk prediction models for overdose and suicide risk [<xref ref-type="bibr" rid="ref30">30</xref>-<xref ref-type="bibr" rid="ref32">32</xref>]. Identifying patients at risk could also facilitate large-scale efforts in harm reduction, such as prescribing naloxone and xylazine test distribution. Additionally, health care systems could use this approach for epidemiologic surveillance of fentanyl use, identification of at-risk patients who might not be receiving appropriate care, or evaluations of clinical care processes and outcomes among this patient population. These applications may require the use of evaluation frameworks other than standard aggregate model performance reporting to ensure clinical reliability across patient populations [<xref ref-type="bibr" rid="ref33">33</xref>]. The evaluation approach in this study reporting class-specific performance and fairness analysis reflects this standard. Additionally, these clinical tools may require more evaluation prior to integration into clinical decision-making systems, such as prospective evaluation, cost-benefit analysis, and further consideration of the risks associated with misclassification.</p><p>Aside from the potency of fentanyl, some of the mortality and negative outcomes associated with fentanyl at the population level are likely attributable to its dramatic increase in use in such a short time (and health care systems&#x2019; lack of methods to identify and treat vulnerable patients). Importantly, this study provides a blueprint to develop automated methods that can help in identifying use of other potentially emerging substances, such as use of nitazenes and other newly developed synthetic opioids.</p><p>Our findings also highlight opportunities for further research with important clinical and operational implications. All approaches we used demonstrated lower performance for identifying nonprescribed fentanyl use than for identifying the &#x201C;prescribed use&#x201D; and &#x201C;other&#x201D; categories. On the basis of review of thousands of snippets, and as reflected in <xref ref-type="table" rid="table3">Table 3</xref>, those differences are due to greater linguistic variability in how nonprescribed fentanyl use is documented in clinical notes. Prescribed use is usually documented with dosages and often in a list of other medications. Common examples of the &#x201C;other&#x201D; category include templated drug testing results or documentation in allergy lists. In contrast, documentation indicating actual or potential nonprescribed use is heterogeneous and may include contextual references that challenge model interpretation, such as drug use by family members, nonprescribed use of other substances, or historical fentanyl use mentioned alongside currently active use disorders for other substances such as alcohol. Although these scenarios were categorized as &#x201C;other&#x201D; during annotation to create gold-standard training data, their semantic similarity to nonprescribed use plausibly contributed to misclassification. Future research could address developing models to better recognize these complexities.</p><p>Our specific findings&#x2014;such as that Mistral-7B had higher precision&#x2014;may not be generalizable to non-VHA systems given differences in care delivery, EHR formats, documentation, and patient demographics between systems. However, these findings are potentially impactful given that the VHA provides care to nearly 10 million veterans. Furthermore, our general approach to identifying fentanyl terms, extracting clinical documentation among relevant patient groups, annotation, and training and validating models could be applied in other health care settings.</p><p>The SHAP-associated terms should be interpreted cautiously because several high-ranking features were subword tokens generated by the Bio-ClinicalBERT tokenizer rather than stand-alone clinical concepts. Manual review showed that some fragments were mapped to clinically meaningful parent terms when considered in context. For example, in the prescribed fentanyl use classifier, &#x201C;verse&#x201D; appeared as part of &#x201C;versed&#x201D; or midazolam, &#x201C;ane&#x201D; appeared as part of &#x201C;anesthesia,&#x201D; &#x201C;bla&#x201D; appeared as part of &#x201C;ablation,&#x201D; &#x201C;losure&#x201D; appeared as part of &#x201C;closure,&#x201D; and &#x201C;gade&#x201D; appeared as part of &#x201C;Tegaderm,&#x201D; all of which are plausibly associated with procedural settings where fentanyl may be prescribed or administered. However, these subword attributions should not be interpreted independently of their parent terms and surrounding note context. Therefore, SHAP analyses were used as supportive model inspection tools rather than definitive explanations of model behavior.</p><p>This study has other limitations. It relied on information documented in clinical notes, and the accuracy or completeness of these records is unknown. Additionally, the sampling strategy relied on predefined fentanyl terms, and while this term list was developed systematically, no new terms were identified during the annotation process. However, this approach may miss implicit mentions or emerging slang terms not captured at the time of development and could impact the sensitivity of a full identification pipeline in a real-world setting.</p></sec><sec id="s4-2"><title>Conclusions</title><p>Identifying patients with nonprescribed fentanyl use is essential for patient care and informing public policy and system-level prevention and treatment strategies. As <italic>ICD-10</italic> codes have low sensitivity for nonprescribed OUD and no codes are specific to patients with nonprescribed fentanyl use, extracting this information from EHR documentation is a crucial step in mitigating the harms of fentanyl use. We describe models with strong performance in identifying nonprescribed fentanyl use from clinical text, offering a potential tool for improving detection and intervention efforts.</p></sec></sec></body><back><ack><p>Microsoft 365 Copilot and VA GPT were used to assist with refinement of the language of the manuscript and refinement of code for statistical analysis and figures.</p></ack><notes><sec><title>Funding</title><p>This work was funded by the US Department of Veterans Affairs (VA) Office of Suicide Prevention. The views expressed in this article are those of the authors and do not necessarily reflect the position or policy of the VA or the US government. JT is supported by the Advanced Fellowship in Health Systems Research supported by the Office of Academic Affiliations of the VA. JAS is supported by Career Development Award 1IK2HX002861-01A2 from the VA Health Services Research and Development Service. NEI is supported by the National Institutes of Health National Heart, Lung, and Blood Institute (K23HL166783). NM is supported jointly by the University of Minnesota Medical School and Clinical and Translational Science Institute early-career research award. RZ is supported by the National Cancer Institute (R01CA287413), National Institute on Aging (R01AG078154), National Center for Complementary and Integrative Health (R01AT009457), and National Institute on Minority Health and Health Disparities (R21MD019134).</p></sec><sec><title>Data Availability</title><p>The datasets generated or analyzed during this study are not publicly available due to protected patient data but are available from the corresponding author on reasonable request.</p></sec></notes><fn-group><fn fn-type="con"><p>Conceptualization: JT, JAS, RAD</p><p>Data curation: JT, JAS, IO, NEI, NM, JY, RAD</p><p>Formal analysis: JT, IO, JY, RAD</p><p>Funding acquisition: JAS, RAD</p><p>Methodology: JT, JAS, NEI, NM, IO, JY, RZ, LAB, RAD</p><p>Project administration: JT, JAS, RAD</p><p>Software: IO, JY</p><p>Supervision: JAS, LAB, RAD</p><p>Validation: JT, JAS, RAD</p><p>Visualization: JT, IO, JY</p><p>Writing&#x2014;original draft: JT, JAS, RAD</p><p>Writing&#x2014;review and editing: JT, JAS, IO, NEI, NM, JY, RZ, LAB, RAD</p></fn><fn fn-type="conflict"><p>LAB reports grants from the US Department of Veterans Affairs (VA), Department of Defense, National Institutes of Health, and the state of Colorado; editorial remuneration from Wolters Kluwer and the RAND Corporation; and royalties from the American Psychological Association and Oxford University Press. In addition, LAB consults with sports leagues via her university affiliation. RAD reports grants from the National Institutes of Health National Institute on Diabetes and Digestive and Kidney Diseases (R01DK115629); National Heart, Lung, and Blood Institute (T32 HL07741); Agency for Healthcare Research and Quality (P30HS029744); VA Office of Research and Development; VA Office of Suicide Prevention; and the Centers for Disease Control and Prevention Center for Forecasting and Outbreak Analytics. All other authors declare no other conflicts of interest.</p></fn></fn-group><glossary><title>Abbreviations</title><def-list><def-item><term id="abb1">EHR</term><def><p>electronic health record</p></def></def-item><def-item><term id="abb2">ICD</term><def><p>International Classification of Diseases</p></def></def-item><def-item><term id="abb3">ICD-10</term><def><p>International Classification of Diseases, 10th Revision</p></def></def-item><def-item><term id="abb4">NLP</term><def><p>natural language processing</p></def></def-item><def-item><term id="abb5">OUD</term><def><p>opioid use disorder</p></def></def-item><def-item><term id="abb6">SBOR</term><def><p>Suicide Behavior and Overdose Report</p></def></def-item><def-item><term id="abb7">SHAP</term><def><p>Shapley additive explanations</p></def></def-item><def-item><term id="abb8">STROBE</term><def><p>Strengthening the Reporting of Observational Studies in Epidemiology</p></def></def-item><def-item><term id="abb9">VHA</term><def><p>Veterans Health Administration</p></def></def-item></def-list></glossary><ref-list><title>References</title><ref id="ref1"><label>1</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Garnett</surname><given-names>MF</given-names> </name><name name-style="western"><surname>Mini&#x00F1;o</surname><given-names>AM</given-names> </name></person-group><article-title>Drug overdose deaths in the United States, 2003&#x2013;2023</article-title><source>NCHS Data Brief</source><year>2024</year><month>12</month><issue>522</issue><fpage>1</fpage><pub-id pub-id-type="doi">10.15620/cdc/170565</pub-id><pub-id pub-id-type="medline">40623710</pub-id></nlm-citation></ref><ref id="ref2"><label>2</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Tanz</surname><given-names>LJ</given-names> </name><name name-style="western"><surname>Stewart</surname><given-names>A</given-names> </name><name name-style="western"><surname>Gladden</surname><given-names>RM</given-names> </name><name name-style="western"><surname>Ko</surname><given-names>JY</given-names> </name><name name-style="western"><surname>Owens</surname><given-names>L</given-names> </name><name name-style="western"><surname>O&#x2019;Donnell</surname><given-names>J</given-names> </name></person-group><article-title>Detection of illegally manufactured fentanyls and carfentanil in drug overdose deaths - United States, 2021-2024</article-title><source>MMWR Morb Mortal Wkly Rep</source><year>2024</year><month>12</month><day>5</day><volume>73</volume><issue>48</issue><fpage>1099</fpage><lpage>1105</lpage><pub-id pub-id-type="doi">10.15585/mmwr.mm7348a2</pub-id><pub-id pub-id-type="medline">39636782</pub-id></nlm-citation></ref><ref id="ref3"><label>3</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Post</surname><given-names>LA</given-names> </name><name name-style="western"><surname>Ciccarone</surname><given-names>D</given-names> </name><name name-style="western"><surname>Unick</surname><given-names>GJ</given-names> </name><etal/></person-group><article-title>Decline in US drug overdose deaths by region, substance, and demographics</article-title><source>JAMA Netw Open</source><year>2025</year><month>06</month><day>2</day><volume>8</volume><issue>6</issue><fpage>e2514997</fpage><pub-id pub-id-type="doi">10.1001/jamanetworkopen.2025.14997</pub-id><pub-id pub-id-type="medline">40504530</pub-id></nlm-citation></ref><ref id="ref4"><label>4</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Kiang</surname><given-names>MV</given-names> </name><name name-style="western"><surname>Humphreys</surname><given-names>K</given-names> </name></person-group><article-title>Recent drug overdose mortality decline compared with pre-COVID-19 trend</article-title><source>JAMA Netw Open</source><year>2025</year><month>02</month><day>3</day><volume>8</volume><issue>2</issue><fpage>e2458090</fpage><pub-id pub-id-type="doi">10.1001/jamanetworkopen.2024.58090</pub-id><pub-id pub-id-type="medline">39908021</pub-id></nlm-citation></ref><ref id="ref5"><label>5</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Rowe</surname><given-names>CL</given-names> </name><name name-style="western"><surname>Santos</surname><given-names>GM</given-names> </name><name name-style="western"><surname>Kornbluh</surname><given-names>W</given-names> </name><name name-style="western"><surname>Bhardwaj</surname><given-names>S</given-names> </name><name name-style="western"><surname>Faul</surname><given-names>M</given-names> </name><name name-style="western"><surname>Coffin</surname><given-names>PO</given-names> </name></person-group><article-title>Using ICD-10-CM codes to detect illicit substance use: a comparison with retrospective self-report</article-title><source>Drug Alcohol Depend</source><year>2021</year><month>04</month><day>1</day><volume>221</volume><fpage>108537</fpage><pub-id pub-id-type="doi">10.1016/j.drugalcdep.2021.108537</pub-id><pub-id pub-id-type="medline">33621806</pub-id></nlm-citation></ref><ref id="ref6"><label>6</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>McGrew</surname><given-names>KM</given-names> </name><name name-style="western"><surname>Homco</surname><given-names>JB</given-names> </name><name name-style="western"><surname>Garwe</surname><given-names>T</given-names> </name><etal/></person-group><article-title>Validity of International Classification of Diseases codes in identifying illicit drug use target conditions using medical record data as a reference standard: a systematic review</article-title><source>Drug Alcohol Depend</source><year>2020</year><month>03</month><day>1</day><volume>208</volume><fpage>107825</fpage><pub-id pub-id-type="doi">10.1016/j.drugalcdep.2019.107825</pub-id><pub-id pub-id-type="medline">31982637</pub-id></nlm-citation></ref><ref id="ref7"><label>7</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Ranapurwala</surname><given-names>SI</given-names> </name><name name-style="western"><surname>Alam</surname><given-names>IZ</given-names> </name><name name-style="western"><surname>Pence</surname><given-names>BW</given-names> </name><etal/></person-group><article-title>Development and validation of an electronic health records-based opioid use disorder algorithm by expert clinical adjudication among patients with prescribed opioids</article-title><source>Pharmacoepidemiol Drug Saf</source><year>2023</year><month>05</month><volume>32</volume><issue>5</issue><fpage>577</fpage><lpage>585</lpage><pub-id pub-id-type="doi">10.1002/pds.5591</pub-id><pub-id pub-id-type="medline">36585827</pub-id></nlm-citation></ref><ref id="ref8"><label>8</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Englander</surname><given-names>H</given-names> </name><name name-style="western"><surname>Thakrar</surname><given-names>AP</given-names> </name><name name-style="western"><surname>Bagley</surname><given-names>SM</given-names> </name><name name-style="western"><surname>Rolley</surname><given-names>T</given-names> </name><name name-style="western"><surname>Dong</surname><given-names>K</given-names> </name><name name-style="western"><surname>Hyshka</surname><given-names>E</given-names> </name></person-group><article-title>Caring for hospitalized adults with opioid use disorder in the era of fentanyl: a review</article-title><source>JAMA Intern Med</source><year>2024</year><month>06</month><day>1</day><volume>184</volume><issue>6</issue><fpage>691</fpage><lpage>701</lpage><pub-id pub-id-type="doi">10.1001/jamainternmed.2023.7282</pub-id><pub-id pub-id-type="medline">38683591</pub-id></nlm-citation></ref><ref id="ref9"><label>9</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Hochstatter</surname><given-names>KR</given-names> </name><name name-style="western"><surname>Terplan</surname><given-names>M</given-names> </name><name name-style="western"><surname>Mitchell</surname><given-names>SG</given-names> </name><etal/></person-group><article-title>Characteristics and correlates of fentanyl preferences among people with opioid use disorder</article-title><source>Drug Alcohol Depend</source><year>2022</year><month>11</month><day>1</day><volume>240</volume><fpage>109630</fpage><pub-id pub-id-type="doi">10.1016/j.drugalcdep.2022.109630</pub-id><pub-id pub-id-type="medline">36152404</pub-id></nlm-citation></ref><ref id="ref10"><label>10</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Mayer</surname><given-names>S</given-names> </name><name name-style="western"><surname>Boyd</surname><given-names>J</given-names> </name><name name-style="western"><surname>Collins</surname><given-names>A</given-names> </name><name name-style="western"><surname>Kennedy</surname><given-names>MC</given-names> </name><name name-style="western"><surname>Fairbairn</surname><given-names>N</given-names> </name><name name-style="western"><surname>McNeil</surname><given-names>R</given-names> </name></person-group><article-title>Characterizing fentanyl-related overdoses and implications for overdose response: findings from a rapid ethnographic study in Vancouver, Canada</article-title><source>Drug Alcohol Depend</source><year>2018</year><month>12</month><day>1</day><volume>193</volume><fpage>69</fpage><lpage>74</lpage><pub-id pub-id-type="doi">10.1016/j.drugalcdep.2018.09.006</pub-id><pub-id pub-id-type="medline">30343236</pub-id></nlm-citation></ref><ref id="ref11"><label>11</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Hazlehurst</surname><given-names>B</given-names> </name><name name-style="western"><surname>Green</surname><given-names>CA</given-names> </name><name name-style="western"><surname>Perrin</surname><given-names>NA</given-names> </name><etal/></person-group><article-title>Using natural language processing of clinical text to enhance identification of opioid-related overdoses in electronic health records data</article-title><source>Pharmacoepidemiol Drug Saf</source><year>2019</year><month>08</month><volume>28</volume><issue>8</issue><fpage>1143</fpage><lpage>1151</lpage><pub-id pub-id-type="doi">10.1002/pds.4810</pub-id><pub-id pub-id-type="medline">31218780</pub-id></nlm-citation></ref><ref id="ref12"><label>12</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Vega</surname><given-names>L</given-names> </name><name name-style="western"><surname>Conneen</surname><given-names>W</given-names> </name><name name-style="western"><surname>Veronin</surname><given-names>MA</given-names> </name><name name-style="western"><surname>Schumaker</surname><given-names>RP</given-names> </name></person-group><article-title>A neural network approach to predict opioid misuse among previously hospitalized patients using electronic health records</article-title><source>PLOS ONE</source><year>2024</year><volume>19</volume><issue>8</issue><fpage>e0309424</fpage><pub-id pub-id-type="doi">10.1371/journal.pone.0309424</pub-id><pub-id pub-id-type="medline">39197006</pub-id></nlm-citation></ref><ref id="ref13"><label>13</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Poulsen</surname><given-names>MN</given-names> </name><name name-style="western"><surname>Freda</surname><given-names>PJ</given-names> </name><name name-style="western"><surname>Troiani</surname><given-names>V</given-names> </name><name name-style="western"><surname>Mowery</surname><given-names>DL</given-names> </name></person-group><article-title>Developing a framework to infer opioid use disorder severity from clinical notes to inform natural language processing methods: characterization study</article-title><source>JMIR Ment Health</source><year>2024</year><month>01</month><day>15</day><volume>11</volume><fpage>e53366</fpage><pub-id pub-id-type="doi">10.2196/53366</pub-id><pub-id pub-id-type="medline">38224481</pub-id></nlm-citation></ref><ref id="ref14"><label>14</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Singleton</surname><given-names>J</given-names> </name><name name-style="western"><surname>Li</surname><given-names>C</given-names> </name><name name-style="western"><surname>Akpunonu</surname><given-names>PD</given-names> </name><name name-style="western"><surname>Abner</surname><given-names>EL</given-names> </name><name name-style="western"><surname>Kucharska-Newton</surname><given-names>AM</given-names> </name></person-group><article-title>Using natural language processing to identify opioid use disorder in electronic health record data</article-title><source>Int J Med Inform</source><year>2023</year><month>02</month><volume>170</volume><fpage>104963</fpage><pub-id pub-id-type="doi">10.1016/j.ijmedinf.2022.104963</pub-id><pub-id pub-id-type="medline">36521420</pub-id></nlm-citation></ref><ref id="ref15"><label>15</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Crowley</surname><given-names>R</given-names> </name><name name-style="western"><surname>Atiq</surname><given-names>O</given-names> </name><name name-style="western"><surname>Hilden</surname><given-names>D</given-names> </name><name name-style="western"><surname>Cooney</surname><given-names>TG</given-names> </name><collab>Health and Public Policy Committee of the American College of Physicians</collab></person-group><article-title>Health care for our nation's veterans: a policy paper from the American College of Physicians</article-title><source>Ann Intern Med</source><year>2021</year><month>11</month><volume>174</volume><issue>11</issue><fpage>1600</fpage><lpage>1602</lpage><pub-id pub-id-type="doi">10.7326/M21-2392</pub-id><pub-id pub-id-type="medline">34606323</pub-id></nlm-citation></ref><ref id="ref16"><label>16</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Begley</surname><given-names>MR</given-names> </name><name name-style="western"><surname>Ravindran</surname><given-names>C</given-names> </name><name name-style="western"><surname>Peltzman</surname><given-names>T</given-names> </name><etal/></person-group><article-title>Veteran drug overdose mortality, 2010-2019</article-title><source>Drug Alcohol Depend</source><year>2022</year><month>04</month><day>1</day><volume>233</volume><fpage>109296</fpage><pub-id pub-id-type="doi">10.1016/j.drugalcdep.2022.109296</pub-id><pub-id pub-id-type="medline">35219064</pub-id></nlm-citation></ref><ref id="ref17"><label>17</label><nlm-citation citation-type="web"><article-title>Harm reduction for veterans with substance use disorder</article-title><source>U.S. Department of Veterans Affairs</source><access-date>2025-12-05</access-date><comment><ext-link ext-link-type="uri" xlink:href="https://www.mentalhealth.va.gov/substance-use/harm-reduction.asp">https://www.mentalhealth.va.gov/substance-use/harm-reduction.asp</ext-link></comment></nlm-citation></ref><ref id="ref18"><label>18</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Bennett</surname><given-names>AS</given-names> </name><name name-style="western"><surname>Guarino</surname><given-names>H</given-names> </name><name name-style="western"><surname>Britton</surname><given-names>PC</given-names> </name><etal/></person-group><article-title>U.S. military veterans and the opioid overdose crisis: a review of risk factors and prevention efforts</article-title><source>Ann Med</source><year>2022</year><month>12</month><volume>54</volume><issue>1</issue><fpage>1826</fpage><lpage>1838</lpage><pub-id pub-id-type="doi">10.1080/07853890.2022.2092896</pub-id><pub-id pub-id-type="medline">35792749</pub-id></nlm-citation></ref><ref id="ref19"><label>19</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Rubin</surname><given-names>R</given-names> </name></person-group><article-title>VA efforts to reduce opioid overdose deaths in at-risk veterans</article-title><source>JAMA</source><year>2019</year><month>12</month><day>24</day><volume>322</volume><issue>24</issue><fpage>2374</fpage><pub-id pub-id-type="doi">10.1001/jama.2019.20562</pub-id><pub-id pub-id-type="medline">31860031</pub-id></nlm-citation></ref><ref id="ref20"><label>20</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Oliva</surname><given-names>EM</given-names> </name><name name-style="western"><surname>Bowe</surname><given-names>T</given-names> </name><name name-style="western"><surname>Tavakoli</surname><given-names>S</given-names> </name><etal/></person-group><article-title>Development and applications of the Veterans Health Administration&#x2019;s Stratification Tool for Opioid Risk Mitigation (STORM) to improve opioid safety and prevent overdose and suicide</article-title><source>Psychol Serv</source><year>2017</year><month>02</month><volume>14</volume><issue>1</issue><fpage>34</fpage><lpage>49</lpage><pub-id pub-id-type="doi">10.1037/ser0000099</pub-id><pub-id pub-id-type="medline">28134555</pub-id></nlm-citation></ref><ref id="ref21"><label>21</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>von Elm</surname><given-names>E</given-names> </name><name name-style="western"><surname>Altman</surname><given-names>DG</given-names> </name><name name-style="western"><surname>Egger</surname><given-names>M</given-names> </name><etal/></person-group><article-title>The Strengthening the Reporting of Observational Studies in Epidemiology (STROBE) statement: guidelines for reporting observational studies</article-title><source>Lancet</source><year>2007</year><month>10</month><day>20</day><volume>370</volume><issue>9596</issue><fpage>1453</fpage><lpage>1457</lpage><pub-id pub-id-type="doi">10.1016/S0140-6736(07)61602-X</pub-id><pub-id pub-id-type="medline">18064739</pub-id></nlm-citation></ref><ref id="ref22"><label>22</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Trujeque</surname><given-names>J</given-names> </name><name name-style="western"><surname>Dudley</surname><given-names>RA</given-names> </name><name name-style="western"><surname>Mesfin</surname><given-names>N</given-names> </name><etal/></person-group><article-title>Comparison of six natural language processing approaches to assessing firearm access in Veterans Health Administration electronic health records</article-title><source>J Am Med Inform Assoc</source><year>2025</year><month>01</month><day>1</day><volume>32</volume><issue>1</issue><fpage>113</fpage><lpage>118</lpage><pub-id pub-id-type="doi">10.1093/jamia/ocae169</pub-id><pub-id pub-id-type="medline">39530748</pub-id></nlm-citation></ref><ref id="ref23"><label>23</label><nlm-citation citation-type="web"><article-title>Labeling images and text documents</article-title><source>Microsoft</source><access-date>2025-02-06</access-date><comment><ext-link ext-link-type="uri" xlink:href="https://learn.microsoft.com/en-us/azure/machine-learning/how-to-label-data?view=azureml-api-2">https://learn.microsoft.com/en-us/azure/machine-learning/how-to-label-data?view=azureml-api-2</ext-link></comment></nlm-citation></ref><ref id="ref24"><label>24</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Landis</surname><given-names>JR</given-names> </name><name name-style="western"><surname>Koch</surname><given-names>GG</given-names> </name></person-group><article-title>The measurement of observer agreement for categorical data</article-title><source>Biometrics</source><year>1977</year><month>03</month><volume>33</volume><issue>1</issue><fpage>159</fpage><lpage>174</lpage><pub-id pub-id-type="medline">843571</pub-id></nlm-citation></ref><ref id="ref25"><label>25</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Jiang</surname><given-names>AQ</given-names> </name><name name-style="western"><surname>Sablayrolles</surname><given-names>A</given-names> </name><name name-style="western"><surname>Mensch</surname><given-names>A</given-names> </name><etal/></person-group><article-title>Mistral 7B</article-title><source>arXiv</source><comment>Preprint posted online on  Oct 10, 2023</comment><pub-id pub-id-type="doi">10.48550/arXiv.2310.06825</pub-id></nlm-citation></ref><ref id="ref26"><label>26</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Grattafiori</surname><given-names>A</given-names> </name><name name-style="western"><surname>Dubey</surname><given-names>A</given-names> </name><name name-style="western"><surname>Jauhri</surname><given-names>A</given-names> </name><etal/></person-group><article-title>The Llama 3 herd of models</article-title><source>arXiv</source><comment>Preprint posted online on  Jul 31, 2024</comment><pub-id pub-id-type="doi">10.48550/arXiv.2407.21783</pub-id></nlm-citation></ref><ref id="ref27"><label>27</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Lundberg</surname><given-names>S</given-names> </name><name name-style="western"><surname>Lee</surname><given-names>SI</given-names> </name></person-group><article-title>A unified approach to interpreting model predictions</article-title><source>arXiv</source><comment>Preprint posted online on  May 22, 2017</comment><pub-id pub-id-type="doi">10.48550/arXiv.1705.07874</pub-id></nlm-citation></ref><ref id="ref28"><label>28</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Wong</surname><given-names>ES</given-names> </name><name name-style="western"><surname>Wang</surname><given-names>V</given-names> </name><name name-style="western"><surname>Liu</surname><given-names>CF</given-names> </name><name name-style="western"><surname>Hebert</surname><given-names>PL</given-names> </name><name name-style="western"><surname>Maciejewski</surname><given-names>ML</given-names> </name></person-group><article-title>Do Veterans Health Administration enrollees generalize to other populations?</article-title><source>Med Care Res Rev</source><year>2016</year><month>08</month><volume>73</volume><issue>4</issue><fpage>493</fpage><lpage>507</lpage><pub-id pub-id-type="doi">10.1177/1077558715617382</pub-id><pub-id pub-id-type="medline">26589675</pub-id></nlm-citation></ref><ref id="ref29"><label>29</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Wang</surname><given-names>Z</given-names> </name><name name-style="western"><surname>Zhang</surname><given-names>H</given-names> </name><name name-style="western"><surname>Zhu</surname><given-names>D</given-names> </name><name name-style="western"><surname>Xie</surname><given-names>C</given-names> </name></person-group><article-title>Interpretable and lightweight predictive modeling for congestive heart failure using ICU electronic health records</article-title><source>Front Artif Intell Res</source><year>2026</year><volume>3</volume><issue>2</issue><pub-id pub-id-type="doi">10.71465/fair724</pub-id></nlm-citation></ref><ref id="ref30"><label>30</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>McCarthy</surname><given-names>JF</given-names> </name><name name-style="western"><surname>Bossarte</surname><given-names>RM</given-names> </name><name name-style="western"><surname>Katz</surname><given-names>IR</given-names> </name><etal/></person-group><article-title>Predictive modeling and concentration of the risk of suicide: implications for preventive interventions in the US Department of Veterans Affairs</article-title><source>Am J Public Health</source><year>2015</year><month>09</month><volume>105</volume><issue>9</issue><fpage>1935</fpage><lpage>1942</lpage><pub-id pub-id-type="doi">10.2105/AJPH.2015.302737</pub-id><pub-id pub-id-type="medline">26066914</pub-id></nlm-citation></ref><ref id="ref31"><label>31</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>McCarthy</surname><given-names>JF</given-names> </name><name name-style="western"><surname>Cooper</surname><given-names>SA</given-names> </name><name name-style="western"><surname>Dent</surname><given-names>KR</given-names> </name><etal/></person-group><article-title>Evaluation of the Recovery Engagement and Coordination for Health-Veterans Enhanced Treatment suicide risk modeling clinical program in the Veterans Health Administration</article-title><source>JAMA Netw Open</source><year>2021</year><month>10</month><day>1</day><volume>4</volume><issue>10</issue><fpage>e2129900</fpage><pub-id pub-id-type="doi">10.1001/jamanetworkopen.2021.29900</pub-id><pub-id pub-id-type="medline">34661661</pub-id></nlm-citation></ref><ref id="ref32"><label>32</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Minegishi</surname><given-names>T</given-names> </name><name name-style="western"><surname>Garrido</surname><given-names>MM</given-names> </name><name name-style="western"><surname>Lewis</surname><given-names>ET</given-names> </name><etal/></person-group><article-title>Randomized policy evaluation of the Veterans Health Administration Stratification Tool for Opioid Risk Mitigation (STORM)</article-title><source>J Gen Intern Med</source><year>2022</year><month>11</month><volume>37</volume><issue>14</issue><fpage>3746</fpage><lpage>3750</lpage><pub-id pub-id-type="doi">10.1007/s11606-022-07622-1</pub-id><pub-id pub-id-type="medline">35715661</pub-id></nlm-citation></ref><ref id="ref33"><label>33</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Hu</surname><given-names>Y</given-names> </name></person-group><article-title>Toward retrieval-grounded evaluation for conversational large language model-based risk assessment</article-title><source>JMIR AI</source><year>2026</year><month>03</month><day>12</day><volume>5</volume><fpage>e90759</fpage><pub-id pub-id-type="doi">10.2196/90759</pub-id><pub-id pub-id-type="medline">41818631</pub-id></nlm-citation></ref></ref-list></back></article>