All perfect praise be to Allaah, the Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad is His slave and Messenger.
You have to ask a trustworthy Muslim doctor. If (he concludes that) your fasting will delay your recovery or worsen your illness, then you are not allowed to fast and you have to make up the days that you did not fast during Ramadan after your recovery. This is based on the statement of Allaah Almighty (which means): {So whoever among you is ill or on a journey [during them]—then an equal number of days [are to be made up].} [Quran 2: 184]
You are not obliged to give food as an expiation at all. However, if your sickness is chronic, then you have to give food to one poor person for each day that you did not fast since Allaah Almighty says (what means): {And upon those who are able [to fast, but with hardship]—a ransom [as substitute] of feeding a poor person [each day].} [Quran 2: 184]
Ad-Daaraqutni reported that Ibn ‘Abbas said regarding the statement of Allaah Almighty (which means): {And upon those who are able [to fast, but with hardship]—a ransom [as substitute] of feeding a poor person [each day].}: “This concession is only for the elderly who are not able to fast or those who are chronically ill.” [Ad-Daaraqutni: Saheeh Isnaad]
We ask Allah Almighty to grant you a speedy recovery for He is able to do all that.
Allaah Knows best.