§ 4814. Order for examination
(a) Any court before which a criminal prosecution is pending may order the department of mental health to have the defendant examined by a psychiatrist at any time before, during or after trial, and before final judgment in any of the following cases:
(1) When the defendant enters a plea of not guilty, or when such a plea is entered in the defendant's behalf, and then gives notice of the defendant's intention to rely upon the defense of insanity at the time of the alleged crime, or to introduce expert testimony relating to a mental disease, defect, or other condition bearing upon the issue of whether he or she had the mental state required for the offense charged;
(2) When the defendant, the state, or an attorney, guardian or other person acting on behalf of the defendant, raises before such court the issue of whether the defendant is mentally competent to stand trial for the alleged offense;
(3) When the court believes that there is doubt as to the defendant's sanity at the time of the alleged offense; or
(4) When the court believes that there is doubt as to the defendant's mental competency to be tried for the alleged offense.
(b) Such order may be issued by the court on its own motion, or on motion of the state, the defendant, or an attorney, guardian or other person acting on behalf of the defendant. (Added 1969, No. 20, § 1; amended 1973, No. 118, § 16, eff. Oct. 1, 1973; 1991, No. 231 (Adj. Sess.), § 6; 1995, No. 174 (Adj. Sess.), § 3; 2005, No. 174 (Adj. Sess.), § 19; 2007, No. 15, § 22.)