Notwithstanding the pendency of the action or any order previously entered by the court, if at any time after the petition is filed the staff of the facility determines that the involuntary patient is no longer in need of involuntary treatment, the facility may so certify in writing and discharge the patient, and shall promptly notify the court of its discharge, and the court may dismiss the action.

73 Del. Laws, c. 358, § 2.;