Whenever there is reason to believe that the physical or mental disease, disorder, or defect of the defendant will or has become an issue in the case, the court may enter into an agreement with the parties at any stage of the proceeding to divert the case into an evaluation of the defendant, treatment of the defendant, including residential or rehabilitation treatment; or any other course or procedure, including diversion into specialized courts. Such agreements may include in-court clinical evaluations.
HRS § 704-407.5