If the director of the facility under which the defendant is being treated in accordance with § 23A-10A-4 determines that the defendant has recovered to an extent that the defendant is able to understand the nature and consequences of the proceedings against the defendant and to assist properly in the defense, the director shall promptly file a certificate to that effect with the clerk of the court that ordered the placement or commitment, and the defendant shall be discharged from the facility where the defendant is hospitalized, if applicable. Upon discharge, the defendant is subject to the provisions of chapter 23A-43.
The court shall send a copy of the certificate to the defendant's counsel and to the prosecuting attorney. The court shall hold a hearing, conducted under the provisions of § 23A-46-3, to determine the competency of the defendant. If, after the hearing, the court finds by a preponderance of the evidence that the defendant has recovered to an extent that the defendant is capable of understanding the nature and consequences of the proceedings against the defendant and to assist properly in the defense, the court shall set the date for trial. If, after the hearing, the court does not find by a preponderance of the evidence that the defendant has recovered to an extent that the defendant is capable of understanding the nature and consequences of the proceedings against the defendant and to assist properly in the defense, the court shall order the defendant to be placed in a restoration to competency program under the direction of an approved facility, in an approved facility, or on outpatient status for restoration to competency if the court makes a written finding that the defendant is not considered to be a danger to the health and safety of others and is otherwise eligible for bond for a term consistent with this section and §§ 23A-10A-14 and 23A-10A-15.
SDCL 23A-10A-4.1