It is not legal to forcibly treat a patient in a prison, only in a hospital.
People suffering mental disorders quite often refuse treatment for their diagnosed disorder. In a British prison health centre, about one quarter of psychotic patients refused mental health treatment.