In this Chapter, lawful custody includes custody or detention pursuant to any of the following:(a) lawful arrest;(b) a person surrendering to his bail;(c) an order for remand, a conviction, or a sentence of imprisonment;(d) a restriction order made under the Criminal Justice (Mental Impairment) Act 1999 or any other order under that Act that commits a person to detention in a secure mental health unit, within the meaning of the Mental Health Act 2013 ;(da) a treatment order made under the Criminal Justice (Mental Impairment) Act 1999 ;(db) apprehension of a person under section 31 of the Criminal Justice (Mental Impairment) Act 1999 ;(e) a declaration made under section 19 of the Sentencing Act 1997 ;(f) an assessment order made under section 72 of the Sentencing Act 1997 ;(g) a treatment order made under section 75(1) of the Sentencing Act 1997 ;(h) a restriction order made under section 75(1) of the Sentencing Act 1997 or any other order under that Act that commits a person to detention in a secure mental health unit, within the meaning of the Mental Health Act 2013 .