(1) If the adolescent is receiving inpatient treatment in a hospital setting and is not released as a result of the petition filed under RCW
71.34.620, he or she shall be released not later than thirty days following the later of: (a) The date of the authority's determination under RCW
71.34.610(2); or (b) the filing of a petition for judicial review under RCW
71.34.620, unless a professional person or the designated crisis responder initiates proceedings under this chapter.
(2) If the adolescent receiving treatment in a residential treatment facility is not released as a result of the petition filed under RCW
71.34.620, he or she may remain in a residential treatment facility so long as it continues to be a medical necessity for the adolescent to receive such treatment.