Solution; pilots are medically examined by airline appointed doctors who are free to notify management when " fitness to fly" is called into question.
I don't see how your scheme would foil somebody who was absolutely determined to hide a medical problem.
Also using your logic it sounds like you think crew members would have to go to the company Doc(s) for every single consultation for every single ailment, regardless of what it is (from sniffles and colds through to broken bones, perhaps even worse) and also regardless of where the crew member is taken ill.....it would of course also need to be a service available 24/7. Leaving aside the legal and logistical problems associated with your plan best of luck getting the company bean counters to pay to set up that kind of service...where I work the company medical facilities have been steadily reduced over the years and I doubt it could even cope with all pilots demanding that their recurrent medicals were done in house, let alone 4000+ pilots using it as a G.P's service.