Welcome to e health forum.
Presence of pain in the stomach that radiates to the right shoulder is a classic finding, seen in gallbladder disorders (gall stones, cholecystitis, etc).
Since your doctor has already scheduled a HIDA scan, which will provide info about your Gall bladder function, it will help to make a definitive diagnosis and a direction to further treatment of your condition.
Since the endoscopies have already confirmed the presence of ulcers in your stomach, proper diet change as well as potent acid reducing medications can be prescribed by your doctor for proper relief of your symptoms.