1. At any time, upon a finding by a psychiatrist or licensed doctorate-level psychologist that there is a substantial probability that the defendant has acquired the ability to appreciate the charge, understand the proceedings, and effectively assist in the defendant’s defense, the psychiatrist or licensed doctorate-level psychologist providing outpatient treatment to the defendant or the director of the inpatient facility shall immediately notify the court. After receiving notice the court shall proceed as provided in subsection 4.
 2. At any time, a treating psychiatrist or licensed doctorate-level psychologist may notify the court that the defendant receiving outpatient treatment will require inpatient services to continue benefiting from treatment or that it is appropriate for a defendant receiving inpatient treatment services to receive outpatient treatment services. Upon receiving notification, the court shall proceed as provided under subsection 4.
 3. At any time upon a finding by a treating psychiatrist or licensed doctorate-level psychologist that there is no substantial probability that the defendant will be restored to competency in a reasonable amount of time, the psychiatrist or licensed doctorate-level psychologist providing outpatient treatment to the defendant or the director of the inpatient facility shall immediately notify the court. Upon receiving notification, the court shall proceed as provided under subsection 4.
 4. Upon receiving a notification under this section, the court shall schedule a hearing to be held within fourteen days. The court shall also issue an order to transport the defendant to the hearing if the defendant is in custody or is being held in an inpatient facility. The defendant shall be transported by the sheriff of the county where the court’s motion or the application pursuant to section 812.3 was filed.
 5. If the court finds by a preponderance of the evidence that the defendant’s competency has been restored, the court shall terminate the placement pursuant to section 812.6, and reinstate the criminal proceedings against the defendant, and may order continued treatment to maintain the competency of the defendant.
 6. If the court finds by a preponderance of the evidence that the defendant remains incompetent to stand trial but is making progress in regaining competency, the court shall continue the placement ordered pursuant to section 812.6.
 7. The court may change the placement of a defendant and the placement may be more restrictive if necessary for the continued progress of the defendant’s treatment as shown by clear and convincing evidence.
 8. If the court finds by a preponderance of the evidence that there is no substantial probability the defendant’s competency will be restored in a reasonable amount of time, the court shall terminate the commitment under section 812.6 in accordance with the provisions of section 812.9.