Skip to main content
BMC Gastroenterology logoLink to BMC Gastroenterology
. 2026 Jul 2;26:587. doi: 10.1186/s12876-026-05057-0

Predictive factors and nomogram for post-endoscopic retrograde cholangiopancreatography pancreatitis

Huaizhou Yuan 1,✉, Haiping Wang 1
PMCID: PMC13617894  PMID: 42393582

Abstract

Background

Endoscopic retrograde cholangiopancreatography (ERCP) is a cornerstone of minimally invasive diagnosis and treatment for pancreaticobiliary diseases. However, post-ERCP pancreatitis (PEP), the most common complication, occurs with a relatively high incidence and can lead to organ failure or even death in severe cases. The effectiveness of existing preventive measures is highly dependent on accurate risk stratification, while empirical clinical judgment lacks consistency, underscoring the urgent need for objective and individualized predictive tools.

Objective

To identify independent risk factors for PEP and to construct a nomogram prediction model for individualized risk assessment in patients undergoing ERCP.

Methods

Clinical data from 289 patients who underwent ERCP at Jinzhong First People’s Hospital between January 2020 and October 2025 were retrospectively analyzed. Patients were divided into PEP and non-PEP groups according to the consensus diagnostic criteria. Univariate analysis was performed to compare demographic characteristics, clinical factors, procedural details, and laboratory parameters between the two groups. Least absolute shrinkage and selection operator (LASSO) regression was used for feature selection, followed by multivariate logistic regression analysis to identify independent risk factors for PEP. A nomogram prediction model was constructed based on these factors. Model performance was evaluated using the area under the receiver operating characteristic curve (AUC), calibration curves, and decision curve analysis (DCA) in the training cohort (n = 202) and validation cohort (n = 87).

Results

The incidence of PEP in this cohort was 10.73% (31/289). Multivariate logistic regression analysis identified five independent risk factors for PEP: sphincter of Oddi dysfunction, history of pancreatitis, pancreatic duct opacification, difficult cannulation, and guidewire access to the pancreatic duct (≥ 3 times). Elevated total bilirubin (TBil) level was identified as an independent protective factor against PEP. The nomogram incorporating these factors demonstrated excellent predictive performance, with AUC values of 0.922 (95%CI: 0.865–0.980) in the training cohort and 0.915 (95%CI: 0.878–0.951) in the validation cohort. Calibration curves showed good agreement between predicted probabilities and actual observations (Hosmer-Lemeshow test P > 0.05), and DCA confirmed the model’s clinical utility across a wide range of threshold probabilities.

Conclusion

The nomogram model constructed in this study integrates six easily accessible clinical and operational factors, provides an effective and reliable tool for individualized prediction of PEP risk. This model can assist clinicians in early identification of high-risk patients, facilitating targeted preventive interventions and potentially improving the safety of ERCP procedures.

Supplementary Information

The online version contains supplementary material available at https://doi.org/10.1186/s12876-026-05057-0.

Keywords: Endoscopic retrograde cholangiopancreatography, Pancreatitis, Risk factors, Nomogram, Prediction model

Introduction

Endoscopic retrograde cholangiopancreatography (ERCP) is a core minimally invasive technique for the diagnosis and treatment of hepatobiliary and pancreatic diseases. Owing to its advantages of minimal trauma and rapid postoperative recovery, it is widely used in the clinical management of common bile duct stones, biliary strictures, chronic pancreatitis, and other related conditions [1, 2]. However, as an invasive procedure, complications following ERCP remain a key factor limiting its safety [3]. Among these complications, post-ERCP pancreatitis (PEP) is recognized as one of the most common and concerning, with reported incidences ranging from 1% to 40% across different studies [4, 5]. The occurrence of PEP not only leads to exacerbated abdominal pain and prolonged hospitalization but also significantly increases healthcare costs and economic burden. More critically, approximately 5% of PEP cases may progress to severe pancreatitis, triggering systemic inflammatory response, multiorgan failure, and even death, with a mortality rate of about 0.2% [6]. Therefore, the prevention and management of PEP have become central to enhancing the overall safety and efficacy of ERCP.

At present, the clinical prevention strategy for PEP is relatively well-established. Measures such as rectal administration of non-steroidal anti-inflammatory drugs and prophylactic pancreatic stent placement have been recommended by guidelines as first-line interventions for high-risk patients [7, 8]. However, the effective application of these preventive measures highly depends on accurate assessment of an individual patient’s risk of PEP. Currently, clinical practice remains largely dependent on empirical judgment by physicians, which suffers from strong subjectivity, insufficient standardization, and considerable inter-individual variability in risk assessment, making it difficult to achieve precise and personalized risk intervention. Against this background, developing a scientific and objective risk prediction model is of significant clinical importance. In recent years, several risk prediction models for pancreatitis have been developed by researchers, providing important references for clinical risk identification [9–11]. Nevertheless, most of these models were constructed based on general pancreatitis populations and included predominantly postoperative inflammatory markers and parameters related to disease severity, without focusing on procedure-specific risk factors associated with ERCP. Moreover, some existing PEP-specific models involve only a limited set of variables, such as patient baseline characteristics or basic laboratory parameters, while overlooking key intraoperative risk factors including difficult cannulation, repeated guidewire entry into the pancreatic duct, and pancreatic duct opacification, thereby lacking sufficient dimensions for risk assessment [12]. In addition, some models incorporate complex indicators with high testing costs and complicated calculation procedures, which limits their rapid applicability in emergency settings or during procedures, resulting in poor clinical utility. Furthermore, most of these models lack rigorous internal validation and clinical utility assessment.

Given the above limitations, existing prediction tools fail to meet the clinical need for individualized and precise assessment of PEP risk. To address these gaps, the present study integrated multidimensional clinical parameters, including patient baseline characteristics, preoperative laboratory indicators, and key intraoperative procedural factors of ERCP. The least absolute shrinkage and selection operator (LASSO) regression was used to avoid model overfitting, followed by multivariate logistic regression to identify independent risk factors for PEP, and a novel visualized nomogram prediction model was developed. All variables included in this model are routinely available in clinical practice, balancing predictive accuracy with clinical convenience. This model aims to provide a scientific and reliable quantitative tool for early identification of high-risk patients and implementation of individualized preventive interventions, thereby supporting the reduction of PEP incidence and improving the overall safety of ERCP procedures.

Materials and methods

Study subjects

Clinical data from 289 patients who underwent ERCP at the Department of Gastroenterology, First People’s Hospital of Jinzhong, between January 2020 and October 2025 were retrospectively analyzed. Inclusion criteria were: (1) age ≥ 18 years; (2) patients undergoing ERCP for biliary or pancreatic diseases with indications conforming to current clinical guidelines; (3) complete clinical data; (4) normal preoperative serum amylase levels. Exclusion criteria were: (1) patients with a confirmed diagnosis of acute pancreatitis or acute exacerbation of chronic pancreatitis before the procedure; (2) patients undergoing ERCP for emergency conditions such as acute cholangitis or acute biliary pancreatitis; (3) patients with a history of pancreatectomy; (4) patients undergoing concurrent procedures during ERCP that could affect pancreatic status, such as percutaneous transhepatic cholangial drainage or laparoscopic surgery; (5) pregnant women; (6) patients with incomplete clinical data. All ERCP procedures in this study were performed by senior endoscopists with at least five years of experience in ERCP. This study adhered strictly to medical research ethical standards, and the study protocol was reviewed and approved by the Ethics Committee of First People’s Hospital of Jinzhong. As a retrospective study involving only the collection and analysis of historical medical records without altering patients’ established treatment plans or involving additional invasive procedures or interventions, the Ethics Committee approved the waiver of informed consent.

Diagnostic criteria and severity classification of PEP

The diagnosis and severity classification of PEP in this study strictly followed the internationally accepted Cotton consensus criteria [13]. Based on these criteria, patients were divided into PEP group and non-PEP group. The severity of PEP was classified into mild, moderate, and severe grades according to the length of hospital stay and complications. Meanwhile, all study subjects were randomly allocated into a training set (n = 202) and a validation set (n = 87) at a ratio of 7:3 for subsequent model performance evaluation and validation.

Data collection

General clinical data were collected for all patients, including sex, age, body mass index (BMI), underlying diseases (hypertension, diabetes mellitus, common bile duct stones, and Oddi sphincter dysfunction), smoking status, alcohol consumption status, and relevant medical history. Additionally, ERCP procedure-related factors were recorded, including pancreatic duct opacification, difficult cannulation, guidewire entry into the pancreatic duct (≥ 3 times), endoscopic pancreatic sphincterotomy, and endoscopic biliary sphincterotomy. Laboratory parameters included: neutrophil (NE) count, lymphocyte (LY) count, platelet (PLT) count, monocyte (MO) count, C-reactive protein (CRP), alkaline phosphatase (ALP), albumin (ALB), prothrombin time (PT), fibrinogen (FIB), serum total bilirubin (TBil), alanine aminotransferase (ALT), aspartate aminotransferase (AST), gamma-glutamyltransferase (GGT), systemic immune-inflammation index (SII), monocyte-to-lymphocyte ratio (MLR), neutrophil-to-monocyte ratio (NMR), neutrophil-to-lymphocyte ratio (NLR), and platelet-to-lymphocyte ratio (PLR).

In this study, the diagnosis of Oddi sphincter dysfunction was based on clinical manifestations, laboratory findings, and imaging results, in accordance with the Rome IV criteria [14]. The diagnosis required that patients present with recurrent biliary or pancreatic-type abdominal pain, accompanied by transient elevations in liver function tests or pancreatic enzymes, or imaging evidence of bile duct dilation, with exclusion of biliary or pancreatic tumors and other organic diseases by examinations including abdominal ultrasound and computed tomography. All diagnoses were independently confirmed by two senior gastroenterologists. Furthermore, the number of guidewire passages into the pancreatic duct was defined as the number of attempts during the procedure in which the guidewire tip crossed the duodenal papilla and entered the main pancreatic duct, with each withdrawal and re-entry counted as one passage. Only successful entries into the pancreatic duct confirmed under fluoroscopy were counted in this study; ineffective attempts such as minimal papillary contact, failure to enter the pancreatic duct, or immediate withdrawal were not included. During data extraction, two investigators independently reviewed the ERCP procedure records and extracted the number of guidewire entries into the pancreatic duct as documented by the operator. Discrepancies were resolved through discussion or by consulting a third senior endoscopist.

Perioperative preventive measures

The perioperative preventive measures were as follows: In our department, all patients without contraindications routinely received a 100 mg indomethacin suppository rectally immediately after the procedure. For patients who experienced repeated guidewire passages into the pancreatic duct (≥ 3 times) or pancreatic duct opacification during the procedure, a 5Fr pancreatic stent (Cook Ireland Ltd., Ireland) was selectively placed at the operator’s discretion. It should be noted that the use of these preventive measures was not completely uniform across all patients in this study. Therefore, in the subsequent statistical analyses, “use of rectal indomethacin” and “placement of a pancreatic stent” were included as two independent covariates for adjustment.

Statistical analysis

Statistical analysis was performed using SPSS 26.0 software, and R software (version 4.2.1) was used for nomogram construction and model validation. Measurement data conforming to normal distribution were expressed as mean ± standard deviation, with comparisons between groups using Student’s t-test. Measurement data not conforming to normal distribution were expressed as M (P25, P75), with comparisons between groups using the Mann-Whitney U test. Count data were expressed as numbers and percentages, with comparisons between groups using the χ² test. Following univariate analysis, the least absolute shrinkage and selection operator (LASSO) regression with 10-fold cross-validation was used for feature selection to identify independent predictive features. Subsequently, based on the variables selected by LASSO regression, a multivariate logistic regression analysis was further performed to adjust for potential confounding effects among the variables, evaluate the independent associations of each variable with PEP, and ultimately construct a nomogram-based risk prediction model. The dataset was randomly divided into a training set and a test set in a 7:3 ratio according to the predefined procedure. The performance and clinical value of the nomogram model were evaluated and validated using the area under the receiver operating characteristic (ROC) curve (AUC), calibration curves, and decision curve analysis (DCA). Given the limited number of PEP events (n = 31) in this study, to assess the potential degree of overfitting and correct for optimism, we performed internal validation using bootstrap resampling with 1000 replicates. The optimism-corrected area under the curve (AUC) and calibration slope were calculated to evaluate the stability and discriminative ability of the prediction model. An AUC > 0.75 indicated that the model’s discriminative ability reached a clinically acceptable level. A P-value > 0.05 in the Hosmer-Lemeshow test indicated no statistical difference between predicted probabilities and actual outcomes, suggesting good model calibration. The significance level was set at two-sided, with P < 0.05 considered statistically significant.

Results

Comparison of clinical data between PEP and Non-PEP groups

Among the 289 patients who underwent ERCP for hepatobiliary or pancreatic diseases in this study, PEP occurred in 31 cases, with an incidence rate of 10.73%. Comparative analysis of demographic and baseline clinical characteristics between the two groups (Table 1) showed that there were no statistically significant differences between the PEP group and the non-PEP group in terms of sex, age, BMI, smoking status, alcohol consumption history, prior ERCP history, hypertension, or diabetes mellitus (all P > 0.05). Compared with the non-PEP group, the PEP group had significantly higher proportions of patients presenting with common bile duct stones, Oddi sphincter dysfunction, and a history of prior pancreatitis (P < 0.05). Regarding PEP severity, the majority of PEP patients in this study had mild PEP (25 cases, 80.65%), followed by moderate PEP (5 cases, 16.13%) and severe PEP (1 case, 3.22%).

Table 1.

Demographic and clinical characteristics

Variables PEP group (n = 31) Non-PEP group (n = 258) Statistical value P value
Demographics
Sex 1.607 0.205
 Male 10 (32.26) 114 (44.19)
 Female 21 (67.74) 144 (55.81)
Age (years) 1.867 0.172
 < 60 20 (64.52) 133 (51.55)
 ≥ 60 11 (35.48) 125 (48.45)
BMI (kg/m2) 21.79 ± 1.25 22.14 ± 1.32 1.402 0.162
Smoking 0.221 0.638
 Yes 13 (41.94) 97 (37.60)
 No 18 (58.06) 161 (62.40)
Drinking 0.270 0.603
 Yes 8 (25.81) 56 (21.71)
 No 23 (74.19) 202 (78.29)
Characteristics
History of ERCP 3.270 0.071
 Yes 2 (6.45) 4 (1.55)
 No 29 (93.55) 254 (98.45)
Hypertension 0.097 0.755
 Yes 9 (29.03) 82 (31.78)
 No 22 (70.97) 176 (68.22)
Diabetes mellitus 0.246 0.620
 Yes 3 (9.68) 33 (12.79)
 No 28 (90.32) 225 (87.21)
History of pancreatitis 6.682 0.010
 Yes 4 (12.90) 8 (3.10)
 No 27 (87.10) 250 (96.90)
Common bile duct stones 5.382 0.020
 Yes 19 (61.29) 102 (39.53)
 No 12 (38.71) 156 (60.47)
Sphincter of Oddi dysfunction 12.399 < 0.001
 Yes 22 (70.97) 98 (37.98)
 No 9 (29.03) 160 (62.02)
Severity — —
 Mild 25 (80.65) 0 (0)
 Moderate 5 (16.13) 0 (0)
 Severe 1 (3.22) 0 (0)

Categorical variables are presented as counts (percentages), and intergroup comparisons were performed using the χ² test, with the test statistic reported as the χ²-value

BMI Body mass index

ERCP procedural factors and prophylactic measures

Comparative analysis (Table 2) showed that ERCP procedure time > 60 min, pancreatic duct opacification, pancreatic sphincterotomy, difficult cannulation, and multiple guidewire passages into the pancreatic duct (≥ 3 times) were significantly associated with the occurrence of PEP (P < 0.05).

Table 4.

Multivariate logistic regression analysis of independent factors influencing PEP

Variables β SE Wald χ2 OR (95% CI) P
Sphincter of Oddi dysfunction 0.387 0.157 6.076 1.473 (1.083 ~ 2.003) 0.014
History of pancreatitis 0.823 0.176 21.798 2.277 (1.607 ~ 3.229) < 0.001
Pancreatic duct opacification 0.542 0.218 6.168 1.719 (1.128 ~ 2.619) 0.013
Difficult cannulation 0.354 0.175 4.102 1.424 (1.015 ~ 2.000) 0.043
Guidewire repeatedly enters pancreatic duct 1.614 0.616 6.865 5.023 (1.502 ~ 16.800) 0.009
TBiL −0.620 0.255 5.912 0.538 (0.326 ~ 0.887) 0.015

TBiL Total bilirubin, SII Systemic immune-inflammation index

Table 2.

ERCP operation related variables

Variables PEP group (n = 31) Non-PEP group (n = 258) Statistical value P value
Procedural factors
ERCP procedure time > 60 min 4.048 0.044
 Yes 5 (16.13) 16 (6.20)
 No 26 (83.87) 242 (93.80)
Pancreatic duct opacification 11.482 0.001
 Yes 16 (51.61) 60 (23.26)
 No 15 (48.39) 198 (76.74)
Endoscopic sphincterotomy of bile duct 0.360 0.548
 Yes 20 (64.52) 152 (58.91)
 No 11 (35.48) 106 (41.09)
Endoscopic sphincterotomy of pancreatic duct 5.039 0.025
 Yes 18 (58.06) 96 (37.21)
 No 13 (41.94) 162 (62.79)
Difficult cannulation 9.838 0.002
 Yes 15 (48.39) 58 (22.48)
 No 16 (51.61) 200 (77.52)
Guidewire access to pancreatic duct (≥ 3 times) 4.585 0.032
 Yes 14 (45.16) 69 (26.74)
 No 17 (54.84) 189 (73.26)
Prophylactic measures
Rectal indomethacin use 0.179 0.672
 Yes 24 (77.42) 208 (80.62)
 No 7 (22.58) 50 (19.38)
Prophylactic pancreatic stent placement 2.406 0.121
 Yes 10 (32.26) 52 (20.16)
 No 21 (67.74) 206 (79.84)

Categorical variables are presented as counts (percentages), and intergroup comparisons were performed using the χ2 test, with the test statistic reported as the χ2-value

ERCP  Endoscopic retrograde cholangiopancreatography

Comparison of laboratory parameters between the PEP group and the Non-PEP group

Analysis of laboratory parameters (Table 3) showed that preoperative levels of NE, CRP, ALT, and AST were significantly higher in the PEP group than in the non-PEP group (P < 0.01), whereas the LY level was significantly lower in the PEP group (P < 0.01). Regarding composite indicators reflecting systemic inflammatory status, the SII, NLR, MLR, PLR, and NMR were all significantly higher in the PEP group than in the non-PEP group (P < 0.01). Furthermore, there was a significant difference in the distribution of TBiL between the two groups (P = 0.005), with a higher proportion of patients having TBiL ≤ 21 µmol/L in the PEP group (38.71% vs. 17.44%).

Table 3.

Laboratory testing and derived indicators

Variables PEP group (n = 31) Non-PEP group (n = 258) Statistical value P value
NE (×109/L) 5.91 ± 1.01 4.43 ± 0.70 10.542 < 0.001
LY (×109/L) 1.10 ± 0.24 1.34 ± 0.29 4.427 < 0.001
PLT (×109/L) 222.91 ± 84.59 212.50 ± 74.78 0.722 0.471
CRP (mg/L) 67.14 (7.03, 96.90) 30.84 (2.50, 40.40) 8.620 < 0.001
MO (×109/L) 0.52 (0.36, 0.63) 0.46 (0.30, 0.51) 1.031 0.137
ALP (U/L) 231.93 ± 204.92 220.14 ± 183.92 0.333 0.739
ALB (g/L) 37.51 ± 5.99 37.77 ± 5.41 0.250 0.803
PT (s) 11.67 ± 1.31 11.64 ± 1.52 0.105 0.916
FIB (g/L) 90.63 ± 21.68 92.84 ± 22.79 0.513 0.609
TBiL (µmol/L) 7.906 0.005
 ≤ 21 12 (38.71) 45 (17.44)
 > 21 19 (61.29) 213 (82.56)
TC (mmol/L) 4.23 (3.61, 4.82) 4.40 (3.77, 5.24) 0.076 0.329
TG (mmol/L) 1.20 (0.85, 1.80) 1.20 (0.85, 1.90) 0.123 0.902
ALT (U/L) 62.0 (30.5, 132.0 ) 26.0 (16.0, 116.0) 9.720 < 0.001
AST (U/L) 44.55 (28.70, 113.20) 28.00 (20.0, 70.50) 7.830 < 0.001
GGT (U/L) 366.71 ± 286.30 388.30 ± 369.11 0.314 0.754
SII 959.14 (718.71, 1211.91) 892.29 (349.70, 981.60) 7.260 < 0.001
NLR 10.94 (3.20, 12.80) 4.52 (1.89, 5.21) 5.640 < 0.001
MLR 0.61 ± 0.29 0.38 ± 0.18 6.223 < 0.001
PLR 247.92 ± 108.58 185.46 ± 99.74 3.263 0.001
NMR 17.20 ± 15.89 11.89 ± 9.63 2.670 0.008

Normally distributed continuous variables are presented as mean ± standard deviation (SD), and intergroup comparisons were performed using the independent samples t-test, with the test statistic reported as the t-value. Categorical variables are presented as counts (percentages), and intergroup comparisons were performed using the χ2 test, with the test statistic reported as the χ2-value. Non-normally distributed continuous variables are presented as median (interquartile range) [M (P25, P75)], and intergroup comparisons were performed using the Mann-Whitney U test, with the test statistic reported as the Z-value

NE Neutrophils, LY Lymphocytes, PLT Platelets, CRP C-reactive protein, MO Monocytes, ALP Alkaline phosphatase, ALB Albumin, FIB Fibrinogen, TBiL total bilirubin, TC Total Cholesterol, TG Triglycerides, ALT Alanine aminotransferase, AST Aspartate aminotransferase, GGT Gamma-glutamyl transferase, SII Systemic immune-inflammation index, NLR Neutrophil-to-lymphocyte ratio, MLR Monocyte-to-lymphocyte ratio, PLR Platelet-to-lymphocyte ratio, NMR Neutrophil-to-monocyte ratio

Variable selection

LASSO regression with regularization was used for further variable selection (Fig. 1A). Each curve in the figure represents the trajectory of a variable. As the λ value increases, the influence of the regularization term intensifies, compressing coefficients with weaker correlations to zero, thereby achieving feature selection. Simultaneously, 10-fold cross-validation was used to calculate the optimal λ value, balancing model bias and variance. The minimum λ value from the model fit was 0.055 (Fig. 1B). Ultimately, this method identified nine optimal variables: choledocholithiasis, sphincter of Oddi dysfunction, history of pancreatitis, pancreatic duct opacification, difficult cannulation, guidewire entry into the pancreatic duct (≥ 3 times), endoscopic pancreatic sphincterotomy, TBil, and SII. It is worth noting that although ERCP procedure time > 60 min was significant in the univariate analysis (P = 0.044), its coefficient was compressed to zero as the λ value increased in the LASSO regression. This was primarily due to multicollinearity between this variable and “difficult cannulation” as well as “multiple guidewire passages into the pancreatic duct” (r = 0.62, P < 0.001). To avoid multicollinearity, this variable was not included among the candidate predictors.

Fig. 1.

Fig. 1

LASSO regression screens the potential predictor variables. A Plot of the Lasso regression path; B: 10-fold cross validation

Multivariate logistic regression analysis of factors influencing PEP

To control for the influence of confounding factors, we constructed a multivariate logistic regression model incorporating multiple variables, with the occurrence of PEP as the dependent variable. Based on the analysis results, only statistically significant variables were retained in the final model: Oddi dysfunction (OR = 1.473, 95% CI: 1.083–2.003, P = 0.014), history of pancreatitis (OR = 2.277, 95% CI: 1.607–3.229, P < 0.001), pancreatic duct opacification (OR = 1.719, 95% CI: 1.128–2.619, P = 0.013), difficult cannulation (OR = 1.424, 95% CI: 1.015-2.000, P = 0.043), and guidewire entry into the pancreatic duct (≥ 3 times) (OR = 5.023, 95% CI: 1.502–16.800, P = 0.009) were identified as independent risk factors for PEP, while TBil level (OR = 0.538, 95% CI: 0.326–0.887, P = 0.015) was identified as an independent protective factor. Common bile duct stones, endoscopic pancreatic sphincterotomy, and SII, which were selected by LASSO regression, did not reach statistical significance in the multivariate analysis and were therefore not included in the final model. The variables included in the final model and the corresponding results are presented in Table 4.

Development of the nomogram risk prediction model for post-ERCP pancreatitis

A nomogram risk prediction model for PEP occurrence was constructed based on the results of the multivariate logistic regression analysis (Fig. 2). In the nomogram, the value of each independent variable corresponds to a score on the topmost scale. The scores for individual variables are summed to obtain a total score, which is then mapped to a risk threshold to calculate the predicted probability of PEP occurrence in patients undergoing ERCP.

Fig. 2.

Fig. 2

Nomogram prediction model for predicting the risk of PEP after ERCP

Performance evaluation and internal validation of the nomogram prediction model

Through random sampling in a 7:3 ratio, the training set comprised 202 patients, and the test set comprised 87 patients. Subsequently, ROC curves, calibration curves, and DCA were used to evaluate the predictive performance of the nomogram model in both the training and validation sets. The ROC analysis (Fig. 3) showed that the AUC values for the training set and the validation set were 0.922 (95% CI: 0.865–0.980) and 0.915 (95% CI: 0.878–0.951), respectively. Given the limited number of PEP events in this study, we further performed internal validation using the Bootstrap resampling method (1,000 repetitions) to assess the potential degree of model overfitting and to correct for optimistic estimates. The results showed that the optimism-corrected AUC was 0.878 (95% CI: 0.812–0.926), which remained significantly higher than the clinically acceptable threshold of 0.75. These findings indicate that although the model exhibits mild optimistic bias, no severe overfitting is present, and its predictive performance demonstrates good stability.

Fig. 3.

Fig. 3

ROC curve of nomogram model for predicting PEP occurrence after ERCP. A Training cohort; B Validation cohort

Calibration curves were used to assess the predictive accuracy of the nomogram model (Fig. 4). The results showed that the predicted probabilities of the model were highly consistent with the actual risks. Furthermore, the calibration curves of the prediction model approached the ideal calibration line with good fit (Hosmer-Lemeshow test P > 0.05 for both training and validation sets), indicating good discrimination between model predictions and actual observations.

Fig. 4.

Fig. 4

Calibration curve of nomogram model for predicting PEP occurrence after ERCP. A Training cohort; B Validation cohort

We further validated the clinical utility of the model using DCA curves (Fig. 5). The results showed that when the threshold probability ranged from 10% to 80%, the model provided significant net benefit for clinical decision-making. This finding was consistent with the results shown for the validation set.

Fig. 5.

Fig. 5

Decision curve analysis of nomogram model for predicting PEP occurrence after ERCP. A Training cohort; B Validation cohort

Discussion

PEP is the most representative complication after ERCP, resulting from the interaction between the patient’s baseline status and intraoperative injury [15]. In this retrospective study of 289 patients undergoing ERCP, the incidence of PEP at our center was 10.73%, consistent with previous reports [6, 16], indicating that PEP remains a major clinical concern despite the increasing maturity of ERCP techniques. Using LASSO regression combined with multivariate logistic regression analysis, we identified six independent predictors of PEP: Oddi sphincter dysfunction, history of pancreatitis, pancreatic duct opacification, difficult cannulation, repeated guidewire entry into the pancreatic duct (≥ 3 times), and TBiL level. The nomogram developed from these factors showed good discrimination (training set AUC = 0.922, validation set AUC = 0.915). Bootstrap internal validation yielded a bias-corrected AUC of 0.878, suggesting no severe overfitting. The calibration curve showed good agreement between predicted and observed probabilities (Hosmer-Lemeshow test P > 0.05), and decision curve analysis confirmed clinical net benefit across a threshold probability range of 10%-80%.

PEP is the most common complication after ERCP, but its pathogenesis remains incompletely understood. Current research suggests that mechanical injury, chemical injury, post-procedural papillary edema leading to impaired pancreatic juice drainage, thermal injury, and inflammatory responses collectively lead to premature activation of proteolytic enzymes within pancreatic acinar cells, triggering pancreatic autodigestion and thus inducing PEP [17]. The independent risk factors identified in this study align well with the pathogenesis of PEP. A history of pancreatitis increases the vulnerability of the pancreatic parenchyma [18]. a finding consistent with the ESGE guideline [19]. Although previous studies suggested that chronic pancreatitis plays a protective role in PEP development, a recent study by Zhao et al. showed that the risk of PEP in patients with chronic pancreatitis is comparable to that in patients with biliary disease (4.5% vs. 4.8%) [20]. Therefore, clinicians should be alert to the high risk of PEP regardless of the type of pancreatitis history. Furthermore, patients with Oddi sphincter dysfunction have elevated baseline sphincter pressure or spasm, leading to impaired drainage of pancreatic juice and bile. Mechanical stimulation during ERCP can further induce sphincter spasm, increasing intra-pancreatic duct pressure and thereby inducing PEP, although the specific mechanism requires further investigation. Although the diagnosis of this condition in our study had some subjectivity, multivariate logistic regression adjusting for confounding factors still showed that Oddi sphincter dysfunction was independently associated with PEP, consistent with previous literature [21]. Therefore, we believe that diagnostic bias regarding Oddi sphincter dysfunction has limited impact on the overall performance and core conclusions of our model.

Intraoperative factors are the core risk triggers specific to ERCP. Guidewire-guided selective bile duct cannulation is a technical challenge in ERCP for biliary diseases. Due to anatomical variations, impacted stones, papillary stenosis, tumor invasion, and other reasons, selective cannulation fails in some patients. In difficult cannulation cases, the guidewire tends to enter the pancreatic duct inadvertently. After entering the pancreatic duct, the guidewire can dilate and rub against the Oddi sphincter, causing post-procedural sphincter spasm and papillary edema, which impede pancreatic juice drainage—this is a major cause of PEP. In addition, repeated advancement and withdrawal of the guidewire within the pancreatic duct can cause friction and damage to the ductal epithelial cells, inducing postoperative acute pancreatic inflammation [22]. Moreover, repeated dilation of the pancreatic sphincter by the guidewire can lead to contrast medium reflux into the pancreatic duct, and the injection pressure can cause intraductal hypertension and premature activation of pancreatic enzymes, thereby increasing PEP risk [23]. Studies have confirmed that the number of pancreatic duct opacifications is positively correlated with PEP risk: the incidence is 1.3% with one opacification, increases to approximately 10% with 5–7 opacifications, and exceeds 20% with more than 10 opacifications [24]. In response to these risk factors, prophylactic pancreatic stent placement can be used to mitigate the injury caused by repeated guidewire entry into the pancreatic duct; during pancreatic duct opacification, the contrast volume should be minimized and injected slowly to avoid hydrostatic injury. Furthermore, difficult cannulation significantly increases the risk of ERCP-related complications, especially pancreatitis [25].Studies have shown that difficult cannulation and increased cannulation attempts can irritate the papillary sphincter, causing local congestion and edema, leading to outflow obstruction of pancreatic juice and thus inducing PEP [12]. Halttunen et al. [26] reported that the PEP incidence was 2.8% in patients with successful first-pass cannulation, rising to 11.5% after a second attempt, with longer cannulation time associated with higher risk. Clinically, preoperative rectal indomethacin, double-guidewire cannulation, and prophylactic pancreatic sphincterotomy can reduce the incidence of PEP.

Notably, we found that TBiL is an independent protective factor for PEP, which is consistent with several previous authoritative studies [27]. According to the ESGE guideline, patients with normal preoperative bilirubin levels have a significantly higher risk of PEP than those with elevated preoperative bilirubin levels [25]. The reason may be that elevated bilirubin is often associated with biliary obstruction and bile duct dilation, making the bile duct opening easier to identify and cannulation relatively easier. However, when bilirubin levels are normal, the bile duct is not dilated, the opening is difficult to identify, and cannulation becomes more challenging, predisposing to papillary injury [27].In addition to the above risk factors, some researchers have found that ERCP procedure time is an independent risk factor for PEP, but we did not observe this association in our study, possibly due to limited sample size and operator proficiency. Furthermore, although rectal indomethacin and prophylactic pancreatic stents are guideline-recommended preventive measures, we did not observe their statistically significant protective effects in this study. The main reasons are likely indication bias (both measures tend to be used in high-risk patients) and insufficient statistical power due to sample size limitations, even after adjusting for these factors in the multivariate model.

In recent years, several PEP prediction models have been published. Chen et al. [28] developed a machine learning-based PEP prediction model with an AUC of 0.845, but the sample was limited to patients with common bile duct stones. Brenner et al. [29]developed a gradient boosting machine-based PEP risk calculator with an AUC of only 0.70–0.74, indicating limited predictive performance. The SuPER model established by Sugimoto et al. [30] includes only five preprocedural factors and does not incorporate intraoperative variables, potentially underestimating actual risk. A Japanese multicenter prospective study constructed an 11-factor scoring model but did not provide a visualization tool [31]. Compared with these mainstream PEP prediction models, our nomogram has the following advantages: (1) Comprehensive variables: it integrates patient baseline history, intraoperative risk factors, and preoperative protective laboratory indicators, covering both patient susceptibility factors and ERCP-specific procedural injury factors, addressing the limitations of previous models with partial assessments and prediction blind spots; (2) Good predictive performance: the training set and validation set AUCs reached 0.922 and 0.915, respectively, with good calibration (Hosmer-Lemeshow test P > 0.05), and predicted probabilities closely matched actual clinical incidence; (3) Strong clinical utility: the visualized nomogram enables bedside rapid risk quantification, facilitating individualized risk probability calculation by clinicians; (4) Rigorous methodology: LASSO regression combined with multivariate logistic regression was used to accurately screen core predictors, retaining independent significant indicators while eliminating confounding and meaningless redundant variables, minimizing overfitting risk, and achieving both variable parsimony and representativeness, with statistical efficiency and stability superior to traditional models.

Admittedly, the present study has the following limitations. First, the single-center retrospective design and limited sample size (only 31 PEP events) may introduce selection bias and reduce statistical power. The limited events per variable may lead to overestimation of effect sizes, wider confidence intervals, and decreased model stability. Therefore, our model should be considered exploratory and requires further validation in independent external validation cohorts with larger sample sizes. Second, the lack of external validation limits the generalizability of the model, which needs confirmation through multicenter, large-sample studies. Third, some potential confounders (such as operator experience and details of preventive measures) were not included in the analysis. Future multicenter prospective studies should be conducted to incorporate more predictors and standardized records of preventive measures, complete external model validation, and more accurately assess the protective effects of rectal indomethacin and prophylactic pancreatic stents in real-world clinical practice.

Conclusions

In summary, Oddi sphincter dysfunction, history of pancreatitis, pancreatic duct opacification, difficult cannulation, and repeated guidewire entry into the pancreatic duct (≥ 3 times) are independent risk factors for PEP, while TBiL is a protective factor. The nomogram based on these factors demonstrates good predictive performance and clinical utility, providing a quantitative tool for individualized PEP risk assessment to improve the overall safety of ERCP procedures.

Supplementary Information

Supplementary Material 1. (785.3KB, pdf)

Acknowledgements

We would like to sincerely thank all the patients and their families involved in this study.

Authors’ contributions

Huaizhou Yuan ., conceptualization, visualization, writing—original draft; writing—review and editing. Haiping Wang., validation, writing—review and editing.

Funding

The authors declare that no funds, grants, or other financial support were received from any public, commercial, or not-for-profit entities for the conduct of this research, the preparation of this manuscript, or the decision to submit it for publication. The author confirms that there are no financial or non-financial conflicts of interest related to this work.

Data availability

The datasets used and/or analysed during the current study are available from the corresponding author on reasonable request.

Declarations

Ethics approval and consent to participate

All procedures follows the principles of the Declaration of Helsinki. This study was approved by the Medical Ethics Committee of the First People’s Hospital of Jinzhong(No.2026-013-01). Informed consent to participate was obtained from all of the participants in the study.

Consent for publication

Written informed consent was obtained from a legally authorized representative(s) for anonymized patient information to be published in this article.

Competing interests

The authors declare no competing interests.

Footnotes

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

References

  • 1.Cotton PB. Fifty years of ERCP: a personal review[J]. Gastrointest Endosc. 2018;88(2):393–6. [DOI] [PubMed] [Google Scholar]
  • 2.Telfah MM, Noble H, Mahon D, et al. Laparoscopic-assisted endoscopic retrograde cholangiopancreatography (ERCP) for bile duct stones after Roux-en-Y-gastric bypass: single-centre experience[J]. Obes Surg. 2020;30(12):4953–7. [DOI] [PubMed] [Google Scholar]
  • 3.Triki L, Tringali A, Arvanitakis M, et al. Prevention of post-ERCP complications[J]. Best Pract Res Clin Gastroenterol. 2024;69:101906. [DOI] [PubMed] [Google Scholar]
  • 4.Lee YS. Cannulation attempts and the development of post-ERCP pancreatitis[J]. Gastrointest Endosc. 2021;94(2):435–6. [DOI] [PubMed] [Google Scholar]
  • 5.Rainio M, Lindström O, Udd M, et al. Repeated negative urine trypsinogen-2 dipstick test rules out diagnosis of post-ERCP pancreatitis[J]. J Clin Gastroenterol. 2021;55(4):361–6. [DOI] [PubMed] [Google Scholar]
  • 6.Kochar B, Akshintala VS, Afghani E, et al. Incidence, severity, and mortality of post-ERCP pancreatitis: a systematic review by using randomized, controlled trials[J]. Gastrointest Endosc. 2015;81(1):143–9. [DOI] [PubMed] [Google Scholar]
  • 7.Fogel EL, Lehman GA, Tarnasky P, et al. Rectal indometacin dose escalation for prevention of pancreatitis after endoscopic retrograde cholangiopancreatography in high-risk patients: a double-blind, randomised controlled trial[J]. Lancet Gastroenterol Hepatol. 2020;5(2):132–41. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8.Leerhøy B, Elmunzer BJ. How to avoid post-endoscopic retrograde cholangiopancreatography pancreatitis[J]. Gastrointest Endosc Clin N Am. 2018;28(4):439–54. [DOI] [PubMed] [Google Scholar]
  • 9.Li B, Wu W, Liu A, et al. Establishment and validation of a nomogram prediction model for the severe acute pancreatitis[J]. J Inflamm Res. 2023;16:2831–43. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Ratiu I, Bende R, Nica C, et al. Prediction models of severity in acute biliary pancreatitis[J]. Diagnostics (Basel). 2025;15(2):126. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11.Yang K, Song Y, Su Y, et al. Establishment and validation of an early predictive model for severe acute pancreatitis[J]. J Inflamm Res. 2024;17:3551–61. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.Ergin E, Oruç N, Ersöz G, et al. Prognosis and risk factors of ERCP pancreatitis in elderly[J]. Sci Rep. 2021;11(1):15930. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Cotton PB, Lehman G, Vennes J, et al. Endoscopic sphincterotomy complications and their management: an attempt at consensus[J]. Gastrointest Endosc. 1991;37(3):383–93. [DOI] [PubMed] [Google Scholar]
  • 14.Cotton PB, Elta GH, Carter CR, et al. Rome IV. Gallbladder and sphincter of Oddi disorders[J]. Gastroenterology. 2016;150(6):S16–5085. [DOI] [PubMed] [Google Scholar]
  • 15.Friis C, Rothman JP, Burcharth J, et al. Optimal timing for laparoscopic cholecystectomy after endoscopic retrograde cholangiopancreatography: a systematic review[J]. Scand J Surg. 2018;107(2):99–106. [DOI] [PubMed] [Google Scholar]
  • 16.Kang X, Zheng L, Zeng W, et al. Risk factors for post-ERCP pancreatitis in high-risk patients receiving post-procedure rectal indomethacin[J]. J Gastrointest Surg. 2018;22(11):1903–10. [DOI] [PubMed] [Google Scholar]
  • 17.Yıldırım AE, Öztürk ZA, Konduk BT, et al. The safety and efficacy of ERCP in octogenarians: a comparison of two geriatric age cohorts[J]. Acta Gastroenterol Belg. 2017;80(2):263–70. [PubMed] [Google Scholar]
  • 18.Shih H, Hsu W, Kuo C. Postendoscopic retrograde cholangiopancreatography pancreatitis[J]. Kaohsiung J Med Sci. 2019;35(4):195–201. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 19.Dumonceau J, Kapral C, Aabakken L, et al. ERCP-related adverse events: European Society of Gastrointestinal Endoscopy (ESGE) guideline[J]. Endoscopy. 2020;52(2):127–49. [DOI] [PubMed] [Google Scholar]
  • 20.Zhao Z, Hu L, Ren H, et al. Incidence and risk factors for post-ERCP pancreatitis in chronic pancreatitis[J]. Gastrointest Endosc. 2017;86(3):519–24. [DOI] [PubMed] [Google Scholar]
  • 21.Zhou W, Li Y, Zhang Q, et al. Risk factors for postendoscopic retrograde cholangiopancreatography pancreatitis: a retrospective analysis of 7,168 cases[J]. Pancreatology. 2011;11(4):399–405. [DOI] [PubMed] [Google Scholar]
  • 22.Voiosu T, Bălănescu P, Voiosu A, et al. Measuring trainee competence in performing endoscopic retrograde cholangiopancreatography: a systematic review of the literature[J]. United Eur Gastroenterol J. 2019;7(2):239–49. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23.Nakai Y, Kusumoto K, Itokawa Y, et al. Emergency endoscopic retrograde cholangiopancreatography did not increase the incidence of postprocedural pancreatitis compared with elective cases: a prospective multicenter observational study[J]. Pancreas. 2022;51(1):41–7. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 24.Bruesehoff MP. ERCP: much ado about blockages. Update your knowledge about the diagnostic and therapeutic uses for endoscopic retrograde cholangiopancreatography[J]. Nursing. 2010;40(9):46–50. [DOI] [PubMed] [Google Scholar]
  • 25.Dumonceau J, Andriulli A, Elmunzer BJ, et al. Prophylaxis of post-ERCP pancreatitis: European Society of Gastrointestinal Endoscopy (ESGE) guideline - updated June 2014[J]. Endoscopy. 2014;46(9):799–815. [DOI] [PubMed] [Google Scholar]
  • 26.Halttunen J, Meisner S, Aabakken L, et al. Difficult cannulation as defined by a prospective study of the Scandinavian Association for Digestive Endoscopy (SADE) in 907 ERCPs[J]. Scand J Gastroenterol. 2014;49(6):752–8. [DOI] [PubMed] [Google Scholar]
  • 27.Zheng L, Wang X, Tao Q, et al. Different pattern of risk factors for post-ERCP pancreatitis in patients with biliary stricture[J]. Scand J Gastroenterol. 2018;53(5):604–10. [DOI] [PubMed] [Google Scholar]
  • 28.Chen K, Wang L, Wang X, et al. Machine learning-derived predictive model for post-ERCP pancreatitis in patients with common bile duct stones: a retrospective multicenter study[J]. Surg Endosc. 2025;39(12):8171–83. [DOI] [PubMed] [Google Scholar]
  • 29.Brenner T, Kuo A, Sperna Weiland CJ, et al. Development and validation of a machine learning-based, point-of-care risk calculator for post-ERCP pancreatitis and prophylaxis selection[J]. Gastrointest Endosc. 2025;101(1):129–38. [DOI] [PubMed] [Google Scholar]
  • 30.Sugimoto M, Takagi T, Suzuki T, et al. A new preprocedural predictive risk model for post-endoscopic retrograde cholangiopancreatography pancreatitis: the SuPER model[J]. Elife. 2025;13:RP101604. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 31.Fujita K, Yazumi S, Matsumoto H, et al. A clinical scoring model to predict post-endoscopic retrograde cholangiopancreatography pancreatitis in biliary endoscopic retrograde cholangiopancreatography for patients with intact papilla: a large multicenter prospective cohort study[J]. DEN Open. 2025;6(1):e70245. [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Supplementary Material 1. (785.3KB, pdf)

Data Availability Statement

The datasets used and/or analysed during the current study are available from the corresponding author on reasonable request.


Articles from BMC Gastroenterology are provided here courtesy of BMC

RESOURCES