A person admitted to a hospital or the Department under section 21-522 may not be detained in the hospital or by the Department for a period in excess of 48 hours from the time of the person's admission, unless the administrator of the hospital, the chief clinical officer of the Department, or the administrator's or chief clinical officer's designee has, within that period, filed a written petition with the court for an order authorizing the continued detention of the person for emergency observation and diagnosis for a period not to exceed 7 days from the time the order is entered.
D.C. Code § 21-523