(a) The court shall enter an order denying an application for court-ordered treatment if after a hearing the court or jury fails to find, from clear and convincing evidence, that the proposed patient is a person with a chemical dependency and meets the criteria for court-ordered treatment.
(b) If the court denies the application, the court shall order the discharge of a proposed patient who is not at liberty.