Psychiatric records and other medical records cannot be released without the patient's written consent. I was never asked about my past medical history. I was never asked to release old records. If you refer to medical issues in your personal statement or essays, it is your choice as to how explicit you wish to be. If you mention it, it does open the door to questions by an interviewer, but you can be vague in your answer. Adcomms would mainly want to know if the situation is resolved or under control, or if there is any chance it could interfer with your ability to function well as a med student.
The only way the medical history might become specifically raised is if an interviewer is from the same institution where the hospitalization occurred and recognized the applicant as their patient. Even so, they cannot discuss it with other adcomms, due to privacy laws.