Automating Epidemiology Report Generation from the MIMIC-IV Clinical Database using SNOMED CT and SQL | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Automating Epidemiology Report Generation from the MIMIC-IV Clinical Database using SNOMED CT and SQL Houcemeddine Turki, Naveed A. Pasha, Abdullah Altammami, Anas H. Alzahrani This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-7660197/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract Objective To present a unified and modular framework for automating the epidemiological research process from cohort definition to analysis and visualization using the MIMIC-IV dataset. Materials and Methods We combined SNOMED-CT ontologies, prompt-engineered SQL generation, and integration of structured and unstructured electronic health record data. Statistical summaries, logistic regression, and network-based co-word analyses were generated. Results The system successfully automated tasks such as cohort selection, ontology mapping, entity recognition, statistical analysis, and visualization. Applied to MIMIC-IV, the framework produced reproducible and interpretable epidemiological insights within hours, highlighting efficiency gains compared with manual workflows. Discussion Our approach demonstrates methodological advances by integrating knowledge engineering, NLP, and network analysis into a reproducible pipeline. The framework enables scalable, transparent, and efficient epidemiological research but remains limited by computational demands and variability in large language model–based SQL generation. Conclusion This modular pipeline illustrates a pathway toward automated, semantically grounded epidemiology reporting from EHRs, with potential applications in clinical and public health informatics. Epidemiology automation Electronic health records MIMIC-IV Natural language processing Knowledge engineering SNOMED-CT Data visualization Figures Figure 1 Figure 2 Figure 3 Figure 4 BACKGROUND AND SIGNIFICANCE Electronic health records (EHRs) provide at scale both structured data and narrative clinical text, enabling observational studies but also exposing bottlenecks in reproducible cohorting and analysis ( 1 ). Public resources such as MIMIC‑IV have catalyzed secondary use of EHR data for epidemiology and outcomes research ( 2 ). In parallel, digital knowledge infrastructures extend beyond patient data to support evidence retrieval and semantic interoperability: PubMed, maintained by the National Library of Medicine, enables large-scale discovery and synthesis of biomedical literature and clinical trial results ( 3 ); the OBO Foundry provides open, computable ontologies that standardize biological and medical vocabularies ( 4 ); SNOMED CT serves as a globally adopted clinical terminology for consistent documentation and analysis ( 5 ); and Wikidata functions as a collaborative, cross-linked knowledge graph integrating biomedical data from diverse sources ( 6 ). Despite progress in machine learning, natural language processing, and information retrieval, end‑to‑end epidemiologic workflows remain labor‑intensive, error‑prone, and difficult to scale or reproduce ( 1 , 7 , 8 ). The field is moving toward automation, but practical systems must balance efficiency with transparency and governance ( 9 – 11 ). Tooling has matured across several steps: RobotReviewer and Rayyan reduce manual burden in study screening and appraisal ( 12 , 13 ); i2b2 and OHDSI/OMOP improve data standardization and query portability across health systems ( 14 , 15 ). Domain‑specific language models trained on clinical corpora (for example, ClinicalBERT and GatorTron) and multimodal learning frameworks expand what can be extracted from clinical text and signals, but they also surface challenges in interoperability, bias, and explainability that limit adoption without careful validation ( 16 – 19 ). This work addresses these gaps with RealEpi, a reproducible pipeline that couples terminology‑guided querying of SNOMED CT with large‑language‑model–assisted SQL synthesis to automate cohort definition, analysis, and visualization from MIMIC‑IV. RealEpi integrates structured data and de‑identified clinical notes, produces auditable tables and figures, and adds concept co‑occurrence networks for interpretable summaries. We demonstrate feasibility on aortic aneurysm and outline governance steps to manage non‑determinism and generalizability. MATERIALS AND METHODS System Design We developed RealEpi, a modular pipeline that automates cohort definition, extraction of structured and unstructured EHR data, statistical reporting, and network analysis. We instantiated RealEpi for aortic aneurysm using MIMIC-IV v3.1 and SNOMED CT International Edition (2025-08-01). The study is retrospective and observational. To assess generalizability, we repeated the complete pipeline on an unrelated condition, upper respiratory infection (URTI), without modifying code beyond the root SNOMED concept and label set. Prompts, SQL predicates, and outputs were archived identically (Supplementary Appendix B) Data Sources MIMIC-IV v3.1 (hospital and note modules) We used demographics, admissions, diagnoses and procedures (ICD-9/10), labs, medications, microbiology, de-identified discharge summaries, and radiology reports. ICU high-frequency tables were not used. Records were linked with patient id, hospital admission id and ICU stay id. Dates are de-identified with patient-specific offsets. An entity–relationship diagram of the MIMIC-IV v3.1 hospital and note modules is shown in Figure 1 to illustrate table linkages used for cohort construction (2). SNOMED CT SNOMED CT was used to expand the disease concept and to label entities; vendor SNOMED→ICD maps were referenced for comparison. The semantic expansion of aortic aneurysm concepts in SNOMED-CT is visualized in Figure 2, demonstrating hierarchical and equivalent class structure (5). Pipeline The RealEpi pipeline for automatic generation of epidemiology reports from MIMIC-IV is summarized in Figure 3. 1) Cohort selection Ontology Processing and Label Harvest We converted the SNOMED CT RF2 release to OWL using SNOMED2OWL, then to RDF/Turtle using ROBOT. We queried the graph with RDFLib and SPARQL to retrieve the target concept, all descendants, and equivalent‑class definitions. The query followed the recursive pattern rdfs:subClassOf* | owl:equivalentClass/owl:intersectionOf/rdf:rest*/rdf:first to capture hierarchical and logical variants. We harvested preferred labels and synonyms via st:Description.term.en-us.preferred , st:Description.term.en-us.synonym , and rdfs:label . (20–22) LLM-assisted SQL synthesis We used a large language model (gemini‑2.5‑flash) to generate a single WHERE condition over ICD titles from the SNOMED-derived label set (Boolean LIKE patterns only). Because outputs vary across runs, we archived all prompts. The structured prompt template used to constrain SQL generation from SNOMED-derived labels is provided in Supplementary Figure S1. Method A1 was prespecified for analysis. (23) Study design Admissions with the condition as primary diagnosis were included. We compared retrieval with vs without SNOMED-guided terms to assess coverage; cohort flow and counts were logged. Primary outcomes: LOS, discharge disposition (home, rehab/nursing, hospice, other facility, against medical advice, death), and in-hospital mortality. Key covariates are listed below in data extraction phase. 2) Data extraction Structured data From hospital tables, we capture age, sex, race, admission type, BMI and BP from OMR within 48 hours, labs in the same 48 hours (top 40 tests), microbiology test names, procedures (ICD/HCPCS), medications. Additionally we flag labs as elevated/reduced against reference ranges. Unstructured data. We retrieve the full discharge summary and the earliest report of each of the six most common radiology exam types within 2 days of admission. Then we link to the index admission diagnosis. 3) Statistical Analysis We summarized continuous variables with mean, standard deviation, median, and IQR; and for categorical variables with counts and percentages. We estimated 95% confidence intervals for proportions. For group comparisons we used t‑tests for continuous variables and χ² or Fisher’s exact tests for categorical variables, as appropriate. We quantified effect sizes for continuous outcomes using standardized signal mean difference (SSMD) and reported exact two‑sided P‑values. We trained a logistic regression to predict discharge to home, using age, sex, comorbidities, LOS, selected labs, and procedures as predictors. We performed a standard train–test split and reported accuracy and the confusion matrix; coefficients were tabulated for interpretability. Formulas and SQL used to compute LOS and abnormality flags are provided in Supplementary Methods. 4) Co-word analysis Named‑entity recognition and mapping We retrieved the full discharge summary and the earliest report of each of the six most common radiology exam types performed within two days of admission. We ran named‑entity recognition with spaCy en_core_web_sm , then resolved spans to SNOMED CT by string matching against harvested labels and synonyms. We assigned each resolved concept to a first‑order SNOMED metaclass using the same recursive SPARQL pattern used in ontology processing. Concept Co‑occurrence Networks We built undirected co‑occurrence graphs per report type where nodes are resolved SNOMED concepts and edges indicate co‑mention within a report. We weighted edges by co‑occurrence counts, removed self‑loops and isolates, filtered low‑weight edges, and excluded non‑clinical categories (for example, environment, qualifier value). We visualized graphs with a force‑directed layout and provided a concept‑to‑label mapping table. Subgroup networks were generated by filtering admissions (for example, age or sex strata). (24) Software and computational environment Ontology manipulation used ROBOT and RDFLib; network analysis used NetworkX; tabulation and visualization used Pandas and Matplotlib. (21,22,24) The end‑to‑end run executed on an Intel Core i7 with 15 GB RAM and 500 GB storage and for comparison, Google Colab 13.2 GB RAM, 300 GB storage, Intel Xeon CPU. Reproducibility and transparency We versioned data snapshots (MIMIC‑IV v3.1; SNOMED CT 2025‑08‑01), archived the exact LLM prompts and returned SQL conditions, and retained all intermediate tables used for figure and table generation. Because the LLM can yield non‑deterministic outputs, we retained the A1 condition as the analysis default and stored alternative runs for audit. All SPARQL queries, SQL templates, and pipeline scripts are provided as Supplementary Material. Ethics and data use MIMIC‑IV contains de‑identified data released under data use agreements with required human‑subjects training. The underlying data collection was approved by institutional review boards for Beth Israel Deaconess Medical Center and MIT. This study used only de‑identified data. Use of generative AI A large language model (gemini‑2.5‑flash) was used to synthesize candidate SQL conditions from SNOMED‑derived labels and to draft non‑substantive text. All outputs were reviewed and validated by the authors; the AI system is not an author. RESULTS Data sources and run characteristics We used MIMIC-IV v3.1 (release 25 Nov 2024) and the SNOMED CT International Edition (release 1 Aug 2025). The database contained 546,028 hospitalizations for 223,452 unique patients. The SNOMED CT resource comprised 7.38 million statements of medical terminology. The end-to-end pipeline ran on an Intel Core i7, 15 GB RAM, 500 GB storage system in ~3 h 10 min. The most time-consuming steps were note named-entity recognition (SpaCy) and ontology traversal with SPARQL. Conversion of SNOMED CT from RF2 to TTL required several additional hours. Diagnostic coverage and cohort retrieval Supplementary Table S1 lists the ICD-10 diagnoses mapped from SNOMED-CT for aortic aneurysm, expanding beyond vendor cross-maps. Ontology expansion identified 142 names across 60 SNOMED CT concepts for aortic aneurysm. The vendor SNOMED to ICD‑10 cross‑map covered only 5 of 60 diagnoses (8.3 %) and included off‑target congenital umbrella terms. Large‑language‑model–assisted SQL (method A1) retrieved 10 ICD‑10 diagnoses and produced a primary‑diagnosis cohort of 4,105 hospitalizations: abdominal aortic aneurysm without rupture (n = 2,075), thoracic aortic aneurysm without rupture (n = 1,284), thoracic aortic ectasia (n = 418), thoracoabdominal aortic aneurysm without rupture (n = 89), abdominal aortic ectasia (n = 82), abdominal aortic aneurysm ruptured (n = 57), congenital aneurysm of aorta (n = 55), thoracic aortic aneurysm ruptured (n = 22), thoracoabdominal aortic ectasia (n = 13), and thoracoabdominal aortic aneurysm ruptured (n = 10). LLM outputs varied across runs; A1 was used for the main analysis. Table 1 summarizes cohort retrieval by diagnosis across different SQL conditions. Table 1. Summary of Aortic Aneurysm Cohort Domain Finding / Criteria N (%) or Mean [95% CI] Primary Diagnoses Abdominal aortic aneurysm, without rupture 2,072 Thoracic aortic aneurysm, without rupture 1,282 Thoracic aortic ectasia 418 Comorbidities Hyperlipidemia, unspecified 2,209 Essential (primary) hypertension 1,781 Personal history of nicotine dependence 1,716 Laboratory Findings Patients with any abnormal labs 3,753 (91.5%) Red Blood Cells (Reduced) 3,099 Hemoglobin (Reduced) 3,044 Hematocrit (Reduced) 2,857 Glucose (Elevated) 2,752 RDW-SD (Elevated) 2,284 Anthropometrics & Vitals Body Mass Index (BMI), mean 32.6 Systolic blood pressure at admission, mean 98.8 mmHg Diastolic blood pressure at admission, mean 63.6 mmHg Hospitalization Metrics Length of stay (days), mean 6.94 [6.68–7.21] Outcomes Discharged home 1,011 (24.7% [23.3–26.0]) Discharged to rehab/nursing facility 759 (18.5% [17.3–19.7]) In-hospital deaths 153 (3.7% [3.2–4.3]) Clinical results Baseline characteristics and outcomes Figure 4 presents sample visualizations of the cohort, including admission counts per month, LOS distribution, and LOS stratified by admission type. Any abnormal laboratory was present in 3,753 admissions (91.5 %). Mean length of stay was 6.94 days (95 % CI 6.68–7.21). Disposition at discharge was home in 1,011 cases (24.7 %, 95 % CI 23.3–26.0), rehabilitation or nursing in 759 (18.5 %, 95 % CI 17.3–19.7), and in‑hospital death in 153 (3.7 %, 95 % CI 3.2–4.3). Available admission vitals showed mean systolic blood pressure 98.8 mmHg and diastolic 63.6 mmHg; mean BMI was 32.6 kg/m². Frequent abnormal laboratories The most common abnormalities were red blood cells decreased (n = 3,099), hemoglobin decreased (n = 3,044), hematocrit decreased (n = 2,857), glucose increased (n = 2,752), and RDW‑SD increased (n = 2,284). Procedures and clinical outcomes Table 2. Summary of Common Procedures in Aortic Aneurysm Cohort Procedure Count Mean DOS (days) [95% CI] DOS SSMD Mortality % [95% CI] Mortality p-value Mortality vs Population Mean Age (years) [95% CI] Age SSMD Performance of Cardiac Output, Continuous 463 10.50 [9.61–11.39] 0.309 2.6 [1.1–4.0] 0.214 Lower 63.2 [62.1–64.3] -0.514 Insertion of Infusion Device into Superior Vein 293 17.91 [16.21–19.60] 0.714 17.1 [12.8–21.4] <0.001 Higher 70.7 [69.3–72.1] -0.009 Replacement of Thoracic Aorta, Ascending/Arch 226 10.67 [9.46–11.88] 0.311 1.8 [0.1–3.5] 0.145 Lower 61.9 [60.3–63.4] -0.570 Introduction of Nutritional Substance into Upper GI Tract 206 25.34 [22.72–27.96] 0.961 21.8 [16.2–27.5] <0.001 Higher 72.1 [70.5–73.6] 0.080 Fluoroscopy of Multiple Coronary Arteries 198 10.60 [8.96–12.23] 0.265 5.1 [2.0–8.1] 0.417 Higher 65.4 [63.8–66.9] -0.355 Ultrasonography of Heart with Aorta 180 11.59 [10.18–13.00] 0.377 1.1 [0.0–2.6] 0.067 Lower 64.6 [62.9–66.4] -0.387 Associations between selected procedures and hospitalization outcomes are presented in Table 2. Procedure‑level summaries showed heterogeneous associations with utilization and outcomes. Examples include: insertion of infusion device into the superior venous system (n = 293) with mean LOS 17.91 days (95 % CI 16.21–19.60), SSMD 0.714, and mortality 17.1 % (95 % CI 12.8–21.4 %, p<0.001); introduction of nutritional substance into upper GI (n = 206) with mean LOS 25.34 days (95 % CI 22.72–27.96), SSMD 0.961, and mortality 21.8 % (95 % CI 16.2–27.5 %, p<0.001). In contrast, ultrasonography of heart with aorta (n = 180) had mean LOS 11.59 days (95 % CI 10.18–13.00), SSMD 0.377, and mortality 1.1 % (95 % CI 0.0–2.6 %, p = 0.067). These patterns indicate that higher‑intensity supportive procedures co‑occur with longer stays and higher mortality, consistent with disease severity. Discharge disposition by sex A contingency analysis of discharge location by sex showed strong dependence (χ² = 55.67, df = 11, p = 5.83×10⁻⁸). Counts illustrative of the pattern include home health care (male 928 vs female 446), home (male 735 vs female 276), and death (male 104 vs female 50). Supplementary Table S3 shows discharge location stratified by sex, with a significant chi-square test result (p < 0.001). Prediction of discharge home Supplementary Table S4 lists coefficients from the logistic regression predicting discharge home, with an overall accuracy of 0.75. Positive coefficients were observed for surgical same‑day admission and emergency admissions, and for several race categories; negative coefficients were observed for observation‑type admissions and transfer from skilled nursing. Full coefficient tables are provided in the supplementary results. System results Concept networks from clinical notes Entity extraction from discharge and radiology narratives produced interpretable co‑occurrence graphs. In chest portable AP reports, high‑frequency nodes included pleural effusion, cardiomegaly, pneumonia, atelectasis, pneumothorax, endotracheal tube, and pulmonary edema, with edges reflecting expected clinical co‑mentions. Subgroup filtering by age or sex yielded similar semantic neighborhoods with differing weights. A co-occurrence network of SNOMED-CT concepts extracted from chest radiology narratives is shown in Supplementary Figure S2, highlighting clusters such as pleural effusion and cardiomegaly. DISCUSSION We show that terminology‑guided prompting with SNOMED CT plus LLM‑assisted SQL can automate the end‑to‑end production of an epidemiology report from EHR data, with auditable logic and integrated analysis of structured variables and clinical text. On MIMIC‑IV, this approach expanded diagnostic capture beyond vendor cross‑maps, delivered a 4,105‑admission cohort with reproducible tables, figures, and concept networks, and finished on commodity hardware. The result addresses a persistent gap between available informatics capacity (ML/NLP/IR) and practical, reproducible epidemiology pipelines. Repeating the pipeline on URTI, a high‑prevalence respiratory condition with very different code distributions and note semantics, yielded comparable automation and interpretable outputs, supporting portability beyond aortic aneurysm. Automation efforts have historically targeted single steps: screening and bias appraisal (RobotReviewer, Rayyan) data standardization and reuse (i2b2, OMOP/OHDSI), and EHR cohort ETL (DExtER) (12–14,25). Large language models now support screening and data extraction with high accuracy, but typical deployments remain tool‑specific rather than pipeline‑level (7,26,27) . Our contribution is a disease‑agnostic path from ontology to SQL to cohort to report that keeps transformation logic visible, tracks versions of prompts and ontologies, and unifies structured and narrative data in one run. This design positions the proposed framwork as a complement to CDMs and review tools rather than a replacement, closing the loop between cohort definition and analysis at publication grade. Relying on single‑level ICD title matching risks granularity and coverage gaps . SNOMED CT offers polyhierarchy, post‑coordination, and curated synonyms that better represent clinical variability (5,28,29). Traversing descendants and equivalent classes via SPARQL exposes label diversity that vendor cross‑maps may not capture (21,28–30). In our case study, the cross‑map surfaced only 5 of 60 aortic‑aneurysm‑related concepts (8.3%), whereas SNOMED traversal provided 142 names across 60 concepts , enabling broader ICD retrieval once translated into SQL. These observations align with reports that terminology binding and cross‑system mapping require methodical handling to avoid under‑ or over‑inclusion (29,30). So, anchor cohorts in a terminology‑first step, then translate to database filters. This improves recall without pre‑committing to brittle ICD enumerations, and it leaves a reviewable audit trail. Generic text‑to‑SQL can be powerful but variable (31,32). We constrained generation with (a) a narrow Boolean grammar over LIKE patterns, (b) a required include‑list of SNOMED‑derived labels, and (c) archiving of the exact prompt and condition string. We observed non-determinism across runs—a known issue in text‑to‑SQL—which we treated as an analysis choice by fixing “A1” for the main results and retaining alternates for audit (31,32). Mitigations for production can be a zero temperature decoding; seeded runs; regex validation against a white‑listed schema; k‑of‑n voting across low‑variance generations; unit tests that verify that known positive and negative ICD titles are included or excluded; continuous diffs of cohort membership after ontology or model updates (31,32). Most EHR pipelines underuse unstructured notes despite evidence that narratives add signal for phenotyping and outcomes (33–36). We performed NER over discharge and radiology reports, linked entities to SNOMED CT via the same label inventory used for cohorting, and summarized topics as co‑occurrence graphs . The approach follows established practice in content co‑occurrence analysis and aligns with emerging SNOMED entity‑linking benchmarks in clinical text (37,38). The resulting networks surfaced expected neighborhoods (for example, pleural effusion or cardiomegaly or pneumonia in chest radiography narratives), offering an interpretable summary of free‑text at cohort scale. The trade-offs of dictionary‑anchored linking is transparent and fast to review, but it can miss context, negation, and temporality. Prior evaluations show entity‑linking performance varies by concept family and dataset (39,40). Future iterations can add assertion detection and section‑aware parsing, and can benchmark against shared tasks (38–40). Descriptive results and procedure associations were clinically coherent: high‑intensity supportive procedures co‑occurred with longer stays and higher mortality; ultrasound and diagnostic fluoroscopy clustered with lower mortality, consistent with indication patterns rather than causal effects. The discharge‑home model achieved accuracy 0.75, which is reasonable for a first pass but insufficient without discrimination, calibration, and decision‑curve reporting (41,42). Observational EHR analyses remain susceptible to confounding, selection bias, and misclassification; sensitivity analyses and explicit causal framing are necessary in future work (41,43). Report AUC and Brier score; provide calibration intercept and slope; present adjusted odds ratios with 95% CIs for key predictors; conduct subgroup performance checks across age, sex, and race; examine robustness to alternative cohort definitions and to removal of procedures that are proxies for severity (41–43). Supplementary Table S5 compares prior MIMIC-based studies of aortic aneurysm with our cohorting approach, showing broader capture via SNOMED-guided SQL. We versioned the data sources (MIMIC‑IV v3.1; SNOMED CT 2025‑08‑01), stored prompts and returned SQL , and exported intermediate tables that feed every figure and statistic. This meets core expectations for reusability and audit in informatics (4,9,44). We recommend publishing: (1) the root SNOMED concept and the exact SPARQL query (21,22); (2) the frozen SQL predicate; and (3) hashes of the data snapshot and ontology release. Such artifacts allow external teams to reproduce both the cohort membership and the analysis outputs precisely. Runtime was dominated by note‑level NER and ontology traversal on a modest workstation (≈3 h 10 min). This mirrors known costs of entity‑centric pipelines and ontology reasoning at scale (39,40). Engineering options include caching SNOMED traversals, using precompiled label tries, parallelizing NER, and moving link resolution to vector indexes with exact‑term fallbacks. Modular architecture patterns from clinical software can help isolate these components for scaling and substitution (45). Automating parts of evidence generation raises methodological and governance duties. First, human‑in‑the‑loop review remains essential at boundary decisions (phenotype edges, exclusion logic), consistent with best practice in semi‑automated evidence synthesis (7,10,26,27,46). Second, transparency about the role of generative AI is required in the manuscript (AI contribution statement), and models should not be considered authors. Third, observational outputs should be framed descriptively unless causal identification strategy is explicit (43). RealEpi offers a template pattern to go from clinical concept to cohort to publication‑grade outputs with visible SQL and versionable prompts. It can coexist with i2b2 or OMOP and feed registry or quality‑improvement programs (14,15). For clinical researchers: Disease‑agnostic reuse lowers the marginal cost of new descriptive studies; ontology anchoring reduces re‑work around code lists; integrated note mining surfaces context that structured fields miss (1,33–36). For policy and surveillance: With determinization and validation, the pattern can power routine, refreshable situational awareness from operational EHRs, provided proper data governance and latency controls are in place (9,11). Limitations This work has several limitations. First, the pipeline is computationally intensive: named-entity recognition and SNOMED CT resolution are slow, constraining scalability on standard workstations. Similar bottlenecks have been reported in other ontology-driven pipelines and in SpaCy-based entity linking (39,40). Second, the current implementation is optimized for batch analysis of curated, historical data, not for real-time use in operational EHR systems. In practice, live EHR data often contain missing or inconsistent values (e.g., labs, procedures), which could reduce the reliability of derived statistics and co-word networks (43). Third, the clinical findings should be interpreted cautiously. Associations such as higher mortality among patients undergoing multiple procedures likely reflect confounding by severity and reverse causality, not causal effects. Observational analyses remain vulnerable to unmeasured confounders, reinforcing the need for expert interpretation and sensitivity analyses (43). Finally, LLM-assisted SQL generation introduces variability. Outputs are non-deterministic and may require repeated runs or manual review. While SNOMED CT expansion improves coverage, mapping to ICD codes is imperfect due to differences in granularity, which may under- or over-represent some subgroups. Variability in text-to-SQL generation is a recognized challenge, with ongoing work exploring prompt engineering, post-processing, and governance mechanisms to stabilize outputs (32). Generalizability was demonstrated across two conditions within a single EHR corpus; multi‑site validation and cross‑CDM evaluation remain future work. CONCLUSION This study shows that terminology-guided prompting with SNOMED CT and LLM-assisted SQL can automate end-to-end epidemiology reporting from EHRs, demonstrated on MIMIC-IV with a 4,105-admission aortic aneurysm cohort. The RealEpi pipeline integrated structured and narrative data to generate reproducible tables, figures, and concept networks within hours on commodity hardware, expanding diagnostic capture beyond vendor cross-maps while maintaining auditable logic. Although limitations include non-determinism in LLM outputs, SNOMED-ICD granularity mismatches, and computational overhead in note processing, the framework establishes a scalable, transparent, and terminology-anchored pathway for automated descriptive epidemiology with future potential in multi-site validation, real-time surveillance, and population health monitoring. Declarations COMPETING INTERESTS The authors declare no competing interests related to this study. FUNDING This work was supported by the Saudi National Institute of Health (Saudi NIH) under Grant PRI01-2401-KAU19-46641119. Clinical Trial Number: not applicable. Consent to Publish declaration: not applicable Consent to Participate declaration: not applicable Ethics declaration: not applicable Author Contribution HT and AHA conceived the study design and supervised the project. HT developed the ontology processing workflows and implemented the SNOMED CT–based methods. NAP conducted statistical analyses, clinical interpretation, and validation of results. AA managed database queries, assisted with data extraction, and contributed to integration of structured and unstructured data. AHA coordinated the research team, secured funding, and provided oversight of epidemiological methodology. HT and AHA drafted the main manuscript text. NAP and AA prepared figures, tables, and supplementary materials. All authors critically revised the manuscript for important intellectual content and approved the final version. Acknowledgement The authors thank the MIT Laboratory for Computational Physiology for maintaining the MIMIC database and SNOMED International for providing access to clinical terminology resources. We also acknowledge the contributions of the open-source developer communities behind ROBOT, RDFLib, spaCy, NetworkX, and Pandas, whose tools were essential for this work. The authors additionally thank Ala Essa, Meshael Almogrin and Makram Koubaa for their valuable support and contributions to this project. Data Availability This study used the publicly available MIMIC-IV v3.1 clinical database, which is hosted by the MIT Laboratory for Computational Physiology. Access requires completion of the required credentialing process and signing of a data use agreement. The dataset can be obtained at:https://physionet.org/content/mimiciv/3.1/The SNOMED CT International Edition (release 2025-08-01) was obtained under license from SNOMED International. Access is available to registered users via:https://www.snomed.org/snomed-ct/get-snomedAll pipeline code, SQL templates, SPARQL queries, prompt archives, and figure-generating tables supporting this study have been deposited in supplement file References Datta S, Bernstam EV, Roberts K. A frame semantic overview of NLP-based information extraction for cancer-related EHR notes. J Biomed Inform. 2019;100:103301. Johnson AE, Bulgarelli L, Shen L, Gayles A, Shammout A, Horng S, et al. MIMIC-IV, a freely accessible electronic health record dataset. Sci Data. 2023;10(1):1. White J. PubMed 2.0. Med Ref Serv Q. 1 oct 2020;39(4):382‑7. Jackson R, Matentzoglu N, Overton JA, Vita R, Balhoff JP, Buttigieg PL, et al. OBO Foundry in 2021: operationalizing open data principles to evaluate ontologies. Database. 2021;069. Chang E, Mostafa J. The use of SNOMED CT, 2013-2020: a literature review. J Am Med Inform Assoc. 2021;28(9):2017‑26. Turki H, Shafee T, Hadj Taieb MA, Ben Aouicha M, Vrandečić D, Das D, et al. Wikidata: A large-scale collaborative ontological medical database. J Biomed Inform. 2019;99:103292. Ge L, Agrawal R, Singer M, Kannapiran P, Castro Molina JA, Teow KL, et al. Leveraging artificial intelligence to enhance systematic reviews in health research: advanced tools and challenges. Syst Rev. 2024;13(1):269. Albu E, Gao S, Stinjen P, Rademakers FE, Bussel BC, Collyer T, et al. Challenges and recommendations for Electronic Health Records data extraction and preparation for dynamic prediction modelling in hospitalized patients - a practical guide. 2025. Musslick S, Bartlett LK, Chandramouli SH, Dubova M, Gobet F, Griffiths TL, et al. Automating the practice of science: Opportunities, challenges, and implications. Proc Natl Acad Sci. 2025;122(5):2401238121. Ofori-Boateng R, Aceves-Martins M, Wiratunga N, Moreno-Garcia CF. Towards the automation of systematic reviews using natural language processing, machine learning, and deep learning: a comprehensive review. Artif Intell Rev. 2024;57(8):200. Sung J, Hopper JL. Co-evolution of epidemiology and artificial intelligence: challenges and opportunities. Int J Epidemiol. 2023;52(4):969‑73. Marshall IJ, Kuiper J, Wallace BC. RobotReviewer: evaluation of a system for automatically assessing bias in clinical trials. J Am Med Inform Assoc. 2016;23(1):193‑201. Ouzzani M, Hammady H, Fedorowicz Z, Elmagarmid A. Rayyan—a web and mobile app for systematic reviews. Syst Rev. 2016;5(1):210. Klann JG, Abend A, Raghavan VA, Mandl KD, Murphy SN. Data interchange using i2b2. J Am Med Inform Assoc. 2016;23(5):909‑15. Reinecke I, Zoch M, Reich C, Sedlmayr M, Bathelt F. The usage of OHDSI OMOP–a scoping review. In: German Medical Data Sciences 2021: Digital Medicine: Recognize–Understand–Heal. Kiel, Germany: IOS Press; 2021. p. 95‑103. Huang K, Altosaar J, Ranganath R. ClinicalBERT: Modeling clinical notes and predicting hospital readmission. In: CHIL 2020 Workshop. Toronto, Canada: ACM; 2020. Yang X, Chen A, PourNejatian N, Shin HC, Smith KE, Parisien C, et al. A large language model for electronic health records. NPJ Digit Med. 2022;5(1):194. Hamilton AJ, Strauss AT, Martinez DA, Hinson JS, Levin S, Lin G, et al. Machine learning and artificial intelligence: applications in healthcare epidemiology. Antimicrob Steward Healthc Epidemiol. 2021;1(1):28. Kline A, Wang H, Li Y, Dennis S, Hutch M, Xu ZW, et al. Multimodal machine learning in precision health: A scoping review. NPJ Digit Med. 2022;5(1):171. Solbrig HR, Prud’hommeaux E, Jiang G. Blending FHIR RDF and OWL. In: Proceedings of the 10th International Conference on Semantic Web Applications and Tools for Health Care and Life Sciences (SWAT4LS 2017. Rome, Italy: CEUR-WS.org; 2017. Jackson RC, Balhoff JP, Douglass E, Harris NL, Mungall CJ, Overton JA. ROBOT: a tool for automating ontology workflows. BMC Bioinformatics. 2019;20(1):407. Krech D, Grimnes GA, Higgins G, Hees J, Aucamp I, Lindström N. Disponible sur: https://github.com/RDFLib/rdflib Comanici G, Bieber E, Schaekermann M, Pasupat I, Sachdeva N, Dhillon I, et al. Gemini 2.5: Pushing the frontier with advanced reasoning, multimodality, long context, and next generation agentic capabilities. 2025. Hagberg A, Swart PJ, Schult DA. Exploring network structure, dynamics, and function using NetworkX [Internet]. 2008. Disponible sur: https://www.osti.gov/biblio/960616 Gokhale KM, Chandan JS, Toulis K, Gkoutos G, Tino P, Nirantharakumar K. Data extraction for epidemiological research (DExtER): a novel tool for automated clinical epidemiology studies. Eur J Epidemiol. 2021;36(2):165‑78. Guo E, Gupta M, Deng J, Park YJ, Paget M, Naugler C. Automated paper screening for clinical reviews using large language models: data analysis study. J Med Internet Res. 2024;26:48996. Lai H, Liu J, Bai C, Liu H, Pan B, Luo X, et al. Language models for data extraction and risk of bias assessment in complementary medicine. Npj Digit Med. 2025;8(1):74. Lee D, Cornet R, Lau F, Keizer N. A survey of SNOMED CT implementations. J Biomed Inform. 2013;46(1):87‑96. Rossander A, Lindsköld L, Ranerup A, Karlsson D. A state-of-the art review of SNOMED CT terminology binding and recommendations for practice and research. 2021. p. 76‑88. (Methods of information in medicine; vol. 60). Lougheed MD, Thomas NJ, Wasilewski NV, Morra AH, Minard JP. Use of SNOMED CT® and LOINC® to standardize terminology for primary care asthma electronic health records. J Asthma. 2018;55(6):629‑39. Singh A, Shetty A, Ehtesham A, Kumar S, Khoei TT. A survey of large language model-based generative ai for text-to-sql: Benchmarks, applications, use cases, and challenges. In: 2025 IEEE 15th Annual Computing and Communication Workshop and Conference (CCWC. Las Vegas, NV, USA: IEEE; 2025. p. 15‑21. Shi L, Tang Z, Zhang N, Zhang X, Yang Z. A survey on employing large language models for text-to-sql tasks. ACM Comput Surv. 2024; Tayefi M, Ngo P, Chomutare T, Dalianis H, Salvi E, Budrionis A, et al. Challenges and opportunities beyond structured data in analysis of electronic health records. Wiley Interdiscip Rev Comput Stat. 2021;13(6):1549. Zhang D, Yin C, Zeng J, Yuan X, Zhang P. Combining structured and unstructured data for predictive models: a deep learning approach. BMC Med Inform Decis Mak. 2020;20(1):280. Ruckdeschel JC, Riley M, Parsatharathy S, Chamarthi R, Rajagopal C, Hsu HS, et al. Unstructured data are superior to structured data for eliciting quantitative smoking history from the electronic health record. JCO Clin Cancer Inform. 2023;7:2200155. Vest JR, Grannis SJ, Haut DP, Halverson PK, Menachemi N. Using structured and unstructured data to identify patients’ need for services that address the social determinants of health. Int J Med Inf. 2017;107:101‑6. Klarin A. How to conduct a bibliometric content analysis: Guidelines and contributions of content co‐occurrence or co‐word literature reviews. Int J Consum Stud. 2024;48(2):13031. Davidson R, Hardman W, Amit G, Bilu Y, Della Mea V, Galaida A, et al. SNOMED CT entity linking challenge. J Am Med Inform Assoc. 2025;32(9):1397‑406. Kulyabin M, Sokolov G, Galaida A, Maier A, Arias-Vergara T. SNOBERT: A Benchmark for clinical notes entity linking in the SNOMED CT clinical terminology. In: International Conference on Pattern Recognition. Cham: Springer Nature Switzerland; 2024. p. 154‑63. Kartchner D, Deng J, Lohiya S, Kopparthi T, Bathala P, Domingo-Fernández D, et al. A comprehensive evaluation of biomedical entity linking models. In: Proceedings of the Conference on Empirical Methods in Natural Language Processing. Singapore: Association for Computational Linguistics; 2023. p. 14462. Goldstein BA, Navar AM, Pencina MJ, Ioannidis JP. Opportunities and challenges in developing risk prediction models with electronic health records data: a systematic review. J Am Med Inform Assoc. 2016;24(1):198. Casey JA, Schwartz BS, Stewart WF, Adler NE. Using electronic health records for population health research: a review of methods and applications. Annu Rev Public Health. 2016;37(1):61‑81. Goldstein ND. Electronic Health Records in Epidemiology: Appropriate Questions, Common Biases, and Potential Sensitivity Analyses. Curr Epidemiol Rep. 2025;12(1):11. Schoene AM, Basinas I, Tongeren M, Ananiadou S. A narrative literature review of natural language processing applied to the occupational exposome. Int J Environ Res Public Health. 2022;19(14):8544. Bathelt F, Lorenz S, Weidner J, Sedlmayr M, Reinecke I. Application of modular architectures in the medical domain-a scoping review. J Med Syst. 2025;49(1):27. O’Mara-Eves A, Thomas J, McNaught J, Miwa M, Ananiadou S. Using text mining for study identification in systematic reviews: a systematic review of current approaches. Syst Rev. 2015;4(1):5. Additional Declarations No competing interests reported. Supplementary Files SupplementaryMaterial.docx Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-7660197","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":542247301,"identity":"3b13e839-e4a0-4361-8769-f31387ed21cc","order_by":0,"name":"Houcemeddine Turki","email":"","orcid":"","institution":"University of the People","correspondingAuthor":false,"prefix":"","firstName":"Houcemeddine","middleName":"","lastName":"Turki","suffix":""},{"id":542247303,"identity":"4d705a55-6d8f-464e-b314-f262ea09a9fe","order_by":1,"name":"Naveed A. Pasha","email":"","orcid":"","institution":"South City Hospital, Jinnah Sindh Medical University","correspondingAuthor":false,"prefix":"","firstName":"Naveed","middleName":"A.","lastName":"Pasha","suffix":""},{"id":542247304,"identity":"af1439cb-8a2b-4096-94df-dd5504e389f5","order_by":2,"name":"Abdullah Altammami","email":"","orcid":"","institution":"Rutgers University","correspondingAuthor":false,"prefix":"","firstName":"Abdullah","middleName":"","lastName":"Altammami","suffix":""},{"id":542247305,"identity":"f74c7c6b-8255-4a85-b64e-4d00ee9ae421","order_by":3,"name":"Anas H. Alzahrani","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA90lEQVRIiWNgGAWjYDACCQbGA4wNQAYz82GIyAHCWhigWtiSSdXCwGNMnBb+2c0PDv7ccU/enJ3ns8HPNgY5vhsJzB9+4LPkzjGDA5Jnig13NvNuTuxtYzCWvJHAJtmDz5obCQYHDNsSGDcc5t18gLeNIXEDUAsDDx4d8jfSPxxIbEuw33CY5/HBv20M9UAtzB//4NFicCPH4MDBtoREoBbmZKAtCQY3Ehik8dlieCOn4GBjW0LyhsNsxsYy5yQMZ5552CYtg0eL3I30jQ9/tiXYbjh/+LHkmzIbeb7jyYc/vsHnfTQAjCYGSDSNglEwCkbBKKAAAAB8CVXLR/HuFQAAAABJRU5ErkJggg==","orcid":"","institution":"King Abdulaziz University","correspondingAuthor":true,"prefix":"","firstName":"Anas","middleName":"H.","lastName":"Alzahrani","suffix":""}],"badges":[],"createdAt":"2025-09-19 16:08:15","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-7660197/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-7660197/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":95541038,"identity":"8f7589e3-de85-40f1-bf98-b88ced86ce3e","added_by":"auto","created_at":"2025-11-10 11:37:27","extension":"docx","order_by":0,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":911537,"visible":true,"origin":"","legend":"","description":"","filename":"AutomatingEpidemiologyReportGenerationfromtheMIMICIVClinicalDatabaseusingSNOMEDCTandSQL.docx","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/9d910203c5d1a406e540ae07.docx"},{"id":95541035,"identity":"7462d407-b521-426a-84c1-da5fbff0970d","added_by":"auto","created_at":"2025-11-10 11:37:27","extension":"json","order_by":1,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":7228,"visible":true,"origin":"","legend":"","description":"","filename":"c02f553315884e84adb87938dcaacb16.json","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/db08146355adfab1dade487d.json"},{"id":95654442,"identity":"a1c0b0a9-7931-4900-9c0d-f67082fed4d8","added_by":"auto","created_at":"2025-11-11 16:11:58","extension":"docx","order_by":2,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":439644,"visible":true,"origin":"","legend":"","description":"","filename":"SupplementaryMaterial.docx","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/8e95bd6b89cf797e9ebd63d4.docx"},{"id":95654819,"identity":"ad261a4b-fa7f-4123-a6db-5671a2d74628","added_by":"auto","created_at":"2025-11-11 16:13:14","extension":"xml","order_by":3,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":116776,"visible":true,"origin":"","legend":"","description":"","filename":"c02f553315884e84adb87938dcaacb161enriched.xml","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/3292247df4a49ceebf843a47.xml"},{"id":95541044,"identity":"ff40717e-e4e4-4de5-99db-13749752d0dd","added_by":"auto","created_at":"2025-11-10 11:37:27","extension":"png","order_by":4,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":161286,"visible":true,"origin":"","legend":"","description":"","filename":"floatimage1.png","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/cb92dcc3a2c81ae856232b19.png"},{"id":95654289,"identity":"b60b5096-54a2-42c9-8896-0a01a76e5221","added_by":"auto","created_at":"2025-11-11 16:10:51","extension":"png","order_by":5,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":168661,"visible":true,"origin":"","legend":"","description":"","filename":"floatimage2.png","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/b5a590aecd5430989235f229.png"},{"id":95541049,"identity":"cfab9e6f-528e-4ff0-afdc-15c20b6b4d87","added_by":"auto","created_at":"2025-11-10 11:37:27","extension":"png","order_by":6,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":363395,"visible":true,"origin":"","legend":"","description":"","filename":"floatimage3.png","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/1098fbe33416906d0ac23548.png"},{"id":95654239,"identity":"49d2b895-df85-4360-b9c5-52ac4365f4db","added_by":"auto","created_at":"2025-11-11 16:10:39","extension":"jpeg","order_by":7,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":114665,"visible":true,"origin":"","legend":"","description":"","filename":"floatimage4.jpeg","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/25a505eef3e5a7dd7dbb1f5e.jpeg"},{"id":95541039,"identity":"311c5c27-0343-44a5-881b-863e0243ddb6","added_by":"auto","created_at":"2025-11-10 11:37:27","extension":"png","order_by":8,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":48210,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage1.png","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/f0be566a530a3be70907332e.png"},{"id":95541048,"identity":"a24b8f8a-4cc0-4c8e-bd8c-4f524a93f8a9","added_by":"auto","created_at":"2025-11-10 11:37:27","extension":"png","order_by":9,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":33775,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage2.png","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/fdd8fb53ee05275b440a7689.png"},{"id":95541050,"identity":"bc66e8c2-4bd8-4a49-b5b2-9934223610b0","added_by":"auto","created_at":"2025-11-10 11:37:27","extension":"png","order_by":10,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":69276,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage3.png","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/610abafe59182a607ed13ac7.png"},{"id":95654421,"identity":"5c0f5097-cd58-44bc-99c0-09c6de7c348a","added_by":"auto","created_at":"2025-11-11 16:11:48","extension":"png","order_by":11,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":41970,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage4.png","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/e574f96f7fe6abff5f947093.png"},{"id":95541051,"identity":"53bc89d5-22aa-4769-85d6-2e425e948bb9","added_by":"auto","created_at":"2025-11-10 11:37:27","extension":"xml","order_by":12,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":114280,"visible":true,"origin":"","legend":"","description":"","filename":"c02f553315884e84adb87938dcaacb161structuring.xml","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/2a6803e1e1684ad37deb7b79.xml"},{"id":95541052,"identity":"178243c4-d091-4263-971d-d30cfd65ca91","added_by":"auto","created_at":"2025-11-10 11:37:27","extension":"html","order_by":13,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":123827,"visible":true,"origin":"","legend":"","description":"","filename":"earlyproof.html","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/c8989ce74e118d37b2352b6b.html"},{"id":95541034,"identity":"13a54420-fd17-4378-9e25-71c50b89fb91","added_by":"auto","created_at":"2025-11-10 11:37:27","extension":"png","order_by":1,"title":"Figure 1","display":"","copyAsset":false,"role":"figure","size":161286,"visible":true,"origin":"","legend":"\u003cp\u003e\u003cem\u003eEntity–Relationship Diagram of MIMIC-IV; radiology and discharge tables from\u003c/em\u003e mimiciv_note \u003cem\u003eand remaining tables from\u003c/em\u003e mimiciv_3_1_hosp. \u003cem\u003eOnly primary and foreign keys are shown.\u003c/em\u003e\u003c/p\u003e","description":"","filename":"floatimage1.png","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/56eba15cfdd01eb6ded15a1a.png"},{"id":95654567,"identity":"afd6269f-df03-4622-9b9f-fd15e76fae5c","added_by":"auto","created_at":"2025-11-11 16:12:28","extension":"png","order_by":2,"title":"Figure 2","display":"","copyAsset":false,"role":"figure","size":152602,"visible":true,"origin":"","legend":"\u003cp\u003eSemantic representation of aortic aneurysm in SNOMED-CT; blank nodes shown as empty circles.\u003c/p\u003e","description":"","filename":"floatimage2.png","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/f09035037fba94c826d87464.png"},{"id":95654451,"identity":"f253d5c9-d6c5-4adc-ac71-54e1f418b5ee","added_by":"auto","created_at":"2025-11-11 16:11:59","extension":"png","order_by":3,"title":"Figure 3","display":"","copyAsset":false,"role":"figure","size":362564,"visible":true,"origin":"","legend":"\u003cp\u003ePipeline for automatic generation of epidemiology reports from MIMIC-IV integrating SNOMED-guided concept expansion, LLM-assisted SQL synthesis, and analysis/visualization.\u003c/p\u003e\n\u003cp\u003eThe RealEpi pipeline for automatic generation of epidemiology reports from MIMIC-IV is summarized in Figure 3.\u003c/p\u003e","description":"","filename":"floatimage3.png","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/370389488e304263b3ff71fe.png"},{"id":95541036,"identity":"3d98d4e6-e62c-4e2b-9ef5-a998e715cdc2","added_by":"auto","created_at":"2025-11-10 11:37:27","extension":"jpeg","order_by":4,"title":"Figure 4","display":"","copyAsset":false,"role":"figure","size":107133,"visible":true,"origin":"","legend":"\u003cp\u003e\u003cem\u003eSample cohort visualizations: (A) monthly admissions, (B) LOS distribution, (C) LOS by admission type.\u003c/em\u003e\u003c/p\u003e","description":"","filename":"floatimage4.jpeg","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/527f03f42ed2eef3abc85023.jpeg"},{"id":103240342,"identity":"15c74cdf-3b6b-4622-a25f-b08d5fb77f14","added_by":"auto","created_at":"2026-02-23 13:57:17","extension":"pdf","order_by":0,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":1873028,"visible":true,"origin":"","legend":"","description":"","filename":"manuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/0ab6a48c-3030-4407-91f2-0d466897031c.pdf"},{"id":95541041,"identity":"139fb37c-293d-4c1a-b880-995d74f39d85","added_by":"auto","created_at":"2025-11-10 11:37:27","extension":"docx","order_by":0,"title":"","display":"","copyAsset":false,"role":"supplement","size":439644,"visible":true,"origin":"","legend":"","description":"","filename":"SupplementaryMaterial.docx","url":"https://assets-eu.researchsquare.com/files/rs-7660197/v1/5b72691033c82aa513920776.docx"}],"financialInterests":"No competing interests reported.","formattedTitle":"Automating Epidemiology Report Generation from the MIMIC-IV Clinical Database using SNOMED CT and SQL","fulltext":[{"header":"BACKGROUND AND SIGNIFICANCE","content":"\u003cp\u003eElectronic health records (EHRs) provide at scale both structured data and narrative clinical text, enabling observational studies but also exposing bottlenecks in reproducible cohorting and analysis (\u003cspan citationid=\"CR1\" class=\"CitationRef\"\u003e1\u003c/span\u003e). Public resources such as MIMIC‑IV have catalyzed secondary use of EHR data for epidemiology and outcomes research (\u003cspan citationid=\"CR2\" class=\"CitationRef\"\u003e2\u003c/span\u003e). In parallel, digital knowledge infrastructures extend beyond patient data to support evidence retrieval and semantic interoperability: PubMed, maintained by the National Library of Medicine, enables large-scale discovery and synthesis of biomedical literature and clinical trial results (\u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e3\u003c/span\u003e); the OBO Foundry provides open, computable ontologies that standardize biological and medical vocabularies (\u003cspan citationid=\"CR4\" class=\"CitationRef\"\u003e4\u003c/span\u003e); SNOMED CT serves as a globally adopted clinical terminology for consistent documentation and analysis (\u003cspan citationid=\"CR5\" class=\"CitationRef\"\u003e5\u003c/span\u003e); and Wikidata functions as a collaborative, cross-linked knowledge graph integrating biomedical data from diverse sources (\u003cspan citationid=\"CR6\" class=\"CitationRef\"\u003e6\u003c/span\u003e).\u003c/p\u003e\u003cp\u003eDespite progress in machine learning, natural language processing, and information retrieval, end‑to‑end epidemiologic workflows remain labor‑intensive, error‑prone, and difficult to scale or reproduce (\u003cspan citationid=\"CR1\" class=\"CitationRef\"\u003e1\u003c/span\u003e, \u003cspan citationid=\"CR7\" class=\"CitationRef\"\u003e7\u003c/span\u003e, \u003cspan citationid=\"CR8\" class=\"CitationRef\"\u003e8\u003c/span\u003e). The field is moving toward automation, but practical systems must balance efficiency with transparency and governance (\u003cspan additionalcitationids=\"CR10\" citationid=\"CR9\" class=\"CitationRef\"\u003e9\u003c/span\u003e\u0026ndash;\u003cspan citationid=\"CR11\" class=\"CitationRef\"\u003e11\u003c/span\u003e). Tooling has matured across several steps: RobotReviewer and Rayyan reduce manual burden in study screening and appraisal (\u003cspan citationid=\"CR12\" class=\"CitationRef\"\u003e12\u003c/span\u003e, \u003cspan citationid=\"CR13\" class=\"CitationRef\"\u003e13\u003c/span\u003e); i2b2 and OHDSI/OMOP improve data standardization and query portability across health systems (\u003cspan citationid=\"CR14\" class=\"CitationRef\"\u003e14\u003c/span\u003e, \u003cspan citationid=\"CR15\" class=\"CitationRef\"\u003e15\u003c/span\u003e). Domain‑specific language models trained on clinical corpora (for example, ClinicalBERT and GatorTron) and multimodal learning frameworks expand what can be extracted from clinical text and signals, but they also surface challenges in interoperability, bias, and explainability that limit adoption without careful validation (\u003cspan additionalcitationids=\"CR17 CR18\" citationid=\"CR16\" class=\"CitationRef\"\u003e16\u003c/span\u003e\u0026ndash;\u003cspan citationid=\"CR19\" class=\"CitationRef\"\u003e19\u003c/span\u003e).\u003c/p\u003e\u003cp\u003eThis work addresses these gaps with RealEpi, a reproducible pipeline that couples terminology‑guided querying of SNOMED CT with large‑language‑model\u0026ndash;assisted SQL synthesis to automate cohort definition, analysis, and visualization from MIMIC‑IV. RealEpi integrates structured data and de‑identified clinical notes, produces auditable tables and figures, and adds concept co‑occurrence networks for interpretable summaries. We demonstrate feasibility on aortic aneurysm and outline governance steps to manage non‑determinism and generalizability.\u003c/p\u003e"},{"header":"MATERIALS AND METHODS","content":"\u003cp\u003e\u003cstrong\u003eSystem Design\u0026nbsp;\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eWe developed RealEpi, a modular pipeline that automates cohort definition, extraction of structured and unstructured EHR data, statistical reporting, and network analysis. We instantiated RealEpi for aortic aneurysm using MIMIC-IV v3.1 and SNOMED CT International Edition (2025-08-01). The study is retrospective and observational. To assess generalizability, we repeated the complete pipeline on an unrelated condition, upper respiratory infection (URTI), without modifying code beyond the root SNOMED concept and label set. Prompts, SQL predicates, and outputs were archived identically (Supplementary Appendix B)\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eData Sources\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eMIMIC-IV v3.1 (hospital and note modules)\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eWe used demographics, admissions, diagnoses and procedures (ICD-9/10), labs, medications, microbiology, de-identified discharge summaries, and radiology reports. ICU high-frequency tables were not used. Records were linked with patient id, hospital admission id and ICU stay id. Dates are de-identified with patient-specific offsets. An entity\u0026ndash;relationship diagram of the MIMIC-IV v3.1 hospital and note modules is shown in Figure 1 to illustrate table linkages used for cohort construction (2).\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cem\u003eSNOMED CT\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eSNOMED CT was used to expand the disease concept and to label entities; vendor SNOMED\u0026rarr;ICD maps were referenced for comparison. The semantic expansion of aortic aneurysm concepts in SNOMED-CT is visualized in Figure 2, demonstrating hierarchical and equivalent class structure (5).\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ePipeline\u003cbr\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThe RealEpi pipeline for automatic generation of epidemiology reports from MIMIC-IV is summarized in Figure 3.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cem\u003e1) Cohort selection\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eOntology Processing and Label Harvest\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eWe converted the SNOMED CT RF2 release to OWL using SNOMED2OWL, then to RDF/Turtle using ROBOT. We queried the graph with RDFLib and SPARQL to retrieve the target concept, all descendants, and equivalent‑class definitions. The query followed the recursive pattern \u003cem\u003erdfs:subClassOf* | owl:equivalentClass/owl:intersectionOf/rdf:rest*/rdf:first\u003c/em\u003e to capture hierarchical and logical variants. We harvested preferred labels and synonyms via \u003cem\u003est:Description.term.en-us.preferred\u003c/em\u003e, \u003cem\u003est:Description.term.en-us.synonym\u003c/em\u003e, and \u003cem\u003erdfs:label\u003c/em\u003e. (20\u0026ndash;22)\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eLLM-assisted SQL synthesis\u0026nbsp;\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eWe used a large language model (gemini‑2.5‑flash) to generate a single WHERE condition over ICD titles from the SNOMED-derived label set (Boolean LIKE patterns only). Because outputs vary across runs, we archived all prompts. The structured prompt template used to constrain SQL generation from SNOMED-derived labels is provided in Supplementary Figure S1. \u003cstrong\u003eMethod A1\u003c/strong\u003e was prespecified for analysis. (23)\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eStudy design\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eAdmissions with the condition as primary diagnosis were included. We compared retrieval with vs without SNOMED-guided terms to assess coverage; cohort flow and counts were logged. Primary outcomes: LOS, discharge disposition (home, rehab/nursing, hospice, other facility, against medical advice, death), and in-hospital mortality. Key covariates are listed below in data extraction phase.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cem\u003e2) Data extraction\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eStructured data\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eFrom hospital tables, we capture age, sex, race, admission type, BMI and BP from OMR within 48 hours, labs in the same 48 hours (top 40 tests), microbiology test names, procedures (ICD/HCPCS), medications. Additionally we flag labs as elevated/reduced against reference ranges.\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eUnstructured data.\u0026nbsp;\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eWe retrieve the full discharge summary and the earliest report of each of the six most common radiology exam types within 2 days of admission. Then we link to the index admission diagnosis.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cem\u003e3) Statistical Analysis\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eWe summarized continuous variables with mean, standard deviation, median, and IQR; and for categorical variables with counts and percentages. We estimated 95% confidence intervals for proportions. For group comparisons we used t‑tests for continuous variables and \u0026chi;\u0026sup2; or Fisher\u0026rsquo;s exact tests for categorical variables, as appropriate. We quantified effect sizes for continuous outcomes using standardized signal mean difference (SSMD) and reported exact two‑sided P‑values. We trained a logistic regression to predict discharge to home, using age, sex, comorbidities, LOS, selected labs, and procedures as predictors. We performed a standard train\u0026ndash;test split and reported accuracy and the confusion matrix; coefficients were tabulated for interpretability. Formulas and SQL used to compute LOS and abnormality flags are provided in Supplementary Methods.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cem\u003e4) Co-word analysis\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eNamed‑entity recognition and mapping\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eWe retrieved the full discharge summary and the earliest report of each of the six most common radiology exam types performed within two days of admission. We ran named‑entity recognition with spaCy \u003cem\u003een_core_web_sm\u003c/em\u003e, then resolved spans to SNOMED CT by string matching against harvested labels and synonyms. We assigned each resolved concept to a first‑order SNOMED metaclass using the same recursive SPARQL pattern used in ontology processing.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eConcept Co‑occurrence Networks\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eWe built undirected co‑occurrence graphs per report type where nodes are resolved SNOMED concepts and edges indicate co‑mention within a report. We weighted edges by co‑occurrence counts, removed self‑loops and isolates, filtered low‑weight edges, and excluded non‑clinical categories (for example, environment, qualifier value). We visualized graphs with a force‑directed layout and provided a concept‑to‑label mapping table. Subgroup networks were generated by filtering admissions (for example, age or sex strata). (24)\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eSoftware and computational environment\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eOntology manipulation used ROBOT and RDFLib; network analysis used NetworkX; tabulation and visualization used Pandas and Matplotlib. (21,22,24) The end‑to‑end run executed on an Intel Core i7 with 15 GB RAM and 500 GB storage and for comparison, Google Colab 13.2 GB RAM, 300 GB storage, Intel Xeon CPU.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eReproducibility and transparency\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eWe versioned data snapshots (MIMIC‑IV v3.1; SNOMED CT 2025‑08‑01), archived the exact LLM prompts and returned SQL conditions, and retained all intermediate tables used for figure and table generation. Because the LLM can yield non‑deterministic outputs, we retained the A1 condition as the analysis default and stored alternative runs for audit. All SPARQL queries, SQL templates, and pipeline scripts are provided as Supplementary Material.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eEthics and data use\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eMIMIC‑IV contains de‑identified data released under data use agreements with required human‑subjects training. The underlying data collection was approved by institutional review boards for Beth Israel Deaconess Medical Center and MIT. This study used only de‑identified data.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eUse of generative AI\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eA large language model (gemini‑2.5‑flash) was used to synthesize candidate SQL conditions from SNOMED‑derived labels and to draft non‑substantive text. All outputs were reviewed and validated by the authors; the AI system is not an author.\u003c/p\u003e"},{"header":"RESULTS","content":"\u003cp\u003e\u003cstrong\u003eData sources and run characteristics\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eWe used MIMIC-IV v3.1 (release 25 Nov 2024) and the SNOMED CT International Edition (release 1 Aug 2025). The database contained 546,028 hospitalizations for 223,452 unique patients. The SNOMED CT resource comprised 7.38 million statements of medical terminology.\u003cstrong\u003e\u0026nbsp;\u003c/strong\u003eThe end-to-end pipeline ran on an Intel Core i7, 15 GB RAM, 500 GB storage system in ~3 h 10 min. The most time-consuming steps were note named-entity recognition (SpaCy) and ontology traversal with SPARQL. Conversion of SNOMED CT from RF2 to TTL required several additional hours.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eDiagnostic coverage and cohort retrieval\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eSupplementary Table S1 lists the ICD-10 diagnoses mapped from SNOMED-CT for aortic aneurysm, expanding beyond vendor cross-maps. Ontology expansion identified 142 names across 60 SNOMED CT concepts for aortic aneurysm. The vendor SNOMED to ICD‑10 cross‑map covered only 5 of 60 diagnoses (8.3 %) and included off‑target congenital umbrella terms. Large‑language‑model\u0026ndash;assisted SQL (method A1) retrieved 10 ICD‑10 diagnoses and produced a primary‑diagnosis cohort of 4,105 hospitalizations: abdominal aortic aneurysm without rupture (n = 2,075), thoracic aortic aneurysm without rupture (n = 1,284), thoracic aortic ectasia (n = 418), thoracoabdominal aortic aneurysm without rupture (n = 89), abdominal aortic ectasia (n = 82), abdominal aortic aneurysm ruptured (n = 57), congenital aneurysm of aorta (n = 55), thoracic aortic aneurysm ruptured (n = 22), thoracoabdominal aortic ectasia (n = 13), and thoracoabdominal aortic aneurysm ruptured (n = 10). LLM outputs varied across runs; A1 was used for the main analysis. Table 1 summarizes cohort retrieval by diagnosis across different SQL conditions.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cem\u003eTable 1. Summary of Aortic Aneurysm Cohort\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003ctable border=\"1\" cellspacing=\"0\" cellpadding=\"0\"\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eDomain\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eFinding / Criteria\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eN (%) or Mean [95% CI]\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003ePrimary Diagnoses\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eAbdominal aortic aneurysm, without rupture\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e2,072\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\u003cbr\u003e\u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eThoracic aortic aneurysm, without rupture\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e1,282\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\u003cbr\u003e\u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eThoracic aortic ectasia\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e418\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eComorbidities\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eHyperlipidemia, unspecified\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e2,209\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\u003cbr\u003e\u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eEssential (primary) hypertension\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e1,781\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\u003cbr\u003e\u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003ePersonal history of nicotine dependence\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e1,716\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eLaboratory Findings\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003ePatients with any abnormal labs\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e3,753 (91.5%)\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\u003cbr\u003e\u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eRed Blood Cells (Reduced)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e3,099\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\u003cbr\u003e\u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eHemoglobin (Reduced)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e3,044\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\u003cbr\u003e\u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eHematocrit (Reduced)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e2,857\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\u003cbr\u003e\u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eGlucose (Elevated)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e2,752\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\u003cbr\u003e\u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eRDW-SD (Elevated)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e2,284\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eAnthropometrics \u0026amp; Vitals\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eBody Mass Index (BMI), mean\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e32.6\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\u003cbr\u003e\u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eSystolic blood pressure at admission, mean\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e98.8 mmHg\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\u003cbr\u003e\u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eDiastolic blood pressure at admission, mean\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e63.6 mmHg\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eHospitalization Metrics\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eLength of stay (days), mean\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e6.94 [6.68\u0026ndash;7.21]\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eOutcomes\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eDischarged home\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e1,011 (24.7% [23.3\u0026ndash;26.0])\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\u003cbr\u003e\u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eDischarged to rehab/nursing facility\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e759 (18.5% [17.3\u0026ndash;19.7])\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\u003cbr\u003e\u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eIn-hospital deaths\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e153 (3.7% [3.2\u0026ndash;4.3])\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eClinical results\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eBaseline characteristics and outcomes\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eFigure 4 presents sample visualizations of the cohort, including admission counts per month, LOS distribution, and LOS stratified by admission type. Any abnormal laboratory was present in 3,753 admissions (91.5 %). Mean length of stay was 6.94 days (95 % CI 6.68\u0026ndash;7.21). Disposition at discharge was home in 1,011 cases (24.7 %, 95 % CI 23.3\u0026ndash;26.0), rehabilitation or nursing in 759 (18.5 %, 95 % CI 17.3\u0026ndash;19.7), and in‑hospital death in 153 (3.7 %, 95 % CI 3.2\u0026ndash;4.3). Available admission vitals showed mean systolic blood pressure 98.8 mmHg and diastolic 63.6 mmHg; mean BMI was 32.6 kg/m\u0026sup2;.\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eFrequent abnormal laboratories\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eThe most common abnormalities were red blood cells decreased (n = 3,099), hemoglobin decreased (n = 3,044), hematocrit decreased (n = 2,857), glucose increased (n = 2,752), and RDW‑SD increased (n = 2,284).\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eProcedures and clinical outcomes\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cem\u003eTable 2. Summary of Common Procedures in Aortic Aneurysm Cohort\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003ctable border=\"1\" cellspacing=\"0\" cellpadding=\"0\"\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eProcedure\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eCount\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eMean DOS (days) [95% CI]\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eDOS SSMD\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eMortality % [95% CI]\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eMortality p-value\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eMortality vs Population\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eMean Age (years) [95% CI]\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eAge SSMD\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003ePerformance of Cardiac Output, Continuous\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e463\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e10.50 [9.61\u0026ndash;11.39]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0.309\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e2.6 [1.1\u0026ndash;4.0]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0.214\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eLower\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e63.2 [62.1\u0026ndash;64.3]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e-0.514\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eInsertion of Infusion Device into Superior Vein\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e293\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e17.91 [16.21\u0026ndash;19.60]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0.714\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e17.1 [12.8\u0026ndash;21.4]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u0026lt;0.001\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eHigher\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e70.7 [69.3\u0026ndash;72.1]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e-0.009\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eReplacement of Thoracic Aorta, Ascending/Arch\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e226\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e10.67 [9.46\u0026ndash;11.88]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0.311\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e1.8 [0.1\u0026ndash;3.5]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0.145\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eLower\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e61.9 [60.3\u0026ndash;63.4]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e-0.570\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eIntroduction of Nutritional Substance into Upper GI Tract\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e206\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e25.34 [22.72\u0026ndash;27.96]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0.961\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e21.8 [16.2\u0026ndash;27.5]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u0026lt;0.001\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eHigher\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e72.1 [70.5\u0026ndash;73.6]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0.080\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eFluoroscopy of Multiple Coronary Arteries\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e198\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e10.60 [8.96\u0026ndash;12.23]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0.265\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e5.1 [2.0\u0026ndash;8.1]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0.417\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eHigher\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e65.4 [63.8\u0026ndash;66.9]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e-0.355\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eUltrasonography of Heart with Aorta\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e180\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e11.59 [10.18\u0026ndash;13.00]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0.377\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e1.1 [0.0\u0026ndash;2.6]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0.067\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eLower\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e64.6 [62.9\u0026ndash;66.4]\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e-0.387\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003eAssociations between selected procedures and hospitalization outcomes are presented in Table 2. Procedure‑level summaries showed heterogeneous associations with utilization and outcomes. Examples include: insertion of infusion device into the superior venous system (n = 293) with mean LOS 17.91 days (95 % CI 16.21\u0026ndash;19.60), SSMD 0.714, and mortality 17.1 % (95 % CI 12.8\u0026ndash;21.4 %, p\u0026lt;0.001); introduction of nutritional substance into upper GI (n = 206) with mean LOS 25.34 days (95 % CI 22.72\u0026ndash;27.96), SSMD 0.961, and mortality 21.8 % (95 % CI 16.2\u0026ndash;27.5 %, p\u0026lt;0.001). In contrast, ultrasonography of heart with aorta (n = 180) had mean LOS 11.59 days (95 % CI 10.18\u0026ndash;13.00), SSMD 0.377, and mortality 1.1 % (95 % CI 0.0\u0026ndash;2.6 %, p = 0.067). These patterns indicate that higher‑intensity supportive procedures co‑occur with longer stays and higher mortality, consistent with disease severity.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eDischarge disposition by sex\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eA contingency analysis of discharge location by sex showed strong dependence (\u0026chi;\u0026sup2; = 55.67, df = 11, p = 5.83\u0026times;10⁻⁸). Counts illustrative of the pattern include home health care (male 928 vs female 446), home (male 735 vs female 276), and death (male 104 vs female 50). Supplementary Table S3 shows discharge location stratified by sex, with a significant chi-square test result (p \u0026lt; 0.001).\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cem\u003ePrediction of discharge home\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eSupplementary Table S4 lists coefficients from the logistic regression predicting discharge home, with an overall accuracy of 0.75. Positive coefficients were observed for surgical same‑day admission and emergency admissions, and for several race categories; negative coefficients were observed for observation‑type admissions and transfer from skilled nursing. Full coefficient tables are provided in the supplementary results.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eSystem results\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cem\u003eConcept networks from clinical notes\u003c/em\u003e\u003c/strong\u003e\u003cbr\u003e\u0026nbsp;Entity extraction from discharge and radiology narratives produced interpretable co‑occurrence graphs. In chest portable AP reports, high‑frequency nodes included pleural effusion, cardiomegaly, pneumonia, atelectasis, pneumothorax, endotracheal tube, and pulmonary edema, with edges reflecting expected clinical co‑mentions. Subgroup filtering by age or sex yielded similar semantic neighborhoods with differing weights. A co-occurrence network of SNOMED-CT concepts extracted from chest radiology narratives is shown in Supplementary Figure S2, highlighting clusters such as pleural effusion and cardiomegaly.\u003c/p\u003e"},{"header":"DISCUSSION","content":"\u003cp\u003eWe show that \u003cstrong\u003eterminology‑guided prompting with SNOMED CT plus LLM‑assisted SQL\u003c/strong\u003e can automate the end‑to‑end production of an epidemiology report from EHR data, with auditable logic and integrated analysis of structured variables and clinical text. On MIMIC‑IV, this approach expanded diagnostic capture beyond vendor cross‑maps, delivered a 4,105‑admission cohort with reproducible tables, figures, and concept networks, and finished on commodity hardware. The result addresses a persistent gap between available informatics capacity (ML/NLP/IR) and practical, reproducible epidemiology pipelines. Repeating the pipeline on URTI, a high‑prevalence respiratory condition with very different code distributions and note semantics, yielded comparable automation and interpretable outputs, supporting portability beyond aortic aneurysm.\u003c/p\u003e\n\u003cp\u003eAutomation efforts have historically targeted single steps: screening and bias appraisal (RobotReviewer, Rayyan) data standardization and reuse (i2b2, OMOP/OHDSI), and EHR cohort ETL (DExtER)\u0026nbsp;(12\u0026ndash;14,25). \u0026nbsp;Large language models now support screening and data extraction with high accuracy, but typical deployments remain tool‑specific rather than \u003cstrong\u003epipeline‑level\u003c/strong\u003e\u003cstrong\u003e(7,26,27)\u003c/strong\u003e. Our contribution is a \u003cstrong\u003edisease‑agnostic path from ontology to SQL to cohort to report\u003c/strong\u003e that keeps transformation logic visible, tracks versions of prompts and ontologies, and unifies structured and narrative data in one run. This design positions the proposed framwork as a complement to CDMs and review tools rather than a replacement, closing the loop between cohort definition and analysis at publication grade.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eRelying on single‑level ICD title matching risks \u003cstrong\u003egranularity and coverage gaps\u003c/strong\u003e. SNOMED CT offers polyhierarchy, post‑coordination, and curated synonyms that better represent clinical variability (5,28,29). Traversing descendants and equivalent classes via SPARQL exposes label diversity that vendor cross‑maps may not capture\u0026nbsp;(21,28\u0026ndash;30). In our case study, the cross‑map surfaced \u003cstrong\u003eonly 5 of 60\u003c/strong\u003e aortic‑aneurysm‑related concepts (8.3%), whereas SNOMED traversal provided \u003cstrong\u003e142 names across 60 concepts\u003c/strong\u003e, enabling broader ICD retrieval once translated into SQL. These observations align with reports that terminology binding and cross‑system mapping require methodical handling to avoid under‑ or over‑inclusion\u0026nbsp;(29,30). \u003cstrong\u003eSo,\u003c/strong\u003e anchor cohorts in a \u003cstrong\u003eterminology‑first\u003c/strong\u003e step, then translate to database filters. This improves recall without pre‑committing to brittle ICD enumerations, and it leaves a reviewable audit trail.\u003c/p\u003e\n\u003cp\u003eGeneric text‑to‑SQL can be powerful but variable (31,32). We constrained generation with (a) a narrow Boolean grammar over LIKE patterns, (b) a required include‑list of SNOMED‑derived labels, and (c) archiving of the \u003cstrong\u003eexact\u003c/strong\u003e prompt and condition string. We observed \u003cstrong\u003enon-determinism\u003c/strong\u003e across runs\u0026mdash;a known issue in text‑to‑SQL\u0026mdash;which we treated as an analysis choice by fixing \u0026ldquo;A1\u0026rdquo; for the main results and retaining alternates for audit (31,32). \u003cstrong\u003eMitigations for production can be a\u0026nbsp;\u003c/strong\u003ezero temperature decoding; seeded runs; regex validation against a white‑listed schema; k‑of‑n voting across low‑variance generations; unit tests that verify that known positive and negative ICD titles are included or excluded; continuous diffs of cohort membership after ontology or model updates (31,32).\u003c/p\u003e\n\u003cp\u003eMost EHR pipelines underuse unstructured notes despite evidence that narratives add signal for phenotyping and outcomes\u0026nbsp;(33\u0026ndash;36). We performed NER over discharge and radiology reports, linked entities to SNOMED CT via the same label inventory used for cohorting, and summarized topics as \u003cstrong\u003eco‑occurrence graphs\u003c/strong\u003e. The approach follows established practice in content co‑occurrence analysis and aligns with emerging SNOMED entity‑linking benchmarks in clinical text (37,38). The resulting networks surfaced expected neighborhoods (for example, pleural effusion or cardiomegaly or pneumonia in chest radiography narratives), offering an interpretable summary of free‑text at cohort scale. The trade-offs of dictionary‑anchored linking is transparent and fast to review, but it can miss context, negation, and temporality. Prior evaluations show entity‑linking performance varies by concept family and dataset (39,40). Future iterations can add assertion detection and section‑aware parsing, and can benchmark against shared tasks\u0026nbsp;(38\u0026ndash;40).\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eDescriptive results and procedure associations were clinically coherent: \u003cstrong\u003ehigh‑intensity supportive procedures\u003c/strong\u003e co‑occurred with longer stays and higher mortality; ultrasound and diagnostic fluoroscopy clustered with lower mortality, consistent with indication patterns rather than causal effects. The discharge‑home model achieved accuracy 0.75, which is reasonable for a first pass but insufficient without discrimination, calibration, and decision‑curve reporting (41,42). Observational EHR analyses remain susceptible to confounding, selection bias, and misclassification; sensitivity analyses and explicit causal framing are necessary in future work (41,43). Report AUC and Brier score; provide calibration intercept and slope; present adjusted odds ratios with 95% CIs for key predictors; conduct subgroup performance checks across age, sex, and race; examine robustness to alternative cohort definitions and to removal of procedures that are proxies for severity\u0026nbsp;(41\u0026ndash;43). Supplementary Table S5 compares prior MIMIC-based studies of aortic aneurysm with our cohorting approach, showing broader capture via SNOMED-guided SQL.\u003c/p\u003e\n\u003cp\u003eWe versioned the \u003cstrong\u003edata sources\u003c/strong\u003e (MIMIC‑IV v3.1; SNOMED CT 2025‑08‑01), stored \u003cstrong\u003eprompts and returned SQL\u003c/strong\u003e, and exported \u003cstrong\u003eintermediate tables\u003c/strong\u003e that feed every figure and statistic. This meets core expectations for reusability and audit in informatics (4,9,44). We recommend publishing: (1) the root SNOMED concept and the exact SPARQL query (21,22); (2) the frozen SQL predicate; and (3) hashes of the data snapshot and ontology release. Such artifacts allow external teams to reproduce both the \u003cstrong\u003ecohort membership\u003c/strong\u003e and the \u003cstrong\u003eanalysis outputs\u003c/strong\u003e precisely.\u003c/p\u003e\n\u003cp\u003eRuntime was dominated by note‑level NER and ontology traversal on a modest workstation (\u0026asymp;3 h 10 min). This mirrors known costs of entity‑centric pipelines and ontology reasoning at scale (39,40). Engineering options include caching SNOMED traversals, using precompiled label tries, parallelizing NER, and moving link resolution to vector indexes with exact‑term fallbacks. Modular architecture patterns from clinical software can help isolate these components for scaling and substitution (45).\u003c/p\u003e\n\u003cp\u003eAutomating parts of evidence generation raises methodological and governance duties. First, \u003cstrong\u003ehuman‑in‑the‑loop\u003c/strong\u003e review remains essential at boundary decisions (phenotype edges, exclusion logic), consistent with best practice in semi‑automated evidence synthesis (7,10,26,27,46). Second, transparency about the role of generative AI is required in the manuscript (AI contribution statement), and models should \u003cstrong\u003enot\u003c/strong\u003e be considered authors. Third, observational outputs should be framed descriptively unless causal identification strategy is explicit (43).\u003c/p\u003e\n\u003cp\u003eRealEpi offers a \u003cstrong\u003etemplate pattern\u003c/strong\u003e to go from clinical concept to cohort to publication‑grade outputs with visible SQL and versionable prompts. It can coexist with i2b2 or OMOP and feed registry or quality‑improvement programs (14,15).\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eFor clinical researchers:\u003c/strong\u003e Disease‑agnostic reuse lowers the marginal cost of new descriptive studies; ontology anchoring reduces re‑work around code lists; integrated note mining surfaces context that structured fields miss\u0026nbsp;(1,33\u0026ndash;36).\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eFor policy and surveillance:\u003c/strong\u003e With determinization and validation, the pattern can power routine, refreshable situational awareness from operational EHRs, provided proper data governance and latency controls are in place (9,11).\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eLimitations\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThis work has several limitations. First, the pipeline is computationally intensive: named-entity recognition and SNOMED CT resolution are slow, constraining scalability on standard workstations. Similar bottlenecks have been reported in other ontology-driven pipelines and in SpaCy-based entity linking (39,40). Second, the current implementation is optimized for batch analysis of curated, historical data, not for real-time use in operational EHR systems. In practice, live EHR data often contain missing or inconsistent values (e.g., labs, procedures), which could reduce the reliability of derived statistics and co-word networks (43). Third, the clinical findings should be interpreted cautiously. Associations such as higher mortality among patients undergoing multiple procedures likely reflect confounding by severity and reverse causality, not causal effects. Observational analyses remain vulnerable to unmeasured confounders, reinforcing the need for expert interpretation and sensitivity analyses (43). Finally, LLM-assisted SQL generation introduces variability. Outputs are non-deterministic and may require repeated runs or manual review. While SNOMED CT expansion improves coverage, mapping to ICD codes is imperfect due to differences in granularity, which may under- or over-represent some subgroups. Variability in text-to-SQL generation is a recognized challenge, with ongoing work exploring prompt engineering, post-processing, and governance mechanisms to stabilize outputs (32). Generalizability was demonstrated across two conditions within a single EHR corpus; multi‑site validation and cross‑CDM evaluation remain future work.\u003c/p\u003e"},{"header":"CONCLUSION","content":"\u003cp\u003eThis study shows that terminology-guided prompting with SNOMED CT and LLM-assisted SQL can automate end-to-end epidemiology reporting from EHRs, demonstrated on MIMIC-IV with a 4,105-admission aortic aneurysm cohort. The RealEpi pipeline integrated structured and narrative data to generate reproducible tables, figures, and concept networks within hours on commodity hardware, expanding diagnostic capture beyond vendor cross-maps while maintaining auditable logic. Although limitations include non-determinism in LLM outputs, SNOMED-ICD granularity mismatches, and computational overhead in note processing, the framework establishes a scalable, transparent, and terminology-anchored pathway for automated descriptive epidemiology with future potential in multi-site validation, real-time surveillance, and population health monitoring.\u003c/p\u003e"},{"header":"Declarations","content":"\u003ch2\u003eCOMPETING INTERESTS\u003c/h2\u003e\n\u003cp\u003eThe authors declare no competing interests related to this study.\u003c/p\u003e\n\u003ch2\u003eFUNDING\u003c/h2\u003e\n\u003cp\u003eThis work was supported by the Saudi National Institute of Health (Saudi NIH) under Grant PRI01-2401-KAU19-46641119.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eClinical Trial Number:\u003c/strong\u003e not applicable.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eConsent to Publish declaration: \u003c/strong\u003enot applicable\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eConsent to Participate declaration:\u003c/strong\u003e not applicable\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eEthics declaration:\u003c/strong\u003e not applicable\u003c/p\u003e\n\u003ch2\u003eAuthor Contribution\u003c/h2\u003e\n\u003cp\u003eHT and AHA conceived the study design and supervised the project. HT developed the ontology processing workflows and implemented the SNOMED CT\u0026ndash;based methods. NAP conducted statistical analyses, clinical interpretation, and validation of results. AA managed database queries, assisted with data extraction, and contributed to integration of structured and unstructured data. AHA coordinated the research team, secured funding, and provided oversight of epidemiological methodology. HT and AHA drafted the main manuscript text. NAP and AA prepared figures, tables, and supplementary materials. All authors critically revised the manuscript for important intellectual content and approved the final version.\u003c/p\u003e\n\u003ch2\u003eAcknowledgement\u003c/h2\u003e\n\u003cp\u003eThe authors thank the MIT Laboratory for Computational Physiology for maintaining the MIMIC database and SNOMED International for providing access to clinical terminology resources. We also acknowledge the contributions of the open-source developer communities behind ROBOT, RDFLib, spaCy, NetworkX, and Pandas, whose tools were essential for this work. The authors additionally thank Ala Essa, Meshael Almogrin and Makram Koubaa for their valuable support and contributions to this project.\u003c/p\u003e\n\u003ch2\u003eData Availability\u003c/h2\u003e\n\u003cp\u003eThis study used the publicly available MIMIC-IV v3.1 clinical database, which is hosted by the MIT Laboratory for Computational Physiology. Access requires completion of the required credentialing process and signing of a data use agreement. The dataset can be obtained at:https://physionet.org/content/mimiciv/3.1/The SNOMED CT International Edition (release 2025-08-01) was obtained under license from SNOMED International. Access is available to registered users via:https://www.snomed.org/snomed-ct/get-snomedAll pipeline code, SQL templates, SPARQL queries, prompt archives, and figure-generating tables supporting this study have been deposited in supplement file\u003c/p\u003e"},{"header":"References","content":"\u003col\u003e\n\u003cli\u003eDatta S, Bernstam EV, Roberts K. A frame semantic overview of NLP-based information extraction for cancer-related EHR notes. J Biomed Inform. 2019;100:103301. \u003c/li\u003e\n\u003cli\u003eJohnson AE, Bulgarelli L, Shen L, Gayles A, Shammout A, Horng S, et al. MIMIC-IV, a freely accessible electronic health record dataset. Sci Data. 2023;10(1):1. \u003c/li\u003e\n\u003cli\u003eWhite J. PubMed 2.0. Med Ref Serv Q. 1 oct 2020;39(4):382‑7. \u003c/li\u003e\n\u003cli\u003eJackson R, Matentzoglu N, Overton JA, Vita R, Balhoff JP, Buttigieg PL, et al. OBO Foundry in 2021: operationalizing open data principles to evaluate ontologies. Database. 2021;069. \u003c/li\u003e\n\u003cli\u003eChang E, Mostafa J. The use of SNOMED CT, 2013-2020: a literature review. J Am Med Inform Assoc. 2021;28(9):2017‑26. \u003c/li\u003e\n\u003cli\u003eTurki H, Shafee T, Hadj Taieb MA, Ben Aouicha M, Vrandečić D, Das D, et al. Wikidata: A large-scale collaborative ontological medical database. J Biomed Inform. 2019;99:103292. \u003c/li\u003e\n\u003cli\u003eGe L, Agrawal R, Singer M, Kannapiran P, Castro Molina JA, Teow KL, et al. Leveraging artificial intelligence to enhance systematic reviews in health research: advanced tools and challenges. Syst Rev. 2024;13(1):269. \u003c/li\u003e\n\u003cli\u003eAlbu E, Gao S, Stinjen P, Rademakers FE, Bussel BC, Collyer T, et al. Challenges and recommendations for Electronic Health Records data extraction and preparation for dynamic prediction modelling in hospitalized patients - a practical guide. 2025. \u003c/li\u003e\n\u003cli\u003eMusslick S, Bartlett LK, Chandramouli SH, Dubova M, Gobet F, Griffiths TL, et al. Automating the practice of science: Opportunities, challenges, and implications. Proc Natl Acad Sci. 2025;122(5):2401238121. \u003c/li\u003e\n\u003cli\u003eOfori-Boateng R, Aceves-Martins M, Wiratunga N, Moreno-Garcia CF. Towards the automation of systematic reviews using natural language processing, machine learning, and deep learning: a comprehensive review. Artif Intell Rev. 2024;57(8):200. \u003c/li\u003e\n\u003cli\u003eSung J, Hopper JL. Co-evolution of epidemiology and artificial intelligence: challenges and opportunities. Int J Epidemiol. 2023;52(4):969‑73. \u003c/li\u003e\n\u003cli\u003eMarshall IJ, Kuiper J, Wallace BC. RobotReviewer: evaluation of a system for automatically assessing bias in clinical trials. J Am Med Inform Assoc. 2016;23(1):193‑201. \u003c/li\u003e\n\u003cli\u003eOuzzani M, Hammady H, Fedorowicz Z, Elmagarmid A. Rayyan\u0026mdash;a web and mobile app for systematic reviews. Syst Rev. 2016;5(1):210. \u003c/li\u003e\n\u003cli\u003eKlann JG, Abend A, Raghavan VA, Mandl KD, Murphy SN. Data interchange using i2b2. J Am Med Inform Assoc. 2016;23(5):909‑15. \u003c/li\u003e\n\u003cli\u003eReinecke I, Zoch M, Reich C, Sedlmayr M, Bathelt F. The usage of OHDSI OMOP\u0026ndash;a scoping review. In: German Medical Data Sciences 2021: Digital Medicine: Recognize\u0026ndash;Understand\u0026ndash;Heal. Kiel, Germany: IOS Press; 2021. p. 95‑103. \u003c/li\u003e\n\u003cli\u003eHuang K, Altosaar J, Ranganath R. ClinicalBERT: Modeling clinical notes and predicting hospital readmission. In: CHIL 2020 Workshop. Toronto, Canada: ACM; 2020. \u003c/li\u003e\n\u003cli\u003eYang X, Chen A, PourNejatian N, Shin HC, Smith KE, Parisien C, et al. A large language model for electronic health records. NPJ Digit Med. 2022;5(1):194. \u003c/li\u003e\n\u003cli\u003eHamilton AJ, Strauss AT, Martinez DA, Hinson JS, Levin S, Lin G, et al. Machine learning and artificial intelligence: applications in healthcare epidemiology. Antimicrob Steward Healthc Epidemiol. 2021;1(1):28. \u003c/li\u003e\n\u003cli\u003eKline A, Wang H, Li Y, Dennis S, Hutch M, Xu ZW, et al. Multimodal machine learning in precision health: A scoping review. NPJ Digit Med. 2022;5(1):171. \u003c/li\u003e\n\u003cli\u003eSolbrig HR, Prud\u0026rsquo;hommeaux E, Jiang G. Blending FHIR RDF and OWL. In: Proceedings of the 10th International Conference on Semantic Web Applications and Tools for Health Care and Life Sciences (SWAT4LS 2017. Rome, Italy: CEUR-WS.org; 2017. \u003c/li\u003e\n\u003cli\u003eJackson RC, Balhoff JP, Douglass E, Harris NL, Mungall CJ, Overton JA. ROBOT: a tool for automating ontology workflows. BMC Bioinformatics. 2019;20(1):407. \u003c/li\u003e\n\u003cli\u003eKrech D, Grimnes GA, Higgins G, Hees J, Aucamp I, Lindstr\u0026ouml;m N. Disponible sur: https://github.com/RDFLib/rdflib\u003c/li\u003e\n\u003cli\u003eComanici G, Bieber E, Schaekermann M, Pasupat I, Sachdeva N, Dhillon I, et al. Gemini 2.5: Pushing the frontier with advanced reasoning, multimodality, long context, and next generation agentic capabilities. 2025. \u003c/li\u003e\n\u003cli\u003eHagberg A, Swart PJ, Schult DA. Exploring network structure, dynamics, and function using NetworkX [Internet]. 2008. Disponible sur: https://www.osti.gov/biblio/960616\u003c/li\u003e\n\u003cli\u003eGokhale KM, Chandan JS, Toulis K, Gkoutos G, Tino P, Nirantharakumar K. Data extraction for epidemiological research (DExtER): a novel tool for automated clinical epidemiology studies. Eur J Epidemiol. 2021;36(2):165‑78. \u003c/li\u003e\n\u003cli\u003eGuo E, Gupta M, Deng J, Park YJ, Paget M, Naugler C. Automated paper screening for clinical reviews using large language models: data analysis study. J Med Internet Res. 2024;26:48996. \u003c/li\u003e\n\u003cli\u003eLai H, Liu J, Bai C, Liu H, Pan B, Luo X, et al. Language models for data extraction and risk of bias assessment in complementary medicine. Npj Digit Med. 2025;8(1):74. \u003c/li\u003e\n\u003cli\u003eLee D, Cornet R, Lau F, Keizer N. A survey of SNOMED CT implementations. J Biomed Inform. 2013;46(1):87‑96. \u003c/li\u003e\n\u003cli\u003eRossander A, Lindsk\u0026ouml;ld L, Ranerup A, Karlsson D. A state-of-the art review of SNOMED CT terminology binding and recommendations for practice and research. 2021. p. 76‑88. (Methods of information in medicine; vol. 60). \u003c/li\u003e\n\u003cli\u003eLougheed MD, Thomas NJ, Wasilewski NV, Morra AH, Minard JP. Use of SNOMED CT\u0026reg; and LOINC\u0026reg; to standardize terminology for primary care asthma electronic health records. J Asthma. 2018;55(6):629‑39. \u003c/li\u003e\n\u003cli\u003eSingh A, Shetty A, Ehtesham A, Kumar S, Khoei TT. A survey of large language model-based generative ai for text-to-sql: Benchmarks, applications, use cases, and challenges. In: 2025 IEEE 15th Annual Computing and Communication Workshop and Conference (CCWC. Las Vegas, NV, USA: IEEE; 2025. p. 15‑21. \u003c/li\u003e\n\u003cli\u003eShi L, Tang Z, Zhang N, Zhang X, Yang Z. A survey on employing large language models for text-to-sql tasks. ACM Comput Surv. 2024; \u003c/li\u003e\n\u003cli\u003eTayefi M, Ngo P, Chomutare T, Dalianis H, Salvi E, Budrionis A, et al. Challenges and opportunities beyond structured data in analysis of electronic health records. Wiley Interdiscip Rev Comput Stat. 2021;13(6):1549. \u003c/li\u003e\n\u003cli\u003eZhang D, Yin C, Zeng J, Yuan X, Zhang P. Combining structured and unstructured data for predictive models: a deep learning approach. BMC Med Inform Decis Mak. 2020;20(1):280. \u003c/li\u003e\n\u003cli\u003eRuckdeschel JC, Riley M, Parsatharathy S, Chamarthi R, Rajagopal C, Hsu HS, et al. Unstructured data are superior to structured data for eliciting quantitative smoking history from the electronic health record. JCO Clin Cancer Inform. 2023;7:2200155. \u003c/li\u003e\n\u003cli\u003eVest JR, Grannis SJ, Haut DP, Halverson PK, Menachemi N. Using structured and unstructured data to identify patients\u0026rsquo; need for services that address the social determinants of health. Int J Med Inf. 2017;107:101‑6. \u003c/li\u003e\n\u003cli\u003eKlarin A. How to conduct a bibliometric content analysis: Guidelines and contributions of content co‐occurrence or co‐word literature reviews. Int J Consum Stud. 2024;48(2):13031. \u003c/li\u003e\n\u003cli\u003eDavidson R, Hardman W, Amit G, Bilu Y, Della Mea V, Galaida A, et al. SNOMED CT entity linking challenge. J Am Med Inform Assoc. 2025;32(9):1397‑406. \u003c/li\u003e\n\u003cli\u003eKulyabin M, Sokolov G, Galaida A, Maier A, Arias-Vergara T. SNOBERT: A Benchmark for clinical notes entity linking in the SNOMED CT clinical terminology. In: International Conference on Pattern Recognition. Cham: Springer Nature Switzerland; 2024. p. 154‑63. \u003c/li\u003e\n\u003cli\u003eKartchner D, Deng J, Lohiya S, Kopparthi T, Bathala P, Domingo-Fern\u0026aacute;ndez D, et al. A comprehensive evaluation of biomedical entity linking models. In: Proceedings of the Conference on Empirical Methods in Natural Language Processing. Singapore: Association for Computational Linguistics; 2023. p. 14462. \u003c/li\u003e\n\u003cli\u003eGoldstein BA, Navar AM, Pencina MJ, Ioannidis JP. Opportunities and challenges in developing risk prediction models with electronic health records data: a systematic review. J Am Med Inform Assoc. 2016;24(1):198. \u003c/li\u003e\n\u003cli\u003eCasey JA, Schwartz BS, Stewart WF, Adler NE. Using electronic health records for population health research: a review of methods and applications. Annu Rev Public Health. 2016;37(1):61‑81. \u003c/li\u003e\n\u003cli\u003eGoldstein ND. Electronic Health Records in Epidemiology: Appropriate Questions, Common Biases, and Potential Sensitivity Analyses. Curr Epidemiol Rep. 2025;12(1):11. \u003c/li\u003e\n\u003cli\u003eSchoene AM, Basinas I, Tongeren M, Ananiadou S. A narrative literature review of natural language processing applied to the occupational exposome. Int J Environ Res Public Health. 2022;19(14):8544. \u003c/li\u003e\n\u003cli\u003eBathelt F, Lorenz S, Weidner J, Sedlmayr M, Reinecke I. Application of modular architectures in the medical domain-a scoping review. J Med Syst. 2025;49(1):27. \u003c/li\u003e\n\u003cli\u003eO\u0026rsquo;Mara-Eves A, Thomas J, McNaught J, Miwa M, Ananiadou S. Using text mining for study identification in systematic reviews: a systematic review of current approaches. Syst Rev. 2015;4(1):5. \u003c/li\u003e\n\u003c/ol\u003e"}],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":true,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":false,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":false,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Epidemiology automation, Electronic health records, MIMIC-IV, Natural language processing, Knowledge engineering, SNOMED-CT, Data visualization","lastPublishedDoi":"10.21203/rs.3.rs-7660197/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-7660197/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003ch2\u003eObjective\u003c/h2\u003e\u003cp\u003eTo present a unified and modular framework for automating the epidemiological research process from cohort definition to analysis and visualization using the MIMIC-IV dataset.\u003c/p\u003e\u003ch2\u003eMaterials and Methods\u003c/h2\u003e\u003cp\u003eWe combined SNOMED-CT ontologies, prompt-engineered SQL generation, and integration of structured and unstructured electronic health record data. Statistical summaries, logistic regression, and network-based co-word analyses were generated.\u003c/p\u003e\u003ch2\u003eResults\u003c/h2\u003e\u003cp\u003eThe system successfully automated tasks such as cohort selection, ontology mapping, entity recognition, statistical analysis, and visualization. Applied to MIMIC-IV, the framework produced reproducible and interpretable epidemiological insights within hours, highlighting efficiency gains compared with manual workflows.\u003c/p\u003e\u003ch2\u003eDiscussion\u003c/h2\u003e\u003cp\u003eOur approach demonstrates methodological advances by integrating knowledge engineering, NLP, and network analysis into a reproducible pipeline. The framework enables scalable, transparent, and efficient epidemiological research but remains limited by computational demands and variability in large language model\u0026ndash;based SQL generation.\u003c/p\u003e\u003ch2\u003eConclusion\u003c/h2\u003e\u003cp\u003eThis modular pipeline illustrates a pathway toward automated, semantically grounded epidemiology reporting from EHRs, with potential applications in clinical and public health informatics.\u003c/p\u003e","manuscriptTitle":"Automating Epidemiology Report Generation from the MIMIC-IV Clinical Database using SNOMED CT and SQL","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-11-10 11:37:22","doi":"10.21203/rs.3.rs-7660197/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"af73e1d7-4625-4738-83e4-b640f3c52d88","owner":[],"postedDate":"November 10th, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2026-04-22T07:10:58+00:00","versionOfRecord":[],"versionCreatedAt":"2025-11-10 11:37:22","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-7660197","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-7660197","identity":"rs-7660197","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.