When you are experiencing any kind of chronic illness, it’s expectable that there will be times where you feel better, and times where you feel worse. If you are physically able, try to work more on the dissertation in the ‘good’ phases- when your energy is higher and your pain/discomfort is less. By making better use of the "good" times, you can feel more at ease during the bad times. Working on the dissertation in this manner will help you maintain the physical capacity to eventually finish.