(a) The release of a defendant committed under this chapter from the commission, an outpatient treatment program, or another facility is subject to disapproval by the committing court if the court or the attorney representing the state has notified the head of the facility or outpatient treatment provider, as applicable, to which the defendant has been committed that a criminal charge remains pending against the defendant.
(b) If the head of the facility or outpatient treatment provider to which a defendant has been committed under this chapter determines that the defendant should be released from the facility, the head of the facility or outpatient treatment provider shall notify the committing court and the sheriff of the county from which the defendant was committed in writing of the release not later than the 14th day before the date on which the facility or outpatient treatment provider intends to release the defendant.
(c) The head of the facility or outpatient treatment provider shall provide with the notice a written statement that states an opinion as to whether the defendant to be released has attained competency to stand trial.
(d) The court shall, on receiving notice from the head of a facility or outpatient treatment provider of intent to release the defendant under Subsection (b), hold a hearing to determine whether release is appropriate under the applicable criteria in Subtitle C or D, Title 7, Health and Safety Code. The court may, on motion of the attorney representing the state or on its own motion, hold a hearing to determine whether release is appropriate under the applicable criteria in Subtitle C or D, Title 7, Health and Safety Code, regardless of whether the court receives notice that the head of a facility or outpatient treatment provider provides notice of intent to release the defendant under Subsection (b). The court may conduct the hearing:
(1) at the facility; or
(2) by means of an electronic broadcast system as provided by Article 46B.013.
(e) If the court determines that release is not appropriate, the court shall enter an order directing the head of the facility or the outpatient treatment provider to not release the defendant.
(f) If an order is entered under Subsection (e), any subsequent proceeding to release the defendant is subject to this article.