A gastroenterologist is a medical doctor who specializes in conditions affecting the digestive system. They are trained to diagnose and treat problems in the gastrointestinal (GI) tract, which includes the esophagus, stomach, small intestine, large intestine, rectum, and anus, as well as the pancreas, liver, bile ducts, and gallbladder. Gastroenterologists complete three years of medical residency after medical school, treating all kinds of diseases and conditions, and then complete three years of additional study to become experts in gastrointestinal diseases and conditions. They are trained to perform a number of procedures used to help diagnose and treat these conditions, such as upper endoscopy, colonoscopy, biopsy, and the various endoscopic techniques needed to visualize the digestive system, including endoscopic ultrasound. Patients can see gastroenterologists both in the clinic and the hospital.