(a) An attorney representing the state, any county, or municipality or the Department of Youth Services or the Department of Human Resources or an attorney representing the person or persons filing a petition to have a minor or child committed may serve as the advocate in support of the petition to commit in all matters regarding the petition.
(b) At the final hearing upon a petition seeking to commit a minor or child to the custody of the department on the basis that the minor or child is mentally ill, the juvenile court may grant the petition if clear and convincing evidence proves all of the following:
(1) That the minor or child sought to be committed is mentally ill.
(2) That, as a consequence of the mental illness, the minor or child poses a real and present threat of substantial harm to himself, herself, or to others.
(3) That the threat of substantial harm has been evidenced by a recent overt act.
(4) That treatment is available for the mental illness of the minor or child or that confinement is necessary to prevent the minor or child from causing substantial harm to himself, herself, or to others.
(5) That commitment is the least restricting alternative necessary and available for treatment of the illness of the minor or child.
(c) Upon these findings, the juvenile court shall enter an order setting forth the findings and may order the minor or child committed to the custody of the department.
(d) The commissioner of the department, or his or her designee, may designate a hospital outside the department where a committed child or minor may receive care and treatment and may place the child or minor in the designated hospital upon commitment to the department.