ERCP for bile duct cancer

ERCP stands for endoscopic retrograde cholangio pancreatography. It can help to diagnose conditions of the liver, bile ducts, pancreas or gallbladder.

What is an ERCP?

Your doctor uses a long flexible tube with a small camera and light at the end, called an endoscope. It's also sometimes called a duodenoscope. They pass this tube through your mouth, throat, stomach and into the first part of your small bowel (duodenum).

Your doctor can look down the endoscope or at pictures on a TV monitor. They also take x-rays of the pancreas, gallbladder and bile ducts.  

They can take samples (biopsies) of any abnormal looking areas.

The test takes between 15 minutes and 2 hours.

Diagram of an endoscopic retrograde cholangio pancreatography

Why you might have it

You might have an ERCP if your doctor thinks there is a blockage in your bile ducts. A blockage in the bile ducts can cause:

  • yellowing of your skin and whites of your eyes
  • itchy skin
  • tummy (abdominal) pain
  • dark coloured urine 

Your doctor might take a sample of tissue (biopsy) during the ERCP. This is important to diagnose your cancer and helps doctors plan your treatment.

You might also have an ERCP as part of your treatment. For example, if you have a blockage in your bile ducts, your doctor can put a plastic or metal tube (stent) into the duct to relieve the blockage.


Your doctor might suggest you have a cholangioscopy at the same time you have an ERCP. You might have it to look for the cause of a bile duct blockage. 

Your doctor puts a smaller tube down a channel in the endoscope. This smaller tube has a probe and camera attached. This tube is called cholangioscope.

The cholangioscope can go directly into the bile ducts so your doctor can see if there are any abnormal areas. They can take samples of tissue (biopsies) of the abnormal areas. 

Cholangioscopy is sometimes better than ERCP alone. It can help doctors pick up abnormal areas that might be due to cancer, and helps them targeting where to take biopsies from.

Your doctor will tell you if they think you need a cholangioscopy. 

Preparing for an ERCP

Before the ERCP, you usually have a blood test to check how well your blood clots.

Let the hospital department know if you're taking medicine that changes how your blood clots. This includes:

  • aspirin
  • clopidogrel
  • arthritis medicines
  • warfarin or heparin
  • apixaban or rivaroxaban

You might need to stop taking this type of medicine a number of days before the ERCP. Your doctor or nurse will tell you when you should stop. They will also tell you if you need to stop taking any other medicines and when.

You can't eat for 6 to 8 hours before the test. This is so that your stomach and duodenum are empty. You might be able to drink sips of water up to 2 hours before your appointment. Your doctor or nurse gives you written instructions about this beforehand.

Talk to your doctor or nurse if not eating could be a problem for you. For example, if you have diabetes.

Because you have sedation Open a glossary item for this test, you will need someone with you to take you home and stay overnight. You shouldn’t drive, drink alcohol, operate heavy machinery or sign any legally binding documents for 24 hours.

It’s also a good idea to bring an overnight bag just in case you need to stay in hospital overnight.

How you have an ERCP

You usually have this test in the endoscopy department, but you might have it in the x-ray department. Your appointment letter tells you where to go.

Before the procedure you see the doctor. They explain the procedure to you and ask you to sign a consent form. This is a good time to ask any questions you may have. 

You usually change into a hospital gown and remove any jewellery or metal objects on your body. As this will interfere with the x-ray pictures they take.  

You lie on the bed or x-ray couch. The nurse puts a small plastic tube (cannula) into the back of one of your hands. You may have antibiotics to prevent infection and fluids through a drip.

Your nurse gives you a plastic mouth guard to wear. This is to protect your teeth and gums during the test. They also give you oxygen through a tube that fits into your nose (nasal cannula).

During the test

You usually have an injection of sedation first to make you very drowsy. Your doctor might spray the back of your throat with a local anaesthetic to make it easier to swallow the endoscopy tube.

Once the sedative has worked, your doctor passes the endoscope. They pass the tube through your mouth, down your throat into your stomach. They'll ask you to swallow as the tube goes down. You will be able to breathe normally, but you may gag slightly.

Once in the stomach, it then goes into your duodenum. This is where the pancreatic and bile ducts join. They might put a small amount of air into your stomach to help them see more clearly. This can make some people feel uncomfortable and like you want to burp.

They pass a thinner tube down through the endoscope which can fit into your bile duct. They then inject dye (contrast medium) through the tubes into the channels (ducts) of the biliary tree and pancreas. This is so they can see them on x-ray pictures.

Your doctor can take samples of cells from the bile ducts using a brush (brush cytology). And they may also take pieces of tissue (biopsies). They send these samples to the laboratory for examination under a microscope. They may also take some photographs.

Your nurse checks your heart rate, breathing rate and oxygen levels throughout the test.

Detailed diagram of an endoscopic retrograde cholangic pancreatography (ERCP)

After the test

Your doctor removes the tube. You then need to rest for a while. You stay in the department for a few hours after this test. You won’t be able to eat or drink anything straight away. The nurse looking after you will let you know when you can eat and drink.

You might not remember much (if anything) about the test when you wake up from the sedation.

After the test you might:

  • have a sore throat for a few days
  • have bloating and discomfort in your tummy (abdomen) for a day or two
  • feel sick or be sick after the sedation

Your nurse removes the cannula from your hand before you leave. You should be able to go home the same day. You won't be able to drive for the rest of the day and should have someone to go home with you and stay overnight.

Possible risks

There are possible risks with an ERCP and cholangioscopy. Some can be serious and life threatening. Your doctor makes sure the benefits of the test outweigh these risks. Your doctor or nurse will explain all the risks of having an ERCP and what to look out for.

Inflammation of the pancreas (pancreatitis)

You may have inflammation of the pancreas after this test. This can cause pain in your tummy (abdomen). Your doctor can give you painkillers to help control this. It's important to tell your nurse or doctor if you get pain in your abdomen. 

Inflammation of the pancreas can also be severe. You might need to stay in hospital for some days if this happens.


There's a risk of infection with this test. If you get a temperature or generally feel unwell contact your doctor.  


There may be some bleeding from having an ERCP which usually stops on its own. In some cases this can be severe and you will need medicine to stop it and maybe a blood transfusion. 

Allergic reaction

There is a risk of having an allergic reaction to the sedation or dye. This can cause problems with your breathing, heart rate and blood pressure. If this happens, the staff will give you medicines to control the reaction. 

Tear in your bowel

Very rarely there is a small tear (perforation) in the first part of your small bowel. If this happens it’s likely you would need surgery to repair the tear.

Exposure to radiation

The amount of radiation you receive from the x-rays during the test is small and doesn't make you feel unwell. Talk to your doctor if this worries you.

When to contact a doctor

Contact the hospital where you had the ERCP or go the accident and emergency department (A&E) if you have:

  • ongoing or severe pain in your abdomen
  • a high temperature
  • yellowing of the skin (jaundice), if you didn't have it before
  • black poo (this can be a sign of blood in your poo)
  • being sick and are unable to stop

Getting your results

You should get the results within 1 or 2 weeks.

Usually, the doctor who does the ERCP writes a report straightway. They send the report to your specialist, who gives the results to you. If your GP has sent you for the test, the results are sent directly to the GP surgery.

Waiting for results can be an anxious time. It might be helpful to talk to someone close to you. 

If it isn't an emergency and you haven't had your results a few weeks after your test, contact the doctor who arranged the test to chase your results for you.

You can also contact the Cancer Research UK nurses on freephone 0808 800 4040. The lines are open from 9 to 5, from Monday to Friday.
Last reviewed: 
04 Oct 2021
Next review due: 
04 Oct 2024
  • ERCP: The Fundamentals (2nd Edition)
    P B Cotton and J Leung
    Wiley Blackwell, 2015

  • Biliary cancer: ESMO clinical practice guidelines for diagnosis, treatment and follow up
    JW Valle and others
    Annals of Oncology, 2016. Volume 27, Pages 28-37

  • Guidelines for the diagnosis and treatment of cholangiocarcinoma: an update
    SA Khan and others 
    Gut, 2012. Volume 61, Pages 1657-1669

  • ERCP (2nd Edition)
    T H Baron and others
    Elsevier Saunders, 2013

  • Advances in endoscopic retrograde cholangiopancreatography for the treatment of cholangiocarcinoma
    DS Uppal and AY Wang
    World Journal of Gastrointestinal Endoscopy, 2015. Vol 7, Issue 7. Pages 675-687

  • Cholangiocarcinoma
    A S Khan and others
    Surgical Clinics of North America, 2019. Vol 99, Issue 2. Pages 315-335

Related links