It could be, but the only way to know for sure is by going back to your doctor and having further tests. The kind of pain you describe is sometimes caused by a virus, sometimes acid reflux, sometimes by a hiatal hernia, sometimes by eating certain foods, sometimes by anxiety. That’s only a few reasons that people have sharp stomach pain. Before you decide it’s your anxiety that is causing you trouble, you want to be sure that you don’t have an undiagnosed medical problem that could be cleared up with either some medication or lifestyle changes.
Please see a Gastroenterologist. That’s a doctor who specializes in the stomach and intestinal tract. And please do share that you have anxiety. A doctor can only help if he or she has all the relevant information. If there is no medical diagnosis, then you might want to see a mental health counselor about how to handle your anxiety so you don’t express it through body pain.
I wish you well.