It is very likely that your anti inflammatory medication caused your gastritis.
Gastritis is a condition in which the acid in the stomach starts to irritate the very lining of the stomach that produces it. Normally, the stomach lining has a number of mechanisms to protect itself from its own acid, such as the secretion of a thick layer of mucus that covers the lining and prevents the acid from penetrating.
Unfortunately, some anti inflammatory medications, especially the class of anti inflammatory medications known as non steroidal anti inflammatory medications (NSAIDS) - which include common over the counter medicines like ibuprofen and naproxen - cause these protective mechanisms of the stomach method to stop functioning efficiently. This can lead to pain, indigestion, and abdominal discomfort - i.e., the symptoms of gastritis.
If you are experiencing these symptoms it is very important that you stop taking the medications involved, as continuing to take them puts you at risk of ulcer
or intestinal bleeding
. You should talk to your primary care doctor
, who will be able to discuss with you what you may need to do to help resolve the gastritis; additionally they will be able to discuss alternative pain medications for your other condition.