(6) At a time and place designated by the court, submit to a psychological evaluation when the person has been charged with a violation of item (4) of subsection (a) of Section 24-1 of the Criminal Code of 1961 or the Criminal Code of 2012 and that violation occurred in a school or in any conveyance owned, leased, or contracted by a school to transport students to or from school or a school-related activity, or on any public way within 1,000 feet of real property comprising any school.
Psychological evaluations ordered pursuant to this Section shall be completed promptly and made available to the State, the defendant, and the court. As a further condition of pretrial release under these circumstances, the court shall order the defendant to refrain from entering upon the property of the school, including any conveyance owned, leased, or contracted by a school to transport students to or from school or a school-related activity, or on any public way within 1,000 feet of real property comprising any school. Upon receipt of the psychological evaluation, either the State or the defendant may request a change in the conditions of pretrial release, pursuant to Section 110-6 of this Code. The court may change the conditions of pretrial release to include a requirement that the defendant follow the recommendations of the psychological evaluation, including undergoing psychiatric treatment. The conclusions of the psychological evaluation and any statements elicited from the defendant during its administration are not admissible as evidence of guilt during the course of any trial on the charged offense, unless the defendant places his or her mental competency in issue.