Upper endoscopy allows a physician to examine the lining of the upper part of the gastrointestinal tract, which includes the esophagus, stomach, and duodenum (first portion of the small intestine). The physician uses a thin, flexible tube called an endoscope, which has its own lens and light source, to view the images on a video monitor. Upper endoscopy is often referred to as an upper GI endoscopy, esophagogastroduodenoscopy (EGD), or panendoscopy.