Any person retained in a facility under the provisions of paragraph (a) of section 10 shall be free to leave such facility at any time, and a parent or guardian who requested the admission of such person may withdraw such person at any time, upon giving written notice to the superintendent. The superintendent may restrict the right to leave or withdraw to normal working hours and weekdays and, in the superintendent's discretion, may require persons or the parent or guardian of a person to give 3 days written notice of their intention to leave or withdraw. If a person or their parent or guardian is required to give 3 days notice of intention to leave or withdraw, an examination of the person may be conducted to determine their clinical progress, their suitability for discharge and to investigate other aspects of their case, including their legal competency and their family, home or community situation, in the interest of discharging them from the facility. The person may be retained at the facility beyond the expiration of the 3-day notice period if prior to the expiration of the 3-day notice period the superintendent files with the district court a petition for the commitment of the person at the facility. Before accepting an application for voluntary admission where the superintendent may require 3 days written notice of intention to leave or withdraw, the admitting or treating physician or qualified advanced practice registered nurse shall assess the person's capacity to understand that:
Mass. Gen. Laws ch. 123, § 11