Utah Code Ann. § 77-16a-103
(1)
(a)
(i) If a defendant wishes to enter a plea of guilty with a mental condition, the parties may stipulate as to:
(b) If the parties do not stipulate to Subsection (1)(a)(i), the court shall hold a hearing and determine, by clear and convincing evidence:
(c) After reviewing the stipulation described in Subsection (1)(a)(i) or conducting a hearing under Subsection (1)(b):
(2)
(a) If a defendant wishes to enter a plea of guilty with a mental condition for a felony offense and the parties do not stipulate to Subsection (1)(a)(i), before holding the hearing described in Subsection (1)(b), the court may order the defendant to submit to an examination, which may be conducted only by a forensic evaluator appointed by the department, to determine:
(b)
(ii) The examination shall determine:
(c) Before an examination is conducted pursuant to Subsection (1)(b) or this Subsection (2):
(ii) for purposes of a guilty with a mental condition evaluation, a custodian of mental health records pertaining to the defendant, including the defendant's prior mental health evaluations or records relating to the defendant's substance use disorder, may provide the records to:
(3)
(a) If a defendant relies on a private mental health evaluation in support of the defendant's plea of guilty with a mental condition and the parties do not stipulate to Subsection (1)(a)(i), upon the request of the prosecutor before the hearing described in Subsection (1)(b), the court shall order the defendant to submit to an examination by:
(c) For purposes of a guilty with a mental condition evaluation, a custodian of mental health records pertaining to the defendant, including the defendant's prior mental health evaluations or records relating to the defendant's substance use disorder, may provide the records to:
(5)
(a) If a court finds that a defendant had a mental condition at the time of the commission of the offense, the defendant could benefit from supervision or treatment, and has entered a plea of guilty with a mental condition in accordance with Subsection (1)(c)(i), the court:
(i) shall order:
(c) For purposes of a guilty with a mental condition treatment assessment, a custodian of mental health records pertaining to the defendant, including the defendant's prior mental health evaluations or records relating to the defendant's substance use disorder, may provide the records to:
(d) At the treatment review hearing described in Subsection (5)(a)(ii), the court shall:
(e)
(ii)
(iii) The court shall, before making a determination as to a secure setting placement, notify the executive director of the proposed placement and provide the department with an opportunity to:
(f) If the court determines that the defendant is eligible for supervised release as part of the defendant's treatment and supervision recommendations under Subsection (5)(d), except as provided in Section 76-3-406, the court may order:
(i) if the offense is a felony:
(B) mental health supervision by:
(ii) if the offense is a misdemeanor, mental health supervision by:
(g)
(ii) At a review hearing described in Subsection (5)(g)(i):
(h) If a defendant is willfully non-compliant with the treatment or supervision ordered by the court under this Subsection (5), the court shall hold an order to show cause hearing to determine whether the court should:
(6)
(a) The court shall defer sentencing for a defendant who has pleaded guilty with a mental condition as described in Subsection (5) until:
(i) the court determines, after an order to show cause hearing or a review hearing as described in Subsection (5), that:
(b) At the sentencing hearing, the court shall:
(iv) consider the best interests of the defendant, including which sentence will help prevent the defendant:
(7)
(a) Except as provided in Subsection (7)(b), after a defendant who has been sentenced under Subsection (6) has completed the defendant's sentence and any probation or parole:
(8)
(a)
(b)