After section 428D of the Principal Act the following section is inserted in Division 1 of Part 11A:
“428DA. Assessment whether emergency detention required
“(1) If, in proceedings before the Magistrates Court, it has reasonable grounds for believing that an accused requires immediate treatment or care by reason of his or her being mentally dysfunctional or mentally ill, the Magistrates Court may, without requiring the accused to submit to the jurisdiction of the tribunal, order that—
(a) the accused be taken by a police officer, or an escort under the Custodial Escorts Act 1998 , to an approved health facility for examination by a medical practitioner for the purpose of determining whether the accused is mentally dysfunctional or mentally ill;
(b) the accused may only be released into the custody of a police officer—
(i) by the person in charge of the approved health facility; or
(ii) if the accused is found to be mentally dysfunctional or mentally ill requiring detention and care—by the person in charge of an approved health facility or approved mental health facility at which the accused is detained for care; and
(c) on being so released, the accused be dealt with in 1 of the following ways:
(i) subject to subsection (2) and despite the Bail Act, be admitted to bail by an authorised officer;
(ii) despite the Bail Act, be held in the custody of a police officer who shall cause the accused to be brought before a court as soon as practicable for the purpose of the court determining whether or not to grant bail;
(iii) be dealt with by an authorised officer in accordance with the Bail Act.
“(2) If, when making an order under subparagraph (1) (c) (i), the Magistrates Court specifies terms and conditions on which bail is to be granted, an authorised officer may only grant bail subject to those terms and conditions.
“(3) If, under this section, an accused who is taken to an approved health facility—
(a) is released or discharged from the approved health facility or, if detained for care, an approved mental health facility, otherwise than into the custody of a police officer; or
(b) leaves the approved health facility or approved mental health facility, otherwise than in the custody of a police officer;
a police officer may arrest the accused without warrant for the purposes of the terms of the order being satisfied.
“(4) In this section—