If a defendant is found "guilty but mentally ill" and is placed on probation, the sentencing court, upon recommendation of a licensed psychiatrist or a licensed psychologist, shall make treatment a condition of probation. Any report required by the sentencing court shall be filed with the court service department and the sentencing court. The defendant's failure to continue treatment, except by agreement with the treating agency and the sentencing court, is basis for commencing a probation revocation hearing and grounds for probation revocation.
SDCL 23A-27-40