Except as provided in this chapter and chapter 590, a court requiring the appearance of a person confined in a state correctional facility, mental hospital, or other institution after criminal conviction, civil commitment, or under court order, may order the confining institution to release the person into the temporary custody of the court. The order must specify:
(1) the reason for the person's appearance;
(2) to whom the confined person may be released; and
(3) the date and time of the release.
The court shall, without any cost to the releasing institution, determine and implement a cost-effective and convenient method for obtaining the person's appearance, including requiring the parties to the proceedings to pay all or a part of the costs as otherwise provided by law.
Upon receipt of a court order for release under this section, the chief executive officer of the confining institution shall take appropriate steps to comply with the order in a manner which is consistent with public safety.