As far as I know medical certificates are avalible from your doctor and you should be eliagble considering your circumstances. This will be taken into consideration when the SQA are awarding your grade. BUT. Medical certificates must have been produced either before or soon after your exam. As far as I know within 3 days of your exam. I could be mistaken on this but it is vital you speak to your school as soon as possible if you think that it may further impact your exams or, if you feel like you may wish to leave this matter until after the exams are over, speak to your Support for Learning dept because they may be able to award you support in exams such as extra time so that the impact on your grades is minimised.
I hope that this help! Good luck!