No-one should be able to access your medical history without your approval or knowledge. You need to give permission for that to happen, or you need to provide "all relevant medical information" when requested.
If you withhold information that is relevant to your job application, you may find yourself in deep $h!t later on, particularly if an incident happens.
Better to be up-front about any potential factor that is relevant to your job application... and having been treated for PTSD, is relevant in any medical examination for job fitness... particularly where you are contemplating a job where peoples lives are in your hands, and reliant on your correct decision-making, under extreme pressure.