I.
The type of sickness that makes it valid to not fast in Ramadan is that in which the patient cannot fast, or he can fast but with great difficulty because of his sickness, or because he fears that it may lead to death or damage or loss of faculties and organs, or because fasting will exacerbate his sickness, or he feels that it would make his sickness last longer or delay his recovery.
We have discussed this previously on our website. Please see question no. 12488.
If a trustworthy doctor told you that fasting is harmful in your case, then it is permissible for you not to fast. In fact, it may be obligatory in some cases, if fasting will put your life or your general health in danger.
Al-Qurtubi (may Allah have mercy on him) said:
When a person is sick, there are two scenarios, the first of which is that he cannot fast at all; in this case, it is obligatory for him not to fast.
The second scenario is that he is able to fast but will incur some harm and hardship. In this case, it is recommended for him not to fast.
End quote from Tafsir al-Qurtubi, 2/267.
Ash-Shawkani said:
When a person is sick, there are two scenarios: if he is not able to fast, then he must not fast.
If he is able to fast but will incur harm and hardship, there is a concession allowing him not to fast. This is the view of the majority of scholars.
End quote from Fat-h al-Qadir, 1/180.
II.
For the days on which you did not fast during your sickness, for which you had a concession allowing you not to fast because of that, the expiation is feeding needy persons, because diabetes is a chronic illness, depending on the doctors’ diagnosis in your case.
The same applies to the days when you did not fast because of your menses; you may feed the needy to compensate for that, because feeding the needy – and not fasting – is what you should do in principle, because of your sickness.
Ibn Qudamah (may Allah have mercy on him) said:
The sick person for whom there is no hope of recovery may not fast, and feed one poor person for each day, because he is like the elderly person.
End quote from Al-Mughni, 4/396.
Shaykh Ibn `Uthaymin (may Allah have mercy on him) said:
If a someone is permanently unable to fast and there is no hope of recovery for him – such as one who is elderly or sick with no hope of recovery, as in the case of cancer and the like – then he is not obliged to fast, because he is not able to do it. Allah, may He be Exalted, says: {So fear Allah as much as you are able} [at-Taghabun 64:16] and {Allah does not place on any soul a burden greater than it can bear} [Al-Baqarah 2:286].
But he must feed needy persons to compensate for not fasting, feeding one poor person for each day.
End quote from Majalis Ramadan, p. 32.
So what you did of feeding the poor to compensate for those days is to be regarded as valid and is acceptable compensation for not fasting, and you do not have to make up those days.
We have previously discussed how much food is to be given for the obligatory penalty (fidyah) for not fasting in question no. 49944.
As for the future, you should see how you feel: if you feel that fasting will be too hard and difficult because of your sickness, or that it will have a negative impact on your health, then accepting the concession is more appropriate for you. In the hadith it tells us that the Prophet (blessings and peace of Allah be upon him) said: “Allah loves His concessions to be accepted as He dislikes sins to be committed.” Narrated by Ahmad, 5832; classed as authentic by al-Albani in Al-Irwa’, 564.
It was narrated that `A’ishah (may Allah be pleased with her) said: The Messenger of Allah (blessings and peace of Allah be upon him) was never given the choice between two things but he would choose the easier of the two, so long as it was not a sin; if it was a sin he would be the furthest of the people from it. Narrated by al-Bukhari, 6786; Muslim, 2327.
If fasting will harm you and lead to making your condition worse, or will damage some faculties or organs, then it is not permissible for you to fast, and you could incur sin because of it.
It says in Fatawa al-Lajnah ad-Da’imah lil-Ifta’, 1 (9/83):
A concession is granted to the sick person for whom it is difficult to fast, and to travellers, allowing them not to fast during the day in Ramadan, because Allah, may He be Exalted, says: {and whoever is ill or on a journey - then an equal number of other days} [Al-Baqarah 2:185].
But if they fast, their fast is valid, because of the hadith of `A’ishah (may Allah be pleased with her) which says that Hamzah ibn `Amr al-Aslami (may Allah be pleased with him) said to the Prophet (blessings and peace of Allah be upon him): Can I fast when travelling? As he used to fast a great deal. The Prophet (blessings and peace of Allah be upon him) said: If you wish, fast, and if you wish, do not fast. Narrated by al-Bukhari and Muslim.
But if they fear that they will be harmed by fasting, then they must not fast, because of the hadith of Jabir (may Allah be pleased with him), who said: The Messenger of Allah (blessings and peace of Allah be upon him) was on a journey and he saw a crowd of people around a man who was being shaded. He said: “What is this?” They said: He is fasting. He said: “It is not righteousness to fast whilst travelling.”
So you have to find out by consulting specialist doctors who know your case.
For more information, see the answers to questions no. 11107 and 107305.
And Allah knows best.