Any academic institution worth bothering with will have a procedure in place to take this sort of thing in their stride. Hand them any sort of legitimate document from someone with medical qualification, and the system should take care of you. Whether or not your professor is prepared to "tolerate" it is irrelevant; the procedure defines what sort of considerations you'll get, and the professor is required to abide by that.
The point of a system like this is to prevent the sort of worry you seem to be suffering from. It's not in anyone's interests for students to be ignoring potential health concerns for fear of academic reprisals, so the system is designed to protect you academically as well as medically. The rule is simple: health comes first, and the academia will make reasonable effort to fit around that.
I developed migraines, chest pains and spiking blood pressure in the middle of my final year of university. I ended up seeing multiple doctors and getting prescribed meds that could leave me unable to focus on anything, let alone my dissertation or exam revision. My advice to you is a combination of what I did, and what I wish I'd done:
- Work only when you feel able to work effectively.
This goes for any scenario, even just minor sleep deprivation. You'll get further by not having to go back and fix mistakes you made while tired, ill, or otherwise not thinking clearly.
- Get to a doctor as soon as possible.
Two reasons: it's on record that you're seeking medical advice so that you can't be accused of making it up later (it's rare, but better to be covered) and it stops the problem going on any longer than it has to. Many health things are easier to fix if you catch them early.
- Let the faculty know.
Tell them that you feel unable to work because of health concerns, that you have a doctor's appointment, and you'll keep them posted. Again, it's easier if you don't pull it out of nowhere right before a deadline. Sometimes that's unavoidable, but if you can avoid it, it helps. If they understand why you're absent and they see you being conscientious about it, they're more likely to overlook a brief absence if the doctors tell you it's nothing. They tend to be much less accepting of unexplained disappearances.
- Follow medical advice to the letter.
Don't worry about the work you may be missing: if a doctor says you shouldn't, then don't. The qualification is less important than your health.
- Keep the faculty advised.
You don't have to be too specific; feel free to say generic things like "taking medication" rather than "antidepressants", for example. They only need to know the bits that directly impact them; you don't need to tell them anything you'd rather keep confidential as long as they know whether you're able to attend lectures, do your coursework, sit exams etc. Phrases like "unpleasant side effects" and "not feeling up to it" can cover a lot without giving them details.
- Make reasonable effort to meet them halfway once you're well again.
A little goodwill goes a long way, and once you're healthy again it doesn't hurt to offer things like catch-up work, meeting with professors to discuss your options, that sort of thing.
In the end, this all boils down to one thing: health first, then work.