(a) At any time during the involuntary admission period, a person may be converted to a voluntary admission status if the person's treating physician or treatment staff psychiatrist files a written statement of consent with the court.
(b) The court shall dismiss the action immediately upon the filing of the statement.