The parent or guardian of a minor who is less than 18 years of age may file a notice to withdraw the minor from the facility. On receipt of the notice,
(1) the facility may discharge the minor to the custody of the parent or guardian; or
(2) if, in the opinion of the treating physician, release of the minor would be seriously detrimental to the minor's health, the treating physician may
(A) discharge the minor to the custody of the parent or guardian after advising the parent or guardian that this action is against medical advice and after receiving a written acknowledgment of the advice; or
(B) refuse to discharge the minor, initiate involuntary commitment proceedings, and continue to hold the minor until a court order under AS 47.30.700 has been issued; or
(3) if, in the opinion of the treating physician, the minor is likely to cause serious harm to self or others and there is reason to believe the release could place the minor in imminent danger, the treating physician shall refuse to discharge the minor, and shall initiate involuntary commitment proceedings and continue to hold the minor until a court order under AS 47.30.700 has been issued.