My experience is slightly different since I will always be dealing with the aftermath of injury, not illness. But I suspect the mental effects are similar.

For me, I got tired of feeling sorry for myself and feeling limited. I wanted to prove that I could return to normal life and live however I wanted to. I was tired of living in a world of pain that I didn't know how to get out of. I decided to give the world of pain less priority and focus on the world of physical endurance.

The injuries still catch up with me, but for the most part my focus of physical fitness helped me tremendously. Those endorphins are magic!