Those who become mentally ill often have a history of chronic pain.