(a) Upon motion of the State or any defendant, the judge of a court in which a criminal proceeding is pending must, for good cause shown, enter an order requiring that any person confined in an institution in this State be produced and compelled to attend as a witness in the action or proceeding.
(b) If the witness is confined pursuant to another pending criminal proceeding, and the judge determines that the production of the witness would result in an unreasonable interference with the conduct of the prior proceeding, he may deny the order. If an order for production is issued, a judge or justice of the appellate division of the General Court of Justice may, upon application of a defendant or prosecutor in the other district for good cause shown, vacate the order for production.
(c) The costs of production of the witness are assessed as are other witness fees. (1973, c. 1286, s. 1; 1975, c. 166, s. 27.)