{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,7,15]],"date-time":"2026-07-15T19:05:54Z","timestamp":1784142354724,"version":"3.55.0"},"reference-count":34,"publisher":"Oxford University Press (OUP)","issue":"3","license":[{"start":{"date-parts":[[2026,6,11]],"date-time":"2026-06-11T00:00:00Z","timestamp":1781136000000},"content-version":"vor","delay-in-days":161,"URL":"https:\/\/creativecommons.org\/licenses\/by-nc-nd\/4.0\/"}],"funder":[{"name":"National Heart, Lung, and Blood Institute of the National Institutes of Health","award":["R01 HL161253-01A1"],"award-info":[{"award-number":["R01 HL161253-01A1"]}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":[],"published-print":{"date-parts":[[2026,7,8]]},"abstract":"<jats:title>Abstract<\/jats:title>\n                  <jats:sec>\n                    <jats:title>Study Objectives<\/jats:title>\n                    <jats:p>Large language models may efficiently develop Regular Expression (regex)-based natural language processing for electronic health record phenotyping. We present PromptNLP to assess feasibility by evaluating performance and generalizability to clinical notes across multiple institutions.<\/jats:p>\n                  <\/jats:sec>\n                  <jats:sec>\n                    <jats:title>Methods<\/jats:title>\n                    <jats:p>Sleep-related clinical notes from Kaiser Permanente Southern California, Beth Israel Deaconess Medical Center, and Emory University were used to extract apnea-hypopnea index and Epworth Sleepiness Scale. PromptNLP involves two steps: (1) build an apnea-hypopnea index\/Epworth Sleepiness Scale phrase library (\u201cTargeted\u201d via manual, \u201cGeneral\u201d via large language models); (2) input the library into an large language model with prompts to generate regex. For model development (Phase 1), we compared PromptNLP regexes with manual regex. For external validation (Phase 2), we adapted the Phase 1 Targeted regex to Beth Israel Deaconess Medical Center and Emory notes. For application (Phase 3), we applied adapted the regex to 207\u2009404 Kaiser Permanente Southern California notes with validation against 8602 structured apnea-hypopnea index.<\/jats:p>\n                  <\/jats:sec>\n                  <jats:sec>\n                    <jats:title>Results<\/jats:title>\n                    <jats:p>Phase 1: All Targeted PromptNLP regexes outperformed manual regex for recall (apnea-hypopnea index: 95%\u201396% vs 80.8%; Epworth Sleepiness Scale: 98%\u2013100% vs 88%; p\u00a0&amp;lt;\u2009.05). General regexes surpassed manual, but with lower recall. Phase 2: Direct Beth Israel Deaconess Medical Center application performed poorly (apnea-hypopnea index\/Epworth Sleepiness Scale: 30%\/12%), but adapting the phrase library improved recall to 96%\/84%. For Emory, recall improved from 85%\/86% to 94%\/89% after adaptation. Across Phases 1 and 2, the PromptNLP regexes achieved 100% precision. Phase 3: 8216 (95.5%) apnea-hypopnea index values were correctly extracted with 99.8% precision.<\/jats:p>\n                  <\/jats:sec>\n                  <jats:sec>\n                    <jats:title>Conclusions<\/jats:title>\n                    <jats:p>PromptNLP demonstrated feasibility as an efficient, accurate, and generalizable method, outperforming manual approaches and enabling iterative cross-system improvement. Systematic comparisons to direct large language model approaches are needed.<\/jats:p>\n                    <jats:p>Statement of Significance Transforming free-text clinical notes into reliable, structured data is essential for large-scale research and innovation in care delivery, yet existing approaches are limited by high manual effort, poor adaptability, or privacy concerns. This study introduces a novel framework, PromptNLP, that combines the strengths of generative artificial intelligence with rule-based extraction to enable accurate and scalable phenotyping from electronic health records. By improving the efficiency and generalizability of extracting key sleep-related measures across health systems, this work supports broader population studies and translational research in sleep medicine. Important next steps include clarifying when different text analysis approaches are most appropriate by comparing natural language processing methods and extending this framework to additional clinical domains.<\/jats:p>\n                  <\/jats:sec>","DOI":"10.1093\/sleepadvances\/zpag059","type":"journal-article","created":{"date-parts":[[2026,6,4]],"date-time":"2026-06-04T11:46:47Z","timestamp":1780573607000},"source":"Crossref","is-referenced-by-count":0,"title":["Large language model derived regular expressions for sleep phenotyping from electronic health record: a feasibility study"],"prefix":"10.1093","volume":"7","author":[{"ORCID":"https:\/\/orcid.org\/0009-0001-9631-886X","authenticated-orcid":false,"given":"Nathanael","family":"Hwang","sequence":"first","affiliation":[{"name":"Department of Sleep Medicine, Kaiser Permanente Southern California , Fontana, CA,","place":["United States"]},{"name":"Department of Neurology, Beth Israel Deaconess Medical Center, Harvard Medical School , Boston, MA,","place":["United States"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-4803-312X","authenticated-orcid":false,"given":"M Brandon","family":"Westover","sequence":"additional","affiliation":[{"name":"Department of Neurology, Beth Israel Deaconess Medical Center, Harvard Medical School , Boston, MA,","place":["United States"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Diego R","family":"Mazzotti","sequence":"additional","affiliation":[{"name":"Department of Internal Medicine, Kansas University Medical Center , Kansas City, KS,","place":["United States"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-5575-3953","authenticated-orcid":false,"given":"Robert J","family":"Thomas","sequence":"additional","affiliation":[{"name":"Department of Neurology, Beth Israel Deaconess Medical Center, Harvard Medical School , Boston, MA,","place":["United States"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-2329-6847","authenticated-orcid":false,"given":"Lynn Marie","family":"Trotti","sequence":"additional","affiliation":[{"name":"Department of Neurology and Emory Sleep Center, Emory University School of Medicine , Atlanta, GA,","place":["United States"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Dennis","family":"Hwang","sequence":"additional","affiliation":[{"name":"Department of Sleep Medicine, Kaiser Permanente Southern California , Fontana, CA,","place":["United States"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-3163-6242","authenticated-orcid":false,"given":"Matt","family":"Gratton","sequence":"additional","affiliation":[{"name":"Department of Internal Medicine, Kansas University Medical Center , Kansas City, KS,","place":["United States"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-8397-3729","authenticated-orcid":false,"given":"Jiaxiao","family":"Shi","sequence":"additional","affiliation":[{"name":"Department of Research and Evaluation, Kaiser Permanente Southern California , Pasadena, CA,","place":["United States"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Rui","family":"Yan","sequence":"additional","affiliation":[{"name":"Department of Research and Evaluation, Kaiser Permanente Southern California , Pasadena, CA,","place":["United States"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-6928-5310","authenticated-orcid":false,"given":"Emmanuel","family":"Mignot","sequence":"additional","affiliation":[{"name":"Department of Psychiatry and Behavioral Sciences, Stanford University , Palo Alto, CA,","place":["United States"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Gari D","family":"Clifford","sequence":"additional","affiliation":[{"name":"Department of Biomedical Informatics, Emory School of Medicine , Atlanta, GA,","place":["United States"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Umakanth A","family":"Katwa","sequence":"additional","affiliation":[{"name":"Division of Pulmonary Medicine, Harvard Medical School, Boston Children\u2019s Hospital , Boston, MA,","place":["United States"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Kendra A","family":"Becker","sequence":"additional","affiliation":[{"name":"Department of Sleep Medicine, Kaiser Permanente Southern California , Fontana, CA,","place":["United States"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Matthew T","family":"Klimper","sequence":"additional","affiliation":[{"name":"Department of Sleep Medicine, Kaiser Permanente Southern California , Fontana, CA,","place":["United States"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Jessica K","family":"Jara","sequence":"additional","affiliation":[{"name":"Department of Sleep Medicine, Kaiser Permanente Southern California , Fontana, CA,","place":["United States"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-5041-8312","authenticated-orcid":false,"given":"Haoqi","family":"Sun","sequence":"additional","affiliation":[{"name":"Department of Neurology, Beth Israel Deaconess Medical Center, Harvard Medical School , Boston, MA,","place":["United States"]}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"286","published-online":{"date-parts":[[2026,6,11]]},"reference":[{"issue":"1","key":"2026071514511530000_ref1","doi-asserted-by":"publisher","first-page":"1","DOI":"10.4258\/hir.2019.25.1.1","article-title":"Managing unstructured big data in healthcare system","volume":"25","author":"Kong","year":"2019","journal-title":"Healthc Inform Res"},{"issue":"10","key":"2026071514511530000_ref2","doi-asserted-by":"publisher","first-page":"e0000347","DOI":"10.1371\/journal.pdig.0000347","article-title":"Challenges and best practices for digital unstructured data enrichment in health research: a systematic narrative review","volume":"2","author":"Sedlakova","year":"2023","journal-title":"PLOS Digit Health"},{"issue":"1","key":"2026071514511530000_ref3","doi-asserted-by":"publisher","first-page":"82","DOI":"10.1186\/s12911-025-02913-z","article-title":"De-identification of clinical notes with pseudo-labeling using regular expression rules and pre-trained BERT","volume":"25","author":"An","year":"2025","journal-title":"BMC Med Inform Decis Mak"},{"key":"2026071514511530000_ref4","doi-asserted-by":"publisher","first-page":"106","DOI":"10.1016\/j.jbi.2018.08.002","article-title":"Trie-based rule processing for clinical NLP: a use-case study of n-trie, making the ConText algorithm more efficient and scalable","volume":"85","author":"Shi","year":"2018","journal-title":"J Biomed Inform"},{"issue":"1","key":"2026071514511530000_ref5","doi-asserted-by":"publisher","first-page":"139","DOI":"10.1109\/TCBB.2018.2849968","article-title":"Natural language processing for EHR-based computational phenotyping","volume":"16","author":"Zeng","year":"2019","journal-title":"IEEE\/ACM Trans Comput Biol Bioinform"},{"issue":"9","key":"2026071514511530000_ref6","doi-asserted-by":"publisher","first-page":"1511","DOI":"10.5664\/jcsm.11732","article-title":"Artificial intelligence in sleep medicine: assessing the diagnostic precision of ChatGPT-4","volume":"21","author":"Patel","year":"2025","journal-title":"J Clin Sleep Med"},{"key":"2026071514511530000_ref7","doi-asserted-by":"publisher","first-page":"106677","DOI":"10.1016\/j.sleep.2025.106677","article-title":"Diagnostic performance of large language models (LLMs) compared with physicians in sleep medicine","volume":"134","author":"Patel","year":"2025","journal-title":"Sleep Med"},{"issue":"1","key":"2026071514511530000_ref8","doi-asserted-by":"publisher","first-page":"177","DOI":"10.1038\/s41746-024-01180-y","article-title":"The long but necessary road to responsible use of large language models in healthcare research","volume":"7","author":"Kwong","year":"2024","journal-title":"NPJ Digit Med."},{"key":"2026071514511530000_ref9","doi-asserted-by":"publisher","first-page":"e75849","DOI":"10.2196\/75849","article-title":"Harm reduction strategies for thoughtful use of large language models in the medical domain: perspectives for patients and clinicians","volume":"27","author":"Moell","year":"2025","journal-title":"J Med Internet Res"},{"issue":"1","key":"2026071514511530000_ref10","doi-asserted-by":"publisher","first-page":"e241073","DOI":"10.1148\/radiol.241073","article-title":"Open-source large language models in radiology: a review and tutorial for practical research and clinical deployment","volume":"314","author":"Savage","year":"2025","journal-title":"Radiology."},{"issue":"6","key":"2026071514511530000_ref11","doi-asserted-by":"publisher","first-page":"540","DOI":"10.1093\/sleep\/14.6.540","article-title":"A new method for measuring daytime sleepiness: the Epworth Sleepiness Scale","volume":"14","author":"Johns","year":"1991","journal-title":"Sleep."},{"issue":"3","key":"2026071514511530000_ref12","doi-asserted-by":"publisher","first-page":"479","DOI":"10.5664\/jcsm.6506","article-title":"Clinical practice guideline for diagnostic testing for adult obstructive sleep apnea: an American Academy of sleep medicine clinical practice guideline","volume":"13","author":"Kapur","year":"2017","journal-title":"J Clin Sleep Med"},{"issue":"7","key":"2026071514511530000_ref13","doi-asserted-by":"publisher","first-page":"677","DOI":"10.1164\/rccm.201202-0200OC","article-title":"Continuous positive airway pressure treatment of sleepy patients with milder obstructive sleep apnea: results of the CPAP Apnea Trial North American Program (CATNAP) randomized clinical trial","volume":"186","author":"Weaver","year":"2012","journal-title":"Am J Respir Crit Care Med"},{"issue":"9","key":"2026071514511530000_ref14","doi-asserted-by":"publisher","first-page":"873","DOI":"10.1136\/thoraxjnl-2014-206655","article-title":"Association of sleep characteristics with atrial fibrillation: the multi-ethnic study of atherosclerosis","volume":"70","author":"Kwon","year":"2015","journal-title":"Thorax."},{"issue":"9464","key":"2026071514511530000_ref15","doi-asserted-by":"publisher","first-page":"1046","DOI":"10.1016\/S0140-6736(05)71141-7","article-title":"Long-term cardiovascular outcomes in men with obstructive sleep apnoea-hypopnoea with or without treatment with continuous positive airway pressure: an observational study","volume":"365","author":"Marin","year":"2005","journal-title":"Lancet."},{"issue":"2","key":"2026071514511530000_ref16","doi-asserted-by":"publisher","first-page":"269","DOI":"10.1164\/rccm.200911-1746OC","article-title":"Obstructive sleep apnea-hypopnea and incident stroke: the sleep heart health study","volume":"182","author":"Redline","year":"2010","journal-title":"Am J Respir Crit Care Med"},{"issue":"4","key":"2026071514511530000_ref17","doi-asserted-by":"publisher","first-page":"359","DOI":"10.1016\/S2213-2600(19)30271-1","article-title":"Effect of obstructive sleep apnoea and its treatment with continuous positive airway pressure on the prevalence of cardiovascular events in patients with acute coronary syndrome (ISAACC study): a randomised controlled trial","volume":"8","author":"Sanchez-de-la-Torre","year":"2020","journal-title":"Lancet Respir Med"},{"issue":"5","key":"2026071514511530000_ref18","doi-asserted-by":"publisher","first-page":"613","DOI":"10.1164\/rccm.201601-0088OC","article-title":"Effect of positive airway pressure on cardiovascular outcomes in coronary artery disease patients with nonsleepy obstructive sleep apnea. The RICCADSA Randomized Controlled Trial","volume":"194","author":"Peker","year":"2016","journal-title":"Am J Respir Crit Care Med"},{"issue":"7","key":"2026071514511530000_ref19","doi-asserted-by":"publisher","DOI":"10.1093\/sleep\/zsaf082","article-title":"Symptom subtypes of obstructive sleep apnea 10 years later: past, present, and future","volume":"48","author":"Keenan","year":"2025","journal-title":"Sleep."},{"issue":"4","key":"2026071514511530000_ref20","doi-asserted-by":"publisher","first-page":"493","DOI":"10.1164\/rccm.201808-1509OC","article-title":"Symptom subtypes of obstructive sleep Apnea predict incidence of cardiovascular outcomes","volume":"200","author":"Mazzotti","year":"2019","journal-title":"Am J Respir Crit Care Med"},{"issue":"10","key":"2026071514511530000_ref21","doi-asserted-by":"publisher","first-page":"919","DOI":"10.1056\/NEJMoa1606599","article-title":"CPAP for prevention of cardiovascular events in obstructive sleep Apnea","volume":"375","author":"McEvoy","year":"2016","journal-title":"N Engl J Med"},{"issue":"1","key":"2026071514511530000_ref22","doi-asserted-by":"publisher","first-page":"57","DOI":"10.1038\/s41746-020-0258-y","article-title":"Protected health information filter (Philter): accurately and securely de-identifying free-text clinical notes","volume":"3","author":"Norgeot","year":"2020","journal-title":"NPJ Digit Med"},{"issue":"4","key":"2026071514511530000_ref23","doi-asserted-by":"publisher","first-page":"352","DOI":"10.1161\/CIRCULATIONAHA.109.901801","article-title":"Prospective study of obstructive sleep apnea and incident coronary heart disease and heart failure: the sleep heart health study","volume":"122","author":"Gottlieb","year":"2010","journal-title":"Circulation."},{"issue":"9","key":"2026071514511530000_ref24","doi-asserted-by":"publisher","first-page":"2459","DOI":"10.3390\/jcm11092459","article-title":"Postoperative atrial fibrillation in adults with obstructive sleep Apnea undergoing coronary artery bypass grafting in the RICCADSA cohort","volume":"11","author":"Peker","year":"2022","journal-title":"J Clin Med"},{"issue":"7","key":"2026071514511530000_ref25","doi-asserted-by":"publisher","first-page":"1048","DOI":"10.1513\/AnnalsATS.202208-676OC","article-title":"Cardiovascular outcomes in adults with coronary artery disease and obstructive sleep apnea with versus without excessive daytime sleepiness in the RICCADSA Clinical trial","volume":"20","author":"Eulenburg","year":"2023","journal-title":"Ann Am Thorac Soc"},{"key":"2026071514511530000_ref26","first-page":"115","article-title":"Clinical information extraction with large language models: a case study on organ procurement","volume":"2024","author":"Adam","year":"2024","journal-title":"AMIA Annu Symp Proc"},{"issue":"4","key":"2026071514511530000_ref27","doi-asserted-by":"publisher","first-page":"ooae131","DOI":"10.1093\/jamiaopen\/ooae131","article-title":"Implementation of a rule-based algorithm to find patients eligible for cancer clinical trials","volume":"7","author":"Bickell","year":"2024","journal-title":"JAMIA Open"},{"issue":"1","key":"2026071514511530000_ref28","doi-asserted-by":"publisher","first-page":"165","DOI":"10.1146\/annurev-biodatasci-030421-030931","article-title":"Modern clinical text mining: a guide and review","volume":"4","author":"Percha","year":"2021","journal-title":"Annu Rev Biomed Data Sci"},{"key":"2026071514511530000_ref29","doi-asserted-by":"publisher","DOI":"10.1101\/2025.07.25.25332130","article-title":"SPELL-LLMs: a scalable and privacy-compliant NLP pipeline using locally hosted large language models for clinical information extraction","author":"Kleinlein","year":"2025"},{"issue":"1","key":"2026071514511530000_ref30","doi-asserted-by":"publisher","first-page":"240","DOI":"10.1038\/s41746-025-01653-8","article-title":"Small language models learn enhanced reasoning skills from medical textbooks","volume":"8","author":"Kim","year":"2025","journal-title":"NPJ Digit Med"},{"key":"2026071514511530000_ref31","doi-asserted-by":"publisher","first-page":"e63445","DOI":"10.2196\/63445","article-title":"Using large language models to abstract complex social determinants of health from original and deidentified medical notes: development and validation study","volume":"26","author":"Ralevski","year":"2024","journal-title":"J Med Internet Res"},{"issue":"3","key":"2026071514511530000_ref32","doi-asserted-by":"publisher","DOI":"10.1093\/jamiaopen\/ooae060","article-title":"Leveraging GPT-4 for identifying cancer phenotypes in electronic health records: a performance comparison between GPT-4, GPT-3.5-turbo, flan-T5, Llama-3-8B, and spaCy's rule-based and machine learning-based methods","volume":"7","author":"Bhattarai","year":"2024","journal-title":"JAMIA Open"},{"issue":"10","key":"2026071514511530000_ref33","doi-asserted-by":"publisher","first-page":"2217","DOI":"10.1093\/jamia\/ocae177","article-title":"Extraction of sleep information from clinical notes of Alzheimer's disease patients using natural language processing","volume":"31","author":"Sivarajkumar","year":"2024","journal-title":"J Am Med Inform Assoc"},{"issue":"12","key":"2026071514511530000_ref34","doi-asserted-by":"publisher","first-page":"1131","DOI":"10.3390\/jpm14121131","article-title":"Enhancing large language model reliability: minimizing hallucinations with dual retrieval-augmented generation based on the latest diabetes guidelines","volume":"14","author":"Lee","year":"2024","journal-title":"J Pers Med"}],"container-title":["SLEEP Advances"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/academic.oup.com\/sleepadvances\/advance-article-pdf\/doi\/10.1093\/sleepadvances\/zpag059\/68513108\/zpag059.pdf","content-type":"application\/pdf","content-version":"am","intended-application":"syndication"},{"URL":"https:\/\/academic.oup.com\/sleepadvances\/article-pdf\/7\/3\/zpag059\/68513108\/zpag059.pdf","content-type":"application\/pdf","content-version":"vor","intended-application":"syndication"},{"URL":"https:\/\/academic.oup.com\/sleepadvances\/article-pdf\/7\/3\/zpag059\/68513108\/zpag059.pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,7,15]],"date-time":"2026-07-15T18:51:23Z","timestamp":1784141483000},"score":1,"resource":{"primary":{"URL":"https:\/\/academic.oup.com\/sleepadvances\/article\/doi\/10.1093\/sleepadvances\/zpag059\/8706330"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026]]},"references-count":34,"journal-issue":{"issue":"3","published-print":{"date-parts":[[2026,7,8]]}},"URL":"https:\/\/doi.org\/10.1093\/sleepadvances\/zpag059","relation":{},"ISSN":["2632-5012"],"issn-type":[{"value":"2632-5012","type":"electronic"}],"subject":[],"published-other":{"date-parts":[[2026]]},"published":{"date-parts":[[2026]]},"article-number":"zpag059"}}