Endoscopic retrograde cholangiopancreatography (ERCP) is a procedure carried out to diagnose and treat problems in the liver, gallbladder, bile ducts and pancreas. These include gallstones, scars tissue, leaks from injury and surgery, and cancer. The inside of the stomach and duodenum is viewed through an endoscope (a flexible, lighted tube that transmits images), and dye is injected into the bile ducts and pancreas so they can be seen on an X-ray. ERCP takes from 30 minutes to two hours. Medication is given to numb the back of the throat and a relaxing sedative is usually given. The endoscope is inserted through the mouth and guided through the oesophagus, stomach and duodenum. A small tube is passed through the endoscope to inject a dye into the bile ducts to make them visible on X-rays, which are taken as soon as the dye is injected. If the exam shows a gallstone or narrowing of the ducts, instruments can be inserted into the endoscope to remove or relieve the obstruction. Also, tissue samples (biopsy) can be taken for further testing.