In most cases, an EGD is the best method for evaluating, diagnosing, and treating any abnormalities of the upper GI tract. It gets doctors the clearest picture of the tract, so they can see any issues and accurately diagnose them. In some cases, an x-ray of the upper GI tract, known as an upper GI/barium swallow, can also allow a clear enough picture for a diagnosis. However, the x-ray is only diagnostic. Treatment of the problem will still have to be done endoscopically or through surgery.