Abstract
Electronic health records (EHRs) offer a scale for medical discovery that exceeds traditional research cohorts, yet they are frequently plagued by selection bias and missing data. We present the Community Care Cohort Project (C3PO), a cohort of 520,868 individuals from the Mass General Brigham (MGB) network. By implementing an intentional sampling strategy focused on longitudinal primary care and utilizing deep natural language processing (NLP) to recover missing vital signs, we demonstrate a significant reduction in bias compared to standard EHR convenience samples. Our results show that C3PO improves the calibration of cardiovascular risk models and provides a high-fidelity framework for generalizable clinical research.
Introduction
The transition to Electronic Health Records (EHRs) has created a massive repository of "found data"—information collected during the routine course of clinical care. While these datasets offer unprecedented scale, they are not designed for research. Two primary obstacles hinder their utility: selection bias and missingness. Selection bias occurs when the patients included in a study (often "convenience samples" of anyone with available data) do not represent the broader population, frequently over-representing the acutely ill. Missingness occurs when critical data points, such as vital signs, are documented in unstructured clinical notes rather than structured tabular fields.
The Community Care Cohort Project (C3PO) was designed to address these challenges by approximating a community-based prospective cohort study within a large-scale healthcare network.
Methodology
The C3PO framework relies on three core pillars: intentional cohort design, NLP-driven data recovery, and a scalable data infrastructure.
1. The C3PO Sampling Strategy
To mitigate selection bias, the researchers moved away from broad convenience sampling. Instead, they restricted the cohort to individuals within the Mass General Brigham (MGB) system who demonstrated longitudinal engagement with primary care. Specifically, inclusion required at least two primary care visits occurring 1–3 years apart between 2001 and 2018. This "primary care first" heuristic ensures that the cohort consists of individuals receiving regular follow-up, filtering out "medical tourists" who may only appear in the system for a single specialized procedure.
2. NLP Data Recovery
To combat missing data, the team employed Bio+Discharge Summary BERT, a deep learning model pre-trained on medical text. This model was fine-tuned to extract height, weight, and blood pressure from over 75 million unstructured narrative notes. This process allowed the recovery of vital signs for patients who lacked this information in the structured tabular database.
3. The JEDI Pipeline
Managing this volume of data required the development of the Joint Extractive Data Infrastructure (JEDI). JEDI is a standardized pipeline designed to aggregate structured data, text, and imaging reports into a unified, high-performance HDF5 file system, facilitating regular updates and efficient analysis.
Results
The resulting C3PO cohort includes 520,868 individuals with a median follow-up of 7.2 years and a median of 13 primary care visits per person. The dataset is exceptionally rich, containing over 2.9 million electrocardiograms and 75 million narrative notes.
Missingness and Fidelity
The application of NLP led to a 31% reduction in missingness for vital signs, recovering data for over 80,000 individuals who would have otherwise been excluded from risk modeling. The accuracy of this recovery was high; for individuals with both tabular and NLP-extracted data, the correlation was nearly perfect (Pearson r range 0.95–0.99, p<0.01 for all).
Model Validation and Calibration
The cohort was validated using the Pooled Cohort Equations (PCE) for cardiovascular risk and the CHARGE-AF score for atrial fibrillation.
- Discrimination: Both models showed strong performance (PCE c-index: 0.724–0.770; CHARGE-AF c-index: 0.782).
- Calibration: C3PO demonstrated superior calibration compared to convenience samples. The Integrated Calibration Index (ICI) for C3PO (0.012–0.030) was significantly lower than that of convenience samples (0.028–0.046), indicating that predicted risks in C3PO more closely matched actual clinical outcomes.
Discussion
A key insight from this project is that longitudinality acts as a filter for data quality. Convenience samples often suffer from an "initial inflection" trap—a spike in new diagnoses immediately following study entry. This suggests that many "new" cases in convenience samples are actually pre-existing conditions discovered during a specialized visit. C3PO avoids this artifact, capturing true incident disease more effectively.
Furthermore, the use of NLP to recover missing data is a matter of equity as well as volume. Patients with missing tabular data are often systematically different from those with complete records. By recovering these "missing voices," NLP helps reduce the bias inherent in who gets their data structured and who does not.
Limitations and Future Directions
While C3PO represents a significant step forward, it is not without limitations. The cohort is predominantly White, which may limit generalizability to more diverse populations. Additionally, while the primary care filter reduces selection bias, "indication bias" (the reason a specific test was ordered) remains a factor in all observational EHR research.
Future work will expand the JEDI pipeline to extract laboratory values and social determinants of health from clinical notes. With its deep longitudinal records, C3PO is uniquely positioned for "trajectory modeling," allowing researchers to use AI to predict long-term health paths rather than isolated clinical events.
Conclusion
The Community Care Cohort Project demonstrates that through intentional sampling and the application of deep learning to unstructured text, EHR data can be transformed into a high-fidelity resource for clinical discovery. By mimicking the design of prospective studies, C3PO provides a blueprint for reducing bias and maximizing the generalizability of real-world evidence.
Summary updated