The endoscope is inserted down the patient's esophagus into the stomach and duodenum. From there, the physician can study either the bile duct system or the pancreatic duct system, or can inject dyes that act as contrast material for the fluoroscope. It is rarely used for diagnostic purposes today, with magnetic resonance cholangiopancreatography or endoscopic ultrasound currently being the preferred methods because they are less invasive. However, ERCP is still used to treat gallstones, leaks from trauma and surgery, and cancer.
The major risk of an ERCP is that the patient will develop pancreatitis solely from the procedure. It is contraindicated if the patient has recently had pancreatitis or is otherwise in poor health.