Which diagnostic test is commonly used to detect abnormalities in the esophagus, stomach, and small intestine?