Before an involuntary patient may be transferred to a more restrictive setting, the chief clinical officer shall file a motion with the court requesting the court to amend its order of placement issued under section E In determining the entity or person to which the respondent is to be committed under division C of this section, the court shall consider the diagnosis, prognosis, preferences of the respondent and the projected treatment plan for the respondent and shall order the implementation of the least restrictive alternative available and consistent with treatment goals. D Any order made pursuant to division C 2 , 3 , 5 , or 6 of this section shall be conditioned upon the receipt by the court of consent by the hospital, facility, agency, or person to accept the respondent and may include a requirement that a person or entity described in division C 2 , 3 , 5 , or 6 of this section inform the board of alcohol, drug addiction, and mental health services or community mental health services provider the board designates about the progress of the respondent with the treatment plan. The court shall dismiss the case or order placement in the least restrictive setting. If the respondent is indigent and the transcript and record is made, a copy shall be provided to the respondent upon request and be treated as an expense under section The orders of a referee take effect immediately. The court shall hold a full hearing on applications for continued commitment at the expiration of the first ninety-day period and at least every two years after the expiration of the first ninety-day period. J A referee appointed by the court may make all orders that a judge may make under this section and sections The application of the attorney or the prosecutor shall include a written report containing the diagnosis, prognosis, past treatment, a list of alternative treatment settings and plans, and identification of the treatment setting that is the least restrictive consistent with treatment needs. If a person voluntarily remains at or is admitted to a hospital, services provider, or other facility, such notification shall not be given without the person's consent. The chief clinical officer of the hospital, services provider, or other facility shall inform a person voluntarily remaining at or admitted to a hospital, services provider, or other facility that the person may authorize such notification. The chief clinical officer may discharge a patient who is under an indictment, a sentence of imprisonment, a community control sanction, or a post-release control sanction or on parole ten days after written notice of intent to discharge the patient has been given by personal service or certified mail, return receipt requested, to the court having criminal jurisdiction over the patient. A copy of the affidavit and temporary order of detention shall be served with the notice to the parties and to respondent's counsel, if counsel has been appointed or retained. Such an examination shall be held within twenty-four hours after the time of arrival, and if the chief clinical officer fails after such an examination to certify that in the chief clinical officer's opinion the person is a mentally ill person subject to court order, the person shall be immediately released. The hearing shall be held within ten days after the date on which the respondent was transferred to the more restrictive setting or on which the motion was filed, whichever is earlier.