Whenever there is reason to doubt the defendant's fitness to proceed, the court may order temporary detention of the defendant for the purpose of an examination. The temporary detention must be in the least restrictive appropriate setting, including the state hospital, the life skills and transition center, or other suitable facility for a reasonable period, not to exceed thirty days, for such examination. In lieu of detention, the court may allow the defendant to remain in the defendant's present residential setting or other suitable residential setting for the purpose of examination, subject to any reasonable limitation the court may impose. A human service center may be considered if the court is aware an inquiry was made before the court ordered the evaluation to ensure appropriate resources exist at the human service center being ordered to conduct the examination. While the defendant is detained, the defendant's legal counsel, family, and others necessary to assist in the defendant's case must have reasonable opportunity to examine and confer with the defendant.
N.D.C.C. § 12.1-04-06