🩺 Post-ERCP Pancreatitis Risk Prediction Simulator
This simulation helps users predict the risk of pancreatitis following ERCP (Endoscopic Retrograde Cholangiopancreatography). It provides a comprehensive understanding of the factors that contribute to post-ERCP pancreatitis and allows learners to develop strategies for minimizing this complication.
Patient-Related Risk Factors for Post-ERCP Pancreatitis
Post-ERCP pancreatitis (PEP) is the most common serious complication of ERCP, occurring in roughly 3–10% of all procedures. Risk is not distributed evenly: a defined set of patient characteristics — largely reflecting a young, hyper-reactive pancreatic sphincter and a naive papilla — multiplies the baseline risk several-fold before the endoscope even reaches the ampulla.
- 3–10%: Overall PEP incidence (unselected ERCP population)
- ~2×: Female sex risk multiplier (vs. male patients)
- up to 25–30%: Suspected SOD, no prophylaxis (single highest-risk group)
- ~2–3×: Prior PEP history multiplier (recurrence risk on repeat ERCP)
Defining the patient-related risk factor set
Multiple prospective cohorts and the ESGE/ASGE guideline synthesis converge on a consistent list of independent patient-related predictors of PEP:
• Age under 50 years — younger patients have a more reactive, higher-tone sphincter of Oddi and a pancreas more prone to autodigestive injury • Female sex — consistently ~2× risk across cohorts, likely reflecting smaller ducts, higher sphincter tone, and a higher prevalence of suspected SOD referrals • Suspected sphincter of Oddi dysfunction (SOD) — the single strongest patient factor; these patients often undergo ERCP for functional pain without overt structural pathology, and PEP rates without prophylaxis have been reported as high as 25–30% • Prior history of PEP — a patient who developed pancreatitis on a previous ERCP carries roughly 2–3× the risk on a repeat procedure • Normal serum bilirubin — paradoxically a risk factor, because a non-dilated, normal-caliber duct is technically harder to cannulate and more vulnerable to instrumentation trauma • Recurrent acute pancreatitis history — a pancreas already sensitized by prior inflammatory episodes reacts more briskly to ductal manipulation
Pathophysiology behind patient susceptibility
All patient-related risk factors converge on a common final pathway: transient outflow obstruction and/or direct acinar injury trigger premature intra-acinar activation of trypsinogen to trypsin, initiating the same autodigestive cascade seen in any acute pancreatitis, but confined (usually) to a mild, self-limited process.
A high-tone, spastic sphincter of Oddi (typical of SOD, younger patients, and women) resists the guidewire and catheter, increasing the number of cannulation attempts and the likelihood of inadvertent pancreatic duct entry. A small-caliber, non-dilated duct (signaled by normal bilirubin) offers a narrower target and a less forgiving margin for instrumentation. Patients with a prior PEP episode or recurrent pancreatitis have pancreatic tissue with lower reserve and a lower threshold for a second inflammatory insult.
Critically, these patient factors are non-modifiable — they cannot be changed by technique — which is precisely why risk-adapted prophylaxis strategies exist: the endoscopist cannot alter who the patient is, only how the procedure is performed and what pharmacologic protection is layered on top.
From individual factors to a stratification framework
No single patient factor by itself typically justifies calling a case "high-risk" — the guidelines instead use a threshold rule: the presence of ≥2 patient-related risk factors, or the presence of any one major/high-impact factor (most notably suspected SOD), is sufficient to classify a patient as high-risk for PEP.
This threshold approach is deliberately conservative. Because indomethacin prophylaxis is inexpensive, low-risk, and effective, professional society guidelines (ESGE 2020, ASGE) have progressively broadened its use toward nearly all ERCP patients rather than restricting it strictly to those meeting formal high-risk criteria — but formal patient-factor counting remains the backbone of pre-procedure risk communication and of decisions about adding a pancreatic duct stent.
A young woman with suspected SOD and a normal bilirubin level who has had a prior episode of PEP already meets or exceeds the ≥2-factor high-risk threshold before the scope is even inserted — this composite profile has historically carried reported PEP rates in the 20–40% range without any prophylactic measures.
Procedure-Related Risk Factors — How Technique Stacks the Odds
Once the procedure begins, a second, independent layer of risk accumulates on top of whatever patient-related risk already exists. These factors are technique- and anatomy-dependent, often unavoidable given the clinical indication, and they compound multiplicatively rather than simply adding — a difficult cannulation in a young woman is a fundamentally different risk profile than the same cannulation difficulty in an older man with a dilated duct.
- ~2–3×: PD injection/opacification (risk multiplier when contrast enters PD)
- ~2×: Precut (access) sphincterotomy (access-related mucosal trauma)
- >10 attempts: "Difficult" cannulation threshold (or >10 min at the papilla)
- ~4×: Balloon dilation of intact sphincter (vs. sphincterotomy alone)
The procedure-related risk factor set
The major procedure-related predictors identified across ERCP outcome registries include:
• Pancreatic duct injection/opacification — any contrast injection into the PD, even if unintentional, distends the ductal system and is one of the strongest independent procedural predictors • Pancreatic duct cannulation — guidewire or catheter passage into the PD, whether an isolated event or repeated during a difficult biliary attempt • Precut (access) sphincterotomy — a fistulotomy or needle-knife technique used when standard cannulation fails; the mucosal trauma of gaining access this way roughly doubles risk • Balloon dilation of an intact (non-sphincterotomized) biliary sphincter — now largely avoided for this reason, associated with a markedly higher PEP rate (historically implicated in ~4× risk) versus sphincterotomy • Difficult or prolonged cannulation — conventionally defined as more than 10 cannulation attempts, more than 10 minutes spent at the papilla, or more than 5 inadvertent PD cannulations • Failed stone extraction — an incomplete procedure often means repeated instrumentation and unresolved ductal obstruction, both of which independently raise risk
Mechanical and hydrostatic mechanisms of procedural injury
Procedure-related risk factors injure the pancreas through direct mechanical and hydrostatic pathways rather than the sphincter-tone pathway that dominates patient-related risk:
• Hydrostatic ductal injury: contrast injected into the pancreatic duct under pressure — especially with excessive volume or acinarization (contrast opacifying the acini themselves) — distends the ductal-acinar unit beyond its physiologic tolerance • Mechanical trauma: repeated guidewire passes, catheter probing, and thermal energy from precut sphincterotomy directly injure the papilla and distal pancreatic duct orifice, provoking local edema that itself worsens outflow obstruction — a vicious cycle • Thermal/electrosurgical injury: needle-knife precut and sphincterotomy current can cause localized burns to the pancreatic orifice, particularly when the pancreatic duct takeoff is in close proximity to the biliary orifice • Loss of the "protective" sequence: standard biliary sphincterotomy before balloon dilation preferentially opens the biliary sphincter fibers; skipping this step and dilating an intact sphincter forces mechanical stretch onto pancreatic-adjacent fibers as well
Stacking behavior — why factors compound rather than simply add
Procedural risk factors rarely occur in isolation. A cannulation that becomes difficult is more likely to result in inadvertent PD cannulation, which is more likely to prompt PD injection to define anatomy, which may in turn prompt precut sphincterotomy — a cascade in which each additional factor is both a consequence of the last and an independent risk contributor to what follows.
Because of this compounding, published PEP incidence figures rise steeply, not linearly, as procedural factors accumulate: a routine, uncomplicated biliary cannulation in a low-risk patient carries a PEP rate well under 5%, while a difficult cannulation requiring precut access and repeated PD opacification in a high-risk patient can approach, and in some historical cohorts exceed, 25–40% without prophylaxis.
Difficult cannulation is simultaneously a risk factor in its own right and a gateway to nearly every other procedural risk factor (PD cannulation, PD injection, precut sphincterotomy) — which is why endoscopist experience and early recognition of a difficult papilla, with prompt escalation to advanced access techniques or case abandonment, is itself a key risk-mitigation strategy.
Real-Time Cumulative Risk Scoring and Stratification Thresholds
Patient-related and procedure-related risk factors are ultimately combined into a single working risk category that drives clinical decision-making in real time — before, during, and immediately after the procedure. Rather than a single validated numeric score used universally, most ERCP centers apply a consensus threshold framework rooted in the ESGE and ASGE prophylaxis guidelines.
- 3–10%: Overall population incidence (unselected ERCP cohort)
- <5%: Low-risk category (no major risk factors)
- 5–10%: Moderate-risk category (one risk factor present)
- 15–25%: High-risk category, no prophylaxis (≥2 patient or ≥1 major factor)
The consensus stratification thresholds
The working risk categories used across most published ERCP risk-prediction tools and adopted implicitly by ESGE/ASGE prophylaxis guidance are:
• Low risk (<5% expected PEP incidence): no major patient factors, uncomplicated single-pass biliary cannulation, no PD instrumentation • Moderate risk (5–10%): a single patient or procedural risk factor present, or a modestly difficult cannulation • High risk (15–25% without prophylaxis): ≥2 patient-related risk factors, or any one "major" factor (suspected SOD, precut sphincterotomy, PD injection, or balloon dilation of an intact sphincter), or a difficult cannulation exceeding the 10-attempts/10-minute threshold
These bands are intentionally coarse rather than a precise point-based numeric score, because prospective validation of finely graded numeric risk calculators for PEP has been inconsistent across populations — the categorical approach is simpler to apply at the bedside and is what actually drives the prophylaxis decision.
Combining patient and procedure factors in real time
In practice, risk assessment is a two-phase process that this simulator mirrors directly:
Phase 1 (pre-procedure): patient factors are reviewed from the history and labs before the scope is passed — age, sex, suspected SOD, prior PEP, bilirubin, recurrent pancreatitis. This establishes a pre-procedure baseline risk tier and informs the default plan for prophylaxis.
Phase 2 (intra-procedure, real time): as cannulation proceeds, the endoscopist and team track accumulating procedural factors — number of cannulation attempts, any PD wire passage or injection, need for precut access, whether stone extraction succeeds. Each additional factor can escalate the patient from moderate to high risk mid-procedure, which is precisely the scenario in which "rescue" pancreatic duct stent placement is most often triggered at the end of the case, even if it was not planned at the outset.
The cumulative score is therefore not a single static number generated once, but a running assessment updated as the case unfolds — analogous to the live gauge shown in this simulation, which recalculates as risk factors are added.
Why the high-risk threshold matters clinically
The high-risk designation is the single most consequential branch point in the entire PEP-prevention pathway, because it is the trigger for essentially every proven prophylactic intervention: rectal NSAID administration (now often given regardless of risk tier per updated guidance, but especially emphasized in high-risk cases), consideration of prophylactic pancreatic duct stenting, and more conservative technique (earlier abandonment of a difficult cannulation, earlier escalation to a more experienced operator or alternative access technique such as EUS-guided biliary access).
Without any prophylaxis, high-risk patients experience PEP at rates that rival or exceed the risk of the biliary pathology the ERCP was performed to treat — which is why risk stratification is not an academic exercise but the pivot point for a materially different periprocedural care plan.
Overall ERCP-population PEP incidence of 3–10% masks enormous heterogeneity: a low-risk patient undergoing straightforward stent exchange may face under 2% risk, while an unrecognized high-risk patient managed as though average-risk can face a 15–25% chance of a complication that, in its severe form, carries real morbidity and even mortality.
Prophylactic Intervention Selection — Indomethacin, PD Stents, and Hydration
Risk stratification exists to inform action. Three evidence-based prophylactic interventions — rectal indomethacin, prophylactic small-caliber pancreatic duct stenting, and aggressive periprocedural IV hydration — are layered onto high-risk (and increasingly, average-risk) patients to blunt the inflammatory cascade before it becomes clinically manifest pancreatitis.
- 100 mg: Rectal indomethacin dose (immediately pre- or post-ERCP)
- ~10–13: Number needed to treat (high-risk) (to prevent one PEP case)
- 5 Fr: Prophylactic PD stent caliber (small-caliber, spontaneously passes)
- ~5–8%: Combined prophylaxis incidence (indomethacin + PD stent, high-risk group)
Rectal indomethacin — mechanism and evidence base
Indomethacin is a non-selective NSAID that inhibits cyclooxygenase (COX-1 and COX-2), reducing prostaglandin and downstream inflammatory mediator synthesis within the injured pancreatic acinar and ductal tissue. Because PEP begins with an acute inflammatory cascade essentially identical to other forms of acute pancreatitis, blunting that cascade pharmacologically at the moment of ductal instrumentation is directly protective.
The landmark Elmunzer et al. (NEJM, 2012) multicenter randomized trial established a single dose of 100mg rectal indomethacin, given immediately before or after ERCP, in patients at elevated risk — reducing PEP incidence significantly compared with placebo, with a number needed to treat of roughly 10–13 in the high-risk population studied. Rectal (not oral) administration is used specifically because it achieves reliable systemic absorption without relying on gastric emptying, which may be impaired periprocedurally, and avoids the delay of oral dosing.
Given its low cost, minimal contraindications (mainly active GI bleeding, significant renal impairment, or NSAID allergy), and consistent benefit, ESGE and ASGE guidelines now recommend rectal indomethacin for essentially all patients undergoing ERCP with any elevated PEP risk, and many centers give it routinely to nearly all ERCP patients regardless of formal risk category.
Prophylactic pancreatic duct stenting
For very-high-risk patients — particularly those in whom the pancreatic duct has already been instrumented, injected, or in whom precut sphincterotomy or difficult cannulation has occurred — a small-caliber (typically 5 Fr) prophylactic pancreatic duct stent is placed at the end of the procedure in addition to (or occasionally instead of, when indomethacin is contraindicated) rectal NSAID prophylaxis.
The stent maintains pancreatic ductal outflow through the papillary edema and spasm that inevitably follows instrumentation, preventing the ductal hypertension that would otherwise drive autodigestive injury. Small-caliber, unflanged or single-pigtail stents are deliberately chosen because they are designed to migrate and pass spontaneously into the duodenum within 1–3 weeks, avoiding the need for a second procedure purely for stent removal — though a follow-up abdominal X-ray is typically obtained to confirm passage, since a retained PD stent can itself cause ductal injury over time.
Meta-analyses combining PD stent placement with pharmacologic prophylaxis in very-high-risk cohorts show incidence reductions to roughly 5–8%, compared with the 15–25% expected in equivalent high-risk patients receiving no prophylaxis at all — a relative risk reduction on the order of 65–70%.
Periprocedural IV hydration as an adjunct
Aggressive periprocedural intravenous hydration, typically with lactated Ringer's solution rather than normal saline (lactated Ringer's has a more physiologic, less acidotic profile that appears to better support pancreatic microcirculation and reduce trypsinogen activation), has been studied as a low-cost, low-risk adjunct to indomethacin and PD stenting.
Hydration protocols generally involve a bolus (commonly on the order of 3 mL/kg/hr sustained periprocedurally, with regimens studied both as bolus dosing and extended infusion) delivered before, during, and after the procedure, aiming to optimize pancreatic perfusion during the window of maximal inflammatory risk. While the magnitude of benefit from hydration alone is more modest and less consistently reproduced than the indomethacin effect, it is inexpensive, essentially risk-free in patients without volume-overload contraindications (e.g., significant heart failure or renal failure), and is frequently bundled into high-risk ERCP protocols as a third layer of protection alongside pharmacologic and mechanical (stent) prophylaxis.
The three prophylactic strategies act through distinct, complementary mechanisms — indomethacin dampens the inflammatory cascade pharmacologically, PD stenting relieves ductal hypertension mechanically, and hydration supports pancreatic microperfusion — which is why combining them in very-high-risk patients produces a larger incidence reduction (to roughly 5–8%) than any single measure alone.
Post-Procedure Monitoring, Diagnosis, and Outcome Comparison
The final stage of PEP risk management is post-procedure surveillance: a single, well-timed lipase measurement combined with clinical observation determines whether a patient can be safely discharged or requires admission, and — if PEP develops — how severe it is and what that means for the length and intensity of care required.
- 2–4 h: Serum lipase draw time (post-ERCP)
- ~95–100%: Normal lipase at 2–4h, NPV (very unlikely to develop PEP)
- ≥2 days: PEP diagnostic hospitalization (required, plus symptoms + enzymes >3× ULN)
- >10 days / organ failure: Severe PEP (Atlanta-analog) (necrosis, ICU-level care)
Lipase kinetics and the 2–4 hour measurement window
Serum lipase rises rapidly after pancreatic ductal or acinar injury, typically within 1–2 hours, and is checked at 2–4 hours post-ERCP because this window balances two competing needs: waiting long enough for a true injury signal to emerge, while still allowing a same-day discharge decision for outpatient procedures.
A lipase greater than 3× the upper limit of normal (ULN) at this 2–4 hour mark is strongly associated with a positive predictive value for developing clinically significant PEP, particularly when paired with abdominal pain — though a mildly elevated enzyme level in an asymptomatic patient is common after ERCP and does not by itself constitute pancreatitis. Far more clinically useful is the negative result: a normal lipase at 2–4 hours carries a very high negative predictive value (commonly cited in the 95–100% range across validation cohorts), meaning a patient with a normal level and no symptoms can be reassured and safely discharged rather than observed overnight "just in case."
Amylase was historically used similarly but has largely been supplanted by lipase, which remains elevated longer and is more pancreas-specific, reducing false positives from non-pancreatic sources.
Formal PEP diagnostic criteria and severity grading
The consensus definition of post-ERCP pancreatitis (derived from the original Cotton criteria and refined in line with revised Atlanta classification principles for acute pancreatitis generally) requires all of the following:
• New or substantially worsened abdominal pain, typically epigastric, after the procedure • Serum amylase or lipase greater than 3× the upper limit of normal, measured more than 24 hours after the procedure (i.e., a truly elevated, sustained value rather than a transient post-procedural bump) • A clinical course requiring hospital admission or prolongation of a planned admission for at least 2 days
Once diagnosed, severity is graded on a clinical course basis analogous to the revised Atlanta classification for acute pancreatitis:
• Mild: hospitalization of roughly 2–3 days, no organ failure, no local complications — the large majority of PEP cases • Moderate: hospitalization of 4–10 days, or transient organ dysfunction, or local complications (peripancreatic fluid collection) without persistent organ failure • Severe: hospitalization exceeding 10 days, persistent organ failure (respiratory, renal, or cardiovascular), pancreatic necrosis, or need for percutaneous/surgical intervention — fortunately the least common outcome but the one responsible for essentially all PEP-attributable mortality
Outcome comparison — the measurable impact of risk-adapted prophylaxis
The entire risk-stratification and prophylaxis pathway modeled in this simulator exists to move a patient from a high-incidence, high-severity outcome distribution to a low-incidence, predominantly mild one. Aggregating the literature ranges discussed across all five stages:
• Overall unselected ERCP population, mixed prophylaxis practice: ~3–10% PEP incidence • High-risk patients with no prophylaxis at all: ~15–25% PEP incidence, with a meaningfully higher share reaching moderate or severe grades • High-risk patients receiving combined prophylaxis (rectal indomethacin plus prophylactic PD stent, with or without adjunct hydration): ~5–8% PEP incidence, and the cases that do occur skew more mild
This roughly 65–70% relative risk reduction from combined prophylaxis in the highest-risk patients is one of the more robust, reproducible effect sizes in interventional endoscopy — and it is why current ESGE/ASGE guidance has shifted from "prophylax only the clearly high-risk patient" toward "default to rectal indomethacin in nearly everyone, and add PD stenting whenever a very-high-risk procedural course has unfolded."
The Elmunzer et al. 2012 NEJM trial that established rectal indomethacin as standard of care enrolled only high-risk patients and still needed to treat just 10–13 patients to prevent one case of PEP — an efficiency rarely matched by other single-dose prophylactic interventions in gastrointestinal endoscopy, and the reason indomethacin prophylaxis is now considered near-universal best practice.
This simulation helps users predict the risk of pancreatitis following ERCP (Endoscopic Retrograde Cholangiopancreatography). It provides a comprehensive understanding of the factors that contribute to post-ERCP pancreatitis and allows learners to develop strategies for minimizing this complication.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install