Avoidance of alcohol abuse could prevent many cases of flank pain from hepatitis or pancreatitis. A vaccine is available to prevent certain forms of hepatitis. Drinking plenty of fluids every day can sometimes prevent kidney stones. Many of the causes of flank pain cannot be prevented.
Irritable bowel syndrome may make a person uncomfortable and even depressed, but poses no serious long-term health risks. A small kidney stone may pass by itself and have no long-term effects. A large kidney stone may require surgery to remove. Appendicitis and cancer may lead to death if treatment doesn't work.
Flank pain is not contagious and usually poses no risk to others. If the cause is an infection, the infection may be contagious.