Yes, an endoscopic procedure called an esophagogastroduodenoscopy (EGD) allows the doctor to examine the lining of the esophagus, stomach, and upper duodenum. They can test stomach acid levels through an EGD.