Answer
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
1- If the Muslim medical personnel can function without harming him/herself or falling short in their duty to save lives during any pandemic, then they should indeed fast.
2- If he/she assessed that there will be harm to him/her or their patients in any way, then they could break their fasting and make up for the days later.
Answering your question, Dr. Jasser Auda, Professor and Al-Shatibi Chair of Maqasid Studies at the International Peace College South Africa, states:
Fasting is one of the pillars of Islam and it is an obligation of every adult Muslim to fast every day of the month of Ramadan. Breaking the fast for one day intentionally and without a good reason has to be compensated by 60 days of fasting – if possible, as is well known.
However, there are reasons stated clearly in the Quran as to why a Muslim would be allowed to break his/her fasting and makes up for the days later. Allah says:
{O you who have believed, decreed upon you is fasting as it was decreed upon those before you that you may become righteous –
[Fasting for] a limited number of days. So whoever among you is ill or on a journey [during them] – then an equal number of days (are to be made up).
And upon those who are able [to fast, but with hardship] – a ransom [as substitute] of feeding a poor person [each day]. And whoever volunteers excess – it is better for him. But to fast is best for you, if you only knew.
The month of Ramadhan [is that] in which was revealed the Qur’an, a guidance for the people and clear proofs of guidance and criterion. So whoever sights [the new moon of] the month, let him fast it; and whoever is ill or on a journey – then an equal number of other days. Allah intends for you ease and does not intend for you hardship and [wants] for you to complete the period and to glorify Allah for that [to] which He has guided you; and perhaps you will be grateful.} (Al-Baqarah 2:183-5)
By way of analogy, Prophet Muhammad (peace be upon him), his Companions after him, and scholars of Islam throughout history in various contexts have allowed other forms of “hardship” to be reasons for breaking the fasting.
On the other hand, saving lives is a collective duty on every society and on the Muslim community particularly. Medical professionals under the current circumstances of Coronavirus (COVID-19) have a heavier burden and a greater responsibility when it comes to the duty of saving lives.
Therefore, it is not permissible for Muslim medical staff to take their vacations under these circumstances so that they would be able to fast.
On the other hand, it is now a medical fact that fasting is a tool of boosting one’s immune system and not to the contrary as some might think.
Therefore, if the Muslim medical personnel can function without harming him/herself or falling short in their duty to save lives, then they should indeed fast.
Otherwise, that is if he/she assessed that there will be harm to him/her or their patients in any way, then they could break their fasting and make up for the days later during the year. Allah does not ask of a believer what puts them in hardship.
Almighty Allah knows best.