This page was reviewed under our medical and editorial policy by
Toufic Kachaamy, MD, Chief of Medicine, City of Hope Phoenix
This page was reviewed on January 13, 2022.
Endoscopic retrograde cholangiopancreatography (ERCP) is a procedure used to diagnose and treat cancer in the pancreas and bile ducts.
It involves inserting a long, flexible tube with a camera (an endoscope) into your mouth and down the esophagus and stomach until it reaches the small intestine. Then, a contrast dye is injected through the tube and an X-ray machine is used to take pictures. The contrast dye improves the clarity of the X-ray images and helps reveal whether the pancreatic and bile ducts are narrowed or blocked, which may indicate cancer.
Since an ERCP provides access to the bile ducts and pancreatic duct, doctors may also perform other procedures at the same time, including:
ERCP helps diagnose and treat blockages caused by:
As a diagnostic tool, ERCP may be used for a biopsy and to reveal potentially cancerous blockages through X-ray images.
As a treatment tool, ERCP may be used to fix a blockage in the pancreatic or bile ducts via stent placement. If a patient is experiencing jaundice (yellowing of the skin and eyes) due to a blockage in the bile ducts, a stent placement usually remedies this issue.
When scheduling an ERCP procedure, ask your doctor to provide detailed instructions on how to prepare. You may be told, for example, not to eat, drink or smoke anything in the eight hours leading up to the procedure.
Other steps you may take:
Before an ERCP, you’ll receive medicine to make you comfortable during the procedure. Most of the time, patients are given a sedative drug through an intravenous (IV) needle in the arm. Others may be given general anesthesia. Anesthesia puts you to sleep completely, while sedatives make you drowsy, relaxed and comfortable.
After the X-rays, your doctor may pass surgical tools through the endoscope to collect a small sample of cells (biopsy). If a blockage is found, the doctor will insert a smaller tube into the endoscope and place it inside the blocked duct to prop it open (stent placement).
Overall, the procedure usually takes one to two hours. After the procedure, another one to two hours of recovery at the hospital or doctor’s office may be required. In rare cases, some people need to stay at the hospital overnight.
When the anesthesia or sedation has subsided, your doctor will likely share how the procedure went and what was found. Biopsy results aren’t available immediately, but if a biopsy was performed, your doctor may share the results in a couple of days.
Once your doctor has cleared you to go home, you’ll be given instructions in person and in writing on what to expect after the procedure and what to look out for. A sore throat, for example, is common after ERCP, and may persist for a couple of days.
Communicate with your doctor about any pain you feel. You may be advised to take Tylenol® (acetaminophen) to relieve pain, but you shouldn’t take aspirin, Advil® (ibuprofen) or Aleve® (naproxen), as these medicines may affect blood clotting.
The benefit of an ERCP is that it allows for multiple steps to be done at once. During this procedure, your doctor is able to get a good look at the pancreatic and bile ducts, perform a biopsy to see whether cancer is present, and place a stent in a blocked or narrowed duct.
Another diagnostic test, called a magnetic resonance cholangiopancreatography (MRCP), produces clear images of the ducts using a magnetic resonance imaging (MRI) scan alone, but it doesn’t involve entering the body, and no endoscope is used. This test is helpful if your doctor only needs to see the area to help diagnose cancer or plan treatment, but it doesn’t allow for a biopsy or stent placement to be performed.
However, since ERCP is more invasive than some other tests, it may also be more risky. The potential side effects and complications of ERCP include:
Even more rarely, death may occur during an ERCP. However, an ERCP comes with a lower risk of complications than surgery.
Altogether, complications during an ERCP procedure are thought to occur 5 percent to 10 percent of the time, according to the American Gastroenterological Association.
Certain symptoms may suggest complications and warrant immediate medical attention, including: