<?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">JMIR Ment Health</journal-id><journal-id journal-id-type="publisher-id">mental</journal-id><journal-id journal-id-type="index">16</journal-id><journal-title>JMIR Mental Health</journal-title><abbrev-journal-title>JMIR Ment Health</abbrev-journal-title><issn pub-type="epub">2368-7959</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">v13i1e89213</article-id><article-id pub-id-type="doi">10.2196/89213</article-id><article-categories><subj-group subj-group-type="heading"><subject>Original Paper</subject></subj-group></article-categories><title-group><article-title>Electronic Health Record&#x2013;Based Phenotyping for Obsessive-Compulsive Disorder: Algorithm Development and Multicenter Validation Study</article-title></title-group><contrib-group><contrib contrib-type="author"><name name-style="western"><surname>Wang</surname><given-names>Bo</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff1">1</xref><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>Miller-Fleming</surname><given-names>Tyne W</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff4">4</xref><xref ref-type="aff" rid="aff5">5</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Yu</surname><given-names>Dongmei</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="aff" rid="aff2">2</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Hucks</surname><given-names>Donald</given-names></name><degrees>MS</degrees><xref ref-type="aff" rid="aff5">5</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Gantz</surname><given-names>Emily</given-names></name><degrees>DO</degrees><xref ref-type="aff" rid="aff5">5</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Johnston</surname><given-names>Rebecca</given-names></name><degrees>MS</degrees><xref ref-type="aff" rid="aff5">5</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Maxwell-Horn</surname><given-names>Angela</given-names></name><degrees>MD</degrees><xref ref-type="aff" rid="aff5">5</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Cox</surname><given-names>Nancy</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff5">5</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Sutcliffe</surname><given-names>James</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff4">4</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Mathews</surname><given-names>Carol A</given-names></name><degrees>MD</degrees><xref ref-type="aff" rid="aff6">6</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>McArthur</surname><given-names>Evonne</given-names></name><degrees>MD, PhD</degrees><xref ref-type="aff" rid="aff5">5</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>McGuire</surname><given-names>Patrick L</given-names></name><degrees>MD</degrees><xref ref-type="aff" rid="aff3">3</xref><xref ref-type="aff" rid="aff7">7</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Kabir</surname><given-names>Dia</given-names></name><degrees>MS</degrees><xref ref-type="aff" rid="aff1">1</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Dankese</surname><given-names>Ashley</given-names></name><xref ref-type="aff" rid="aff1">1</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Giangrande</surname><given-names>Evan J</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff1">1</xref><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>Fortgang</surname><given-names>Rebecca G</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="aff" rid="aff3">3</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Wang</surname><given-names>Shirley B</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff8">8</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Karmacharya</surname><given-names>Rakesh</given-names></name><degrees>MD, PhD</degrees><xref ref-type="aff" rid="aff1">1</xref><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>Roffman</surname><given-names>Joshua L</given-names></name><degrees>MD</degrees><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="aff" rid="aff3">3</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Scharf</surname><given-names>Jeremiah M</given-names></name><degrees>MD, PhD</degrees><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="aff" rid="aff2">2</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Smoller</surname><given-names>Jordan W</given-names></name><degrees>MD, SCD</degrees><xref ref-type="aff" rid="aff1">1</xref><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>Soda</surname><given-names>Takahiro</given-names></name><degrees>MD, PhD</degrees><xref ref-type="aff" rid="aff6">6</xref><xref ref-type="aff" rid="aff9">9</xref><xref ref-type="aff" rid="aff10">10</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Crowley</surname><given-names>James J</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff11">11</xref></contrib><contrib contrib-type="author" corresp="yes"><name name-style="western"><surname>Davis</surname><given-names>Lea K</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff5">5</xref><xref ref-type="aff" rid="aff12">12</xref><xref ref-type="aff" rid="aff13">13</xref></contrib></contrib-group><aff id="aff1"><institution>Massachusetts General Hospital</institution><addr-line>Richard B. Simches Research Building, 185 Cambridge Street, 2nd Floor</addr-line><addr-line>Boston</addr-line><addr-line>MA</addr-line><country>United States</country></aff><aff id="aff2"><institution>Broad Institute of MIT and Harvard</institution><addr-line>Boston</addr-line><addr-line>MA</addr-line><country>United States</country></aff><aff id="aff3"><institution>Department of Psychiatry, Harvard Medical School</institution><addr-line>Boston</addr-line><addr-line>MA</addr-line><country>United States</country></aff><aff id="aff4"><institution>Vanderbilt Genetics Institute, Vanderbilt University</institution><addr-line>Nashville</addr-line><addr-line>TN</addr-line><country>United States</country></aff><aff id="aff5"><institution>Vanderbilt University Medical Center</institution><addr-line>Nashville</addr-line><addr-line>TN</addr-line><country>United States</country></aff><aff id="aff6"><institution>Department of Psychiatry, University of Florida</institution><addr-line>Gainesville</addr-line><addr-line>FL</addr-line><country>United States</country></aff><aff id="aff7"><institution>Brigham and Women's Faulkner Hospital</institution><addr-line>Boston</addr-line><addr-line>MA</addr-line><country>United States</country></aff><aff id="aff8"><institution>Department of Psychology, Yale University</institution><addr-line>New Haven</addr-line><addr-line>CT</addr-line><country>United States</country></aff><aff id="aff9"><institution>University of Florida Genetics Institute</institution><addr-line>Gainesville</addr-line><addr-line>FL</addr-line><country>United States</country></aff><aff id="aff10"><institution>Center for Autism and Neurodevelopment, University of Florida</institution><addr-line>Gainesvilles</addr-line><addr-line>FL</addr-line><country>United States</country></aff><aff id="aff11"><institution>Department of Genetics, University of North Carolina at Chapel Hill</institution><addr-line>Chapel Hill</addr-line><addr-line>NC</addr-line><country>United States</country></aff><aff id="aff12"><institution>Department of Medicine, Icahn School of Medicine at Mount Sinai</institution><addr-line>3 E 101st St</addr-line><addr-line>New York</addr-line><addr-line>NY</addr-line><country>United States</country></aff><aff id="aff13"><institution>New York Genome Center</institution><addr-line>New York</addr-line><addr-line>NY</addr-line><country>United States</country></aff><contrib-group><contrib contrib-type="editor"><name name-style="western"><surname>Torous</surname><given-names>John</given-names></name></contrib></contrib-group><contrib-group><contrib contrib-type="reviewer"><name name-style="western"><surname>Strom</surname><given-names>Nora I</given-names></name></contrib><contrib contrib-type="reviewer"><name name-style="western"><surname>Merritt</surname><given-names>Victoria C</given-names></name></contrib></contrib-group><author-notes><corresp>Correspondence to Lea K Davis, PhD, Department of Medicine, Icahn School of Medicine at Mount Sinai, 3 E 101st St, New York, NY, 10029, United States, 1 2122416500; <email>lea.davis@mssm.edu</email></corresp></author-notes><pub-date pub-type="collection"><year>2026</year></pub-date><pub-date pub-type="epub"><day>2</day><month>10</month><year>2026</year></pub-date><volume>13</volume><elocation-id>e89213</elocation-id><history><date date-type="received"><day>09</day><month>12</month><year>2025</year></date><date date-type="rev-recd"><day>29</day><month>06</month><year>2026</year></date><date date-type="accepted"><day>08</day><month>07</month><year>2026</year></date></history><copyright-statement>&#x00A9; Bo Wang, Tyne W Miller-Fleming, Dongmei Yu, Donald Hucks, Emily Gantz, Rebecca Johnston, Angela Maxwell-Horn, Nancy Cox, James Sutcliffe, Carol A Mathews, Evonne McArthur, Patrick L McGuire, Dia Kabir, Ashley Dankese, Evan J Giangrande, Rebecca G Fortgang, Shirley B Wang, Rakesh Karmacharya, Joshua L Roffman, Jeremiah M Scharf, Jordan W Smoller, Takahiro Soda, James J Crowley, Lea K Davis. Originally published in JMIR Mental Health (<ext-link ext-link-type="uri" xlink:href="https://mental.jmir.org">https://mental.jmir.org</ext-link>), 2.10.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 JMIR Mental Health, is properly cited. The complete bibliographic information, a link to the original publication on <ext-link ext-link-type="uri" xlink:href="https://mental.jmir.org/">https://mental.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://mental.jmir.org/2026/1/e89213"/><abstract><sec><title>Background</title><p>Obsessive-compulsive disorder (OCD) is a common psychiatric disorder, with two-thirds of affected individuals reporting severe impairment. Despite its substantial burden and moderate heritability, the etiology of OCD remains poorly understood, and treatments are often suboptimal. Although recent genome-wide association studies (GWAS) have identified some risk loci, much of the genetic architecture of OCD remains undiscovered, underscoring the need for scalable approaches to identify large, well-defined patient cohorts.</p></sec><sec><title>Objective</title><p>This study aimed to develop and validate a scalable electronic health record (EHR)&#x2013;based phenotyping algorithm for identifying OCD cases to support large-scale genetic and translational research.</p></sec><sec sec-type="methods"><title>Methods</title><p>We leveraged EHR-linked biobank data from 2 large hospital systems, namely Vanderbilt University Medical Center (VUMC) and Mass General Brigham (MGB), to develop a high-throughput phenotyping algorithm integrating diagnostic codes, medication records, and natural language processing (NLP) of clinical notes. Algorithm performance was evaluated through expert chart review, and genetic analyses were performed in individuals of European genetic ancestry using the polygenic scores (PGS) of OCD, major depressive disorder (MDD), and height derived from the most recent GWAS.</p></sec><sec sec-type="results"><title>Results</title><p>Expert chart reviews demonstrated our algorithm combining both <italic>International Statistical Classification of Diseases</italic> (<italic>ICD</italic>) codes and NLP achieved the highest positive predictive values (PPV) for OCD case identification (0.84 at VUMC; 0.91 at MGB) compared to using either <italic>ICD</italic> codes or NLP alone, albeit with reduced case yield. At both sites, algorithm-defined OCD cases of European genetic ancestry showed significantly higher OCD PGS than controls. In sensitivity analyses adjusting for MDD status, OCD PGS associations were more robust than MDD PGS associations, while height PGS showed no association, supporting the genetic plausibility and relative specificity of the phenotype.</p></sec><sec sec-type="conclusions"><title>Conclusions</title><p>This study presents a scalable and cost-efficient EHR-based approach for identifying OCD cases across health systems. The algorithm achieves high PPV, and among individuals of European genetic ancestry, algorithm-defined cases show significant OCD PGS enrichment, supporting its utility for large-scale genetic studies and advancing understanding of the disorder&#x2019;s complex etiology.</p></sec></abstract><kwd-group><kwd>obsessive-compulsive disorder</kwd><kwd>electronic health records</kwd><kwd>natural language processing</kwd><kwd>EHR phenotyping</kwd><kwd>psychiatric genetics</kwd><kwd>polygenic scores</kwd></kwd-group></article-meta></front><body><sec id="s1" sec-type="intro"><title>Introduction</title><p>Obsessive-compulsive disorder (OCD) is a common psychiatric disorder with a lifetime prevalence of 2.3% and an annual prevalence of 1.2% [<xref ref-type="bibr" rid="ref1">1</xref>]. It is characterized by intrusive thoughts or impulses that typically cause anxiety or distress (obsessions), and repetitive mental acts or behaviors that one feels compelled to do (compulsions). OCD is highly debilitating; two-thirds of those affected report severe impairment, averaging 45 days in the past year unable to carry out usual work, home, or social activities [<xref ref-type="bibr" rid="ref1">1</xref>]. Globally, OCD was ranked the 10th most disabling illness in 1990, as measured by years lived with disability, just behind schizophrenia, owing to its high prevalence, chronic course, and pervasive symptoms [<xref ref-type="bibr" rid="ref2">2</xref>]. Symptoms typically emerge early in life, with a mean onset at age 19 [<xref ref-type="bibr" rid="ref1">1</xref>]. For a majority of individuals, OCD is a chronic condition, with remission achieved in only about one-fifth of cases [<xref ref-type="bibr" rid="ref3">3</xref>]. Factors associated with lower remission rates include greater symptom severity [<xref ref-type="bibr" rid="ref3">3</xref>,<xref ref-type="bibr" rid="ref4">4</xref>], earlier age of onset [<xref ref-type="bibr" rid="ref4">4</xref>], and longer illness duration [<xref ref-type="bibr" rid="ref5">5</xref>].</p><p>Despite its significant burden, the etiology of OCD remains poorly understood, and existing treatments are suboptimal. Twin studies have consistently demonstrated higher concordance rates for OCD in monozygotic compared to dizygotic twins [<xref ref-type="bibr" rid="ref6">6</xref>-<xref ref-type="bibr" rid="ref10">10</xref>], with estimated heritability around 40%&#x2010;50% [<xref ref-type="bibr" rid="ref9">9</xref>,<xref ref-type="bibr" rid="ref11">11</xref>]. Early genome-wide association studies (GWAS) for OCD were limited by small sample sizes (&#x003C;3500 cases) [<xref ref-type="bibr" rid="ref12">12</xref>,<xref ref-type="bibr" rid="ref13">13</xref>] but established OCD as a complex genetic trait, indicating that larger sample sizes could yield significant loci. The most recent OCD GWAS identified 30 genome-wide significant loci [<xref ref-type="bibr" rid="ref14">14</xref>]; however, despite recent growth in sample size, OCD GWAS still include fewer cases than GWAS of several other psychiatric disorders.</p><p>National disease registers, such as those in Nordic countries, have proven effective for large-scale sample collection. Diagnostic codes within these registers have generally shown high positive predictive values (PPV; the proportion of algorithm-defined cases confirmed as true cases), around 90%. For instance, 2 register-based studies in Sweden and Denmark reported PPVs ranging from 85%&#x2010;96% [<xref ref-type="bibr" rid="ref15">15</xref>,<xref ref-type="bibr" rid="ref16">16</xref>]. Electronic health records (EHRs) provide an alternative for case ascertainment that is scalable and cost-efficient. Unlike clinic-based recruitment, EHR-based approaches do not require prospective patient contact, and unlike national registers, which are largely limited to Nordic countries, EHRs are widely available across health care systems and offer access to rich clinical data beyond diagnostic codes, including medication records and clinical notes. EHR-based approaches have been successfully used in psychiatric research for bipolar disorder [<xref ref-type="bibr" rid="ref17">17</xref>], treatment-resistant depression [<xref ref-type="bibr" rid="ref18">18</xref>], binge eating disorder [<xref ref-type="bibr" rid="ref19">19</xref>], and autism spectrum disorder [<xref ref-type="bibr" rid="ref20">20</xref>,<xref ref-type="bibr" rid="ref21">21</xref>].</p><p>Existing OCD GWAS [<xref ref-type="bibr" rid="ref12">12</xref>-<xref ref-type="bibr" rid="ref14">14</xref>,<xref ref-type="bibr" rid="ref22">22</xref>] have used both family and unrelated sample designs. Members of this study team recently contributed EHR-linked biobank data to a large-scale GWAS meta-analysis including 28 OCD case-control cohorts [<xref ref-type="bibr" rid="ref14">14</xref>]. Case ascertainment strategies varied across cohorts, introducing heterogeneity. Motivated by the need to improve the quality of data contributing to future OCD GWAS, as well as other downstream applications, we sought to develop an externally validated phenotyping approach that integrates structured and unstructured EHR data, an area that remains relatively underexplored in OCD research.</p><p>In this study, we report the development and validation of a high-throughput phenotyping algorithm that integrates natural language processing (NLP), <italic>International Statistical Classification of Diseases</italic> (<italic>ICD</italic>) codes, and medication administration records to systematically identify relevant evidence and determine patient OCD status across 2 academic medical centers: Vanderbilt University Medical Center (VUMC) and Mass General Brigham (MGB). Both institutions are part of the Psychiatric Electronic Medical Record and Genomics Network (PsycheMERGE), a network of EHR-linked biobanks for precision psychiatry research. Our algorithm was rigorously validated by expert chart review, demonstrating high PPV at both centers. Applying this method, we identified 417&#x2010;1057 samples at VUMC and 335&#x2010;1379 samples at MGB, depending on the algorithmic definition. Among identified cases of European genetic ancestry with available genotype data, we observed significantly elevated polygenic scores (PGSs) derived from the latest OCD GWAS [<xref ref-type="bibr" rid="ref14">14</xref>]. Our results demonstrate that automated EHR-based phenotyping can effectively identify OCD cases and controls with precision, and that among individuals of European genetic ancestry, the identified cases show PGS associations consistent with samples ascertained through traditional, resource-intensive methods. This approach represents a valuable tool for accelerating psychiatric genetic research.</p></sec><sec id="s2" sec-type="methods"><title>Methods</title><sec id="s2-1"><title>Study Participants</title><p>This research was conducted as part of the Psychiatric Genomics Consortium&#x2019;s (PGC) ongoing effort to identify and collect DNA samples from patients with OCD, using 2 EHR-linked biobanks within the PsycheMERGE Network: Vanderbilt University Medical Center&#x2019;s biobank (BioVU) at VUMC in Nashville, Tennessee, and the MGB Biobank (MGBB) [<xref ref-type="bibr" rid="ref23">23</xref>] at MGB in Boston, Massachusetts. The study included 213,275 individuals receiving care at VUMC from 1989 to 2021, and 97,275 patients at MGB from 1976 to 2021. Additional data details are provided in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>.</p></sec><sec id="s2-2"><title>Ethical Considerations</title><p>Ethical approvals were obtained from the institutional review boards at both VUMC and MGB, including an informed consent waiver for the use of retrospective medical record data without patient interaction. All participants provided written informed consent for their inclusion in the respective biobanks for broad-based research use.</p></sec><sec id="s2-3"><title>OCD Phenotyping Algorithm</title><sec id="s2-3-1"><title>Algorithm Overview</title><p>Our OCD algorithm was developed at VUMC through an iterative, consensus-driven process, involving domain experts from PGC, VUMC psychiatry, and neurology. Structured data elements of the algorithm included <italic>International Classification of Diseases, 9th Revision</italic> (<italic>ICD-9</italic>) and <italic>International Statistical Classification of Diseases, 10th Revision</italic> (<italic>ICD-10</italic>) inclusion and exclusion codes (Tables S3-S4 in <xref ref-type="supplementary-material" rid="app2">Multimedia Appendix 2</xref>), while diagnostic and treatment-related keywords were incorporated into the NLP arm (Table S5 in <xref ref-type="supplementary-material" rid="app2">Multimedia Appendix 2</xref>). These keywords were identified through iterative consultation with psychiatry domain experts. To establish a broad performance base, we included <italic>ICD</italic> codes for body dysmorphic disorder (BDD) and trichotillomania, with the understanding that these criteria can be modified to adjust the algorithm&#x2019;s specificity for different use cases. Medications were extracted from multiple sources, including structured EHR databases containing recorded prescriptions and unstructured clinical notes. Once all algorithm components were finalized and the logical order of its operations was confirmed by the domain experts, we implemented the algorithm within the VUMC clinical database. Overall, 3 rounds of chart review were conducted at VUMC and MGB, respectively, to validate its performance. Detailed steps in developing the algorithm are provided in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>.</p><p>The resulting algorithm integrates diagnostic, medication, and clinical note data to determine patients&#x2019; OCD status. It begins with exclusion criteria (<xref ref-type="fig" rid="figure1">Figure 1A</xref>), followed by 2 inclusion pathways: (1) an <italic>ICD</italic> arm identifying relevant patients with at least one relevant <italic>ICD-9</italic> and <italic>ICD-10</italic> code for OCD or obsessive-compulsive (OC) spectrum disorders (<xref ref-type="fig" rid="figure1">Figure 1B</xref>); and (2) an NLP arm detecting OCD-related mentions in patients&#x2019; clinical notes (<xref ref-type="fig" rid="figure1">Figure 1C</xref>). Exclusion criteria include <italic>ICD</italic> codes for &#x201C;Other specified metabolic disorders&#x201D; and &#x201C;Metabolic disorder, unspecified&#x201D; to prevent rare but highly penetrant metabolic disorders, such as Lesch-Nyhan syndrome, from being misidentified as OCD. We derived 4 definitions of OCD from this algorithm: (1) <italic>ICD</italic>-defined, including cases identified exclusively through the <italic>ICD</italic> arm of the algorithm; (2) NLP-only, encompassing cases that lacked <italic>ICD</italic>-coded information but are identified through the NLP arm based on clinical notes; (3) <italic>ICD</italic>-or-NLP, identifying cases from either the <italic>ICD</italic> or the NLP arm, ie, the disjunction of the 2 arms resulting in the union of cases; and (4) <italic>ICD</italic>-and-NLP, requiring concordance between the 2 arms, ie, the conjunction of both arms representing the intersection of cases. We used the <italic>ICD</italic>-or-NLP definition to sample OCD cases for chart reviews, as it represents the broadest and most inclusive version of our algorithm.</p><fig position="float" id="figure1"><label>Figure 1.</label><caption><p>Obsessive-compulsive disorder (OCD) phenotyping algorithm flowchart at Vanderbilt University Medical Center (VUMC) and Mass General Brigham (MGB), consisting of an <italic>International Classification of Diseases</italic> (<italic>ICD)</italic> code-based exclusion criteria (A), an <italic>ICD</italic> code-based inclusion arm (B), and a rule-based natural language processing (NLP) algorithm arm (C). *: All <italic>International Classification of Diseases, 10th Revision</italic> (<italic>ICD</italic>-10) subcodes under F42 (ie, F42.*). &#x2020;: <italic>ICD</italic> codes used for exclusion in the NLP arm: Table S4 in <xref ref-type="supplementary-material" rid="app2">Multimedia Appendix 2</xref>. &#x2021;: Medication names list: Table S5 in <xref ref-type="supplementary-material" rid="app2">Multimedia Appendix 2</xref>. <italic>ICD</italic>: International Statistical Classification of Disease and Related Health Problems, OCD: obsessive-compulsive disorder.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="mental_v13i1e89213_fig01.png"/></fig></sec><sec id="s2-3-2"><title>NLP System</title><p>We developed a rule-based NLP system to identify OCD mentions from clinical notes (<xref ref-type="fig" rid="figure1">Figure 1C</xref>), comprising 2 steps: (1) detecting OCD keyword mentions (C1); and (2) identifying cognitive behavioral therapy (CBT) mentions and relevant medications (C2). To meet the criteria in C1, a patient must have at least 2 mentions of OCD on separate days in clinical documents, such as problem lists, discharge summaries, clinical communications, progress notes, or visit notes, with the first OCD mention before age 55 [<xref ref-type="bibr" rid="ref24">24</xref>,<xref ref-type="bibr" rid="ref25">25</xref>]. This requirement accounts for the possibility that late-life OCD diagnosis may more likely reflect changes due to cognitive decline, often with a biological etiology distinct from that of idiopathic OCD. We incorporated exclusion criteria in C1, using keywords and codes, to disambiguate the acronym &#x201C;OCD&#x201D; and prevent false identifications, such as mentions related to osteochondritis dissecans. In C2, mentions of OCD treatments, including CBT or relevant medications, provide additional evidence for OCD. Medications (see <xref ref-type="supplementary-material" rid="app2">Multimedia Appendix 2</xref> Table S5 for the list of medication names used) were extracted from 2 sources: (1) structured patient medication database; and (2) unstructured clinical notes using the MedEx-UIMA (The University of Texas Health Science Center at Houston and Vanderbilt University) system [<xref ref-type="bibr" rid="ref26">26</xref>]. Further details about the NLP system are provided in Appendix S3 and Figure S1 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>.</p></sec></sec><sec id="s2-4"><title>Chart Review</title><p>Two reviewers with clinical training in psychiatric assessment (EM: a postpsychiatry clerkship medical student; PM: a psychiatry resident) were selected to conduct chart reviews at VUMC. Both were trained using chart review instructions (Appendix S4 <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>), which included <italic>Diagnostic and Statistical Manual of Mental Disorders</italic> (Fifth Edition; <italic>DSM-5</italic>) diagnostic criteria for OCD, evidence grading guidelines, and defined inclusion and exclusion rules. OCD cases for chart review were identified using the <italic>ICD</italic>-or-NLP definition. Both reviewers independently examined charts from the same set of 25 subjects to assess interrater reliability (IRR). Reviewers, blinded to each other&#x2019;s assessments, determined OCD presence and graded supporting evidence. A psychiatrist (JB) and a psychiatric nurse practitioner (HH), both with clinical expertise in OCD, adjudicated discrepancies and provided feedback. Once adequate agreement (IRR&#x003E;90%) was achieved, each reviewer independently assessed an additional 25 subjects. If agreement was inadequate, another 25 subjects were reviewed, followed by the same confirmation process until the required agreement threshold was met. Once confirmed, the remaining subjects were reviewed independently.</p><p>For external validation at MGB, 2 board-certified psychiatrists (JR and RK) with extensive experience in psychiatric chart review conducted 2 review rounds for algorithm refinement and evaluation. Disagreements were adjudicated by a third experienced psychiatrist (JS). The first 2 rounds together included 68 algorithm-identified cases and 8 noncases. In the final round, 3 clinical psychologists (EG, RF, and SW) reviewed 90 randomly sampled algorithm-identified cases. All 3 reviewers first independently reviewed the same 10 charts for calibration, followed by a meeting to align on diagnostic criteria and evidence grading. Each reviewer then independently assessed 33&#x2010;35 charts, with each chart reviewed by 2 reviewers and discrepancies resolved by the third. Reviewers at both sites followed standardized chart review instructions (Appendix S4 and Figure S2 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>).</p></sec><sec id="s2-5"><title>Genetic Analysis (VUMC)</title><p>For genetic analysis, we used BioVU, VUMC&#x2019;s biobank that links deidentified DNA samples with EHRs. BioVU, established in 2007, obtains patient consent through forms provided in outpatient clinic settings. We applied quality control measures (described in Appendix S5.1 <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>) to the algorithm-defined OCD cases and controls in BioVU to generate the final dataset used for genetic analysis. OCD cases were matched to controls at a 1:3 case-control ratio based on median age in the medical record, sex, and the first 2 genetic principal components.</p><p>The OCD PGS was derived from the OCD GWAS by Strom et al [<xref ref-type="bibr" rid="ref14">14</xref>] (excluding 23andMe and BioVU samples). The PGS for height and major depressive disorder (MDD) were derived using GWAS summary statistics for height [<xref ref-type="bibr" rid="ref27">27</xref>] and MDD [<xref ref-type="bibr" rid="ref28">28</xref>], respectively. We used Polygenic Risk Score via Continuous Shrinkage (PRS-CS) [<xref ref-type="bibr" rid="ref29">29</xref>] to estimate posterior single-nucleotide polymorphism (SNP) effect sizes, using CEU (refers to Utah residents with Northern and Western European ancestry) samples from the 1000 Genomes Project Phase 3 as the reference panel. PGSs were calculated as the sum of the risk allele dosages weighted by the posterior SNP effect sizes. Logistic regression assessed the association of the OCD, MDD, and height PGSs with algorithm-defined OCD status, adjusting for current age, genotype batch, and principal component analysis components 1&#x2010;10. Nagelkerke <italic>R</italic><sup>2</sup> was calculated for the full model and for the corresponding model excluding the PGS term, and the difference was reported to quantify the incremental contribution of each PGS to OCD case status. Additionally, we performed a sensitivity analysis that included MDD status as a covariate to assess whether associations between the OCD, MDD, and height PGSs and OCD case status were independent of comorbid MDD. MDD status was extracted from the EHR using a previously established algorithm [<xref ref-type="bibr" rid="ref30">30</xref>,<xref ref-type="bibr" rid="ref31">31</xref>], as detailed in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>.</p></sec><sec id="s2-6"><title>Genetic Analysis (MGB)</title><p>The MGBB, established in 2010, collects biological samples, health information, and genetic data to support biomedical research [<xref ref-type="bibr" rid="ref23">23</xref>]. Participants are enrolled using a broad-based consent process by research coordinators at clinical and public hospital locations or electronically through the MGB patient portal. Genotyping was performed for 53,853 participants in 13 batches using 4 Illumina array platforms: Multi-Ethnic Genotyping Array (MEGA, batch 1), Expanded Multi-Ethnic Genotyping Array (MEGAEX, batch 2), Multi-Ethnic Global (MEG, batches 3&#x2010;9), and Global Screening Array (GSA, batches 10&#x2010;13). Batches 8 and 9 were excluded due to few OCD cases (see Table S1 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref> for case and control counts). Quality control procedures are detailed in Appendix S5.2 and Figure S4 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>.</p><p>Consistent with methods used at VUMC, SNP effect sizes from GWAS of OCD, MDD, and height were used to construct PGSs. Posterior SNP effect sizes were calculated using PRS-CS [<xref ref-type="bibr" rid="ref29">29</xref>], with the CEU reference panel. PGSs were calculated as weighted sums of risk allele dosages based on the posterior SNP effect sizes. Logistic regression analyses were performed separately in the MEG and GSA datasets to evaluate associations between each PGS and algorithm-defined OCD case status, adjusted for age and genetic principal components. The incremental contribution of each PGS to OCD status prediction was assessed by calculating the difference in Nagelkerke <italic>R</italic><sup>2</sup> between the full model and the corresponding model excluding the PGS term. Sensitivity analyses were conducted by including MDD status as a covariate to assess whether the associations of the OCD, MDD, and height PGSs with OCD case status were independent of comorbid MDD.</p></sec></sec><sec id="s3" sec-type="results"><title>Results</title><sec id="s3-1"><title>Chart Review Validation</title><p>At VUMC, reviewers achieved 91% raw agreement and Cohen &#x03BA;=0.72 in the first 2 rounds (50 charts total), indicating substantial IRR [<xref ref-type="bibr" rid="ref32">32</xref>]. In the third and final round, each reviewer independently assessed 22&#x2010;25 additional charts, totaling 97 reviews. At MGB, 2 initial rounds of chart review identified 34 OCD cases and 42 noncases, with reviewers agreeing on 71 out of 76 charts (93% agreement; &#x03BA;=0.91). In the final round, 3 reviewers (EG, RF, and SW) assessed 90 charts (52 cases and 38 noncases), achieving 87% agreement and &#x03BA;=0.71. At MGB, only the final round was used for algorithm validation (<xref ref-type="table" rid="table1">Table 1</xref>).</p><table-wrap id="t1" position="float"><label>Table 1.</label><caption><p>Comparison of the 4 obsessive-compulsive disorder (OCD) definitions in terms of positive predictive values (PPV) and the number of genotyped OCD cases identified in the biobanks.</p></caption><table id="table1" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Algorithmic definition</td><td align="left" valign="bottom" colspan="2">VUMC<sup><xref ref-type="table-fn" rid="table1fn1">a</xref></sup></td><td align="left" valign="bottom" colspan="2">MGB<sup><xref ref-type="table-fn" rid="table1fn2">b</xref></sup></td></tr><tr><td align="left" valign="top"/><td align="left" valign="bottom">PPV<sup><xref ref-type="table-fn" rid="table1fn3">c</xref></sup></td><td align="left" valign="bottom">Genotyped, n</td><td align="left" valign="bottom">PPV</td><td align="left" valign="bottom">Genotyped, n</td></tr></thead><tbody><tr><td align="left" valign="top"><italic>ICD</italic>-or-NLP<sup><xref ref-type="table-fn" rid="table1fn4">d</xref></sup><sup>, <xref ref-type="table-fn" rid="table1fn5">e</xref>, <xref ref-type="table-fn" rid="table1fn6">f</xref></sup></td><td align="left" valign="top">0.72</td><td align="left" valign="top">1057</td><td align="left" valign="top">0.58</td><td align="left" valign="top">1379</td></tr><tr><td align="left" valign="top"><italic>ICD</italic>-defined<sup><xref ref-type="table-fn" rid="table1fn7">g</xref></sup></td><td align="left" valign="top">0.73</td><td align="left" valign="top">640</td><td align="left" valign="top">0.64</td><td align="left" valign="top">725</td></tr><tr><td align="left" valign="top">NLP-only<sup><xref ref-type="table-fn" rid="table1fn8">h</xref></sup></td><td align="left" valign="top">0.71</td><td align="left" valign="top">417</td><td align="left" valign="top">0.51</td><td align="left" valign="top">654</td></tr><tr><td align="left" valign="top"><italic>ICD</italic>-and-NLP<sup><xref ref-type="table-fn" rid="table1fn9">i</xref></sup></td><td align="left" valign="top">0.84</td><td align="left" valign="top">515</td><td align="left" valign="top">0.91</td><td align="left" valign="top">335</td></tr></tbody></table><table-wrap-foot><fn id="table1fn1"><p><sup>a</sup>VUMC: Vanderbilt University Medical Center.</p></fn><fn id="table1fn2"><p><sup>b</sup>MGB: Mass General Brigham.</p></fn><fn id="table1fn3"><p><sup>c</sup>PPV: positive predictive values.</p></fn><fn id="table1fn4"><p><sup>d</sup><italic>ICD</italic>: <italic>International Statistical Classification of Diseases</italic>.</p></fn><fn id="table1fn5"><p><sup>e</sup>NLP: natural language processing.</p></fn><fn id="table1fn6"><p><sup>f</sup> Uses both arms and takes the union of the cases identified by either arm.</p></fn><fn id="table1fn7"><p><sup>g</sup>Charts selected based on <italic>ICD</italic>-coded information regardless of whether NLP was positive.</p></fn><fn id="table1fn8"><p><sup>h</sup>Charts that lacked <italic>ICD</italic>-coded information but were algorithm positive based on NLP applied to unstructured notes.</p></fn><fn id="table1fn9"><p><sup>i</sup> Uses both arms and takes their intersection. </p></fn></table-wrap-foot></table-wrap><p><xref ref-type="table" rid="table1">Table 1</xref> summarizes chart review validation results. The <italic>ICD</italic>-and-NLP definition (intersection) achieved the highest PPV of 0.84 at VUMC and 0.91 at MGB, but identified fewer cases (515 and 335, respectively). The <italic>ICD</italic>-or-NLP definition (union) yielded more cases (1057 at VUMC; 1379 at MGB) but lower PPVs (0.72 and 0.58), with 38 of 90 MGB subjects misclassified as OCD cases. These findings highlight the tradeoff between PPV and the number of identified OCD cases when comparing the disjunction (<italic>ICD</italic>-or-NLP) and conjunction (<italic>ICD</italic>-and-NLP) of the 2 arms in the algorithm. The NLP-only definition yielded the lowest PPVs at both sites. Replication at MGB resulted in lower PPVs for 3 of the 4 definitions (<italic>ICD</italic>-defined, NLP-only, and <italic>ICD</italic>-or-NLP), particularly the latter 2, underscoring the challenges associated with using clinical notes across different institutions.</p></sec><sec id="s3-2"><title>Description of Algorithm Results</title><p>Among 213,275 BioVU participants, our algorithm identified 640 genotyped OCD cases by <italic>ICD</italic> codes (<italic>ICD</italic>-defined), 417 by NLP (NLP-only), 1057 by either arm (<italic>ICD</italic>-or-NLP), and 515 by both (<italic>ICD</italic>-and-NLP). For MGBB, 3385 of 97,275 participants were excluded based on predefined criteria (<xref ref-type="fig" rid="figure1">Figure 1A</xref>). Of 93,890 remaining, 53,853 underwent genotyping, yielding 725 <italic>ICD</italic>-defined, 654 NLP-only, 1379 <italic>ICD</italic>-or-NLP, and 335 <italic>ICD</italic>-and-NLP cases (Figure S3 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>). Pie charts summarizing the OCD case counts are presented in Figure S3 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>.</p><p><xref ref-type="table" rid="table2">Table 2</xref> and Table S2 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref> summarize demographic characteristics. <italic>ICD</italic>-defined cohorts included older participants (mean age 46.2, SD 17.53 at VUMC; mean 55.4, SD 17.58 at MGB) and a higher proportion with public insurance (55.2% and 65.4%). In contrast, NLP-only cohorts were younger (44.0 at VUMC; 45.2 at MGB) with fewer on public insurance (45.6% and 50.8%). Females predominated across all cohorts, especially NLP-only (65.7% at VUMC; 67.3% at MGB). Most individuals self-reported as White (91%&#x2010;92%; at VUMC; 83%&#x2010;91%; at MGB), highest in <italic>ICD</italic>-and-NLP cohorts. In terms of hospital utilization, NLP-only cohorts consistently had the fewest visits, diagnoses (<italic>ICD</italic>), procedures (current procedural terminology [CPT]), prescriptions (RxNorm), lab tests (Logical Observation Identifiers Names and Codes [LOINC]), and clinical notes across both sites. The cohort with the highest use varied, being <italic>ICD</italic>-and-NLP at VUMC and <italic>ICD</italic>-only at MGB. Notably, despite lower overall use and a shorter study time frame (1989&#x2010;2021 at VUMC vs 1976&#x2010;2021 at MGB), VUMC cohorts had markedly more clinical notes, suggesting site-level differences in documentation practices.</p><table-wrap id="t2" position="float"><label>Table 2.</label><caption><p>Demographic composition of the Obsessive-compulsive disorder (OCD) cases identified by each arm of the algorithm.</p></caption><table id="table2" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Setting</td><td align="center" valign="bottom">ICD-defined<sup><xref ref-type="table-fn" rid="table2fn1">a</xref></sup> (VUMC<sup><xref ref-type="table-fn" rid="table2fn3">c</xref></sup>)</td><td align="center" valign="bottom">NLP-only<sup><xref ref-type="table-fn" rid="table2fn2">b</xref></sup> (VUMC)</td><td align="center" valign="bottom">ICD-defined (MGB<sup><xref ref-type="table-fn" rid="table2fn4">d</xref></sup>)</td><td align="center" valign="bottom">NLP-only (MGB)</td></tr></thead><tbody><tr><td align="left" valign="top">Genotyped, n</td><td align="center" valign="top">640</td><td align="center" valign="top">417</td><td align="center" valign="top">725</td><td align="center" valign="top">654</td></tr><tr><td align="left" valign="top">Age, mean (SD)</td><td align="center" valign="top">46.22 (17.53)</td><td align="center" valign="top">43.99 (15.61)</td><td align="center" valign="top">55.35 (17.58)</td><td align="center" valign="top">45.17 (11.03)</td></tr><tr><td align="left" valign="top" colspan="5">EHR-reported<sup><xref ref-type="table-fn" rid="table2fn5">e</xref></sup> sex<sup><xref ref-type="table-fn" rid="table2fn6">f</xref></sup>, n (%)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Female</td><td align="center" valign="top">357 (55.78)</td><td align="center" valign="top">274 (65.71)</td><td align="center" valign="top">442 (60.97)</td><td align="center" valign="top">440 (67.28)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Male</td><td align="center" valign="top">283 (44.22)</td><td align="center" valign="top">143 (34.29)</td><td align="center" valign="top">283 (39.03)</td><td align="center" valign="top">214 (32.72)</td></tr><tr><td align="left" valign="top" colspan="5">Self-reported race, n (%)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Asian</td><td align="center" valign="top">9 (1.41)</td><td align="center" valign="top">4 (0.96)</td><td align="center" valign="top">10 (1.38)</td><td align="center" valign="top">17 (2.60)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Black or African American</td><td align="center" valign="top">36 (5.63)</td><td align="center" valign="top">21 (5.04)</td><td align="center" valign="top">29 (4.0)</td><td align="center" valign="top">33 (5.05)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>White</td><td align="center" valign="top">583 (91.10)</td><td align="center" valign="top">382 (91.61)</td><td align="center" valign="top">646 (89.10)</td><td align="center" valign="top">541 (82.72)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Other</td><td align="center" valign="top">3 (0.47)</td><td align="center" valign="top">1 (0.24)</td><td align="center" valign="top">30 (4.14)</td><td align="center" valign="top">54 (8.26)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Unknown</td><td align="center" valign="top">9 (1.41)</td><td align="center" valign="top">9 (2.16)</td><td align="center" valign="top">10 (1.38)</td><td align="center" valign="top">9 (1.38)</td></tr><tr><td align="left" valign="top" colspan="5">Ethnicity, n (%)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Hispanic</td><td align="center" valign="top">11 (1.72)</td><td align="center" valign="top">12 (2.88)</td><td align="center" valign="top">12 (1.66)</td><td align="center" valign="top">20 (3.06)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Non-Hispanic</td><td align="center" valign="top">629 (98.28)</td><td align="center" valign="top">405 (97.12)</td><td align="center" valign="top">713 (98.34)</td><td align="center" valign="top">634 (96.94)</td></tr><tr><td align="left" valign="top" colspan="5">Public payer, n (%)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Yes</td><td align="center" valign="top">353 (55.16)</td><td align="center" valign="top">190 (45.56)</td><td align="center" valign="top">474 (65.38)</td><td align="center" valign="top">332 (50.76)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>No</td><td align="center" valign="top">287 (44.84)</td><td align="center" valign="top">227 (54.44)</td><td align="center" valign="top">251 (34.62)</td><td align="center" valign="top">322 (49.24)</td></tr><tr><td align="left" valign="top" colspan="5">Hospital usage, median (IQR)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>EHR length (in years)</td><td align="center" valign="top">7.78 (11.98)</td><td align="center" valign="top">8.53 (12.26)</td><td align="center" valign="top">18.47 (11.62)</td><td align="center" valign="top">14.50 (13.03)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Visit count</td><td align="center" valign="top">76 (127.25)</td><td align="center" valign="top">63 (105)</td><td align="center" valign="top">366 (463.0)</td><td align="center" valign="top">268.5 (362.75)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><italic>ICD</italic> count</td><td align="center" valign="top">208.5 (408.75)</td><td align="center" valign="top">167 (324)</td><td align="center" valign="top">809 (1271.0)</td><td align="center" valign="top">587.5 (809.0)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>CPT<sup><xref ref-type="table-fn" rid="table2fn7">g</xref></sup> count</td><td align="center" valign="top">215 (339.25)</td><td align="center" valign="top">167 (298)</td><td align="center" valign="top">593 (867.0)</td><td align="center" valign="top">405 (595.25)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>RxNorm count</td><td align="center" valign="top">117.5 (158.25)</td><td align="center" valign="top">99 (138.75)</td><td align="center" valign="top">566.0 (948.0)</td><td align="center" valign="top">390.0 (696.75)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>LOINC<sup><xref ref-type="table-fn" rid="table2fn8">h</xref></sup> count</td><td align="center" valign="top">159 (129.5)</td><td align="center" valign="top">139.5 (127)</td><td align="center" valign="top">525.5 (532.75)</td><td align="center" valign="top">442.0 (457.75)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Note count</td><td align="center" valign="top">1155 (2255)</td><td align="center" valign="top">1081 (2146.75)</td><td align="center" valign="top">363 (544.0)</td><td align="center" valign="top">273.5 (405.25)</td></tr></tbody></table><table-wrap-foot><fn id="table2fn1"><p><sup>a</sup><italic>ICD</italic>: <italic>International Statistical Classification of Diseases</italic>.</p></fn><fn id="table2fn2"><p><sup>b</sup>NLP: natural language processing.</p></fn><fn id="table2fn3"><p><sup>c</sup>VUMC: Vanderbilt University Medical Center.</p></fn><fn id="table2fn4"><p><sup>d</sup>MGB: Mass General Brigham.</p></fn><fn id="table2fn5"><p><sup>e</sup>EHR: electronic health record.</p></fn><fn id="table2fn6"><p><sup>f</sup>EHR-reported sex, defined as sex at birth at MGB and self-reported or clinician-recorded sex at VUMC.</p></fn><fn id="table2fn7"><p><sup>g</sup>CPT: current procedural terminology.</p></fn><fn id="table2fn8"><p><sup>h</sup>LOINC: Logical Observation Identifiers Names and Codes.</p></fn></table-wrap-foot></table-wrap></sec><sec id="s3-3"><title>Genetic Analysis</title><sec id="s3-3-1"><title>VUMC</title><p>In the VUMC BioVU cohort, 676 OCD cases (<italic>ICD</italic>-or-NLP) and 46,677 controls passed genotyping quality control. Genetic analyses were restricted to individuals of European ancestry. After applying case-control matching as described in the Methods, the analytic dataset included 398 <italic>ICD</italic>-defined, 278 NLP-only, 676 <italic>ICD</italic>-or-NLP, and 326 <italic>ICD</italic>-and-NLP cases, each at a 1:3 case-control ratio. OCD, MDD, and height PGSs were computed for each algorithm-defined OCD case-control set using summary statistics from previously published GWASs of OCD [<xref ref-type="bibr" rid="ref14">14</xref>], MDD [<xref ref-type="bibr" rid="ref28">28</xref>], and height [<xref ref-type="bibr" rid="ref27">27</xref>]. As shown in <xref ref-type="table" rid="table3">Table 3</xref>, the OCD PGS was significantly associated with algorithm-defined OCD status in logistic regression analyses for the definitions that incorporated <italic>ICD</italic> codes: <italic>ICD</italic>-defined (odds ratio [OR] 1.22, SE 0.062; <italic>P</italic>=1.51&#x00D7;10<sup>&#x2013;3</sup>), <italic>ICD</italic>-or-NLP (OR 1.15, SE 0.047; <italic>P</italic>=4.05&#x00D7;10<sup>&#x2013;3</sup>), and <italic>ICD</italic>-and-NLP (OR 1.26, SE 0.068; <italic>P</italic>=8.19&#x00D7;10<sup>&#x2013;4</sup>). No significant association was found for the NLP-only definition (OR 1.10, SE 0.072; <italic>P</italic>=.20).</p><table-wrap id="t3" position="float"><label>Table 3.</label><caption><p>Association between obsessive-compulsive disorder (OCD) polygenic scores (PGS) and predicted OCD status in Vanderbilt University Medical Center (VUMC) Vanderbilt University Medical Center&#x2019;s biobank.(BioVU).</p></caption><table id="table3" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Algorithmic definition</td><td align="left" valign="bottom">Dataset</td><td align="left" valign="bottom">Number of cases, n</td><td align="left" valign="bottom">Number of controls, n</td><td align="left" valign="bottom">OR<sup><xref ref-type="table-fn" rid="table3fn1">a</xref></sup></td><td align="left" valign="bottom">BETA<sup><xref ref-type="table-fn" rid="table3fn2">b</xref></sup></td><td align="left" valign="bottom">SE</td><td align="left" valign="bottom"><italic>P</italic> value</td><td align="left" valign="bottom"><italic>R</italic><sup>2</sup></td></tr></thead><tbody><tr><td align="left" valign="top"><italic>ICD</italic>-defined<sup><xref ref-type="table-fn" rid="table3fn3">c</xref></sup></td><td align="left" valign="top">BioVU<sup><xref ref-type="table-fn" rid="table3fn4">d</xref></sup></td><td align="left" valign="top">398</td><td align="left" valign="top">1194</td><td align="left" valign="top">1.22</td><td align="left" valign="top">0.198</td><td align="left" valign="top">0.062</td><td align="left" valign="top">1.51E-03</td><td align="left" valign="top">0.88%</td></tr><tr><td align="left" valign="top">NLP-only<sup><xref ref-type="table-fn" rid="table3fn5">e</xref></sup></td><td align="left" valign="top">BioVU</td><td align="left" valign="top">278</td><td align="left" valign="top">834</td><td align="left" valign="top">1.10</td><td align="left" valign="top">0.094</td><td align="left" valign="top">0.072</td><td align="left" valign="top">.1946</td><td align="left" valign="top">0.21%</td></tr><tr><td align="left" valign="top"><italic>ICD</italic>-or-NLP</td><td align="left" valign="top">BioVU</td><td align="left" valign="top">676</td><td align="left" valign="top">2028</td><td align="left" valign="top">1.15</td><td align="left" valign="top">0.135</td><td align="left" valign="top">0.047</td><td align="left" valign="top">4.05E-03</td><td align="left" valign="top">0.43%</td></tr><tr><td align="left" valign="top"><italic>ICD</italic>-and-NLP</td><td align="left" valign="top">BioVU</td><td align="left" valign="top">326</td><td align="left" valign="top">978</td><td align="left" valign="top">1.26</td><td align="left" valign="top">0.229</td><td align="left" valign="top">0.068</td><td align="left" valign="top">8.19E-04</td><td align="left" valign="top">1.21%</td></tr></tbody></table><table-wrap-foot><fn id="table3fn1"><p><sup>a</sup>OR: odds ratio.</p></fn><fn id="table3fn2"><p><sup>b</sup>BETA: beta coefficient.</p></fn><fn id="table3fn3"><p><sup>c</sup><italic>ICD</italic>: <italic>International Statistical Classification of Disease</italic>.</p></fn><fn id="table3fn4"><p><sup>d</sup>BioVU: Vanderbilt University Medical Center&#x2019;s biobank.</p></fn><fn id="table3fn5"><p><sup>e</sup>NLP: natural language processing.</p></fn></table-wrap-foot></table-wrap><p>As shown in Table S7 in <xref ref-type="supplementary-material" rid="app2">Multimedia Appendix 2</xref>, the MDD PGS was also associated with algorithm-defined OCD status for the definitions incorporating <italic>ICD</italic> codes, with effect estimates broadly similar to those observed for the OCD PGS. Compared with the corresponding OCD PGS associations, the MDD PGS showed a slightly larger effect estimate and smaller <italic>P</italic> value for <italic>ICD</italic>-defined (OR 1.23, SE 0.061; <italic>P</italic>=6.47&#x00D7;10<sup>&#x2013;4</sup>), a slightly smaller effect estimate and larger <italic>P</italic> value for the <italic>ICD</italic>-or-NLP definition (OR 1.13, SE 0.048; <italic>P</italic>=1.10&#x00D7;10<sup>&#x2013;2</sup>), and a similar effect estimate and <italic>P</italic> value for the <italic>ICD</italic>-and-NLP definition (OR 1.26, SE 0.069; <italic>P</italic>=7.78&#x00D7;10<sup>&#x2013;4</sup>). Full VUMC results for the OCD, MDD, and height PGS analyses, before and after adjustment for MDD status, are provided in Table S7 in <xref ref-type="supplementary-material" rid="app2">Multimedia Appendix 2</xref>.</p><p>We next assessed whether the associations between PGSs and algorithm-defined OCD status were robust to comorbid MDD by including EHR-derived MDD status as an additional covariate. After adjustment for MDD status, the OCD PGS associations remained directionally consistent across the <italic>ICD</italic>-defined, <italic>ICD</italic>-or-NLP, and <italic>ICD</italic>-and-NLP definitions. These associations remained statistically significant for the <italic>ICD</italic>-or-NLP definition (OR 1.11, SE 0.051; <italic>P</italic>=4.51&#x00D7;10<sup>&#x2013;2</sup>) and the <italic>ICD</italic>-and-NLP definition (OR 1.20, SE 0.077; <italic>P</italic>=2.13&#x00D7;10<sup>&#x2013;2</sup>), and were marginal for <italic>ICD</italic>-defined (OR 1.14, SE 0.071; <italic>P</italic>=6.08&#x00D7;10<sup>&#x2013;2</sup>). In contrast, the MDD PGS associations were attenuated and were no longer statistically significant after adjustment for MDD status: <italic>ICD</italic>-defined (OR 1.10, SE 0.069; <italic>P</italic>=.15), <italic>ICD</italic>-or-NLP (OR 1.04, SE 0.037; <italic>P</italic>=.480), and <italic>ICD</italic>-and-NLP (OR 1.14, SE 0.076; <italic>P</italic>=.08).</p><p>To further assess specificity, we examined associations between the height PGS and algorithm-defined OCD case-control status as a negative control analysis. As expected, the height PGS was not significantly associated with any algorithm-defined OCD phenotype, either before or after adjustment for MDD status (<italic>P</italic>&#x003E;.40 across all analyses).</p></sec><sec id="s3-3-2"><title>MGB</title><p>At MGB, 1379 OCD cases (<italic>ICD</italic>-or-NLP) and 52,474 controls were genotyped across 13 batches on 4 Illumina genotyping platforms. After quality control, duplicated or related samples, non-European samples, and samples and SNPs with low genotyping quality were removed. This left 658 cases and 23,314 controls with 593,590 SNPs in the MEG dataset, and 388 cases and 13,458 controls with 407,608 SNPs in the GSA dataset. After matching controls to cases at a 4:1 ratio based on sex, genotyping batch, age, and genetic proximity, imputation was performed separately for MEG (658 cases, 2632 controls) and GSA (388 cases, 1552 controls). A total of 5,866,159 SNPs passed postimputation quality control in both datasets.</p><p>PGSs were computed using GWAS summary statistics of OCD, MDD, and height. As shown in <xref ref-type="table" rid="table4">Table 4</xref>, logistic regression adjusting for population stratification showed significant associations between OCD PGS and algorithm-defined OCD status for <italic>ICD</italic>-defined (META: OR 1.30, SE 0.048; <italic>P</italic>=7.0&#x00D7;10<sup>&#x2013;8</sup>), <italic>ICD</italic>-or-NLP (META: OR 1.19, SE 0.035; <italic>P</italic>=5.71&#x00D7;10<sup>&#x2013;7</sup>), and <italic>ICD</italic>-and-NLP (META: OR 1.32, SE 0.073; <italic>P</italic>=1.53&#x00D7;10<sup>&#x2013;4</sup>). Conversely, no significant association was found for the NLP-only definition in the meta-analysis (OR 1.08, SE 0.052; <italic>P</italic>=.13), consistent with its lower PPV at MGB (<xref ref-type="table" rid="table1">Table 1</xref>).</p><table-wrap id="t4" position="float"><label>Table 4.</label><caption><p>Association between obsessive-compulsive disorder (OCD) polygenic scores (PGS) and predicted OCD status in MGB Biobank (MGBB).</p></caption><table id="table4" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom" colspan="2">Algorithmic definition and dataset</td><td align="left" valign="bottom">Number of cases, n</td><td align="left" valign="bottom">Number of controls, N</td><td align="left" valign="bottom">OR<sup><xref ref-type="table-fn" rid="table4fn1">a</xref></sup></td><td align="left" valign="bottom">BETA<sup><xref ref-type="table-fn" rid="table4fn2">b</xref></sup></td><td align="left" valign="bottom">SE</td><td align="left" valign="bottom"><italic>P</italic> value</td><td align="left" valign="bottom"><italic>R</italic><sup>2</sup>, %</td></tr></thead><tbody><tr><td align="left" valign="top" colspan="9"><italic>ICD</italic>-defined<sup><xref ref-type="table-fn" rid="table4fn3">c</xref></sup></td></tr><tr><td align="left" valign="top" colspan="2"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>GSA<sup><xref ref-type="table-fn" rid="table4fn4">d</xref></sup></td><td align="left" valign="top">185</td><td align="left" valign="top">740</td><td align="left" valign="top">1.47</td><td align="left" valign="top">0.383</td><td align="left" valign="top">0.086</td><td align="left" valign="top">8.86E-06</td><td align="left" valign="top">3.47</td></tr><tr><td align="left" valign="top" colspan="2"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>MEG<sup><xref ref-type="table-fn" rid="table4fn5">e</xref></sup></td><td align="left" valign="top">379</td><td align="left" valign="top">1516</td><td align="left" valign="top">1.23</td><td align="left" valign="top">0.204</td><td align="left" valign="top">0.058</td><td align="left" valign="top">4.54E-04</td><td align="left" valign="top">1.02</td></tr><tr><td align="left" valign="top" colspan="2"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>All</td><td align="left" valign="top">564</td><td align="left" valign="top">2256</td><td align="left" valign="top">1.30</td><td align="left" valign="top">0.260</td><td align="left" valign="top">0.048</td><td align="left" valign="top">7.0E-08</td><td align="left" valign="top">&#x2014;<sup><xref ref-type="table-fn" rid="table4fn6">f</xref></sup></td></tr><tr><td align="left" valign="top" colspan="9">NLP-only<sup><xref ref-type="table-fn" rid="table4fn7">g</xref></sup></td></tr><tr><td align="left" valign="top" colspan="2"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>GSA</td><td align="left" valign="top">203</td><td align="left" valign="top">812</td><td align="left" valign="top">1.18</td><td align="left" valign="top">0.166</td><td align="left" valign="top">0.080</td><td align="left" valign="top">3.86E-02</td><td align="left" valign="top">0.66</td></tr><tr><td align="left" valign="top" colspan="2"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>MEG</td><td align="left" valign="top">279</td><td align="left" valign="top">1116</td><td align="left" valign="top">1.02</td><td align="left" valign="top">0.015</td><td align="left" valign="top">0.068</td><td align="left" valign="top">.8199</td><td align="left" valign="top">0.01</td></tr><tr><td align="left" valign="top" colspan="2"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>All</td><td align="left" valign="top">482</td><td align="left" valign="top">1928</td><td align="left" valign="top">1.08</td><td align="left" valign="top">0.078</td><td align="left" valign="top">0.052</td><td align="left" valign="top">.1315</td><td align="left" valign="top">&#x2014;</td></tr><tr><td align="left" valign="top" colspan="9"><italic>ICD</italic>-or-NLP</td></tr><tr><td align="left" valign="top" colspan="2"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>GSA</td><td align="left" valign="top">389</td><td align="left" valign="top">1556</td><td align="left" valign="top">1.31</td><td align="left" valign="top">0.267</td><td align="left" valign="top">0.058</td><td align="left" valign="top">4.21E-06</td><td align="left" valign="top">1.74</td></tr><tr><td align="left" valign="top" colspan="2"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>MEG</td><td align="left" valign="top">661</td><td align="left" valign="top">2644</td><td align="left" valign="top">1.13</td><td align="left" valign="top">0.122</td><td align="left" valign="top">0.044</td><td align="left" valign="top">5.18E-03</td><td align="left" valign="top">0.37</td></tr><tr><td align="left" valign="top" colspan="2"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>All</td><td align="left" valign="top">1050</td><td align="left" valign="top">4200</td><td align="left" valign="top">1.19</td><td align="left" valign="top">0.174</td><td align="left" valign="top">0.035</td><td align="left" valign="top">5.71E-07</td><td align="left" valign="top">&#x2014;</td></tr><tr><td align="left" valign="top" colspan="9"><italic>ICD</italic>-and-NLP</td></tr><tr><td align="left" valign="top" colspan="2"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>GSA</td><td align="left" valign="top">85</td><td align="left" valign="top">340</td><td align="left" valign="top">1.42</td><td align="left" valign="top">0.351</td><td align="left" valign="top">0.128</td><td align="left" valign="top">6.10E-03</td><td align="left" valign="top">2.83</td></tr><tr><td align="left" valign="top" colspan="2"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>MEG</td><td align="left" valign="top">164</td><td align="left" valign="top">656</td><td align="left" valign="top">1.27</td><td align="left" valign="top">0.242</td><td align="left" valign="top">0.089</td><td align="left" valign="top">6.91E-02</td><td align="left" valign="top">1.37</td></tr><tr><td align="left" valign="top" colspan="2"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>All</td><td align="left" valign="top">249</td><td align="left" valign="top">996</td><td align="left" valign="top">1.32</td><td align="left" valign="top">0.278</td><td align="left" valign="top">0.073</td><td align="left" valign="top">1.53E-04</td><td align="left" valign="top">&#x2014;</td></tr></tbody></table><table-wrap-foot><fn id="table4fn1"><p><sup>a</sup>OR: odds ratio.</p></fn><fn id="table4fn2"><p><sup>b</sup>BETA: beta coefficient.</p></fn><fn id="table4fn3"><p><sup>c</sup><italic>ICD</italic>: International Statistical Classification of Disease</p></fn><fn id="table4fn4"><p><sup>d</sup>GSA: Global Screening Array.</p></fn><fn id="table4fn5"><p><sup>e</sup>MEG: Multi-Ethnic Global.</p></fn><fn id="table4fn6"><p><sup>f</sup>Not available.</p></fn><fn id="table4fn7"><p><sup>g</sup>NLP: natural language processing.</p></fn></table-wrap-foot></table-wrap><p>As shown in Table S8 in <xref ref-type="supplementary-material" rid="app2">Multimedia Appendix 2</xref>, associations between MDD PGS and OCD status were also observed across the meta-analyzed datasets. In the <italic>ICD</italic>-defined cohort, the MDD PGS showed a slightly smaller effect estimate than the OCD PGS (META: OR 1.21, SE 0.048; <italic>P</italic>=5.81&#x00D7;10<sup>&#x2013;5</sup>). In contrast, for NLP-only (META: OR 1.21, SE 0.052; <italic>P</italic>=1.93&#x00D7;10<sup>&#x2013;4</sup>), <italic>ICD</italic>-or-NLP (META: OR 1.21, SE 0.035; <italic>P</italic>=3.40&#x00D7;10<sup>&#x2013;8</sup>), and <italic>ICD</italic>-and-NLP (META: OR 1.35, SE 0.074; <italic>P</italic>=4.60&#x00D7;10<sup>&#x2013;5</sup>), the MDD PGS demonstrated larger effect estimates and smaller <italic>P</italic> values than the corresponding OCD PGS associations.</p><p>As in the VUMC analyses, we conducted sensitivity analyses including MDD status as an additional covariate. In these adjusted models, MDD PGS associations remained statistically significant but were attenuated across algorithmic definitions. For example, in the <italic>ICD</italic>-and-NLP meta-analysis, the MDD PGS OR decreased from 1.35 before MDD adjustment to 1.29 after adjustment (Table S8 in <xref ref-type="supplementary-material" rid="app2">Multimedia Appendix 2</xref>). In contrast, OCD PGS associations remained statistically significant and showed little attenuation after adjustment for MDD status: <italic>ICD</italic>-defined (META: OR 1.29, SE 0.049; <italic>P</italic>=2.45&#x00D7;10<sup>&#x2013;7</sup>), <italic>ICD</italic>-or-NLP (META: OR 1.17, SE 0.036; <italic>P</italic>=7.88&#x00D7;10<sup>&#x2013;6</sup>), and <italic>ICD</italic>-and-NLP (META: OR 1.33, SE 0.075; <italic>P</italic>=1.75&#x00D7;10<sup>&#x2013;4</sup>) definitions. Together with the VUMC results, these findings suggest that OCD PGS associations were more robust to adjustment for MDD status than MDD PGS associations, supporting the relative specificity of OCD-related genetic liability in the algorithm-defined OCD phenotypes.</p><p>Finally, consistent with the VUMC negative-control results, no significant associations were found between the height PGS and algorithm-defined OCD status across any phenotype definition, either before or after adjustment for MDD status (all meta-analysis <italic>P</italic>&#x003E;.20).</p></sec></sec></sec><sec id="s4" sec-type="discussion"><title>Discussion</title><sec id="s4-1"><title>Principal Findings</title><p>OCD is a common psychiatric condition, yet remission is achieved in only one-fifth of cases [<xref ref-type="bibr" rid="ref3">3</xref>]. The average interval between symptom onset and treatment initiation is 7 years [<xref ref-type="bibr" rid="ref33">33</xref>], and longer duration of untreated OCD is associated with poorer outcomes [<xref ref-type="bibr" rid="ref34">34</xref>]. Given this, identifying biological markers and genetic risk factors is crucial for facilitating earlier diagnosis and targeted interventions. Large-scale agnostic gene discovery studies of OCD are gaining traction, and recent work demonstrates that discovery yield increases as sample size grows [<xref ref-type="bibr" rid="ref14">14</xref>]. Previous OCD GWAS have relied on cases ascertained from various sources, including specialist clinics and advocacy organizations [<xref ref-type="bibr" rid="ref12">12</xref>,<xref ref-type="bibr" rid="ref13">13</xref>], or national disease registers from the Nordic countries [<xref ref-type="bibr" rid="ref15">15</xref>,<xref ref-type="bibr" rid="ref16">16</xref>]. The availability of large-scale, real-world EHR data has provided an opportunity to develop scalable and cost-efficient tools to identify patients with psychiatric disorders, such as OCD, for genetic studies. A prior study used NLP, supplemented by structured diagnostic fields, to ascertain obsessive-compulsive symptoms (OCS) and OCD in a UK mental health case register among patients with schizophrenia, schizoaffective disorder, or bipolar disorder, with the aim of estimating prevalence and examining clinical associations [<xref ref-type="bibr" rid="ref35">35</xref>]. However, their study was conducted at a single site within a specialty mental health setting and did not include any genetic analysis. In contrast, our study focused on identifying OCD cases from broader patient populations for genetic research, with validation across 2 US health care systems.</p><p>In this study, we developed and validated an EHR-based algorithm for identifying OCD that integrates diagnostic codes, medication records, and NLP-derived information from clinical notes. The algorithm achieved high PPV across multiple chart review rounds at 2 health care systems, VUMC and MGB, located in the southeastern and northeastern United States, respectively. We further evaluated whether algorithm-defined phenotypes captured known OCD genetic liability by testing associations with OCD PGS in individuals of European genetic ancestry from BioVU and MGBB. The significant associations observed provide early support that, within this ancestry-defined subset, the algorithm identifies cases with common variant liability overlapping that of traditionally ascertained OCD samples. As outlined below, 3 key findings from our analyses are particularly noteworthy.</p><p>First, chart reviews showed <italic>ICD</italic>-and-NLP achieved the highest PPVs (0.84 at VUMC; 0.91 at MGB), outperforming either arm alone (<italic>ICD</italic>-defined, NLP-only) and their union (<italic>ICD</italic>-or-NLP), particularly at MGB, where the PPVs for the <italic>ICD</italic>-defined and NLP-only definitions were only 0.64 and 0.51, respectively (<xref ref-type="table" rid="table1">Table 1</xref>). These findings suggest the structured diagnostic codes and NLP-derived evidence from clinical notes complement each other in enhancing the precision of OCD phenotype ascertainment. On the other hand, <italic>ICD</italic>-and-NLP identified fewer cases (515 at VUMC, 335 at MGB) for downstream genetic studies, whereas <italic>ICD</italic>-or-NLP captured more (1057 at VUMC, 1379 at MGB) but with substantially reduced PPVs (0.72 at VUMC, 0.58 at MGB). This underscores that the 2 arms are complementary only when used in conjunction since the union of their identified cases (disjunction) tends to accumulate false positives, resulting in poorer PPVs. Moreover, this pattern of findings highlights the tradeoff between achieving high precision (PPV) and maximizing the number of cases identified when selecting an algorithmic definition. Additionally, we observed PPVs achieved by using only <italic>ICD</italic> codes to select cases at the 2 US-based health care systems (PPV=0.73 and 0.64) were notably lower than those reported in the Nordic studies (0.91&#x2010;0.96 in Sweden [<xref ref-type="bibr" rid="ref15">15</xref>], 0.85&#x2010;0.96 in Denmark [<xref ref-type="bibr" rid="ref16">16</xref>]), suggesting less reliability of <italic>ICD</italic>-only ascertainment in the United States compared to Nordic registers.</p><p>Second, among individuals of European genetic ancestry, we observed significant associations between OCD PGS from GWAS and algorithm-defined OCD phenotypes, including <italic>ICD</italic>-defined (OR 1.22; <italic>P</italic>=1.51&#x00D7;10<sup>&#x2013;3</sup> at VUMC; OR 1.30; <italic>P</italic>=7.0&#x00D7;10<sup>&#x2013;8</sup> at MGB), <italic>ICD</italic>-or-NLP (OR 1.15; <italic>P</italic>=4.05&#x00D7;10<sup>&#x2013;3</sup> at VUMC; OR 1.19; <italic>P</italic>=5.71&#x00D7;10<sup>&#x2013;7</sup> at MGB), and <italic>ICD</italic>-and-NLP (OR 1.26; <italic>P</italic>=8.19&#x00D7;10<sup>&#x2013;4</sup> at VUMC; OR 1.32; <italic>P</italic>=1.53&#x00D7;10<sup>&#x2013;4</sup> at MGB). These findings provide early support that the proposed algorithm identifies phenotypes that capture common variant liability overlapping with traditionally ascertained OCD samples, supporting their potential integration with traditional cohorts to enhance the statistical power of genetic discovery. By contrast, when used in isolation, the NLP arm yielded smaller effect estimates and weaker OCD PGS associations, underscoring limitations in relying solely on rule-based NLP for ascertaining OCD cases from clinical narratives.</p><p>The MDD PGS was also associated with algorithm-defined OCD status, consistent with the high clinical comorbidity and shared genetic liability between OCD and depression. However, sensitivity analyses adjusting for MDD status showed that OCD PGS associations were more robust to this adjustment than MDD PGS associations, supporting the relative specificity of OCD-related genetic liability in the algorithm-defined OCD phenotypes. In addition, height PGS, included as a negative-control trait, was not associated with algorithm-defined OCD status at either site. These findings support the genetic plausibility and relative specificity of the algorithm-defined OCD phenotypes, while also underscoring that PGS enrichment alone should not be interpreted as definitive evidence of diagnostic specificity.</p><p>Comparing OCD PGS effect estimates across definitions, <italic>ICD</italic>-defined showed significant associations, indicating that diagnostic codes alone capture substantial common-variant liability. However, <italic>ICD</italic>-only ascertainment has lower PPV in our US EHR systems than in Nordic registers and does not capture OCD-related evidence documented only in clinical narratives. The comparison between <italic>ICD</italic>-and-NLP and <italic>ICD</italic>-or-NLP is therefore more informative for evaluating the precision-yield tradeoff. Although the stricter <italic>ICD</italic>-and-NLP definition yielded numerically higher ORs than the broader <italic>ICD</italic>-or-NLP definition at both sites, consistent with its higher PPV, confidence intervals overlapped substantially. The choice of definition should therefore be guided by the downstream application: for large-scale genetic discovery studies, where statistical power depends heavily on sample size, the broader <italic>ICD</italic>-or-NLP definition may be preferable despite modestly lower genetic enrichment; for studies prioritizing phenotypic precision, such as treatment outcome research, the stricter <italic>ICD</italic>-and-NLP definition may be more appropriate.</p><p>Finally, replication across 2 health care systems provides several recommendations for investigators seeking to apply a similar approach in other EHR systems: (1) because variability in local documentation practices and clinical workflows can affect data completeness and algorithm transferability, implementation at a new site should begin with mapping of local structured and unstructured (clinical notes) data, documentation workflows, and relevant clinical infrastructure. For example, the presence of an OCD-specialty clinic may influence how OCD-related evidence is represented in the EHR. Among patients evaluated in these settings, OCD may be more frequently documented in both structured diagnostic fields and narrative notes; at the same time, these same workflows may also generate <italic>ICD</italic> codes related to referrals or text mentions related to screening questionnaires, intake templates, or differential diagnosis. Such mentions may provide useful evidence for OCD phenotyping in some contexts but may also introduce noise for either <italic>ICD</italic>-only or NLP-only algorithms developed in other health care systems; (2) site-specific validation, including local chart reviewing, is recommended before deployment to estimate algorithm performance and identify common sources of false positives. Standardized chart review protocols and reviewer training materials (<xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>) can help improve reproducibility across sites, while still allowing reviewers to account for local documentation practices; (3) the NLP component of the algorithm should be reviewed and refined against local samples before deployment, particularly for institution-specific abbreviations and acronym collisions, negation patterns, questionnaire and template formatting, and copy-forward text; and (4) when genetic data are available, PGS analyses for OCD and unrelated negative-control traits, such as height, can complement chart review by providing additional evidence that the EHR-derived phenotype captures psychiatric genetic liability overlapping with traditionally ascertained OCD samples. Together, these recommendations support an approach in which the algorithm&#x2019;s overall architecture and the validation framework can be implemented across sites, while specific components, particularly the NLP rules and the chart review calibration, should be adapted to each health care system&#x2019;s EHR structure, documentation practices, and clinical context.</p></sec><sec id="s4-2"><title>Limitations and Future Directions</title><p>Several limitations should be noted: (1) cross-site validation was complicated by variations in data availability and completeness. Diagnostic codes and corresponding clinical notes are not always accessible at the same time, in part because notes may be sequestered or otherwise unavailable, whereas codes remain accessible. This issue is particularly pronounced for psychiatric notes, which have historically had restricted access due to privacy safeguards. Although the &#x2018;Open Notes&#x2019; mandate under the 21st Century Cures Act has improved access, adoption remains inconsistent across institutions. Moreover, since patients often receive care across multiple systems, only partial clinical documentation or diagnostic codes may appear within any single site&#x2019;s EHR, further complicating algorithm replication; (2) rule-based NLP models, including ours, often fail to fully grasp clinical context and struggle with semantic ambiguity due to their reliance on rigid rules. Our analysis at MGB demonstrated this limitation through examples: the NLP arm of the algorithm misclassified cases due to missed negations (eg, &#x201C;no&#x201D; responses in poorly formatted questionnaires), copy-pasted text, and abbreviation misinterpretation (eg, &#x201C;OCD&#x201D; for osteochondritis dissecans); (3) PGS analyses were restricted to individuals of European genetic ancestry due to the limited availability of GWAS summary statistics for non-European populations. As a result, our PGS findings should be interpreted as supporting the genetic plausibility of the phenotype within the European-ancestry population, and not as evidence of equivalent genetic validity across other ancestral backgrounds. This limitation is not unique to this study but reflects a broader challenge in psychiatric genetics, where the underrepresentation of non-European populations in GWAS limits the cross-ancestry portability of PGS-based validation; (4) although PGS enrichment in algorithm-identified cases demonstrates elevated common variant liability for OCD, it does not establish diagnostic specificity, given genetic correlations and clinical comorbidity across psychiatric disorders. Our sensitivity analyses partially address this concern by showing that OCD PGS associations were more robust to MDD adjustment than MDD PGS associations, and that an unrelated PGS was not associated with OCD status. Nevertheless, residual confounding by psychiatric comorbidity or other clinical factors cannot be ruled out. Furthermore, although we excluded BioVU samples from the GWAS summary statistics used at VUMC and 23andMe samples at both sites, both the GWAS and our algorithm ultimately rely on clinical diagnostic conventions, and the observed PGS associations may partly reflect shared ascertainment processes rather than fully independent biological validation.</p><p>This work within the PsycheMERGE network currently focuses on developing a standardized review protocol by training chart reviewers across multiple health care institutions using simulated psychiatric patient records. This standardization and calibration aim to directly address the reduced generalizability of phenotyping algorithms due to inconsistencies in chart review strategies. Recent advances in large language models (LLMs) offer new opportunities for scalable phenotyping without substantial annotated data. Future work will explore using LLMs to identify OCD-related information in clinical notes, supported by recent findings demonstrating superior diagnostic accuracy of LLMs compared to mental health professionals in identifying OCD cases from clinical vignettes [<xref ref-type="bibr" rid="ref36">36</xref>]. Furthermore, we will diversify the genetic ancestry representation in our OCD validation analyses by using resources such as the All of Us Research Program [<xref ref-type="bibr" rid="ref37">37</xref>]. This will support the development of more inclusive and equitable models of OCD genetic risk, addressing the limitations of current European-centric studies.</p></sec><sec id="s4-3"><title>Conclusions</title><p>We developed and validated an EHR-based phenotyping algorithm for OCD integrating diagnostic codes, medication records, and unstructured clinical notes across 2 health care systems (VUMC and MGB). Combining the <italic>ICD</italic> and NLP arms of this algorithm identified OCD cases with high precision, and among individuals of European genetic ancestry, the identified cases showed significant associations with GWAS-derived OCD PGS at both sites. Sensitivity analyses adjusting for MDD status and negative-control analyses using height PGS further supported the genetic plausibility and relative specificity of the phenotype. This scalable, cost-efficient approach can facilitate large-scale genetic studies and advance understanding of OCD&#x2019;s complex etiology.</p></sec></sec></body><back><ack><p>We would like to acknowledge Dr Jonathan Becker and Helen Hatfield, MSN, for serving as clinical chart reviewers for this study.</p></ack><notes><sec><title>Funding</title><p>LKD and DH were supported by R01MH137220 and R01MH118233 awarded from the National Institute of Mental Health. BW is supported in part by funding from the Brain and Behavior Research Foundation Young Investigator Award and NIMH grant P50MH129699. The Synthetic Derivative and BioVU projects at VUMC are supported by numerous sources: including the NIH funded Shared Instrumentation Grant S10OD017985 and S10RR025141; CTSA grants UL1TR002243, UL1TR000445, and UL1RR024975 from the National Center for Advancing Translational Sciences. Its contents are solely the responsibility of the authors and do not necessarily represent official views of the National Center for Advancing Translational Sciences or the National Institutes of Health. Genomic data are also supported by investigator-led projects that include U01HG004798, R01NS032830, RC2GM092618, P50GM115305, U01HG006378, U19HL065962, R01HD074711; and additional funding sources listed on the VICTR website [<xref ref-type="bibr" rid="ref38">38</xref>].</p></sec><sec><title>Data Availability</title><p>Protected Health Information restrictions apply to the availability of the clinical data here, which were used under IRB approval for use only in the current study. As a result, this dataset is not publicly available.</p></sec></notes><fn-group><fn fn-type="con"><p>Conceptualization: LKD</p><p>Data curation: LKD, BW, TWM-F., and DY</p><p>Formal analysis: BW, TWM-F., and DY</p><p>Funding acquisition: LKD, JWS</p><p>Investigation: LKD, BW, TWM-F, and DY</p><p>Methodology: LKD, BW</p><p>Project administration: DH, DK, AD</p><p>Resources: LKD, JWS</p><p>Supervision: LKD, JWS</p><p>Validation: EM, PLM, EJG, RGF, SBW, RK, JLR, JB, and JWS</p><p>Visualization: BW, DY</p><p>Writing &#x2013; original draft: BW, TS, JJC, TWM-F, and DY</p><p>Writing &#x2013; review &#x0026; editing: All authors.</p></fn><fn fn-type="conflict"><p>JWS reported grants from Biogen, Inc and serving as a scientific advisory board member with options from Sensorium Therapeutics, Inc outside the submitted work. BW reported receiving grants from the Brain and Behavior Research Foundation during the conduct of the study. No other disclosures were reported.</p></fn></fn-group><glossary><title>Abbreviations</title><def-list><def-item><term id="abb1">BDD</term><def><p>body dysmorphic disorder</p></def></def-item><def-item><term id="abb2">BioVU</term><def><p>Vanderbilt University Medical Center&#x2019;s biobank</p></def></def-item><def-item><term id="abb3">CBT</term><def><p>cognitive behavioral therapy</p></def></def-item><def-item><term id="abb4">CEU</term><def><p>Utah residents with Northern and Western European ancestry</p></def></def-item><def-item><term id="abb5">CPT</term><def><p>current procedural terminology</p></def></def-item><def-item><term id="abb6"><italic>DSM-5</italic></term><def><p><italic>Diagnostic and Statistical Manual of Mental Disorders, Fifth Edition</italic></p></def></def-item><def-item><term id="abb7">EHR</term><def><p>electronic health record</p></def></def-item><def-item><term id="abb8">GSA</term><def><p>Global Screening Array</p></def></def-item><def-item><term id="abb9">GWAS</term><def><p>genome-wide association studies</p></def></def-item><def-item><term id="abb10"><italic>ICD</italic></term><def><p><italic>International Statistical Classification of Diseases</italic></p></def></def-item><def-item><term id="abb11"><italic>ICD-10</italic></term><def><p><italic>International Statistical Classification of Diseases, 10th Revision</italic></p></def></def-item><def-item><term id="abb12"><italic>ICD-9</italic></term><def><p><italic>International Classification of Diseases, 9th Revision</italic></p></def></def-item><def-item><term id="abb13">IRR</term><def><p>interrater reliability</p></def></def-item><def-item><term id="abb14">LLM</term><def><p>large language models</p></def></def-item><def-item><term id="abb15">LOINC</term><def><p>Logical Observation Identifiers Names and Codes</p></def></def-item><def-item><term id="abb16">MDD</term><def><p>major depressive disorder</p></def></def-item><def-item><term id="abb17">MEG</term><def><p>Multi-Ethnic Global</p></def></def-item><def-item><term id="abb18">MEGA</term><def><p>Multi-Ethnic Genotyping Array</p></def></def-item><def-item><term id="abb19">MEGAEX</term><def><p>Expanded Multi-Ethnic Genotyping Array</p></def></def-item><def-item><term id="abb20">MGB</term><def><p>Mass General Brigham</p></def></def-item><def-item><term id="abb21">MGBB</term><def><p>The Mass General Brigham Biobank</p></def></def-item><def-item><term id="abb22">NLP</term><def><p>natural language processing</p></def></def-item><def-item><term id="abb23">OC</term><def><p>obsessive-compulsive</p></def></def-item><def-item><term id="abb24">OCD</term><def><p>obsessive-compulsive disorder</p></def></def-item><def-item><term id="abb25">OCS</term><def><p>obsessive-compulsive symptoms</p></def></def-item><def-item><term id="abb26">OR</term><def><p>odds ratio</p></def></def-item><def-item><term id="abb27">PGC</term><def><p>Psychiatric Genomics Consortium</p></def></def-item><def-item><term id="abb28">PGS</term><def><p>polygenic scores</p></def></def-item><def-item><term id="abb29">PPV</term><def><p>positive predictive values</p></def></def-item><def-item><term id="abb30">PRS-CS</term><def><p>polygenic risk scores via Bayesian regression with continuous shrinkage priors</p></def></def-item><def-item><term id="abb31">PsycheMERGE</term><def><p>Psychiatric electronic Medical Record and Genomics Network</p></def></def-item><def-item><term id="abb32">SNP</term><def><p>single-nucleotide polymorphism</p></def></def-item><def-item><term id="abb33">VUMC</term><def><p>Vanderbilt University Medical Center</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>Ruscio</surname><given-names>AM</given-names> </name><name name-style="western"><surname>Stein</surname><given-names>DJ</given-names> </name><name name-style="western"><surname>Chiu</surname><given-names>WT</given-names> </name><name name-style="western"><surname>Kessler</surname><given-names>RC</given-names> </name></person-group><article-title>The epidemiology of obsessive-compulsive disorder in the National Comorbidity Survey Replication</article-title><source>Mol Psychiatry</source><year>2010</year><month>01</month><volume>15</volume><issue>1</issue><fpage>53</fpage><lpage>63</lpage><pub-id pub-id-type="doi">10.1038/mp.2008.94</pub-id><pub-id pub-id-type="medline">18725912</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>Lopez</surname><given-names>AD</given-names> </name><name name-style="western"><surname>Murray</surname><given-names>CC</given-names> </name></person-group><article-title>The global burden of disease, 1990-2020</article-title><source>Nat Med</source><year>1998</year><month>11</month><volume>4</volume><issue>11</issue><fpage>1241</fpage><lpage>1243</lpage><pub-id pub-id-type="doi">10.1038/3218</pub-id><pub-id pub-id-type="medline">9809543</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>Law</surname><given-names>C</given-names> </name><name name-style="western"><surname>Kamarsu</surname><given-names>S</given-names> </name><name name-style="western"><surname>Obisie-Orlu</surname><given-names>IC</given-names> </name><etal/></person-group><article-title>Personality traits as predictors of OCD remission: a longitudinal study</article-title><source>J Affect Disord</source><year>2023</year><month>01</month><day>1</day><volume>320</volume><fpage>196</fpage><lpage>200</lpage><pub-id pub-id-type="doi">10.1016/j.jad.2022.09.121</pub-id><pub-id pub-id-type="medline">36183822</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>Geiger</surname><given-names>Y</given-names> </name><name name-style="western"><surname>van Oppen</surname><given-names>P</given-names> </name><name name-style="western"><surname>Visser</surname><given-names>H</given-names> </name><name name-style="western"><surname>Eikelenboom</surname><given-names>M</given-names> </name><name name-style="western"><surname>van den Heuvel</surname><given-names>OA</given-names> </name><name name-style="western"><surname>Anholt</surname><given-names>GE</given-names> </name></person-group><article-title>Long-term remission rates and trajectory predictors in obsessive-compulsive disorder: findings from a six-year naturalistic longitudinal cohort study</article-title><source>J Affect Disord</source><year>2024</year><month>04</month><day>1</day><volume>350</volume><fpage>877</fpage><lpage>886</lpage><pub-id pub-id-type="doi">10.1016/j.jad.2024.01.155</pub-id><pub-id pub-id-type="medline">38266929</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>Eisen</surname><given-names>JL</given-names> </name><name name-style="western"><surname>Sibrava</surname><given-names>NJ</given-names> </name><name name-style="western"><surname>Boisseau</surname><given-names>CL</given-names> </name><etal/></person-group><article-title>Five-year course of obsessive-compulsive disorder: predictors of remission and relapse</article-title><source>J Clin Psychiatry</source><year>2013</year><month>03</month><volume>74</volume><issue>3</issue><fpage>233</fpage><lpage>239</lpage><pub-id pub-id-type="doi">10.4088/JCP.12m07657</pub-id><pub-id pub-id-type="medline">23561228</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>INOUYE</surname><given-names>E</given-names> </name></person-group><article-title>Similar and dissimilar manifestations of obsessive-compulsive neurosis in monozygotic twins</article-title><source>Am J Psychiatry</source><year>1965</year><month>06</month><volume>121</volume><fpage>1171</fpage><lpage>1175</lpage><pub-id pub-id-type="doi">10.1176/ajp.121.12.1171</pub-id><pub-id pub-id-type="medline">14286051</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>Clifford</surname><given-names>CA</given-names> </name><name name-style="western"><surname>Murray</surname><given-names>RM</given-names> </name><name name-style="western"><surname>Fulker</surname><given-names>DW</given-names> </name></person-group><article-title>Genetic and environmental influences on obsessional traits and symptoms</article-title><source>Psychol Med</source><year>1984</year><month>11</month><volume>14</volume><issue>4</issue><fpage>791</fpage><lpage>800</lpage><pub-id pub-id-type="doi">10.1017/s0033291700019760</pub-id><pub-id pub-id-type="medline">6545413</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>Jonnal</surname><given-names>AH</given-names> </name><name name-style="western"><surname>Gardner</surname><given-names>CO</given-names> </name><name name-style="western"><surname>Prescott</surname><given-names>CA</given-names> </name><name name-style="western"><surname>Kendler</surname><given-names>KS</given-names> </name></person-group><article-title>Obsessive and compulsive symptoms in a general population sample of female twins</article-title><source>Am J Med Genet</source><year>2000</year><month>12</month><day>4</day><volume>96</volume><issue>6</issue><fpage>791</fpage><lpage>796</lpage><pub-id pub-id-type="doi">10.1002/1096-8628(20001204)96:6&#x003C;791::aid-ajmg19&#x003E;3.0.co;2-c</pub-id><pub-id pub-id-type="medline">11121183</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>Mataix-Cols</surname><given-names>D</given-names> </name><name name-style="western"><surname>Boman</surname><given-names>M</given-names> </name><name name-style="western"><surname>Monzani</surname><given-names>B</given-names> </name><etal/></person-group><article-title>Population-based, multigenerational family clustering study of obsessive-compulsive disorder</article-title><source>JAMA Psychiatry</source><year>2013</year><month>07</month><volume>70</volume><issue>7</issue><fpage>709</fpage><lpage>717</lpage><pub-id pub-id-type="doi">10.1001/jamapsychiatry.2013.3</pub-id><pub-id pub-id-type="medline">23699935</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>Mataix-Cols</surname><given-names>D</given-names> </name><name name-style="western"><surname>Fern&#x00E1;ndez de la Cruz</surname><given-names>L</given-names> </name><name name-style="western"><surname>Beucke</surname><given-names>JC</given-names> </name><etal/></person-group><article-title>Heritability of clinically diagnosed obsessive-compulsive disorder among twins</article-title><source>JAMA Psychiatry</source><year>2024</year><month>06</month><day>1</day><volume>81</volume><issue>6</issue><fpage>631</fpage><lpage>632</lpage><pub-id pub-id-type="doi">10.1001/jamapsychiatry.2024.0299</pub-id><pub-id pub-id-type="medline">38568562</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>Davis</surname><given-names>LK</given-names> </name><name name-style="western"><surname>Yu</surname><given-names>D</given-names> </name><name name-style="western"><surname>Keenan</surname><given-names>CL</given-names> </name><etal/></person-group><article-title>Partitioning the heritability of Tourette syndrome and obsessive compulsive disorder reveals differences in genetic architecture</article-title><source>PLoS Genet</source><year>2013</year><month>10</month><volume>9</volume><issue>10</issue><fpage>e1003864</fpage><pub-id pub-id-type="doi">10.1371/journal.pgen.1003864</pub-id><pub-id pub-id-type="medline">24204291</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>Stewart</surname><given-names>SE</given-names> </name><name name-style="western"><surname>Yu</surname><given-names>D</given-names> </name><name name-style="western"><surname>Scharf</surname><given-names>JM</given-names> </name><etal/></person-group><article-title>Genome-wide association study of obsessive-compulsive disorder</article-title><source>Mol Psychiatry</source><year>2013</year><month>07</month><volume>18</volume><issue>7</issue><fpage>788</fpage><lpage>798</lpage><pub-id pub-id-type="doi">10.1038/mp.2012.85</pub-id><pub-id pub-id-type="medline">22889921</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>Mattheisen</surname><given-names>M</given-names> </name><name name-style="western"><surname>Samuels</surname><given-names>JF</given-names> </name><name name-style="western"><surname>Wang</surname><given-names>Y</given-names> </name><etal/></person-group><article-title>Genome-wide association study in obsessive-compulsive disorder: results from the OCGAS</article-title><source>Mol Psychiatry</source><year>2015</year><month>03</month><volume>20</volume><issue>3</issue><fpage>337</fpage><lpage>344</lpage><pub-id pub-id-type="doi">10.1038/mp.2014.43</pub-id><pub-id pub-id-type="medline">24821223</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>Strom</surname><given-names>NI</given-names> </name><name name-style="western"><surname>Gerring</surname><given-names>ZF</given-names> </name><name name-style="western"><surname>Galimberti</surname><given-names>M</given-names> </name><etal/></person-group><article-title>Genome-wide analyses identify 30 loci associated with obsessive-compulsive disorder</article-title><source>Nat Genet</source><year>2025</year><month>06</month><volume>57</volume><issue>6</issue><fpage>1389</fpage><lpage>1401</lpage><pub-id pub-id-type="doi">10.1038/s41588-025-02189-z</pub-id><pub-id pub-id-type="medline">40360802</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>R&#x00FC;ck</surname><given-names>C</given-names> </name><name name-style="western"><surname>Larsson</surname><given-names>KJ</given-names> </name><name name-style="western"><surname>Lind</surname><given-names>K</given-names> </name><etal/></person-group><article-title>Validity and reliability of chronic tic disorder and obsessive-compulsive disorder diagnoses in the Swedish National Patient Register</article-title><source>BMJ Open</source><year>2015</year><month>06</month><day>22</day><volume>5</volume><issue>6</issue><fpage>e007520</fpage><pub-id pub-id-type="doi">10.1136/bmjopen-2014-007520</pub-id><pub-id pub-id-type="medline">26100027</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>Nissen</surname><given-names>J</given-names> </name><name name-style="western"><surname>Powell</surname><given-names>S</given-names> </name><name name-style="western"><surname>Koch</surname><given-names>SV</given-names> </name><etal/></person-group><article-title>Diagnostic validity of early-onset obsessive-compulsive disorder in the Danish Psychiatric Central Register: findings from a cohort sample</article-title><source>BMJ Open</source><year>2017</year><month>09</month><day>18</day><volume>7</volume><issue>9</issue><fpage>e017172</fpage><pub-id pub-id-type="doi">10.1136/bmjopen-2017-017172</pub-id><pub-id pub-id-type="medline">28928194</pub-id></nlm-citation></ref><ref id="ref17"><label>17</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Castro</surname><given-names>VM</given-names> </name><name name-style="western"><surname>Minnier</surname><given-names>J</given-names> </name><name name-style="western"><surname>Murphy</surname><given-names>SN</given-names> </name><etal/></person-group><article-title>Validation of electronic health record phenotyping of bipolar disorder cases and controls</article-title><source>Am J Psychiatry</source><year>2015</year><month>04</month><volume>172</volume><issue>4</issue><fpage>363</fpage><lpage>372</lpage><pub-id pub-id-type="doi">10.1176/appi.ajp.2014.14030423</pub-id><pub-id pub-id-type="medline">25827034</pub-id></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>Perlis</surname><given-names>RH</given-names> </name><name name-style="western"><surname>Iosifescu</surname><given-names>DV</given-names> </name><name name-style="western"><surname>Castro</surname><given-names>VM</given-names> </name><etal/></person-group><article-title>Using electronic medical records to enable large-scale studies in psychiatry: treatment resistant depression as a model</article-title><source>Psychol Med</source><year>2012</year><month>01</month><volume>42</volume><issue>1</issue><fpage>41</fpage><lpage>50</lpage><pub-id pub-id-type="doi">10.1017/S0033291711000997</pub-id><pub-id pub-id-type="medline">21682950</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>Bellows</surname><given-names>BK</given-names> </name><name name-style="western"><surname>LaFleur</surname><given-names>J</given-names> </name><name name-style="western"><surname>Kamauu</surname><given-names>AWC</given-names> </name><etal/></person-group><article-title>Automated identification of patients with a diagnosis of binge eating disorder from narrative electronic health records</article-title><source>J Am Med Inform Assoc</source><year>2014</year><month>02</month><volume>21</volume><issue>e1</issue><fpage>e163</fpage><lpage>8</lpage><pub-id pub-id-type="doi">10.1136/amiajnl-2013-001859</pub-id><pub-id pub-id-type="medline">24201026</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>Bush</surname><given-names>RA</given-names> </name><name name-style="western"><surname>Connelly</surname><given-names>CD</given-names> </name><name name-style="western"><surname>P&#x00E9;rez</surname><given-names>A</given-names> </name><name name-style="western"><surname>Barlow</surname><given-names>H</given-names> </name><name name-style="western"><surname>Chiang</surname><given-names>GJ</given-names> </name></person-group><article-title>Extracting autism spectrum disorder data from the electronic health record</article-title><source>Appl Clin Inform</source><year>2017</year><month>07</month><day>19</day><volume>8</volume><issue>3</issue><fpage>731</fpage><lpage>741</lpage><pub-id pub-id-type="doi">10.4338/ACI-2017-02-RA-0029</pub-id><pub-id pub-id-type="medline">28925416</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>Malow</surname><given-names>BA</given-names> </name><name name-style="western"><surname>Veatch</surname><given-names>OJ</given-names> </name><name name-style="western"><surname>Niu</surname><given-names>X</given-names> </name><etal/></person-group><article-title>A practical approach to identifying autistic adults within the electronic health record</article-title><source>Autism Res</source><year>2023</year><month>01</month><volume>16</volume><issue>1</issue><fpage>52</fpage><lpage>65</lpage><pub-id pub-id-type="doi">10.1002/aur.2849</pub-id><pub-id pub-id-type="medline">36377765</pub-id></nlm-citation></ref><ref id="ref22"><label>22</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><collab>OCD Collaborative Genetics Association Studies (OCGAS)</collab><collab>International Obsessive Compulsive Disorder Foundation Genetics Collaborative (IOCDF-GC)</collab></person-group><article-title>Revealing the complex genetic architecture of obsessive&#x2013;compulsive disorder using meta-analysis</article-title><source>Mol Psychiatry</source><year>2018</year><month>05</month><volume>23</volume><issue>5</issue><fpage>1181</fpage><lpage>1188</lpage><pub-id pub-id-type="doi">10.1038/mp.2017.154</pub-id></nlm-citation></ref><ref id="ref23"><label>23</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Karlson</surname><given-names>EW</given-names> </name><name name-style="western"><surname>Boutin</surname><given-names>NT</given-names> </name><name name-style="western"><surname>Hoffnagle</surname><given-names>AG</given-names> </name><name name-style="western"><surname>Allen</surname><given-names>NL</given-names> </name></person-group><article-title>Building the partners healthcare biobank at partners personalized medicine: informed consent, return of research results, recruitment lessons and operational considerations</article-title><source>J Pers Med</source><year>2016</year><month>01</month><day>14</day><volume>6</volume><issue>1</issue><fpage>2</fpage><pub-id pub-id-type="doi">10.3390/jpm6010002</pub-id><pub-id pub-id-type="medline">26784234</pub-id></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>Frydman</surname><given-names>I</given-names> </name><name name-style="western"><surname>Ferreira-Garcia</surname><given-names>R</given-names> </name><name name-style="western"><surname>Borges</surname><given-names>MC</given-names> </name><name name-style="western"><surname>Velakoulis</surname><given-names>D</given-names> </name><name name-style="western"><surname>Walterfang</surname><given-names>M</given-names> </name><name name-style="western"><surname>Fontenelle</surname><given-names>LF</given-names> </name></person-group><article-title>Dementia developing in late-onset and treatment-refractory obsessive-compulsive disorder</article-title><source>Cogn Behav Neurol</source><year>2010</year><month>09</month><volume>23</volume><issue>3</issue><fpage>205</fpage><lpage>208</lpage><pub-id pub-id-type="doi">10.1097/WNN.0b013e3181e61ce0</pub-id><pub-id pub-id-type="medline">20829671</pub-id></nlm-citation></ref><ref id="ref25"><label>25</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Frileux</surname><given-names>S</given-names> </name><name name-style="western"><surname>Millet</surname><given-names>B</given-names> </name><name name-style="western"><surname>Fossati</surname><given-names>P</given-names> </name></person-group><article-title>Late-onset OCD as a potential harbinger of dementia with Lewy bodies: a report of two cases</article-title><source>Front Psychiatry</source><year>2020</year><volume>11</volume><fpage>554</fpage><pub-id pub-id-type="doi">10.3389/fpsyt.2020.00554</pub-id><pub-id pub-id-type="medline">32714212</pub-id></nlm-citation></ref><ref id="ref26"><label>26</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Jiang</surname><given-names>M</given-names> </name><name name-style="western"><surname>Wu</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Shah</surname><given-names>A</given-names> </name><name name-style="western"><surname>Priyanka</surname><given-names>P</given-names> </name><name name-style="western"><surname>Denny</surname><given-names>JC</given-names> </name><name name-style="western"><surname>Xu</surname><given-names>H</given-names> </name></person-group><article-title>Extracting and standardizing medication information in clinical text - the MedEx-UIMA system</article-title><source>AMIA Jt Summits Transl Sci Proc</source><year>2014</year><volume>2014</volume><fpage>37</fpage><lpage>42</lpage><pub-id pub-id-type="medline">25954575</pub-id></nlm-citation></ref><ref id="ref27"><label>27</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Yengo</surname><given-names>L</given-names> </name><name name-style="western"><surname>Sidorenko</surname><given-names>J</given-names> </name><name name-style="western"><surname>Kemper</surname><given-names>KE</given-names> </name><etal/></person-group><article-title>Meta-analysis of genome-wide association studies for height and body mass index in &#x223C;700000 individuals of European ancestry</article-title><source>Hum Mol Genet</source><year>2018</year><month>10</month><day>15</day><volume>27</volume><issue>20</issue><fpage>3641</fpage><lpage>3649</lpage><pub-id pub-id-type="doi">10.1093/hmg/ddy271</pub-id><pub-id pub-id-type="medline">30124842</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>Howard</surname><given-names>DM</given-names> </name><name name-style="western"><surname>Adams</surname><given-names>MJ</given-names> </name><name name-style="western"><surname>Clarke</surname><given-names>TK</given-names> </name><etal/></person-group><article-title>Genome-wide meta-analysis of depression identifies 102 independent variants and highlights the importance of the prefrontal brain regions</article-title><source>Nat Neurosci</source><year>2019</year><month>03</month><volume>22</volume><issue>3</issue><fpage>343</fpage><lpage>352</lpage><pub-id pub-id-type="doi">10.1038/s41593-018-0326-7</pub-id><pub-id pub-id-type="medline">30718901</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>Ge</surname><given-names>T</given-names> </name><name name-style="western"><surname>Chen</surname><given-names>CY</given-names> </name><name name-style="western"><surname>Ni</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Feng</surname><given-names>YCA</given-names> </name><name name-style="western"><surname>Smoller</surname><given-names>JW</given-names> </name></person-group><article-title>Polygenic prediction via Bayesian regression and continuous shrinkage priors</article-title><source>Nat Commun</source><year>2019</year><month>04</month><day>16</day><volume>10</volume><issue>1</issue><fpage>1776</fpage><pub-id pub-id-type="doi">10.1038/s41467-019-09718-5</pub-id><pub-id pub-id-type="medline">30992449</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>Newton</surname><given-names>KM</given-names> </name><name name-style="western"><surname>Peissig</surname><given-names>PL</given-names> </name><name name-style="western"><surname>Kho</surname><given-names>AN</given-names> </name><etal/></person-group><article-title>Validation of electronic medical record-based phenotyping algorithms: results and lessons learned from the eMERGE network</article-title><source>J Am Med Inform Assoc</source><year>2013</year><month>06</month><volume>20</volume><issue>e1</issue><fpage>e147</fpage><lpage>54</lpage><pub-id pub-id-type="doi">10.1136/amiajnl-2012-000896</pub-id><pub-id pub-id-type="medline">23531748</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>Kirby</surname><given-names>JC</given-names> </name><name name-style="western"><surname>Speltz</surname><given-names>P</given-names> </name><name name-style="western"><surname>Rasmussen</surname><given-names>LV</given-names> </name><etal/></person-group><article-title>PheKB: a catalog and workflow for creating electronic phenotype algorithms for transportability</article-title><source>J Am Med Inform Assoc</source><year>2016</year><month>11</month><volume>23</volume><issue>6</issue><fpage>1046</fpage><lpage>1052</lpage><pub-id pub-id-type="doi">10.1093/jamia/ocv202</pub-id><pub-id pub-id-type="medline">27026615</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>McHugh</surname><given-names>ML</given-names> </name></person-group><article-title>Interrater reliability: the kappa statistic</article-title><source>Biochem Med (Zagreb)</source><year>2012</year><volume>22</volume><issue>3</issue><fpage>276</fpage><lpage>282</lpage><pub-id pub-id-type="medline">23092060</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>Hezel</surname><given-names>DM</given-names> </name><name name-style="western"><surname>Rose</surname><given-names>SV</given-names> </name><name name-style="western"><surname>Simpson</surname><given-names>HB</given-names> </name></person-group><article-title>Delay to diagnosis in OCD</article-title><source>J Obsessive Compuls Relat Disord</source><year>2022</year><month>01</month><volume>32</volume><fpage>100709</fpage><pub-id pub-id-type="doi">10.1016/j.jocrd.2022.100709</pub-id></nlm-citation></ref><ref id="ref34"><label>34</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Perris</surname><given-names>F</given-names> </name><name name-style="western"><surname>Cipolla</surname><given-names>S</given-names> </name><name name-style="western"><surname>Catapano</surname><given-names>P</given-names> </name><etal/></person-group><article-title>Duration of untreated illness in patients with obsessive-compulsive disorder and its impact on long-term outcome: a systematic review</article-title><source>J Pers Med</source><year>2023</year><month>09</month><day>29</day><volume>13</volume><issue>10</issue><fpage>37888064</fpage><pub-id pub-id-type="doi">10.3390/jpm13101453</pub-id><pub-id pub-id-type="medline">37888064</pub-id></nlm-citation></ref><ref id="ref35"><label>35</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Ahn-Robbins</surname><given-names>D</given-names> </name><name name-style="western"><surname>Grootendorst-van Mil</surname><given-names>NH</given-names> </name><name name-style="western"><surname>Chang</surname><given-names>CK</given-names> </name><etal/></person-group><article-title>Prevalence and correlates of obsessive-compulsive symptoms in individuals with schizophrenia, schizoaffective disorder, or bipolar disorder</article-title><source>J Clin Psychiatry</source><year>2022</year><month>09</month><day>28</day><volume>83</volume><issue>6</issue><fpage>36170204</fpage><pub-id pub-id-type="doi">10.4088/JCP.21m14010</pub-id><pub-id pub-id-type="medline">36170204</pub-id></nlm-citation></ref><ref id="ref36"><label>36</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Kim</surname><given-names>J</given-names> </name><name name-style="western"><surname>Leonte</surname><given-names>KG</given-names> </name><name name-style="western"><surname>Chen</surname><given-names>ML</given-names> </name><etal/></person-group><article-title>Large language models outperform mental and medical health care professionals in identifying obsessive-compulsive disorder</article-title><source>npj Digit Med</source><year>2024</year><month>07</month><day>19</day><volume>7</volume><issue>1</issue><pub-id pub-id-type="doi">10.1038/s41746-024-01181-x</pub-id></nlm-citation></ref><ref id="ref37"><label>37</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><collab>The All of Us Research Program Investigators</collab><name name-style="western"><surname>Denny</surname><given-names>JC</given-names> </name><name name-style="western"><surname>Rutter</surname><given-names>JL</given-names> </name></person-group><article-title>The &#x201C;All of Us&#x201D; research program</article-title><source>N Engl J Med</source><year>2019</year><month>08</month><day>15</day><volume>381</volume><issue>7</issue><fpage>668</fpage><lpage>676</lpage><pub-id pub-id-type="doi">10.1056/NEJMsr1809937</pub-id></nlm-citation></ref><ref id="ref38"><label>38</label><nlm-citation citation-type="web"><article-title>BioVU funding acknowledgement</article-title><source>VICTR</source><access-date>2026-09-10</access-date><comment><ext-link ext-link-type="uri" xlink:href="https://victr.vumc.org/biovu-funding/">https://victr.vumc.org/biovu-funding/</ext-link></comment></nlm-citation></ref></ref-list><app-group><supplementary-material id="app1"><label>Multimedia Appendix 1</label><p>Supplementary materials</p><media xlink:href="mental_v13i1e89213_app1.docx" xlink:title="DOCX File, 5598 KB"/></supplementary-material><supplementary-material id="app2"><label>Multimedia Appendix 2</label><p>Supplementary tables S3-S8</p><media xlink:href="mental_v13i1e89213_app2.xlsx" xlink:title="XLSX File, 105 KB"/></supplementary-material></app-group></back></article>