There is legal precedent as grounds for dismissal for failing to attend a doctors appointment for the purposes of a medical evaluation for an employer or also failing to disclose medical records to an employer in Australia if it was part of your employment contract.
Definitely enforceable without a doubt - and many industries have it as part of a standard employment contract, e.g Aircraft pilot.
Also as part of fairwork legislation to prevent being fired as a result of extended sick leave it actually requires disclosure of the condition.