Shaykh Muqbil explains that if a person is permanently ill and doctors say recovery is unlikely, he may break the fast and instead feed a poor person for each missed day. This ruling follows the Quranic allowance for those who cannot fast due to illness.
What is the ruling on the one who breaks the fast due to an illness which has continued for a number of years?
If the doctors decide that there is no hope of recovery for him – and Allāh ﷻ is The Healer, it could be that the doctors decided that there is no hope of recovery for him and Allāah cures him. However, if they decide that there is no hope of recovery in their opinion, then there is no problem for him to feed the poor every day.
Just as our Lord has said,
۞فَمَن كَانَ مِنكُم مَّرِيضًا أَوْ عَلَىٰ سَفَرٍ فَعِدَّةٌ مِّنْ أَيَّامٍ أُخَرَ ۚ وَعَلَى الَّذِينَ يُطِيقُونَهُ فِدْيَةٌ طَعَامُ مِسْكِينٍ
“And as for those who can fast with difficulty, (e.g. an old man, etc.), they have (a choice either to fast or) to feed a Miskīn (poor person) (for every day).” [Q 2: 184]
So he feed and this is what Anas ibn Mālik did when he could not fast, he would feed the poor everyday.