Court rules employee’s behavior justified mental health exam