I found this:
Section 77 requires that the defendant be tested for fitness to stand trial' (competence), and section 78 directs that the assessment consider whether the mental illness or disability interferes with the defendant's appreciation of wrongfulness, or his ability to act in accordance with such an appreciation. It is an interesting anomaly in that the question of criminal responsibility is assumed to be juridical (in that only the court can decide this) but the Act requires psychiatrists to comment on this.
If a defendant is not competent to stand trial
and /or lacks criminal responsibility the charges are withdrawn and he is referred to a state psychiatric hospital for indefinite hospitalization under section 28 of the Mental Health Act (whereupon he becomes known as a 'state patient').
http://bama.ua.edu/~jhooper/southaf.html