(1) When an individual has a prescription for an antipsychotic, antidepressant, antiepileptic, or other drug prescribed to the individual to treat a serious mental illness by a state hospital or other state facility or a behavioral health agency or other certified medical provider, and the individual is medically stable on the drug, a jail or juvenile detention facility shall continue prescribing the prescribed drug and may not require the substitution of a different drug in a given therapeutic class, except under the following circumstances:
(a) The substitution is for a generic version of a name brand drug and the generic version is chemically identical to the name brand drug; or
(b) The drug cannot be prescribed for reasons of drug recall or removal from the market, or medical evidence indicating no therapeutic effect of the drug.
(2) This section includes but is not limited to situations in which the individual returns to a jail or juvenile detention facility directly after undergoing treatment at a state hospital, behavioral health agency, outpatient competency restoration program, or prison.
(3) The department shall establish a program to reimburse jails and juvenile detention facilities for the costs of any drugs the jail or juvenile detention facility does not otherwise have available and must continue prescribing under this section.