(a) Except as provided in (b) of this section, the professional person in charge shall at any time discharge a respondent on the ground that the respondent is no longer gravely disabled or likely to cause serious harm as a result of mental illness. A certificate to this effect shall be sent to the court, which shall enter an order officially terminating the involuntary commitment.
(b) The professional person in charge shall give the prosecuting authority 10 days' notice before discharging a respondent who was committed after having been found incompetent to proceed under AS 12.47.110.