{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"institution":[{"name":"medRxiv"}],"indexed":{"date-parts":[[2026,11,11]],"date-time":"2026-11-11T02:13:31Z","timestamp":1794363211483,"version":"4.9.0"},"posted":{"date-parts":[[2025,7,25]]},"group-title":"Health Informatics","reference-count":38,"publisher":"openRxiv","license":[{"start":{"date-parts":[[2025,7,25]],"date-time":"2025-07-25T00:00:00Z","timestamp":1753401600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/www.medrxiv.org\/about\/FAQ#license"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":[],"accepted":{"date-parts":[[2025,11,18]]},"abstract":"<jats:title>ABSTRACT<\/jats:title>\n                <jats:sec>\n                  <jats:title>Objective<\/jats:title>\n                  <jats:p>\n                    Electronic health records (EHRs) contain valuable information for clinical research and decision-making. However, leveraging these data remains challenging due to data heterogeneity, inconsistent documentation, missing information, and evolving terminology, especially within unstructured clinical notes. We developed SPELL (\n                    <jats:bold>S<\/jats:bold>\n                    nippet-\n                    <jats:bold>P<\/jats:bold>\n                    rimed r\n                    <jats:bold>E<\/jats:bold>\n                    gex\n                    <jats:bold>LL<\/jats:bold>\n                    M Pipeline), a scalable natural language processing (NLP) workflow to systematically extract structured clinical insights from large volumes of clinical narratives.\n                  <\/jats:p>\n                <\/jats:sec>\n                <jats:sec>\n                  <jats:title>Materials and Methods<\/jats:title>\n                  <jats:p>Our platform employs a hybrid approach combining regular expressions (regex) to rapidly identify relevant textual snippets with locally hosted large language models (LLMs) for accurate clinical interpretation. All data processing occurs securely within institutional computational environments. The modular Python-based workflow facilitates adaptation across institutions and is optimized for computational efficiency, supporting high-throughput processing even in resource-limited settings. We quantified computational scalability (elapsed time, out-of-memory events, GPU temperature, and energy consumed) and audited retrieval recall using clinician-annotated regex-negative notes enriched with relevant structured metadata.<\/jats:p>\n                <\/jats:sec>\n                <jats:sec>\n                  <jats:title>Results<\/jats:title>\n                  <jats:p>The pipeline efficiently processed 31 million clinical reports spanning 1976\u20132024 from eight affiliated hospitals. By analyzing targeted snippets rather than entire documents, our approach reduced processing time by 68% compared to traditional full-document LLM inference, and by &gt;95% compared to manual physician annotation. Accuracy was rigorously validated across three obstetric tasks: extraction of numerical values (blood loss volumes), dates (estimated due dates), and diagnoses (hemolysis, elevated liver enzymes, and low platelets [HELLP] syndrome). Task-level performance included 94-98% exact-match accuracy for the three concepts on curated snippets. Generalizability was investigated using the publicly available MT Samples corpus (5,013 notes, 40 specialties), yielding 84% accuracy for ventricular tachycardia detection with markedly fewer false positives.<\/jats:p>\n                <\/jats:sec>\n                <jats:sec>\n                  <jats:title>Discussion and Conclusions<\/jats:title>\n                  <jats:p>A hybrid regex\u2192snippet\u2192LLM approach delivers accurate, privacy-preserving, and computationally efficient extraction for unstructured EHR data. By focusing inference on snippets and deploying local, open-weights models, SPELL aligns with institutional data governance requirements while enabling scalable clinical informatics studies across diverse extraction tasks.<\/jats:p>\n                <\/jats:sec>\n                <jats:sec>\n                  <jats:title>Summary Statement<\/jats:title>\n                  <jats:p>We developed SPELL, a scalable NLP pipeline combining regex and locally hosted LLMs for efficient information extraction from clinical narratives.<\/jats:p>\n                <\/jats:sec>","DOI":"10.1101\/2025.07.25.25332130","type":"posted-content","created":{"date-parts":[[2025,7,26]],"date-time":"2025-07-26T01:05:19Z","timestamp":1753491919000},"source":"Crossref","is-referenced-by-count":3,"title":["SPELL: A Scalable NLP Method Using Regular Expressions and Large Language Models for Clinical Information Extraction"],"prefix":"10.64898","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-7313-7601","authenticated-orcid":false,"given":"Ricardo","family":"Kleinlein","sequence":"first","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-6268-1540","authenticated-orcid":false,"given":"David W.","family":"Bates","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Carolyn","family":"Guan","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-3541-3724","authenticated-orcid":false,"given":"Kathryn J.","family":"Gray","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-7367-3394","authenticated-orcid":false,"given":"Vesela P.","family":"Kovacheva","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"54368","reference":[{"key":"2025112002401167000_2025.07.25.25332130v2.1","doi-asserted-by":"publisher","DOI":"10.1038\/s41586-023-06160-y"},{"key":"2025112002401167000_2025.07.25.25332130v2.2","doi-asserted-by":"publisher","DOI":"10.1016\/j.jbi.2017.07.012"},{"key":"2025112002401167000_2025.07.25.25332130v2.3","doi-asserted-by":"publisher","DOI":"10.1038\/s41746-023-00957-x"},{"key":"2025112002401167000_2025.07.25.25332130v2.4","doi-asserted-by":"publisher","DOI":"10.1016\/j.ijmedinf.2023.105122"},{"key":"2025112002401167000_2025.07.25.25332130v2.5","doi-asserted-by":"publisher","DOI":"10.1109\/JBHI.2025.3574254"},{"key":"2025112002401167000_2025.07.25.25332130v2.6","doi-asserted-by":"publisher","DOI":"10.1186\/s12913-019-3989-1"},{"key":"2025112002401167000_2025.07.25.25332130v2.7","doi-asserted-by":"publisher","DOI":"10.1136\/amiajnl-2011-000681"},{"key":"2025112002401167000_2025.07.25.25332130v2.8","doi-asserted-by":"publisher","DOI":"10.1001\/jamaoncol.2016.0213"},{"key":"2025112002401167000_2025.07.25.25332130v2.9","doi-asserted-by":"publisher","DOI":"10.1093\/bib\/bbs084"},{"key":"2025112002401167000_2025.07.25.25332130v2.10","doi-asserted-by":"publisher","DOI":"10.1186\/s12859-024-05730-9"},{"key":"2025112002401167000_2025.07.25.25332130v2.11","doi-asserted-by":"publisher","DOI":"10.1093\/bib\/bbz130"},{"key":"2025112002401167000_2025.07.25.25332130v2.12","doi-asserted-by":"publisher","DOI":"10.1016\/j.jbi.2015.02.009"},{"key":"2025112002401167000_2025.07.25.25332130v2.13","doi-asserted-by":"publisher","DOI":"10.1001\/jamasurg.2024.1621"},{"key":"2025112002401167000_2025.07.25.25332130v2.14","doi-asserted-by":"publisher","DOI":"10.1186\/s12874-025-02470-z"},{"key":"2025112002401167000_2025.07.25.25332130v2.15","doi-asserted-by":"publisher","DOI":"10.1038\/s41746-024-01219-0"},{"key":"2025112002401167000_2025.07.25.25332130v2.16","doi-asserted-by":"publisher","DOI":"10.1038\/s41746-024-01233-2"},{"key":"2025112002401167000_2025.07.25.25332130v2.17","doi-asserted-by":"publisher","DOI":"10.1148\/radiol.240895"},{"key":"2025112002401167000_2025.07.25.25332130v2.18","doi-asserted-by":"publisher","DOI":"10.1038\/s41598-024-77535-y"},{"key":"2025112002401167000_2025.07.25.25332130v2.19","unstructured":"MT Samples Dataset, (n.d.). www.mtsamples.com (accessed May 1, 2025)."},{"key":"2025112002401167000_2025.07.25.25332130v2.20","doi-asserted-by":"publisher","DOI":"10.3389\/fmed.2022.1016366"},{"key":"2025112002401167000_2025.07.25.25332130v2.21","doi-asserted-by":"publisher","DOI":"10.1016\/j.cmpb.2023.107693"},{"key":"2025112002401167000_2025.07.25.25332130v2.22","doi-asserted-by":"publisher","DOI":"10.1016\/j.artmed.2024.102847"},{"key":"2025112002401167000_2025.07.25.25332130v2.23","doi-asserted-by":"publisher","DOI":"10.18653\/v1\/W19-1909"},{"key":"2025112002401167000_2025.07.25.25332130v2.24","doi-asserted-by":"publisher","DOI":"10.1093\/bioinformatics\/btz682"},{"key":"2025112002401167000_2025.07.25.25332130v2.25","doi-asserted-by":"publisher","DOI":"10.18653\/v1\/N19-1423"},{"key":"2025112002401167000_2025.07.25.25332130v2.26","doi-asserted-by":"publisher","DOI":"10.1016\/j.cmpb.2024.108326"},{"key":"2025112002401167000_2025.07.25.25332130v2.27","unstructured":"N. Bhagat , O. Mackey , A. Wilcox , Large Language Models for Efficient Medical Information Extraction, AMIA Jt Summits Transl Sci Proc 2024 (2024) 509\u2013514."},{"key":"2025112002401167000_2025.07.25.25332130v2.28","doi-asserted-by":"publisher","DOI":"10.3390\/ijerph182010564"},{"key":"2025112002401167000_2025.07.25.25332130v2.29","unstructured":"A.R. Aronson , Effective mapping of biomedical text to the UMLS Metathesaurus: the MetaMap program, Proc. AMIA Symp. (2001) 17\u201321."},{"key":"2025112002401167000_2025.07.25.25332130v2.30","doi-asserted-by":"publisher","DOI":"10.1136\/jamia.2009.001560"},{"key":"2025112002401167000_2025.07.25.25332130v2.31","doi-asserted-by":"publisher","DOI":"10.1038\/s41746-024-01377-1"},{"key":"2025112002401167000_2025.07.25.25332130v2.32","unstructured":"S.N. Murphy , M.E. Mendis , D.A. Berkowitz , I. Kohane , H.C. Chueh , Integration of clinical and genetic data in the i2b2 architecture, AMIA Annu. Symp. Proc. AMIA Symp. 2006 (2006) 1040."},{"key":"2025112002401167000_2025.07.25.25332130v2.33","unstructured":"A. Paszke , S. Gross , F. Massa , A. Lerer , J. Bradbury , G. Chanan , T. Killeen , Z. Lin , N. Gimelshein , L. Antiga , A. Desmaison , A. K\u00f6pf , E. Yang , Z. DeVito , M. Raison , A. Tejani , S. Chilamkurthy , B. Steiner , L. Fang , S. Chintala , PyTorch: An imperative style, high-performance deep learning library, in: Proc. 33rd Int. Conf. Neural Inf. Process. Syst., Curran Associates Inc, 2019."},{"key":"2025112002401167000_2025.07.25.25332130v2.34","doi-asserted-by":"publisher","DOI":"10.3233\/SHTI231244"},{"key":"2025112002401167000_2025.07.25.25332130v2.35","unstructured":"A. Goel , A. Gueta , O. Gilon , C. Liu , S. Erell , L.H. Nguyen , X. Hao , B. Jaber , S. Reddy , R. Kartha , J. Steiner , I. Laish , A. Feder , LLMs Accelerate Annotation for Medical Information Extraction, in: S. Hegselmann , A. Parziale , D. Shanmugam , S. Tang , M.N. Asiedu , S. Chang , T. Hartvigsen , H. Singh (Eds.), Proc. 3rd Mach. Learn. Health Symp., PMLR, 2023: pp. 82\u2013100. https:\/\/proceedings.mlr.press\/v225\/goel23a.html."},{"key":"2025112002401167000_2025.07.25.25332130v2.36","doi-asserted-by":"publisher","DOI":"10.1016\/j.jbi.2018.08.002"},{"key":"2025112002401167000_2025.07.25.25332130v2.37","doi-asserted-by":"publisher","DOI":"10.1016\/j.jbi.2015.02.010"},{"key":"2025112002401167000_2025.07.25.25332130v2.38","doi-asserted-by":"publisher","DOI":"10.1136\/jamia.2009.000893"}],"container-title":[],"original-title":[],"link":[{"URL":"https:\/\/syndication.highwire.org\/content\/doi\/10.1101\/2025.07.25.25332130","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,1,15]],"date-time":"2026-01-15T20:41:34Z","timestamp":1768509694000},"score":1,"resource":{"primary":{"URL":"http:\/\/medrxiv.org\/lookup\/doi\/10.1101\/2025.07.25.25332130"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,7,25]]},"references-count":38,"URL":"https:\/\/doi.org\/10.1101\/2025.07.25.25332130","relation":{},"subject":[],"published":{"date-parts":[[2025,7,25]]},"subtype":"preprint"}}