An upper gastrointestinal (UGI) endoscopy is a procedure that examines the interior lining of the esophagus, stomach and first part of the small intestine (duodenum). A thin, flexible tube called an endoscope is inserted through the mouth into the esophagus, stomach and duodenum (upper gastrointestinal tract). Since the entire upper gastrointestinal (GI) tract can be examined during this test, the procedure is sometimes called esophagogastroduodenoscopy (EGD).
The EGD is used to diagnose and treat ulcers, inflammation, tumors, infection or bleeding. Tissue samples can be collected for biopsy, polyps can be removed and bleeding can be treated. In addition, endoscopy can reveal problems that do not show up on X-ray tests and can sometimes eliminate the need for exploratory surgery