Endoscopic retrograde cholangiopancreatography (ERCP) can be used to help diagnose conditions of the liver, bile ducts, pancreas or gallbladder, although non-invasive magnetic resonance cholangiopancreatography (MRCP) and endoscopic ultrasound are preferred, unless there is therapeutic intent.
Through the endoscope, the inside of the stomach and duodenum can be visualised. Contrast (dye) can be injected into the ducts in the biliary tree and pancreas so they can be assessed using X-rays. Biopsies can also be taken.
Stents can be inserted during ERCP to relieve ductal blockage.