The New Zealand legislation aims to ensure equal treatment and justice for mentally ill individuals, respecting their human rights and valuing diversity. The Mental Health Act 1992 defines situations where compulsory assessment or treatment is necessary, protects the public and vulnerable individuals, guarantees patients' rights, and provides avenues for challenging compulsory treatment orders or lodging complaints regarding rights.