Court rules on the legality of non-consensual psychiatric treatment