| Background :Post-endoscopic retrograde cholangiopancreatography(ERCP)is the recommend treatment for common bile duct(CBD)stones,but there are complications including post ERCP pancreatitis(PEP)and post ERCP cholecystitis.PEC is an ignored but serious complication.This study aimed to validate and construct a clinical predictive model for predicting PEC by using machine learning model combined with a logistic regression model approach.Secondly,to investigate the risk factors of post ERCP pancreatitis(PEP)for CBD stone patients with gallbladder and investigate the relationship with gallbladder status and build a nomogram prediction model.Methods: A random forest(RF)machine learning model was developed to predict PEC.Eligible patients from 2010 to 2019 with CBD stones and gallbladders in-situ were enrolled.logistic regression analysis was used to compare the predictive ability.The RF model was further validated with another 117 patients.A retrospective study was used to identify risk factors and build a predictive model.Eligible PEP patients’ risk factors were identified by univariate and multivariate logistic regression.Moreover,an external validation group by the same criterion from a multi-center prospective randomized controlled study meanwhile(NCT02510495).Then a nomogram model was built to predict PEP.The predictive discrimination and accuracy values based on receiver operation characteristics(ROC)curve including sensitivity and specificity and decision and clinical impact curve.This study was registered with Clinical Trials.gov,NCT04234126 is completed.Results: For PEC modeling,a total of 1,117 patients were enrolled(90 PEC,3.95%)to build the predictive model for PEC.The RF method identified white blood cell(WBC)count,endoscopic papillary balloon dilatation(EPBD),increase in WBC,residual CBD stones after ERCP,serum amylase levels,and mechanical lithotripsy were the top six predictive factors and has a sensitivity(0.822),specificity(0.853),accuracy(0.855),and the area under curve(AUC)value(0.890).Univariate and multivariate binary logistic regression identified that WBC(OR=1.153;95% CI:1.036–1.282;p=0.009),serum amylase level(OR=1.001;95% CI: 1.000-1.001;p=0.009),gallbladder stones(OR=10.191;95% CI: 2.275-45.649;p=0.002),gallbladder opacification(OR=9.688;95% CI: 2.833–33.125;p=0.000),ERBD(Endoscopic retrograde biliary drainage,ERBD,OR=2.055;95%CI:1.146-3.685;p=0.029),mechanical lithotripsy(OR=2.294;95% CI: 1.293-4.072;p=0.005),EPBD(OR=3.364;95% CI: 2.186-6.041;p= 0.000)and residual bile duct stones after ERCP(OR=2.491;95 % CI: 1.480-4.192;p=0.001)were risk factors for PEC.A logistic regression prediction model was built showing a sensitivity,specificity,and AUC of 0.800,0.801,and 0.864,respectively.An additional 117patients(11 PEC)were used to validate the RF model,with an AUC of 0.889,the decision analysis curve and clinical impact curve showed the accuracy ability.The web server is available online at http://101.35.163.113/PEC/.For PEP modeling,986 patients including 128 PEP patients(incidence of 5.61%)were enrolled.There was no statistical difference in baseline data.After lasso regression for features selecting,multivariate logistic analysis indicated that history of pancreatitis(OR=2.933;95% CI : 1.418-6.067;p=0.004)、 increment of WBC(OR=2.696;95% CI:1.768-4.113;p=0.000)、guide wire into the pancreatic duct(OR=2.109;95% CI:1.282-3.471;p=0.003)、mechanical lithotripsy(OR=1.857;95% C:1.122-3.07;p=0.016)、the gallbladder stone(OR=2.015;95% CI:1.060-4.181;p=0.034)、the gallbladder wall get thickening(OR=2.156;95% CI:1.453-3.199;p=0.001)were independent risk factors for PEP.The ROC curve had an AUC of0.691(95%CI:0.642-0.740),The external validation enrolled 540 patients(57 PEP patients),the ROC curve by former risk factors had an AUC of0.747(95%CI:0.687-0.806),the decision analysis curve and clinical impact curve proved the accuracy.The nomogram model showed the prediction ability by these factors.Conclusions:The RF model both validated by logistic regression based on the WBC count,EPBD,increase in WBC,residual CBD stones after ERCP,serum amylase levels,and mechanical lithotripsy can accurately predicted the occurrence of PEC.The incidence of PEP is related to gallbladder status.Especially in patients with gallbladder stones and gallbladder wall thickening,and history of acute pancreatitis also affected PEP.If these patients have preoperative white blood cell increase,the operation should be cautious during the operation,and try to avoid the guide wire entering the pancreatic duct and mechanical lithotripsy. |