When a pestilence or contagious disease occurs in or near a jail and the physician in attendance certifies that it is liable to endanger the health of the prisoners, the judge of the superior court may, by an order in writing, designate a safe and convenient place in the county, or the jail in a contiguous county, as the place of confinement. The order shall be filed in the office of the clerk of the superior court, and the sheriff shall thereupon remove the prisoners to the place or jail designated, and there confine them until they can be safely returned to the jail from which they were taken.
A.R.S. § 31-106