For recruitment there is screening, as people do go through a medical examination, and part of that is a history-taking where people are asked about their previous medical history, including mental health history. Yes, that does happen.
Based on that, whether someone is screened in or out would often be on a case-by-case basis. It would depend what exactly that history was about.