medical secrets wouldn't be necessary, because it would be against the law to discriminate in any way on any medical conditions right out of the gate in then first place.
Laws against discrimination would not be an adequate substitute for privacy. No matter what the laws were against discrimination, people would still want to keep details about their medical conditions to themselves. People would not want pity, or to be shunned, or to have unwanted/unneeded protections offered, and none of those things would constitute anything that the law could help with.
In your fantasy world, you would need to eliminate all human foibles and weaknesses.
Under a government which imprisons any unjustly, the true place for a just man is also in prison. Thoreau: Civil Disobedience (1846)
I would say here something that was heard from an ecclesiastic of the most eminent degree; ‘That the intention of the Holy Ghost is to teach us how one goes to heaven, not how the heaven goes.’ Galileo Galilei 1615.
If there is no struggle, there is no progress. Those who profess to favor freedom, and deprecate agitation, are men who want crops without plowing up the ground, they want rain without thunder and lightning. Frederick Douglass