(a) Where there are indications that a child may be physically ill, a child with mental illness or an intellectual disability, or an evaluation of a child is needed to help determine issues of competency to understand judicial proceedings, mental state at the time of the offense, or the ability of the child to assist his or her attorney, the juvenile court, on its own motion or motion by the prosecutor, or that of the child's attorney or guardian ad litem for the child, may order the child to be examined at a suitable place by a physician, psychiatrist, psychologist, or other qualified examiner, under the supervision of a physician, psychiatrist, or psychologist who shall certify the findings of the examiner in writing, or a qualified examiner approved by the Department of Mental Health prior to a hearing on the merits of the petition.
(b) The examinations made prior to a hearing as provided for in subsection (a) shall be conducted on an outpatient basis unless the juvenile court finds that placement in a hospital or other appropriate facility is necessary.
(c) The juvenile court, after a hearing, may order an examination, as described in subsection (a), of a parent, legal guardian, or legal custodian who gives his or her consent and whose ability to care for or supervise a child before the juvenile court is at issue.
(d) The juvenile court, either before or after a hearing, may cause any child under the jurisdiction of the juvenile court to be given a physical or mental examination, or both, by a competent physician, psychiatrist, psychologist, or other qualified examiner, under the supervision of a physician, psychiatrist, or psychologist who shall certify the findings of the examiner in writing, or an examiner approved by the Department of Mental Health to be designated by the juvenile court, and the physician, psychiatrist, psychologist, or mental examiner shall certify to the juvenile court the condition in which the child is found.
(e) If, upon the examination, there is reason to believe that a minor or child is a minor or child with mental illness or an intellectual disability, as defined by the Department of Mental Health, a petition for mental commitment of the minor or child may be filed pursuant to Article 4, commencing with Section 12-15-401.
(f) Upon examination, if it appears that the child is in need of surgery, medical treatment or care, hospital care, or dental care, the juvenile court may cause the child to be treated by a competent physician, surgeon, or dentist or placed in a public hospital or other institution for training or care or in an approved private home, hospital, or institution, which will receive him or her for like purposes. The expense of the treatment shall be a valid charge against the county unless otherwise provided for.
(g) The juvenile court may grant authority to order emergency medical care to any such person, agency, or department charged with the detention, temporary shelter care, or other care of a child under the jurisdiction of the juvenile court.