Diseases like diabetes, asthma, etc., are very common nowadays. As Nathrao mentioned, these conditions do not qualify for avoiding the notice period. Even if hospitalization is required at times, the company will only extend the notice period by that duration.
It seems you may have other reasons to avoid the notice period but are searching for something that the company would accept.
Regarding Your Question
"Is it mandatory that I have to buy the notice period?" Please note that you cannot take this for granted. Even if this option is included in the rule book, the company, usually the reporting manager, will have the final discretion.
When you start a job, it is not your prerogative to think or say, "I don't want to serve notice." You must either accept the full deal or let go of the full deal. If you seek changes in the terms, they need to be discussed.
What if the company were to say, "We promised you X salary but now want to offer you X-Y salary." Would that be acceptable to you? Would you not refer to the rules at that point?
Regards,
TS