The Immigration Act

In computing the period of residence required for the acquisition of the status of permanent resident, no period may be counted during which a person is confined to a prison or is an inmate of a hospital for treatment of leprosy or mental disorder.