An order made under the preceding subsection may direct detention for a period specified in the order, but any justice of the peace acting in and for the same place may extend a period so specified as often as it appears to him to be necessary so to do.
Any person who leaves a hospital contrary to an order made under this section for his detention therein shall be liable to a fine not exceeding five pounds, and the court may order him to be taken back to the hospital.
An order under this section may be addressed, in the case of an order for a person's detention, to such officer of the hospital and, in the case of an order made under the last preceding subsection, to such officer of the local authority oh whose application the order for detention was made, as the justice may think expedient, and that officer and any officer of the hospital may do all acts necessary for giving effect to the order.