Upper endoscopy (EGD) is the examination of the upper gastrointestinal tract using a long, flexible scope. This procedure allows your physician to observe all parts of the upper gastrointestinal tract – the esophagus, the stomach, and the first part of your small intestine. Upper endoscopy (EGD) can be used to investigate symptoms, diagnose or biopsy for diseases, or treat digestive system problems. It is sometimes ordered to test for anemia, bleeding, inflammation, diarrhea or cancers of the digestive system. Patients experience little or no discomfort during the procedure and it typically takes 30 minutes or less.