Identifying antipsychotic treatment episodes using natural language processing and change-point detection
Listed in
This article is not in any list yet, why not save it to one of your lists.Abstract
Background: Prescribing information for antipsychotic medications is predominantly recorded in unstructured clinical text, preventing large-scale analysis of treatment trajectories. We developed and validated a framework integrating natural language processing (NLP) and change-point detection (CPD) to reconstruct longitudinal antipsychotic treatment episodes from electronic health records (EHRs). Methods: We analysed EHRs from 12,530 patients with schizophrenia-spectrum disorders (ICD-10 F20--F29) at the South London and Maudsley NHS Foundation Trust (2007--2017). Antipsychotic mentions were extracted using a validated NLP pipeline and modelled as categorical time series; the Pruned Exact Linear Time (PELT) algorithm detected episode boundaries. Performance was evaluated against 113 manually annotated episodes from 50 patients. Associations between treatment-episode metrics and healthcare utilisation were assessed using generalised linear models adjusted for age at onset, gender, ethnicity, and diagnosis. Results: The algorithm achieved an F1 score of 0.81 against manual annotations. Across 11,731 patients, 24,648 treatment episodes were identified. Combined antipsychotic use was detected in 31.7% of episodes (1,989 transition overlaps; 5,827 concurrent therapy). Clozapine users had more treatment episodes than non-clozapine users (mean 3.3 vs.\1.9), consistent with clinical expectations. Higher combination-prescribing rates and more pre-clozapine episodes were positively associated with hospital admissions and inpatient stays; a higher proportion of long-acting injectable (LAI) episodes was associated with reduced service use. Conclusions: This NLP-CPD framework provides a scalable approach to reconstructing antipsychotic treatment trajectories from unstructured EHRs. Derived episode metrics demonstrate clinical validity and reveal associations between treatment complexity and healthcare utilisation, offering a generalisable architecture for prescribing quality monitoring and automated identification of treatment resistance.