Ariz. Rev. Stat. § 36-3717
A. Except as provided in subsection B of this section, a person who is detained or civilly committed pursuant to this article shall not be transported from a licensed facility under the supervision of the superintendent of the Arizona state hospital, except that a person may be transported to court for any of the following reasons: