have a endocrinologist do blood work. I lost 32 lbs in two months because my thyroid was hyper-thyroid, stomach pain and constipation were part of the symptoms, along with fast heart rate.
it could be gastritis, which causes painful acid production, and a thinning of the stmache lining, it can be caused by certain foods, especially citris and vinegar, and spicy foods, Try taking gavison liqued befor meals, and see if the symptoms decrease. Also befor bedtime.