Accessibility settings

Published on in Vol 14 (2026)

Preprints (earlier versions) of this paper are available at https://preprints.jmir.org/preprint/99147, first published .
Doctor listening to patient's concerns during a medical consultation

Extraction of Social Determinants of Health From Patient-Reported and Clinician-Documented Measures Using Large Language Models: Algorithm Development and Validation

Extraction of Social Determinants of Health From Patient-Reported and Clinician-Documented Measures Using Large Language Models: Algorithm Development and Validation

1Thalheimer Center for Cardio-Oncology, Abramson Cancer Center, Perelman School of Medicine, University of Pennsylvania, Philadelphia, PA, United States

2Department of Medicine, Division of Cardiology, Perelman School of Medicine, University of Pennsylvania, 3400 Civic Center Boulevard, Philadelphia, PA, United States

3Department of Biostatistics, Epidemiology and Informatics, Perelman School of Medicine, University of Pennsylvania, Philadelphia, PA, United States

*these authors contributed equally

Corresponding Author:

Bonnie Ky, MSCE, MD


Background: Social determinants of health (SDOH) impact cancer and cardiovascular disease risk, yet systematic extraction of SDOH from unstructured electronic health records remains challenging. Traditional natural language processing approaches require extensive manual annotation and institution-specific training data, while active SDOH screening imposes a burden on patients and clinicians and is prone to missingness. Large language models (LLMs) offer a promising alternative, but existing LLM-based SDOH extraction studies lack patient-level validation, are limited to constrained note types, and have not been validated against patient-reported outcomes.

Objective: This study aimed to develop and validate an LLM-based natural language processing framework for extracting SDOH from electronic health records at both the individual note and patient level, with comprehensive error analysis and comparison across both clinician-documented and patient-reported measures.

Methods: From 3 independent cohorts, 100 patients were sampled and categorized into 5 distinct batches, and 97 patients yielded meaningful notes to construct the final dataset. Batch 1 was used for prompt development to evaluate 5 LLMs, with the best model then validated on the remaining 4 batches. Five SDOH domains were extracted, including employment, financial toxicity, distress, food insecurity, and physical activity. Validation errors were categorized by a trained clinician at both the note level (n=284) and patient level (n=45). Agreement between clinician-documented and patient-reported SDOH measures was also assessed.

Results: GPT-4.1 (OpenAI) achieved 0.94 accuracy in the development batch. Across validation batches 2 to 5, GPT-4.1 achieved a mean note-level accuracy of 0.94 (SD 0.01) for the 5 SDOH domains, with an overall κ=0.70. The overall mean patient-level accuracy across validation batches was 0.88 (SD 0.04 across batches) for the 5 domains. Clinician-validated error analysis at both the note and patient level identified incorrect inferences as the predominant error type (note level: 164/284, 57.7%; patient level: 22/45, 48.9%). Of the 97 cases, clinician-documented and patient-reported SDOH showed moderate agreement (κ=0.17‐0.52), with underdocumentation of financial toxicity (n=57, 58.8% agreement) and food insecurity (n=76, 78.4%) and overdocumentation of distress (n=67, 69.1%).

Conclusions: GPT-4.1 provides validated SDOH extraction at both the note and patient level. Most errors stemmed from model interpretation rather than the model’s inability to find relevant information. Moderate agreement between documentation sources (patient-reported vs clinician-documented) highlights their complementary value and the need to improve clinician documentation of SDOH domains.

Trial Registration: ClinicalTrials.gov NCT01173341; https://clinicaltrials.gov/study/NCT01173341 and NCT05078190; https://clinicaltrials.gov/study/NCT05078190 and NCT05096338; https://clinicaltrials.gov/study/NCT05096338

JMIR Med Inform 2026;14:e99147

doi:10.2196/99147

Keywords



Patients with cancer are at an increased risk of cardiovascular disease (CVD) [1,2]. Social determinants of health (SDOH), which encompass the conditions in which people are born, grow, live, work, and age, have a profound influence on both cancer and CVD risk [3]. These factors can affect all aspects of cancer and CVD care, from prevention and early detection to treatment completion and clinical outcomes [4,5]. Financial toxicity from medical costs [5-8], employment disruption during active therapy [9], food insecurity affecting nutritional status [10], distress [11-13], and physical inactivity [14-17] all impact both short-term and long-term outcomes yet remain understudied. Defining and understanding how SDOH affect CVD risk, particularly among patients treated with potentially cardiotoxic cancer therapy, is critical [18].

A variety of strategies have been used to ascertain SDOH from patients, including the following: (1) active collection of SDOH data using questionnaires administered either within the electronic health record (EHR) or by dedicated personnel; (2) use of structural SDOH data obtained by geocoding patient addresses and linking them to public census datasets [19]; and (3) post hoc extraction of SDOH data from existing EHR data using unstructured clinical notes [20]. However, active collection of SDOH data through dedicated questionnaires often imposes a substantial burden on both patients and providers and is prone to missingness [21]. Prior studies suggest that only 0.5% of SDOH data were documented structurally in the Epic SDOH Wheel module [22,23]. Moreover, documented structural SDOH data from public census datasets usually lack granularity and specificity [20] and, as proxies, are neither sensitive nor specific in predicting individual-level SDOH [24].

Traditional natural language processing (NLP) methodologies, including rule-based learning, supervised deep learning, and supervised machine learning, have achieved some success in extracting SDOH data from unstructured EHR texts [20,25-29], but key gaps remain. Few studies have developed robust lexicons, leveraged standardized terminologies, or examined deeper representations of SDOH attributes and their interrelationships [20]. Additionally, traditional NLP methods often necessitate extensive manual specification of lexical patterns, large annotated datasets for supervised learning, and substantial computational resources for model development and fine-tuning [30].

Recent rapid advancements in state-of-the-art large language models (LLMs) have shown significant promise in SDOH extraction [31]. LLMs can perform multidomain extraction within a single model, handle noisy or heterogeneous text more robustly, and generalize more effectively across institutions and documentation styles [32]. They also rely less on extensive datasets, using effective prompt engineering rather than fine-tuning [33]. Most importantly, LLMs demonstrate stronger comprehension of complex clinical narratives and encode broad clinical knowledge, enabling more accurate interpretation of context-dependent SDOH and even inference of SDOH not explicitly stated in the notes [34].

However, there are important opportunities to improve upon existing LLM-based SDOH extraction frameworks. Recent studies, including large scoping reviews, have applied LLMs to SDOH extraction, yielding a wide range of performance [20,25,32,35-38], with most focusing on sentence-level or note-level predictions without holistically reconciling information to generate patient-level labels. None have incorporated validation against patient-reported outcomes. Most training datasets were derived from preannotated public corpora, constrained note types, or predefined social history sections [25,35], limiting their ability to capture real-world heterogeneity. Many studies focused solely on extracting SDOH mentions without performing full classification or attribute assignment [25,32,38]. Finally, the SDOH domains examined to date have predominantly been those that are relatively well defined and previously addressed by traditional NLP methods, rather than leveraging LLMs’ capacity to process domains with greater lexical and contextual complexity.

Thus, to overcome these limitations, we sought to develop a clinically relevant, scalable, and generalizable SDOH extraction framework designed for application to real-world clinical research and practice, leveraging state-of-the-art LLMs, including GPT-5 (OpenAI). To accomplish this objective, we (1) prioritized real-world applicability by implementing the model within a clinically representative framework; (2) constructed a real-world dataset that included various note types and narrative text; (3) developed detailed annotation guidelines designed to maximize insights drawn from LLM-encoded psychosocial and clinical knowledge; (4) examined SDOH domains that have historically been understudied due to their lexical complexity and ambiguity; (5) benchmarked model performance against clinician-documented note-level SDOH classifications; and (6) evaluated performance at the patient level, comparing LLM-derived classifications with both clinician-documented references from patient-specific EHR data and patient-reported references from structured questionnaires.


Study Cohorts and SDOH Measures

To develop and validate an LLM-based NLP pipeline across 5 key SDOH domains, detailed questionnaire responses and EHR documentation for participants across 3 prospective cardio-oncology cohort studies were leveraged (Figure S1 in Multimedia Appendix 1). These studies included the Penn Cardiotoxicity of Cancer Therapy (CCT) Study (NCT01173341); Mechanisms, Predictors, and Social Determinants of Cardiotoxicity in Breast Cancer (CCT2) Study (NCT05078190); and Cardiotoxicity of Prostate Cancer Therapy (PCT) Study (NCT05096338). Briefly, CCT and CCT2 enrolled female patients aged 18 years and older with newly diagnosed breast cancer initiating potentially cardiotoxic cancer therapy, including doxorubicin and/or human epidermal growth factor receptor 2–targeted therapies. PCT enrolled male patients aged 18 years and older with prostate cancer planned for at least 6 months of androgen deprivation therapy.

Participants completed assessments of individual-level SDOH using the National Institute on Minority Health and Health Disparities’ PhenX Measures for SDOH Collections [39], the National Comprehensive Cancer Network (NCCN) Distress Thermometer [40], and the Godin leisure-time physical activity scores [41]. Of note, because of the study design, assessments were completed at the beginning of oncological treatment for the CCT2 and PCT cohorts and approximately 7 years after treatment completion for the CCT cohort, respectively. In all our subsequent analyses, these are referred to as the patient-reported, survey-based reference standard (“patient-reported reference standard”). These validated, widely-accepted, and clinically relevant instruments were intended to be the reference standard for individual SDOH responses, and labels for each participant were established based on questionnaire responses. Trained clinical research coordinators administered questionnaires directly to the participants. For instruments that are validated for self-administration, participants were given the option to complete questionnaires electronically or on paper.

Five key SDOH measures and their attributes were selected for this study based on the following criteria: (1) clinical relevance to CVD risk in patients with cancer [8,10,12,13,16,17,42,43]; (2) availability of patient-reported SDOH measures evaluated using validated measurement instruments in questionnaires; and (3) availability of EHR documentation for SDOH derivation. The SDOH measures ultimately selected include employment, financial toxicity, food insecurity, distress, and physical activity.

Patient and Note Selection From an EHRs Data Source

All clinical notes from our patient cohorts were extracted and deidentified using an adapted version of the PHIlter algorithm [44] by the Institute for Biomedical Informatics Clinical Research Informatics Core at the University of Pennsylvania to define the clinician-documented SDOH dataset. Considering the sparsity of SDOH information in unstructured EHR data, strict clinical note inclusion/exclusion criteria were applied to select relevant clinical notes, thereby reducing annotation burden and noise. To ensure sufficient content for each SDOH domain and temporal alignment between clinician-documented and patient-reported SDOH data, clinical notes within 1 year before and after questionnaire completion were extracted.

To identify those clinical notes most likely to contain SDOH information, notes of the patient cohorts were filtered sequentially based on (1) provider type, (2) care setting (inpatient vs outpatient), (3) note type, and (4) clinical specialty. Provider roles and note types unlikely to contain relevant SDOH documentation, such as administrative, procedural, emergency department, and telephone-only encounters, were excluded. Inpatient notes were limited to core evaluative documentation (eg, admission and consult notes), whereas outpatient notes were restricted to visits authored by care providers, including social workers, who are more likely to document SDOH-related concerns. Specialty-based filtering further prioritized notes from cardiology, oncology, and primary medical subspecialties, where SDOH information is typically captured. For oncology, only the first 3 outpatient oncology notes per patient (during the time frame when patients completed the SDOH questionnaires) were retained to reduce redundancy. Only notes meeting a minimum length threshold (≥400 characters) were included to ensure sufficient narrative content for SDOH extraction. To maximize the approximation to real-world practice, predefined social history sections, keyword filters, or bootstrapping strategies were intentionally not used.

Development of the Annotation Guidelines and Prompt Engineering

A multidisciplinary panel of experts, including physician scientists, medical students, psychologists, and data scientists, developed and refined a detailed annotation guideline (Multimedia Appendix 1). The initial guideline was drafted based on expert clinical consensus and the definitions in the PhenX toolkits, as well as Godin leisure-time physical activity scores. The annotation guideline was then refined through 3 rounds of pilot annotation and revision using patient notes for the first batch of selected patients. Each round involved the following steps: (1) independent annotation from patient notes by 2 annotators, (2) structured review to resolve discrepancies and identify systematic disagreements, and (3) guideline revision to address identified ambiguities. This iterative process continued until expert consensus was achieved. These SDOH annotations are referred to as the clinician-documented, EHR-derived reference standard (“clinician-documented reference standard”).

LLM prompt engineering was conducted using a systematic workflow informed by error analysis at each iteration. Each prompt comprised four components: (1) a statement of the LLM’s role establishing the model as a medical text analyst specializing in SDOH extraction, (2) task instruction specifying the extraction target and output format, (3) domain-specific inclusion and exclusion criteria condensed from annotation guidelines, and (4) output structure requirements mandating both an SDOH classification label and a supporting rationale that includes specific evidence from the text. We used 5 final domain-specific prompt templates, one each for employment, financial toxicity, distress, food insecurity, and physical activity (Multimedia Appendix 1). The same template for each domain was used for note- and patient-level inference: (text) contained either 1 clinical note or all notes for a patient concatenated in source-data row order with ===== NEW NOTE===== delimiters. Each prompt defined the permitted labels and inclusion/exclusion criteria, required a single structured label plus an evidence-based rationale, and instructed the model not to infer unsupported SDOH information. The same substantive prompts were used across models, with only end point–required formatting differences (Multimedia Appendix 1). An example of employment extraction using synthetic clinical notes is shown in Figure S2 in Multimedia Appendix 1), illustrating our SDOH extraction workflow. Full details of this project are available in our GitHub repository [45].

Three rounds of comprehensive error analysis focusing on the information provided via the supporting rationale were conducted. The rationale was used to (1) understand the model’s “reasoning path” and determine whether key information was missed or false assumptions were made in the decision process, and (2) refine the annotation guideline, as some model-generated rationales offered valid and insightful perspectives that augmented the expert consensus. With each round of comprehensive error analysis, we refined both the prompt and the annotation guidelines, after which we updated the annotations of the first batch of patient notes accordingly. The final annotation guideline included detailed criteria for each SDOH domain, example phrases for each SDOH classification, and decision rules for ambiguous cases.

Note Annotation

Both the final annotation guidelines and the annotations of the first batch of patient notes were used to train a group of 3 clinical annotators. For batches 2 to 5, 2 annotators independently performed annotations, and the interannotator agreement (IAA) was calculated (as detailed below). Multiple rounds of additional annotation training were performed until the commonly acknowledged strong IAA threshold (κ≥0.70‐0.80) was reached [46]. For domains with extreme classification imbalance, such as food insecurity (23/1151, 2.0% positive prevalence), Cohen κ was mathematically constrained by the rarity of positive cases. Therefore, the 0.70‐0.80 training threshold was not applied to food insecurity.

Model Selection

Following a comprehensive error analysis, we conducted a systematic evaluation of 5 LLM architectures to identify the optimal model for validation: GPT-4.1, GPT-o3, GPT-5, GPT-5 mini, and GPT-4o mini. All models were evaluated on identical test sets with identical prompts, with adaptations only for model-specific formatting requirements to ensure a fair comparison. The final prompt was adjusted when the model’s performance plateaued on the batch 1 development set. The temperature for all inferences was set to 0.1 when available, as reasoning models did not have this parameter.

Patient-Level Model-Prediction Generation

Patient-level predictions were generated by concatenating all clinical notes for each patient into a single comprehensive text document, separated by clear delimiters (“===== NEW NOTE =====”), and submitting the combined text to the LLM for a unified patient-level classification. This concatenation approach, rather than a simple majority vote across individual note predictions, allowed the model to (1) resolve contradictions or evolving information across multiple encounters and (2) identify patterns that emerged only when viewing the complete clinical history over time.

No significant truncation was identified with this concatenation approach. Using the tiktoken o200k_base encoding, we reconstructed 485 patient-domain requests (97 patients × 5 domains). Prompt lengths had a median of 15,750 (IQR 11,541‐28,616; range 2044‐71,435) tokens. No explicit local truncation was implemented. Based on the standard GPT-4.1 context capacity of 1,047,576 total tokens, the largest prompt plus the requested 8192 output tokens totaled 79,627 tokens (7.6%) of the assumed capacity. Thus, none of the reconstructed requests exceeded the assumed context window.

Statistical Analysis

Statistical significance of performance differences between models on the development set was assessed using the McNemar test for paired classifications across all SDOH domains. Exact P values were computed, with significance defined as P<.05. IAA was assessed on notes from batches 2 to 5 using dual independent annotation. Batch 1 was excluded from the IAA assessment because it was used for developing the annotation guidelines and training the annotators. Agreement was measured using three parameters: (1) sentence-level using the percentage agreements, calculated as the absolute percentage of matches between the 2 annotators, (2) sentence-level using positive specific agreement, calculated as the proportion of times when both annotators agree on a positive classification, and (3) note-level using Cohen κ coefficient. Sentence-level annotations were grounded in specific text spans within notes, with annotators marking the exact sentences containing SDOH information before assigning note-level labels. This sentence-level foundation ensured that note-level classifications were based on explicit textual evidence rather than overall clinical impressions. Of note, Cohen κ was not used to calculate sentence-level IAA because a large proportion of sentences did not contain SDOH information and therefore were not annotated in the corpus. In this context, positive specific agreement, which equals the average F-measure between annotators, approaches the value of κ and was used as a reasonable approximation [47].

For each model, performance was quantified at 2 levels: note-level and patient-level, with clinician-documented SDOH as the reference. The following metrics were computed: (1) overall accuracy (proportion of correct classifications), (2) Cohen κ coefficient measuring agreement beyond chance, and (3) weighted F1-score accounting for class imbalance. Additionally, precision, recall, and unweighted (macro averaged) F1-scores were calculated for each individual class within every SDOH domain to assess performance on rare categories. Performance thresholds were defined as accuracy ≥0.80 and κ≥0.60. The interpretation of κ followed the framework proposed by Landis and Koch [48]. These accuracy thresholds align with recent SDOH extraction benchmarks, where high-performing systems achieve F1-score >0.90 for well-documented categories [32,35], and a recent scoping review reported F1-scores ranging from 0.60 to 0.98 across SDOH domains [49].

Performance across the validation batches was primarily summarized as the mean of the 4 validation batches (batches 2‐5): for each domain, note- and patient-level accuracy and Cohen κ were computed within each batch and then averaged across batches. The overall accuracy was calculated as the mean across the 4 validation batches; the overall κ was computed as the mean across the 5 domain-specific values. This approach was deliberately chosen given the imbalanced label distribution within specific domains and batches.

To assess the validity of using clinical documentation as a proxy for patient-reported SDOH, we compared the clinician-documented reference standard with the patient-reported reference standard. Agreement was measured using Cohen κ and percentage agreement.

Error Analysis Methodology

An error was defined as a mismatch in SDOH classifications between model predictions and the clinician-documented reference standard. The lead clinician of the annotation guideline multidisciplinary panel systematically analyzed all errors in validation batches (batches 2‐5), reviewing the complete clinical note, the primary model’s rationale, and both model-predicted and clinician-documented reference standard labels. Each error was categorized into one of 6 mutually exclusive types at the note level: (1) missing information—model failure to recognize key information, (2) ambiguous documentation—conflicting or unclear information in the clinical documentation, (3) incorrect inference—model misinterpretation of available evidence, (4) reasonable disagreement—both labels were defensible given the note content, (5) reference standard issue—model prediction was more consistent with the note content than the clinician annotation, and (6) hallucination—model prediction based on fabricated or unsupported information that was not present in the note. At the patient level, an additional category of error was reviewed: (7) conflicting information reconciliation—model failure to reconcile conflicting information among different notes.

Software and Implementation

All statistical analyses were performed using Python 3.9, with scikit-learn 1.6.1 for metric calculations, pandas 2.3.3 for data manipulation, and matplotlib 3.9.4 with seaborn 0.13.2 for visualization. LLM inference was performed using Penn Medicine Microsoft Azure Databricks Model Serving end points within our secure tenant, with a temperature of 0.1 where supported, to achieve deterministic and reproducible results.

Ethical Considerations

This retrospective study was approved by the University of Pennsylvania Institutional Review Board (IRB number 852595); the protocol was deemed by the IRB to meet the conditions specified in 45 CFR 46.116(f) [50], and a waiver of consent was approved, as was a waiver of HIPAA (Health Insurance Portability and Accountability Act) authorization. These analyses also use data collected prospectively as part of the CCT, CCT2, and PCT cohorts, which were separately reviewed by the University of Pennsylvania IRB (numbers 811155, 849691, and 849688, respectively) and conducted in accordance with the Declaration of Helsinki. All patients within these cohorts provided written informed consent, including broad consent for future research, and were provided with a modest payment of approximately US $15 per visit. Data were processed in the secure, HIPAA-compliant Penn Medicine Microsoft Azure Databricks cloud environment.


Participant Characteristics and Dataset Composition

A total of 100 patients from 3 prospective cardio-oncology cohorts were randomly sampled to build 5 independent batches for annotation, model development, and testing (Table 1). The cohort included 31 (31%) patients from CCT, 36 (36%) patients from CCT2, and 33 (33%) patients from PCT, with a balanced distribution of SDOH as defined by patient-reported reference standards. The median age was 57 (IQR 47‐68) years, with 64% (n=64) female and 33% (n=33) male patients. The cohort was racially diverse, comprising 54% (n=54) White, 33% (n=33) Black/African American, 5% (n=5) Asian, and 8% (n=8) other/unknown patients.

Table 1. Demographics and social determinants of health (SDOH) characteristics of the initially selected patients (N=100).
Demographic and SDOH characteristicsPatient cohort
Age (y), median (IQR)57 (47-68)
Sex, n (%)
Female64 (64)
Male33 (33)
Other/unknown3 (3)
Race, n (%)
White54 (54)
Black/African American33 (33)
Asian5 (5)
Other/unknown8 (8)
Ethnicity, n (%)
Not Hispanic92 (92)
Hispanic7 (7)
Other/unknown1 (1)
Employment, n (%)
Employed32 (32)
Retired31 (31)
Disability19 (19)
Unemployed/homemaker17 (17)
Student1 (1)
Financial toxicity, n (%)
Presence49 (49)
Absence51 (51)
Moderate/severe distress, n (%)
Presence50 (50)
Absence50 (50)
Food insecurity, n (%)
Presence32 (32)
Absence68 (68)
Physical activity, n (%)
Active44 (44)
Inactive56 (56)

From an initial pool of 60,703 clinical notes for all patients from the clinical cohorts, the application of inclusion and exclusion criteria yielded 1151 notes distributed across 5 batches: batch 1 (191 notes), batch 2 (211 notes), batch 3 (266 notes), batch 4 (233 notes), and batch 5 (250 notes). Three patients returned no notes and were therefore excluded from the final dataset (n=97). The clinician-documented reference standard annotations at the note level demonstrated an imbalance across all SDOH domains (Table 2). Employment status was most frequently classified as other/unknown (n=718 notes, 62.4%), with some categories demonstrating significant imbalances—unemployed/homemaker (n=64 notes, 5.6%), disability (n=29 notes, 2.5%), and student (n=4 notes, 0.3%). Across all the SDOH domains with binary classifications, the presence classifications were less common for financial toxicity (n=112 notes, 9.7%) and physical activity (n=96 notes, 8.3%). Notably, food insecurity showed the most substantial imbalance, with only 23 (2.0%) notes indicating presence and 1128 (98.0%) notes indicating absence.

Table 2. Clinician-documented reference standard label distribution by social determinants of health (SDOH) domain at the note level.
SDOH domain and categoryNotes (N=1151), n (%)
Employment
Other/unknown718 (62.4)
Employed169 (14.7)
Retired167 (14.5)
Unemployed/homemaker64 (5.6)
Disability29 (2.5)
Student4 (0.3)
Financial toxicity
Absence1039 (90.3)
Presence112 (9.7)
Moderate/severe distress
Absence687 (59.7)
Presence464 (40.3)
Food insecurity
Absence1128 (98.0)
Presence23 (2.0)
Physical activity
Inactive1055 (91.7)
Active96 (8.3)

IAA

At the sentence-level, absolute match rates across annotators ranged from 72.3% (656/907) to 87.3% (642/735), and positive specific agreement ranged from 71.0% to 87.4%, indicating reliable and consistent annotation quality across the validation cohorts (Figure 1A). Employment, financial toxicity, and distress demonstrated strong agreement with both parameters above 80%. Food insecurity and physical activity showed comparatively lower but appreciable agreement with both parameters above 70%.

At the note-level, the absolute match rates across all SDOH domains demonstrated near-perfect agreement, according to the Landis and Koch framework, ranging from 91.6% (879/960) to 99% (950/960; Figure 1B). Note-level Cohen κ demonstrated excellent agreement for employment (κ=0.86) and financial toxicity (κ=0.88), and substantial agreement for distress (κ=0.83) and physical activity (κ=0.72). Although agreement was still moderate, agreement for food insecurity was lesser (κ=0.54), likely a result of imbalanced classification in the dataset. The overall note-level match rate was 95.5% (4586/4800), with an overall κ of 0.77, obtained by averaging all domain κ values for IAA.

‎
Figure 1. Interannotator agreement across the 5 social determinants of health (SDOH) domains for validation batches 2 to 5: (A) sentence level and (B) note level.

Model Selection on the Development Set

Five state-of-the-art LLMs were systematically evaluated on batch 1 (19 patients, 191 notes) to identify the optimal model for validation: GPT-4.1, GPT-o3, GPT-5, GPT-5 mini, and GPT-4o mini. All models were evaluated using identical prompts and test sets to ensure a fair comparison.

At the note level, compared with the clinician-documented reference standard, GPT-4.1 achieved the highest overall accuracy (mean 0.94, SD 0.01) and strong agreement (κ=0.78) (Figure 2A). Performance was balanced across domains: employment (accuracy: 0.96, κ=0.94), financial toxicity (0.95, κ=0.81), distress (0.91, κ=0.79), food insecurity (0.98, κ=0.82), and physical activity (0.92, κ=0.53). At the patient level, again compared with the clinician-documented reference standard, GPT-4.1 achieved a mean accuracy of 0.88 (SD 0.04) and κ=0.76 (Figure 2A). Domain-specific performance varied across models, with GPT-4.1 demonstrating the most balanced accuracy profile across all 5 SDOH domains (Figure 2B).

‎
Figure 2. Model performances of 5 large language models (LLMs) on the development set (batch 1). (A) Comparison of average accuracy across 5 social determinants of health (SDOH) domains at the note and patient levels. (B) Heatmap of note-level accuracy across the 5 LLMs and SDOH domains. GPT-4.1 achieved the highest overall accuracy across all domains.

Other models showed comparable or lower performance: GPT-o3 (mean accuracy 0.93, SD 0.042; 0.71 κ), GPT-5 mini (mean accuracy 0.92, SD 0.068; 0.72), GPT-5 (mean accuracy 0.92, SD 0.045; 0.64), and GPT-4o mini (mean accuracy 0.91, SD 0.070; 0.71). The paired classification test described by the McNemar test confirmed that GPT-4.1 significantly outperformed GPT-4o mini (P<.001), GPT-5 (P=.006), and GPT-5 mini (P=.005), while the difference vs GPT-o3 was not statistically significant (P=.26). GPT-4.1 was selected as the lead model for validation based on the highest accuracy, a strong κ across all domains, and balanced performance. Subsequent validation results confirmed this selection, with GPT-4.1 maintaining consistent performance across all batches.

Validation Performance of GPT-4.1

Compared with the clinician-documented reference standard, GPT-4.1 maintained consistent performance across validation batches 2 to 5 (78 patients, 960 notes) and achieved strong results at both the note and patient levels (Figure 3A and B). Overall note-level accuracy across the 5 SDOH domains was 0.94 (SD 0.01 across all 4 batches), while overall patient-level accuracy was 0.88 (SD 0.04). Across domains, financial toxicity and distress showed the strongest patient-level agreement, whereas food insecurity demonstrated the greatest variability, likely because some validation batches contained no positive reference cases. For example, batches 4 and 5 did not have any positive cases for food insecurity given the inherent imbalance of our clinical cohorts. Mean note-level κ across domains was 0.70 (SD 0.13), ranging from 0.55 for food insecurity to 0.86 for employment (Table 3).

‎
Figure 3. Validation performance of GPT-4.1 across batches 2 to 5. (A) Note-level accuracy across 5 social determinants of health (SDOH) domains in the validation batches. (B) Comparison of note-level and patient-level accuracy across the 5 SDOH domains. Error bars represent the SD across batches. GPT-4.1 achieved the highest overall accuracy across all domains.
Table 3. Validation performance of GPT-4.1 across 5 social determinants of health (SDOH) domains at the note and patient levels in batches 2 to 5.a
SDOH domainNote-level accuracy, mean (SD)Note-level κ, mean (SD)Patient-level accuracy, mean (SD)Patient-level κ, mean (SD)Key interpretation
Employment0.92 (0.01)0.86 (0.02)0.78 (0.15)0.70 (0.21)Strong note-level performance; the difference between note- and patient-level performance may reflect difficulty reconciling longitudinal information
Financial toxicity0.96 (0.04)0.72 (0.16)0.93 (0.07)0.85 (0.17)Strong patient-level performance
Distress0.91 (0.02)0.80 (0.05)0.94 (0.02)0.83 (0.09)Strong and relatively balanced note- and patient-level performance
Food insecurity0.99 (0.01)0.55 (0.48)b0.95 (0.003)0.43 (0.49)bPerformance limited by few positive reference cases
Physical activity0.92 (0.02)0.59 (0.07)0.82 (0.04)0.63 (0.06)Good performance with note- to patient-level decline in accuracy
Overall0.94 (0.01)0.70 (0.13)c0.88 (0.04)0.69 (0.17)cSolid note- and patient-level performance, but differences in accuracy may reflect the complexity of reconciling information across multiple encounters

aPerformance is reported against the clinician-documented reference standard as the mean (SD) across validation batches. Note-level accuracy, note-level Cohen κ, patient-level accuracy, and patient-level Cohen κ are shown for employment, financial toxicity, distress, food insecurity, and physical activity.

bFood insecurity had very few positive reference cases. When a batch had no positive reference cases but the model made a (necessarily false) positive prediction, Cohen κ was defined as 0 and was retained in the mean. Note-level κ was the mean of batches 2 to 4 (κ=0.80, 0.85, and 0.00); batch 5 was omitted because the model made no positive predictions, so agreement was perfect and κ was mathematically undefined. Patient-level κ was the mean of batches 2 to 5 (κ=0.82, 0.89, 0.00, and 0.00). The low means reflected limited positive-class signals given the imbalance, rather than data exclusion.

cOverall κ was calculated as the mean of the 5 domain-specific κ values, with the SD representing the SD of those 5 values. Domain-specific κ, domain-specific note-level accuracy, and overall note-level accuracy were calculated as the mean across the 4 validation batches.

Comprehensive Error Analysis

At the note-level, all 284 clinician-validated misclassifications from a total of 4800 classifications across validation batches were comprehensively reviewed and analyzed (Table 4), with specific examples of each error type provided in Table S1 in Multimedia Appendix 1. The error distribution was as follows: incorrect inference (n=164, 57.7%), missing information (n=44, 15.5%), reasonable disagreement (n=29, 10.2%), reference standard issue (n=24, 8.5%), ambiguous documentation (n=18, 6.3%), and hallucination (n=5, 1.8%). Error patterns varied substantially by domain (Table S2 in Multimedia Appendix 1). While incorrect inference was the predominant error type across employment (42/75, 56%), financial toxicity (35/41, 85.4%), distress (37/90, 41.1%), and physical activity (49/72, 68.1%), hallucination was the most frequent error type for food insecurity (3/6, 50%), likely indicating that the model was more inclined to fabricate information when the data were rare. Missing information most frequently occurred in distress (35/90, 38.9%) but rarely in employment (3/75, 4%) and physical activity (2/72, 2.8%), likely reflecting that the model was more capable of identifying concrete information than abstract concepts. Similarly, reasonable disagreement occurred more frequently in employment (10/75, 13.3%) and physical activity (13/72, 18.1%) while remaining below 10% for all other SDOH domains, reflecting that the model was strong at rationalizing based on concrete information. Reference standard issue occurred at a consistent frequency across all SDOH domains, ranging from 7.3% (3/41) to 9.3% (7/75; mean 8.2%, SD 0.9%), except for food insecurity (1/6, 16.7%), though this estimate was based on only one of the 6 total errors in that domain.

Table 4. Error type distribution across validation batches (batches 2‐5).a
Error typeNote level (n=284), n (%)Patient level (n=45), n (%)
Incorrect inference164 (57.7)22 (48.9)
Missing information44 (15.5)11 (24.4)
Reasonable disagreement29 (10.2)2 (4.4)
Reference standard issue24 (8.5)5 (11.1)
Ambiguous documentation18 (6.3)1 (2.2)
Hallucination5 (1.8)2 (4.4)
Conflicting information reconciliation—b2 (4.4)

aOverall note-level (n=284) and patient-level (n=45) error type distributions for clinician-validated misclassifications. Conflicting information reconciliation was a patient-level-specific error type.

bNot applicable.

At the patient-level, all 45 clinician-validated misclassifications from a total of 390 classifications (78 patients x 5 domains) across validation batches were comprehensively reviewed and analyzed (Table 4), with specific examples of each error type provided in Table S3 in Multimedia Appendix 1. The overall error distribution at the patient level was as follows: incorrect inference (n=22, 48.9%), missing information (n=11, 24.4%), reference standard issue (n=5, 11.1%), reasonable disagreement (n=2, 4.4%), hallucination (n=2, 4.4%), and ambiguous documentation (n=1, 2.2%). Some patient-level errors could be traced back to note-level errors and presented similar false rationales. The new errors mostly stemmed from the category of conflicting information reconciliation and missing information. Specifically, in the missing information category, the model failed to recognize some key information that it was able to identify at the note-level (Table S3 in Multimedia Appendix 1).

Clinician-Documented vs Patient-Reported SDOH

Among the 97 participants, clinician-documented SDOH labels showed only slight-to-moderate agreement with patient-reported questionnaire responses across domains (Table 5), with agreement rates ranging from 58.8% (n=57) to 78.4% (n=76) and κ values from 0.17 to 0.52: food insecurity (n=76, 78.4%; κ=0.42), distress (n=67, 69.1%; κ=0.38), physical activity (n=64, 66%; κ=0.30), employment (n=62, 63.9%; κ=0.52), and financial toxicity (n=57, 58.8%; κ=0.17). Expanded chart review of all clinical notes in batch 1 yielded only modest improvement, suggesting that these discrepancies reflect broader differences between patient-reported and clinician-documented SDOH rather than the note-selection strategy alone. Across 159 discrepancies among 97 patients, financial toxicity and food insecurity were most often patient-reported but not documented in notes, whereas distress and physical inactivity were more often clinician-documented than patient-reported.

Table 5. Agreement between clinician-documented and patient-reported reference standards across social determinants of health (SDOH) domains.a
SDOH domainAgreement rate (N=97), n (%)Cohen κAgreement strength
Food insecurity76 (78.4)0.42Moderate
Distress67 (69.1)0.38Fair
Physical activity64 (66)0.30Fair
Employment62 (63.9)0.52Moderate
Financial toxicity57 (58.8)0.17Slight

aAgreement rates and Cohen κ values comparing clinician-documented electronic health record (EHR) labels with patient-reported questionnaire responses. Agreement strength interpreted according to the Landis and Koch criteria.


SDOH Extraction From Unstructured EHR Data

SDOH influence patient outcomes [51], yet the systematic extraction from clinical documentation remains challenging. Due to the inherent limitations of active screening and geocoded structural data, passive extraction of SDOH data directly from unstructured physician, nursing, and other narrative clinical notes through NLP is gaining increasing interest [23]. SDOH data have traditionally been documented in physician, nursing, and other narrative clinical notes [23], resulting in a substantial reservoir of relevant data embedded within decades of EHR documentation. Emerging evidence suggests that text-extracted SDOH from EHR using NLP may provide superior detection of adverse SDOH compared with structured EHR data alone [25].

Comparison With Prior SDOH Extraction Work

Our findings extend the recent literature on SDOH extraction in several ways. Our framework for SDOH extraction from both note-level and patient-level classifications leveraged recent LLMs and incorporated validation against real-world, patient-reported outcomes. Given the availability of both clinician-documented SDOH information from the EHR and patient-reported SDOH responses from patient questionnaires, we were able to focus on SDOH measures that have been historically understudied due to their lexical complexity and ambiguity. Our dataset was constructed to capture real-world heterogeneity by including note types and narrative text. Our annotation guidelines were tailored to our clinical questions and patient population, using evidence-based SDOH categories and an iterative development process. Our comprehensive error analysis provided transparency into failure modes, revealing that, of the 284 errors, most were due to model interpretation issues (n=164, 57.7%) and an inability to identify key information (n=44, 15.5%), both of which may be amenable to improvement. Furthermore, the model performed equal to or better than human annotators in 53 (18.7%) cases, with mismatch types including reasonable disagreement (n=29, 10.2%) and reference standard issues (n=24, 8.5%).

Compared with traditional NLP approaches in prior scoping reviews [20], which reported precision and recall generally exceeding 80% for key factors using rule-based systems and supervised learning, our LLM-based approach achieved comparable or superior performance (0.91‐0.99 accuracy) without requiring institution-specific training data or manual feature engineering. However, performance degradation at the patient level (0.78‐0.95 accuracy) highlights challenges in information reconciliation that are not addressed in prior sentence- or note-level evaluations.

Framework Performance and Clinical Utility

Our 2-phase validation approach demonstrated that GPT-4.1 maintained consistent performance across validation batches (overall mean note-level accuracy 0.94, SD 0.01), with low variability supporting robust generalizability. This performance is comparable to recent SDOH extraction studies reporting F1-scores of 0.88‐0.93 for well-documented domains using both traditional NLP and LLM-based approaches [23,27,30,32]. κ interpretation followed the Landis and Koch framework, in which κ≥0.80 is labeled as almost perfect agreement and κ≥0.60 substantial agreement.

Patient-level evaluation revealed performance degradation compared with note level (mean overall accuracy 0.88, SD 0.04 vs mean overall accuracy 0.94, SD 0.01), reflecting the complexity of reconciling information across multiple encounters. This finding extends prior work [32,33], which evaluated only note or sentence-level performance, by demonstrating that document-level metrics alone may not reflect clinical utility for patient-level decision-making. The patient-level aggregation strategy—concatenating all notes per patient rather than using majority voting—enabled the model to resolve contradictions.

One of the most significant contributions of our LLM framework is its demonstrable translatability. We developed a clinically informed note-selection system that can be applied across all clinical note types, preserving the heterogeneity inherent in real-world documentation while enriching the proportion of notes likely to contain useful SDOH information. Although our study focuses on a specific patient population, the inclusion of reference-standard patient-reported outcomes enabled a comparison of the model’s outputs at both the note and patient levels, demonstrating reliable transferability to real clinical workflows and research settings. Patient-level aggregation revealed performance differences that were not fully visible at the note level, with implications for evaluating clinical NLP systems beyond SDOH. Document-level metrics alone may be insufficient and potentially misleading, particularly when social or behavioral information is distributed across multiple encounters. Our framework’s ability to reconcile and integrate information across multiple notes for a single patient provides a strong foundation for its downstream applications.

Leveraging the capacity of LLMs to interpret complex contextual information, we investigated SDOH domains that are typically conceptualized as continuous variables and therefore exhibit substantial lexical and semantic complexity. Domains such as distress and physical activity have not been commonly examined in prior work—whether using traditional NLP or LLMs—due to ambiguous definitions and the limited granularity with which these concepts are documented in clinical notes. To address this challenge, we developed streamlined, evidence-based definitions and classification schemes grounded in clinical applicability and correlation structures. Notably, whereas achieving high agreement among human annotators required multiple rounds of training and iterative refinement of the annotation guidelines, the LLM reached excellent performance quickly using relatively simple prompt engineering. To our knowledge, this is the first study to demonstrate that LLMs can accurately process SDOH domains characterized by substantial lexical complexity when guided by clinically-informed constructs—achieving levels of efficiency, cost-effectiveness, and accuracy that exceed both human annotators and traditional NLP approaches.

Iterative Human-in-the-Loop Refinement

Our comprehensive error analysis, which was facilitated by a detailed review of LLM-generated rationales, not only strengthened our prompt engineering strategy but also informed the refinement of the annotation guidelines beyond the initial expert consensus. This interactive development process helped identify and reconcile several foundational assumptions embedded within the LLMs that were difficult to redirect through prompt modifications alone. Rather than treating these assumptions solely as errors, expert reviewers evaluated their clinical reasonableness and, when appropriate, integrated them into the annotation guidelines. This approach simultaneously improved model performance and enhanced the clarity and applicability of the guidelines. For example, the model initially inferred that patients over the age of 65 were retired—an assumption that is generally reasonable but was excluded from the original guidelines due to the growing number of real-world exceptions. After identifying this pattern through error analysis, we elected to incorporate a more conservative version of the assumption: annotators may classify a patient as retired if the patient is older than 70 and no other employment information is available.

Error Patterns: Insights for Model Improvement

Although model misinterpretation was the most common error type across most domains, comprehensive error analysis revealed informative domain-specific patterns. For SDOH domains requiring concrete evidence, such as employment and physical activity, the model rarely failed to find relevant evidence (missing information: employment 3/75, 4%; physical activity 2/72, 2.8%) and demonstrated strong rationales supported by clinical evidence (reasonable disagreement: employment 10/75, 13.3%; physical activity 13/72, 18.1%). However, for SDOH domains requiring greater lexical complexity and abstract interpretation, such as distress, the model’s capacity to identify relevant evidence dropped significantly (missing information: distress 35/90, 38.9%), reflecting that annotators identified distress from contextual cues that the model did not recognize. Across all SDOH domains, the reference standard issue rate was consistent (mean 8.2%, SD 0.9% except food insecurity), reflecting the inherent error rate of human annotation corrected by the LLM. Although there were only 6 error cases for food insecurity, likely due to the rare documentation of this domain, half were hallucinations (3 cases), which may indicate the model’s tendency to fabricate information when data are rare. Admittedly, the cases were too few to draw definitive conclusions, and the overall proportion of hallucination remains exceedingly low (5/284, 1.8%).

The error analysis also revealed distinct challenges in patient-level prediction. While most of the errors could be traced back to note-level errors, conflicting information reconciliation emerged as a patient-level-specific error type, referring to cases where the model failed to appropriately reconcile contradictory SDOH information across multiple clinical encounters for the same patient. While new errors related to conflicting information reconciliation were expected, a substantial proportion of new errors arose instead from missing information, in which the model failed to capture data that it had correctly identified at the individual note level. One possible explanation is that aggregating longitudinal documentation amplifies the difficulty of reconciling discordant evidence, leading the model to omit relevant statements when constructing its final rationale. Alternatively, the increased input length and complexity may exceed the model’s effective use of the context, resulting in incomplete integration of available evidence. The underlying mechanism remains unclear and warrants further investigation.

Of note, although our temperature setting was very conservative, some errors clearly demonstrated a probabilistic pattern, as reported in prior literature [52]. In some notes that have similar contents secondary to the redundant nature of clinical notes, the model identified the same key information but rationalized it differently to generate different predictions, the logic for which remains unclear (Table S4 in Multimedia Appendix 1).

Clinician-Documented vs Patient-Reported Reference Standard Difference

The moderate agreement between clinician-documented and patient-reported SDOH (κ=0.17‐0.52) reveals that these sources capture partially overlapping but distinct information. Several factors may contribute to this divergence. First, human annotation carries inherent error, which can introduce inconsistency. Second, the questionnaires, although considered a reference standard, have their own internal error rate, the magnitude of which is not well established [39]. For example, a patient might report being unemployed even when clinical documentation clearly indicates disability status. Patient questionnaires are also affected by recall, acquiescence, or social desirability biases, as well as response fatigue. Moreover, questionnaires capture SDOH at a single time point and may reflect transient or evolving circumstances that are not consistently documented in the EHR. Additionally, although our annotation guidelines were developed through clinical consensus to maximize alignment with questionnaire responses, the translation between free-text narratives and structured survey items may still be imperfect.

Finally, these discrepancies likely highlight a broader information gap between patient-reported experiences and what is recorded in clinical notes. Domain-specific patterns shed light on such systematic biases. Financial toxicity and food insecurity showed underdocumentation, with 67.5% (27/40) to 95.2% (20/21) of discrepancies representing patient-reported concerns that were not captured in the notes. This extends prior observations that only 0.5% of SDOH data appear in structured EHR fields [22] by showing that even narrative documentation substantially undercaptures sensitive domains. Conversely, distress showed overdocumentation (23/30, 76.7% of discrepancies were clinician-documented but not patient-reported), possibly reflecting clinicians’ emphasis on subjective distress with observable indicators (medications, referrals) that patients do not self-report as meeting distress thresholds, or stigma-related underreporting in surveys. Overall, even among oncology patients, who often receive extensive social support, important aspects of SDOH may remain undocumented, which emphasize an urgent need to strengthen SDOH screening and documentation practices in the clinic to avoid missed opportunities for timely intervention.

Limitations

Several limitations warrant consideration. First, our SDOH definitions are tailored toward the oncology population, which improves clinical usefulness but may limit generalizability. For example, as patients with cancer may experience more physical distress and have higher endurance, the annotation guidelines defined that the physical distress threshold in the distress domain was aligned with CTCAE (Common Terminology Criteria for Adverse Events) grade ≥2 adverse events [53], a standard developed for oncology care. Second, our validation cohorts consisted of patients with cancer from a single quaternary care health system, which also limits generalizability, although patients are cared for across multiple sites. The cohort size reflects the scarcity of deeply phenotyped cardio-oncology clinical data supporting validation against both clinician-documented and patient-reported measures. The sample size is modest, but LLMs can achieve strong task-specific performance without large training cohorts. We assessed robustness through internal validation batches, though external validation may be needed prior to clinical implementation into other health systems. Third, all models evaluated in this study were from a single model family. Performance may differ for models from other developers, and our findings should not be assumed to generalize across architectures. Comparative evaluation across model families represents an important direction for future work. Furthermore, LLM outputs are sensitive to prompt wording, label definitions, and output constraints. We used 1 standardized final prompt per domain, but alternative formulations could produce different classifications and performance estimates. Future studies should test prompt robustness across model families, institutions, and clinical documentation settings.

Importantly, we focused on 5 SDOH domains given the limited availability of both clinician-documented and patient-reported SDOH information, which consists only of a subset of the comprehensive SDOH framework. Moreover, while strategic note selection is a general practice when using LLMs for SDOH phenotyping to optimize and enrich the dataset [54], inevitably, it could introduce selection bias. Our strategy aims to approximate real-world practice, though it could not perfectly mirror it. Additionally, fairness assessment across demographic subgroups should be performed to further inform gaps in disparities. Lastly, the study was retrospective, and prospective validation and implementation in clinical workflows can further determine its real-time utility.

We also note multiple strengths, including the use of real-world patient cohorts with reference-standard patient-reported SDOH measures, both note-level and patient-level classification, and transparent model rationales that enable users to understand the basis for predictions and identify cases requiring human review. The reproducible annotation framework provides a foundation for scaling to larger and more heterogeneous datasets and advances SDOH extraction toward clinically meaningful deployment. Moreover, future research should address these limitations through multi-institutional validation, real-time extraction integrated into clinical workflows, and systematic fairness assessments across demographic groups. Further investigation is also needed to clarify the information gap among structural SDOH data, clinician documentation, and patient-reported SDOH, thereby informing the validity of passive SDOH extraction using LLMs.

Conclusions

We developed and validated a clinically grounded LLM-based framework for extracting 5 highly relevant SDOH domains from unstructured clinical notes. The model demonstrated robust note-level performance across independent cohorts and acceptable patient-level performance, highlighting both the promise and the complexity of translating document-level NLP systems into patient-level clinical applications. A comprehensive error analysis revealed that most failures stemmed from model inference and the model’s relative weakness in extracting abstract information. However, it also demonstrated that the model could identify human annotation errors at a consistent proportion across all SDOH domains. Validation against patient-reported measures suggests that clinician documentation and patient self-report capture complementary dimensions of SDOH and highlight areas in need of future study to further overcome disparities in care.

Acknowledgments

The authors extend their gratitude to the Penn Data and Analytics Center of Excellence (PennDnA) for its computing support.

Generative AI Use

The first draft of the manuscript was written entirely by the authors, and no AI tool was used. Claude Opus 4.5 (Anthropic) was then used to refine the language and formatting to meet publication requirements. GPT-5 (OpenAI) was used to assist in editing Python scripts for statistical analyses and figures. All content, analyses, interpretations, and final wording were reviewed, verified, and approved by the authors, who take full responsibility for the integrity and accuracy of the manuscript.

Funding

This work was funded by the National Heart, Lung, and Blood Institute (K24HL167127 BK and R01HL118018 BK) and the American Heart Association Strategically Focused Research Network in Cardio-Oncology Disparities 869105 and 849569 (BK).

Data Availability

The datasets generated and/or analyzed during the current study are not publicly available due to the presence of protected health information and institutional restrictions on electronic health record sharing. Shareable project details are available in the GitHub repository [45].

Authors' Contributions

Conceptualization: BK, AH, UV, DM

Data curation: BK, AH, UV, AT, DM, PK, MY, AB, AMS, CX

Formal analysis: BK, AH, UV, AT, DM, PK, MY, AB, AMS, CX

Funding acquisition: BK

Software: AH, UK

Writing – original draft: AH, UV, BK, DM

Writing – review & editing: BK, AH, UV, AT, DM, PK, MY, AB, AMS, CX

AH and UV are co-first authors.

DM and BK are co-senior authors.

Conflicts of Interest

None declared.

Multimedia Appendix 1

Development and validation of large language models for extracting social determinants of health from electronic health records.

DOCX File, 1140 KB

  1. Alhuneafat L, Guha A, Blaes A, Konety SH. Cancer and cardiovascular disease: shared risk factors, mechanisms, and clinical implications: JACC: CardioOncology state-of-the-art review. JACC CardioOncol. Aug 2025;7(5):453-469. [CrossRef] [Medline]
  2. Wilcox NS, Amit U, Reibel JB, Berlin E, Howell K, Ky B. Cardiovascular disease and cancer: shared risk factors and mechanisms. Nat Rev Cardiol. Sep 2024;21(9):617-631. [CrossRef] [Medline]
  3. Osei Baah F, Sharda S, Davidow K, et al. Social determinants of health in cardio-oncology: multi-level strategies to overcome disparities in care: JACC: cardioOncology state-of-the-art review. JACC CardioOncol. 2024;6(3):331-346. [CrossRef] [Medline]
  4. Ward E, Jemal A, Cokkinides V, et al. Cancer disparities by race/ethnicity and socioeconomic status. CA Cancer J Clin. 2004;54(2):78-93. [CrossRef] [Medline]
  5. Demissei BG, Ko K, Huang A, et al. Social determinants of health mediate racial disparities in cardiovascular disease in men with prostate cancer. JACC CardioOncol. Jun 2024;6(3):390-401. [CrossRef] [Medline]
  6. Zafar SY, McNeil RB, Thomas CM, Lathan CS, Ayanian JZ, Provenzale D. Population-based assessment of cancer survivors’ financial burden and quality of life: a prospective cohort study. J Oncol Pract. Mar 2015;11(2):145-150. [CrossRef] [Medline]
  7. Altice CK, Banegas MP, Tucker-Seeley RD, Yabroff KR. Financial hardships experienced by cancer survivors: a systematic review. J Natl Cancer Inst. 2016;109(2):djw205. [CrossRef] [Medline]
  8. Valero-Elizondo J, Chouairi F, Khera R, et al. Atherosclerotic cardiovascular disease, cancer, and financial toxicity among adults in the United States. JACC CardioOncol. Jun 2021;3(2):236-246. [CrossRef] [Medline]
  9. Miller KD, Nogueira L, Devasia T, et al. Cancer treatment and survivorship statistics, 2022. CA Cancer J Clin. Sep 2022;72(5):409-436. [CrossRef] [Medline]
  10. Hong YR, Wang R, Case S, Jo A, Turner K, Ross KM. Association of food insecurity with overall and disease-specific mortality among cancer survivors in the US. Support Care Cancer. Apr 25, 2024;32(5):309. [CrossRef] [Medline]
  11. Newman LA, Kaljee LM. Health disparities and triple-negative breast cancer in African American women: a review. JAMA Surg. May 1, 2017;152(5):485-493. [CrossRef] [Medline]
  12. Flanagan MW, Goltz HH, Henson JW, Smith ML. Associations of practical, emotional, and physical problems with psychosocial distress among cancer patients. J Psychosoc Oncol. 2022;40(1):98-114. [CrossRef] [Medline]
  13. Ownby KK. Use of the distress thermometer in clinical practice. J Adv Pract Oncol. Mar 2019;10(2):175-179. [Medline]
  14. Reding KW, Szewczyk W, D’Agostino RB Jr, et al. Black-White disparities in submaximal exercise capacity reductions in breast cancer survivors: a prospective cohort study. JACC CardioOncol. Jun 2024;6(3):467-469. [CrossRef] [Medline]
  15. Carnethon MR, Pu J, Howard G, et al. Cardiovascular health in African Americans: a scientific statement from the American Heart Association. Circulation. Nov 21, 2017;136(21):e393-e423. [CrossRef] [Medline]
  16. Jung W, Cho IY, Jung J, et al. Changes in physical activity and cardiovascular disease risk in cancer survivors: a nationwide cohort study. JACC CardioOncol. Dec 2024;6(6):879-889. [CrossRef] [Medline]
  17. Physical activity guidelines for Americans, 2nd edition. US Department of Health and Human Services; 2018. URL: https://odphp.health.gov/sites/default/files/2019-09/Physical_Activity_Guidelines_2nd_edition.pdf [Accessed 2026-10-22]
  18. Taylor LL, Hong AS, Hahm K, Kim D, Smith-Morris C, Zaha VG. Health literacy, individual and community engagement, and cardiovascular risks and disparities: JACC: CardioOncology State-of-the-Art Review. JACC CardioOncol. 2024;6(3):363-380. [CrossRef] [Medline]
  19. Sánchez-Díaz CT, Babel RA, Iyer HS, et al. Neighborhood archetypes and cardiovascular health in Black breast cancer survivors. JACC CardioOncol. Jun 2024;6(3):405-418. [CrossRef] [Medline]
  20. Li C, Mowery DL, Ma X, et al. Realizing the potential of social determinants data in EHR systems: a scoping review of approaches for screening, linkage, extraction, analysis, and interventions. J Clin Transl Sci. 2024;8(1):e147. [CrossRef] [Medline]
  21. Smith MA, Gigot M, Harburn A, et al. Insights into measuring health disparities using electronic health records from a statewide network of health systems: a case study. J Clin Transl Sci. 2023;7(1):e54. [CrossRef] [Medline]
  22. Epic. URL: https://www.epic.com/ [Accessed 2024-01-01]
  23. Wang M, Pantell MS, Gottlieb LM, Adler-Milstein J. Documentation and review of social determinants of health data in the EHR: measures and associated insights. J Am Med Inform Assoc. Nov 25, 2021;28(12):2608-2616. [CrossRef] [Medline]
  24. Bensken WP, McGrath BM, Gold R, Cottrell EK. Area-level social determinants of health and individual-level social risks: assessing predictive ability and biases in social risk screening. J Clin Transl Sci. 2023;7(1):e257. [CrossRef] [Medline]
  25. Lybarger K, Dobbins NJ, Long R, et al. Leveraging natural language processing to augment structured social determinants of health data in the electronic health record. J Am Med Inform Assoc. Jul 19, 2023;30(8):1389-1397. [CrossRef] [Medline]
  26. Conway M, Keyhani S, Christensen L, et al. Moonstone: a novel natural language processing system for inferring social risk from clinical narratives. J Biomed Semantics. Apr 11, 2019;10(1):6. [CrossRef] [Medline]
  27. Bejan CA, Angiolillo J, Conway D, et al. Mining 100 million notes to find homelessness and adverse childhood experiences: 2 case studies of rare and severe social determinants of health in electronic health records. J Am Med Inform Assoc. Jan 1, 2018;25(1):61-71. [CrossRef] [Medline]
  28. Zhao X, Rios A. A marker-based neural network system for extracting social determinants of health. J Am Med Inform Assoc. Jul 19, 2023;30(8):1398-1407. [CrossRef] [Medline]
  29. Han S, Zhang RF, Shi L, et al. Classifying social determinants of health from unstructured electronic health records using deep learning-based natural language processing. J Biomed Inform. Mar 2022;127:103984. [CrossRef] [Medline]
  30. Wu S, Roberts K, Datta S, et al. Deep learning in clinical natural language processing: a methodical review. J Am Med Inform Assoc. Mar 1, 2020;27(3):457-470. [CrossRef] [Medline]
  31. Ong JCL, Seng BJJ, Law JZF, et al. Artificial intelligence, ChatGPT, and other large language models for social determinants of health: current state and future directions. Cell Rep Med. Jan 16, 2024;5(1):101356. [CrossRef] [Medline]
  32. Keloth VK, Selek S, Chen Q, et al. Social determinants of health extraction from clinical notes across institutions using large language models. NPJ Digit Med. May 17, 2025;8(1):287. [CrossRef] [Medline]
  33. Peng C, Yang X, Smith KE, et al. Model tuning or prompt tuning? A study of large language models for clinical concept and relation extraction. J Biomed Inform. May 2024;153:104630. [CrossRef] [Medline]
  34. Singhal K, Azizi S, Tu T, et al. Large language models encode clinical knowledge. Nature. Aug 2023;620(7972):172-180. [CrossRef] [Medline]
  35. Consoli B, Wang H, Wu X, et al. SDoH-GPT: using large language models to extract social determinants of health. J Am Med Inform Assoc. Jan 1, 2026;33(1):67-78. [CrossRef] [Medline]
  36. Guevara M, Chen S, Thomas S, et al. Large language models to identify social determinants of health in electronic health records. NPJ Digit Med. Jan 11, 2024;7(1):6. [CrossRef] [Medline]
  37. Richie R, Ruiz VM, Han S, Shi L, Tsui FR. Extracting social determinants of health events with transformer-based multitask, multilabel named entity recognition. J Am Med Inform Assoc. Jul 19, 2023;30(8):1379-1388. [CrossRef] [Medline]
  38. Yu Z, Peng C, Yang X, et al. Identifying social determinants of health from clinical narratives: a study of performance, documentation ratio, and potential bias. J Biomed Inform. May 2024;153:104642. [CrossRef] [Medline]
  39. Krzyzanowski MC, Ives CL, Jones NL, et al. The PhenX Toolkit: measurement protocols for assessment of social determinants of health. Am J Prev Med. Sep 2023;65(3):534-542. [CrossRef] [Medline]
  40. National Comprehensive Cancer Network. NCCN Guidelines. URL: https://www.nccn.org/guidelines/guidelines-detail?category=3&id=1431 [Accessed 2025-01-01]
  41. Godin G, Shephard RJ. A simple method to assess exercise behavior in the community. Can J Appl Sport Sci. Sep 1985;10(3):141-146. [Medline]
  42. Bolijn R, Kunst AE, Appelman Y, et al. Prospective analysis of gender-related characteristics in relation to cardiovascular disease. Heart. Jun 10, 2022;108(13):1030-1038. [CrossRef] [Medline]
  43. Amireault S, Godin G, Lacombe J, Sabiston CM. Validation of the Godin-Shephard leisure-time physical activity questionnaire classification coding system using accelerometer assessment among breast cancer survivors. J Cancer Surviv. Sep 2015;9(3):532-540. [CrossRef] [Medline]
  44. Norgeot B, Muenzen K, Peterson TA, et al. Protected health information filter (Philter): accurately and securely de-identifying free-text clinical notes. NPJ Digit Med. 2020;3:57. [CrossRef] [Medline]
  45. Vurgun U. Sdoh-llm-clinical-notes. GitHub. URL: https://github.com/ugurcanvurgun/sdoh-llm-clinical-notes [Accessed 2025-01-01]
  46. Artstein R, Poesio M. Inter-coder agreement for computational linguistics. Computational Linguistics. 2008;34(4):555-596. [CrossRef]
  47. Hripcsak G, Rothschild AS. Agreement, the F-measure, and reliability in information retrieval. J Am Med Inform Assoc. 2005;12(3):296-298. [CrossRef] [Medline]
  48. Landis JR, Koch GG. The measurement of observer agreement for categorical data. Biometrics. Mar 1977;33(1):159-174. [Medline]
  49. Farrag A, Soliman A, Hatef E, Goodin A, Rouhizadeh M. Beyond metrics to methods: a scoping review of transformers and large language models for detection of social drivers of health in clinical notes. J Am Med Inform Assoc. Mar 1, 2026;33(3):754-769. [CrossRef] [Medline]
  50. 45 CFR 46. US Department of Health and Human Services (HHS). URL: https://www.hhs.gov/ohrp/regulations-and-policy/regulations/45-cfr-46/index.html [Accessed 2026-10-31]
  51. Satti DI, Chan JSK, Dee EC, et al. Associations between social determinants of health and cardiovascular health of U.S. adult cancer survivors. JACC CardioOncol. 2023;6(3):439-450. [CrossRef] [Medline]
  52. Gu B, Desai RJ, Lin KJ, Yang J. Probabilistic medical predictions of large language models. NPJ Digit Med. Dec 19, 2024;7:367. [CrossRef] [Medline]
  53. CTEP trial development and conduct. National Cancer Institute (NCI). URL: https://dctd.cancer.gov/research/ctep-trials/trial-development#ctc_50 [Accessed 2017-11-27]
  54. Kirby JC, Speltz P, Rasmussen LV, et al. PheKB: a catalog and workflow for creating electronic phenotype algorithms for transportability. J Am Med Inform Assoc. Nov 2016;23(6):1046-1052. [CrossRef] [Medline]


‎
CCT: Cardiotoxicity of Cancer Therapy
CCT2: Mechanisms, Predictors, and Social Determinants of Cardiotoxicity in Breast Cancer
CTCAE: Common Terminology Criteria for Adverse Events
CVD: cardiovascular disease
EHR: electronic health record
HIPAA: Health Insurance Portability and Accountability Act
IAA: interannotator agreement
IRB: Institutional Review Board
LLM: large language model
NCCN: National Comprehensive Cancer Network
NLP: natural language processing
PCT: Cardiotoxicity of Prostate Cancer Therapy
SDOH: social determinants of health


Edited by Arriel Benis; submitted 23.Apr.2026; peer-reviewed by Lokesh Chinthala, Mei Chen; comments to author 09.Jul.2026; final revised version received 19.Aug.2026; accepted 02.Oct.2026; published 30.Nov.2026.

Copyright

© Anran Huang, Ugurcan Vurgun, Anthony Thompson, Patty Kuo, Maxwell Ye, Ashley Batugo, Amanda M Smith, Congying Xia, Danielle Mowery, Bonnie Ky. Originally published in JMIR Medical Informatics (https://medinform.jmir.org), 30.Nov.2026.

This is an open-access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work, first published in JMIR Medical Informatics, is properly cited. The complete bibliographic information, a link to the original publication on https://medinform.jmir.org/, as well as this copyright and license information must be included.