(a)
(1) When a defendant charged with a criminal offense is believed to be incompetent to stand trial, or there is a question about the defendant's mental capacity at the time of the commission of the crime, the criminal, circuit, or general sessions court judge may, upon the judge's own motion or upon petition by the district attorney general or by the attorney for the defendant and after hearing, order the defendant to be evaluated on an outpatient basis. The evaluation shall be done by the community mental health center or licensed private practitioner designated by the commissioner to serve the court or, if the evaluation cannot be made by the center or the private practitioner, on an outpatient basis by the state hospital or the state-supported hospital designated by the commissioner to serve the court. If, and only if, the outpatient evaluator concludes that further evaluation and treatment are needed, the court may order the defendant hospitalized, and if in a department facility, in the custody of the commissioner for not more than thirty (30) days for further evaluation and treatment for competence to stand trial subject to the availability of suitable accommodations.
(2) At any stage of a felony criminal proceeding, including a pretrial hearing, trial, sentencing, or post-conviction proceeding, the state may move or petition the court to authorize the district attorney general to designate a qualified expert to examine the defendant if the defendant gives notice that the defendant intends to offer testimony about the defendant's mental condition, whether in support of a defense of insanity or for any other purpose. The court may authorize the district attorney general to designate a qualified expert, who is willing to be appointed, to examine the defendant, if:
(A) An inpatient evaluator under subdivision (a)(1) notifies the court in a pretrial proceeding that the type or extent of assessment required exceeds the expertise or resources available to the evaluator or exceeds the scope of analysis of the defendant's competence to stand trial, satisfaction of criteria for the insanity defense, or for commitment under chapter 6, part 5 of this title; or
(B) In any other type of felony criminal proceeding, the court determines that examination of the defendant by a qualified expert for the state is necessary to adjudicate fairly the matter before it.
(3) The amount and payment of expert fees shall be determined and paid by the state district attorneys general conference.
(4)
(A) Except as provided in subdivision (a)(4)(B), during the post-conviction stage of a criminal proceeding, if it is believed that a defendant is incompetent to assist counsel in preparation for, or otherwise participate in, the post-conviction proceeding, the court may, upon its own motion, order that the defendant be evaluated on either an outpatient or inpatient basis, as may be appropriate. If the defendant is indigent, the amount and payment of the costs for the evaluation shall be determined and paid for by the administrative office of the courts. If the defendant is not indigent, the cost of the evaluation shall be charged as court costs. If the evaluation cannot be done on an outpatient basis and if it is necessary to hospitalize the defendant in a department facility, hospitalization shall not be for more than thirty (30) days and shall be subject to available suitable accommodations. Prior to transporting a defendant for such evaluation and treatment in a department facility, the sheriff or other transportation agent shall determine that the receiving department facility has available suitable accommodations. Any costs incurred by the administrative office of the courts shall be absorbed within the current appropriation for the indigent defense fund.
(B) In a post-conviction proceeding in a capital case, if there is a question on the defendant's mental condition at the time of the commission of the crime when there has been no such prior evaluation or a question as to whether the defendant is intellectually disabled, the court may, upon its own motion or upon petition by the district attorney general or by the attorney for the defendant, and, if the matter is contested, after a hearing, order that the defendant be evaluated on an outpatient basis. If and only if the outpatient evaluator concludes that an inpatient evaluation is necessary, the court may order the defendant to be hospitalized for not more than thirty (30) days.
(5) Prior to transporting a defendant for such evaluation and treatment in a department facility, the sheriff or other transportation agent shall determine that the receiving department facility has available suitable accommodations.
(b)
(1) If the court determines on the basis of the mental health evaluation and other relevant evidence:
(A) That the defendant is incompetent to stand trial because of mental illness; or
(B)
(i) That the defendant is competent to stand trial but that the failure to hospitalize would create a likelihood to cause the defendant serious harm by reason of mental illness; and
(ii) The defense attorney agrees with those findings, the district attorney general or the attorney for the defense may petition the criminal court before which the case is pending or that would hear the case, if the defendant were bound over to the grand jury to conduct proceedings for judicial hospitalization under chapter 6, part 5 of this title.
(2) Either party may demand a jury trial on the issues.
(3) The court is vested with jurisdiction to conduct the proceedings.
(4) In the proceedings the court shall determine, in addition to the findings required by chapter 6, part 5 of this title, whether the defendant is substantially likely to injure the defendant or others if the defendant is not treated in a forensic services unit and whether treatment is in the defendant's best interest.
(5) If the court enters an order of judicial hospitalization, the defendant shall be transferred to the custody of the commissioner, and if the court finds in addition that the defendant is substantially likely to injure the defendant or others if the defendant is not treated in a forensic services unit and that treatment in the unit is in the defendant's best interests, the defendant shall be transferred to the custody of the commissioner at a forensic services unit designated by the commissioner. If the court commits a person under this subsection (b), the person comes into the commissioner's custody only if the forensic services unit has available suitable accommodations; provided, that, if there are no suitable available accommodations at the time of the determination, then the commissioner shall expeditiously find a state-owned or operated hospital or treatment resource to accommodate the person upon the availability of suitable available accommodations. Prior to transporting a defendant for such commitment, the sheriff or other transportation agent shall determine that the receiving facility has available suitable accommodations.
(c) When a defendant admitted under subsection (b) has been hospitalized for six (6) months, and at six-month intervals thereafter, the chief officer of the hospital shall file a written report with the clerk of the court by whose order the defendant was confined and shall give a copy of the report to the defendant, the defendant's attorney, the defendant's legal guardian or conservator, if any, and to the district attorney general. The chief officer shall also send a copy of the report to the defendant’s parent, adult child, or spouse, whichever is appropriate, but at least one (1) of the three (3). The report shall detail the chief officer's best judgment as to the defendant's prospects for recovery, the defendant's present condition, the time required for relevant kinds of recovery, and whether there is substantial probability that the defendant will become competent to stand trial in the foreseeable future. This reporting obligation shall cease at the point that misdemeanor charges are retired for defendants with no other charges in accordance with subsection (d).
(d) If a defendant is found to be incompetent to stand trial, any misdemeanor charges pending at the time of the incompetency determination shall be retired no later than eleven (11) months and twenty-nine (29) days after the date of arrest when the misdemeanor charge or charges have not otherwise been disposed of except that no misdemeanor charges shall be retired pursuant to this subsection (d) if the defendant is restored to competency prior to the date on which the misdemeanor charge or charges would have otherwise been retired under this subsection (d).