Extraction of Social Determinants of Health From Patient-Reported and Clinician-Documented Measures Using Large Language Models: Algorithm Development and Validation
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.
Authors
- Ashley Batugo (ORCID: https://orcid.org/0000-0002-7463-4634)
- Patty X. Kuo (ORCID: https://orcid.org/0000-0002-2185-4537)
- Anran Huang (ORCID: https://orcid.org/0000-0003-1435-1576)
- Danielle L. Mowery (ORCID: https://orcid.org/0000-0003-3802-4457)
- Uğurcan Vurgun (ORCID: https://orcid.org/0000-0001-6021-4316)
- Maxwell Ye
- Congying Xia
- Anthony Thompson
- Amanda M. Smith
- Bonnie Ky
Publication Details
- Journal
- JMIR Medical Informatics
- Published
- 2026-11-30
- DOI
- https://doi.org/10.2196/99147
- Primary Topic
- Machine Learning in Healthcare
- Type
- article
- Field-Weighted Citation Impact
- 0.00