I think you are in a confidentiality predicament as well. The medic surely has a duty to protect the confidential medical information of the employee (which it seems they haven't). If this had been done, you probably wouldn't know that they weren't taking their medication.
However, as you already know this and believe it is a serious
OHS risk you can offer a first and final warning, that they need to remain offsite until they are better. If they return to site then you can terminate them. But you would have to have very strong evidence that their being on site is a
OHS risk. If you have clear policies and procedures that handle
OHS breach with a first and final warning then it makes it much easier to action this type of thing.