If:
(a) a person is being prosecuted for a Commonwealth offence; and
(b) the judge or magistrate presiding over the proceedings related to that offence is satisfied that it is necessary to ascertain whether or not the person is, or was, at the time of the alleged commission of that offence, under 18;
the judge or magistrate presiding may make an order requiring the carrying out of a prescribed procedure in respect of the person.