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.
If the surgery is not urgent and the patient is not harmed if it is delayed until after Ramadan, it is better to delay it in order to fast the complete month and absolve himself of liability. However, when a physician decides that the surgery is immediately needed and that delay exposes the patient to danger, he is allowed to perform the surgery and neither of them is guilty in this case, as there is a Sharee‘ah-approved excuse for not fasting.
Allaah Knows best.