(1) If the suspect is in custody (whether or not as the result of the issue of a warrant under section 23XGC), he or she may be detained in custody for such period (the detention period ) as is reasonably necessary to carry out the forensic procedure but in any case for no longer than a period starting when:
(a) the magistrate orders the carrying out of the procedure; or
(b) the suspect is arrested pursuant to a warrant under section 23XGC;
whichever is later, and ending:
(c) if the suspect is a child or an incapable person, or the investigating constable believes on reasonable grounds that the suspect is an Aboriginal person or a Torres Strait Islander--2 hours later; or
(d) in any other case--4 hours later.
(2) In working out any period of time for the purposes of subsection (1), the following times are to be disregarded:
(a) the time (if any) that is reasonably required to convey the suspect from the place where the suspect is when the detention period starts to the nearest premises where facilities for carrying out the procedure in accordance with this Part are available to the investigating constable;
(b) any time during which carrying out the procedure is suspended or delayed to allow the suspect, or someone else on the suspect's behalf, to communicate with a legal practitioner, friend, relative, parent, guardian, interpreter, medical practitioner, dentist or other person as provided by this Part;
(c) any time during which carrying out the procedure is suspended or delayed to allow such a legal practitioner, friend, relative, parent, guardian, interpreter, medical practitioner, dentist or other person to arrive at the place where the procedure is to be carried out;
(d) any time during which carrying out the procedure is suspended or delayed to allow the suspect to receive medical attention;
(e) any time during which carrying out the procedure is suspended or delayed because of the suspect's intoxication;
(f) any reasonable time during which carrying out the procedure is suspended or delayed to allow the suspect to rest or recuperate;
(g) any time during which the suspect is being questioned under Part IC;
(h) any time that is to be disregarded under subsection 23C(7) or 23DB(9).