Can we not make screening for mental illness an inrinsic part of the process for accepting immigrants? Or would that be discrimination?

Can we not make screening for mental illness an inrinsic part of the process for accepting immigrants? Or would that be discrimination?