An endoscopic retrograde cholangiopancreatography is a combined endoscopic and radiological procedure used to examine and, primarily, treat diseases of the bile ducts and pancreas. 

It is indicated for the removal of stones in the bile duct in patients with severe pancreatitis or cholangitis, those who are poor candidates for cholecystectomy or who are post-cholecystectomy, and those with evidence of persistent biliary obstruction.