As much as possible you are advised to sit the exam, even if you are filling in an 'illness, misadventure' form. This is because even though you may think you are too ill you may still do better than an estimated mark would get you (I have had a student literally throwing up throughout the exam who didn't get the 'illness' granted so an enquiry was made - and the answer back and proven was that he still did so well on the exam that he was better off without the 'illness' being granted.
If you can't sit the exam at all they will simply go through the normal moderating, aligning process etc without your marks and then slot you in accordingly e.g. you were coming 2nd 3 marks behind 1st and 4 marks ahead of 3rd you will end up being placed between them. If coming first then you would be placed in 1st with a mark reflecting how far ahead you were in relative terms e.g. you may have been 3 marks ahead but due to the way they report HSC marks with most of the cohort being reported as between 50 and 100 despite school marks spread across 0 - 100 it is possible that you may only be 1 mark ahead.
You will also have to go to school at some point to get the necessary paperwork and then get the doctor to complete the BOSTES form. A normal doctor's certificate won't suffice for the HSC.