Abstract
BACKGROUND AND STUDY AIMS: This study aimed to develop a clinical prediction model to assess the 24-hour post-ERCP complication risk in patients with common bile duct stones (CBDs), guiding clinical decision-making for ERCP as a day surgery. PATIENTS AND METHODS: Retrospective data from The First Hospital of Lanzhou University (2010-2019) and prospective multicenter data on post-ERCP complications (2020-2023) were collected and registered on ClinicalTrials.gov (NCT04234126, NCT04242394). The ADASYN method was used for dataset balancing. Machine learning algorithms, including KNN, XGBoost, RF, SVM, and NB, were compared with traditional models. External validation was performed with retrospective data from other ERCP centers (2015-2017) and The First Hospital of Lanzhou University (2019-2020), with registration under NCT02510495. The optimal model was selected based on the ROC curve (AUC), and an online prediction tool was developed. RESULTS: A logistic regression (LR) model incorporating seven feature variables-mechanical lithotripsy, pancreatic duct cannulation, bile duct dilation, residual stones, white blood cell count, alanine aminotransferase (ALT) level, and pancreatic duct stent placement-was identified as the optimal model, The model yielded specificity, sensitivity, accuracy, and AUC values of 0.835, 0.655, 0.807, and 0.819 in the external validation set, with a second external validation set providing additional results of 0.799, 0.714, 0.784, and 0.805. Patients were stratified into high- and low-risk groups. An online calculator was developed ( https://borujin.shinyapps.io/dynnomapp/ ). CONCLUSIONS: The results indicate that the proposed LR model, utilizing the top seven risk factors, could serve as an effective tool for predicting occurrence of complications in day surgery.