If it appears to the court that the individual requires immediate assessment because the individual presents a substantial risk of significant physical or mental harm to themself in the near future or presents a substantial risk of significant physical harm to others in the near future, the court may order the individual hospitalized and may order a peace officer to take the individual into protective custody and transport the individual to a preadmission screening unit designated by the community mental health services program. After the individual is taken into protective custody by a peace officer, the court may, also, order a security transport officer to transport the individual to a preadmission screening unit designated by the community mental health services program. If the preadmission screening unit authorizes hospitalization, the peace officer or security transport officer must transport the individual to a hospital designated by the community mental health services program, unless other arrangements are provided by the preadmission screening unit. If the examinations and clinical certificates of the psychiatrist, and the physician or the licensed psychologist, are not completed within 24 hours after hospitalization, the individual must be released.