Unpredictable Illness vs. Planned Medical Procedures
It is true that you cannot predict illnesses in advance, such as the flu, accidents, a broken arm, appendicitis, etc., as these are random occurrences that can happen at any time of day or night.
However, if you have an ongoing condition, your doctor may decide that you need an operation to rectify the problem. In that case, you can ask for sick leave in advance. You will know for certain when you are going to the hospital and will have an approximate idea of the time you will need for the hospital stay and recuperation.
The original poster (OP) did not provide enough information to allow members to make a proper assessment of the question.