(1) Whenever the defendant has filed a notice of intention to rely on the defense of physical or mental disease, disorder, or defect excluding penal responsibility, or 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 order an examination as to the defendant's physical or mental disease, disorder, or defect at the time of the conduct alleged.
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.