An Endoscopy may also be called, upper endoscopy, EGD or esophagogastroduodenoscopy. An endoscopy is a procedure used to visually examine your upper digestive system with a tiny camera on the end of a long, flexible tube. A specialist in diseases of the digestive system (gastroenterologist) uses an endoscopy to diagnose and, sometimes, treat conditions that affect the esophagus, stomach and beginning of the small intestine (duodenum). You may have an upper endoscopy done in an outpatient surgery center or a hospital. An endoscopy is a very safe procedure. Rare complications include: bleeding, infection, tearing of the gastrointestinal tract, and reaction to sedation.