Endoscopic retrograde cholangiopancreatography, or ERCP, is an endoscopic test that is used to examine and treat problems of the bile ducts, pancreatic ducts, and gallbladder. Bile ducts are the tubes that drain bile from the liver and pancreatic ducts drain pancreatic juice from the pancreas. Both ducts empty into the duodenum, which is the first part of the small intestine.

Figure 1. Endoscope in small intestine, facing the papilla (opening in the small intestine to the ducts) demonstrating the bile duct in green and the pancreatic duct in tan. Image courtesy of Boston Scientific Inc.
ERCP may be done for many reasons. The most common reason is to find and remove gallstones stuck in the bile duct. Other common reasons are to look for causes of acute pancreatitis (inflammation or irritation of the pancreas), to unblock the ducts when they are not able to drain because of tumor in the bile ducts or pancreas, and to treat leaking of the bile or pancreas ducts. These problems are usually first found through imaging tests which are considered safer initial tests that do not have as many risks as ERCP. Examples of initial imaging tests are ultrasound of the belly, a special kind of MRI study called MRCP, or by an ultrasound scope test called an Endoscopic Ultrasound. These can tell your doctor whether you need to have an ERCP to follow-up on abnormalities found on these non-invasive imaging tests.
ERCP is performed by gastroenterologists or surgeons who are specially trained to do them. An endoscope is a long, flexible tube with a camera and a light at the tip. The test is done while you are asleep and this can be done by your doctor with the help of a doctor who specializes in putting patients to sleep and waking them up again, called an Anesthesiologist. Often medications through your veins are used to help you fall asleep, but sometimes general anesthesia is necessary. The endoscope or tube is passed through the mouth, esophagus, and stomach into the duodenum where the bile duct enters; this is known as the papilla. A small tube is passed through the scope to come out of its tip. This is used to enter the papilla and the ducts, place wires to help with treatments, and to squirt x-ray dye to see what is going on inside the ducts. This lets your doctor decide on how best to treat blockages, stones, or tumors. Your doctor can then use their equipment to help treat and improve these problems. For example, if stones are seen, the bile duct opening can be widened, and stones can be taken out of the duct. The papilla has a muscle that surrounds the bile duct opening and this can be cut using electricity through a small wire on the end of the tube. This is called a sphincterotomy, which can let the duct drain better and allow the doctor to do treatments to help problems in the ducts.

Figure 2. Image showing the tube through the scope, after the cut has been made and a wire is placed beyond a large stone in the bile duct. Image courtesy of Boston Scientific Inc. same issue with imaging rights
You will be required to not eat prior to your procedure, usually at least 6-8 hours before your scheduled procedure. The stomach should be empty so your doctor can see where they are going. This also helps prevent you from throwing up and sucking it down the wrong pipe into your lungs (aspiration).
You should discuss all your medicines with your doctor, as some may need to be changed or temporarily stopped for the test. This step is really important if you are taking medications to thin out your blood. These include medicines like warfarin (Coumadin), heparin, enoxaparin (Lovenox); and/or new blood thinning medications like dabigatran (Pradaxa), rivaroxaban (Xarelto), apixaban (Eliquis), and edoxaban (Savaysa). You should also talk about medications that keep your blood platelets from causing a clot, like clopidogrel (Plavix), ticagrelor (Brilinta), and prasugrel (Effient). You should also ask what you should do with your insulin, or other medicines for diabetes. Nonsteroidal anti-inflammatory drugs (NSAIDs) are common medications used to treat arthritis, pain, or inflammation; and include ibuprofen, naproxen, and diclofenac, to name a few. These medications do not need to be stopped and you can also continue aspirin if you are taking it. You should let your doctor know of any medication allergies, including those to iodine or intravenous (IV) contrast dye.
If you wear CPAP at night, you should discuss with your doctor whether you should bring your machine with you on the day of your procedure.
If you have chronic bronchitis or emphysema, this may change how you are put to sleep for the procedure and you should let your doctor know about this.
If you have any heart conditions, you should also discuss these with your doctor, as special testing prior to your procedure may be needed.
You will not be able to drive after getting the sleeping medication and will need an adult family member or friend come with you on the day of your procedure. They will need to be able to drive you home or be with you if you are taking medical or public transportation.
When you get to the endoscopy unit, you will answer questions about your medical history and your medications will be reviewed. You will talk with your doctor about the ERCP and any questions you have will be answered. An intravenous (IV) line will be put in, so you can get IV fluids, sleeping medications, and possibly pain medicine or antibiotics. You may need a breathing tube for general anesthesia, since the medications can make it hard for you to breathe on your own. You may be asked to remove any watches, jewelry, piercings, dentures, eyeglasses, or contacts prior to the test.
You will be brought to the ERCP room and will be positioned on a special table that allows for x-rays to be taken. You will be asked to lie on your left side, stomach, or back. A small plastic mouthpiece will be placed in your mouth to help protect your teeth and gums. Once you are asleep, you should expect to be comfortable and very relaxed. You are unlikely to remember much of the test after this and most people feel fine afterwards.
Depending on what is seen during the ERCP, a lot of other tests or treatments can be done. These often include biopsies, widening the bile duct or pancreas duct openings (sphincterotomy), removing stones, and placing a tube (stent) across any narrowed areas. There are other treatments that may be done, and your doctor will tell you more about them. Depending on how hard your ERCP is, the time to do the procedure can be quick or may take several hours. Air is introduced through the endoscope so that the endoscopist can see the inside of your stomach and intestine during the examination.
Once the procedure is finished, you will be brought to the recovery room and monitored while the sleeping medications wear off. Sometimes patients feel mild abdominal discomfort from the air in the intestines. This is usually relieved by belching or passing gas. A sore throat is a fairly common complaint. It is treated with throat lozenges and typically resolves in one to two days. You may feel groggy or have difficulty concentrating, so patients are advised to rest for the remainder of the day. You will not be permitted to drive your car for the rest of the day. Depending upon how your initial recovery goes, you may be kept at the hospital overnight for observation.
While ERCP is generally safe and most people do well, there are risks of having one. Your physician should discuss the potential risks with you prior to your procedure.
You should contact your doctor immediately if you experience any of the following symptoms after your ERCP:
If biopsies were taken during your test, you should follow-up as instructed by your physician to discuss the results.
Oleh Haluszka, MD, and Jennifer L. Maranki, MD, Temple University, Philadelphia, PA – Published January 2012.
Royce Groce, MD, The Ohio State University, Columbus, OH – Updated 2020.