Notwithstanding any other provision of this act, no patient with respect to whom proceedings for judicial commitment have been commenced shall be released or discharged during the pendency of such proceedings unless ordered by the court or a judge thereof upon the application of the patient, or his legal guardian, parent, spouse, or next of kin, or upon the report of the director of the facility that the patient may be discharged with safety.
Idaho Code § 66-350