Hello umm! As an otherwise healthy 17-year-old, there is little reason to think this is a heart-related issue. Yes, gas can reach far up there - some people feel gas pains in their shoulders! - but it's good that you are getting that upper endoscopy. It's a really easy test (you'll be semi-conscious and probably won't even remember the majority of it) and they will take biopsies of your stomach and upper small intestine to check for things like inflammation or infection. Sometimes a bacteria called H. pylori can cause ulcers (which cause pain in your epigastric region - above your belly-button) so they will be able to check for this as well.
Have you taken any medications to help alleviate your pain when you feel it? Any antacids like Tums or Pepcid or anything over-the-counter like that? You might want to give it a whirl next time...
You might try posting on the IBS forum; there are a lot of members there who are knowledgable about various stomach pains. You can ask any question you want, we've heard it all. I hope your test goes well and you start feeling better soon.
Co-moderator - IBS Forum