An Upper G.I. Endoscopy, also known as esophagogastroduodenoscopy (EGD), is a diagnostic procedure that allows a doctor to view the inside of the upper part of the gastrointestinal tract, including the esophagus, stomach, and duodenum. This is done using an endoscope, a flexible tube with a light and camera attached.