A single investigation which is likely to most helpful in diagnosis and cost effective for your symptoms would be CT scan of abdomen. Following would be the consideration of the diagnosis;
1) Gastroparesis; slow emptying stomach
2) Hiatal hernia
3) Intestinal obstruction chronic (due to adhesions)
4) Irritable bowel syndrome
Following may help you, meanwhile you are investigated;
2) This may help;
a) Bismuth subsalicylate
b) Activated charcoal
c) Simethicone; (Maalox, Mylanta); Simethicone causes gas bubbles to break up.
d) Beano; contains an enzyme (alpha-galactosidase), which helps to breakdown certain complex carbohydrates.
All are available without prescription.
Avoid foods that appear to aggravate symptoms. These may include milk and dairy products, certain fruits or vegetables, whole grains, artificial sweeteners etc. But this is based on the personal observation for the aggravating food.
Discontinue the following if you do them;
1) gum chewing,
3) drinking carbonated beverages, and
4) gulping food and liquids.
Please feel free for your follow up questions.
Food allergies can be a possibility, though indigestion, diarrhea, pain are likely to be associated with bloating and gas in allergies. Joint pain is difficult to explain on this basis directly. There can be indirect correlation; sleeplessness or fatigue can cause muscle and joint pain. One may need specific blood work (rheumatoid factor, lupus testing) or x-ray of the joints (which are most painful) to look for the cause of joint pain. Crohn's disease (Inflammatory bowel disorder / IBD) which primarily is an intestinal disorder; is associated with the significant joint pain, but usually diarrhea is the predominant symptoms with abdominal pain, bloating and gas. CT scan will help in ruling our that also.
It is pleasure and privilege assisting you.