Wa alaykum salaam
Question: What is the Islamic ruling about someone who is suffering from a disease? How should he go about fasting?
Answer: He who fears for himself of falling ill as a result of fasting is not required to fast. Nor is he who believes that fasting would worsen his poor state of health in any way, be it hampering his recovery or increasing his pain. This should, however, be commensurate with what is generally accepted in these circumstances. If he fears that fasting might be harmful to him, it is permissible to break his fast. And if his illness continues until the next Ramadhan, Qadha is not obligatory but he should give 750 grams of food (wheat, flour or bread or any kind of food) for each day to poor Shiites. If he recovers within the same year, only Qadha is obligatory on him and he will not have to pay kaffara.
As for a patient whose health is not affected by fasting, he must fast and his fasting is in order.
There is no specific rule about mental illness.