Endoscopic retrograde cholangiopancreatography is a procedure in which a flexible tube with a camera and other tools on its end (endoscope) is put through the mouth and guided to the small intestine, near the pancreas. The procedure collects images from the area and takes a small biopsy with a brush.