Va. Code Ann. § 19.2-169.6
A. Any inmate of a local correctional facility may be hospitalized for psychiatric treatment at a hospital designated by the Commissioner of Behavioral Health and Developmental Services as appropriate for treatment of persons under criminal charge if:
2. Upon petition by the person having custody over an inmate, a magistrate finds probable cause to believe that (i) the inmate has a mental illness; (ii) there exists a substantial likelihood that, as a result of a mental illness, the inmate will, in the near future, (a) cause serious physical harm to himself or others as evidenced by recent behavior causing, attempting, or threatening harm and any other relevant information or (b) suffer serious harm due to his lack of capacity to protect himself from harm as evidenced by recent behavior and any other relevant information; and (iii) the inmate requires treatment in a hospital rather than a local correctional facility, and the magistrate issues a temporary detention order for the inmate. Prior to the filing of the petition, the person having custody shall arrange for an evaluation of the inmate conducted in-person or by means of a two-way electronic video and audio communication system as authorized in § 37.2-804.1 by an employee or designee of the local community services board or behavioral health authority who is skilled in the assessment and treatment of mental illness and who has completed a certification program approved by the Department as provided in § 37.2-809. After considering the evaluation of the employee or designee of the local community services board or behavioral health authority, and any other information presented, and finding that probable cause exists to meet the criteria, the magistrate may issue a temporary detention order in accordance with the applicable procedures specified in §§ 37.2-809 through 37.2-813. A temporary detention order issued pursuant to this subdivision may be executed by a deputy sheriff or jail officer, as those terms are defined in § 53.1-1, employed at the local correctional facility where the inmate is incarcerated. The person having custody over the inmate shall notify the court having jurisdiction over the inmate's case, if it is still pending, and the inmate's attorney prior to the detention pursuant to a temporary detention order or as soon thereafter as is reasonable.
Upon detention pursuant to this subdivision, a hearing shall be held either before the court having jurisdiction over the inmate's case or before a district court judge or a special justice, as defined in § 37.2-100, in accordance with the provisions of §§ 37.2-815 through 37.2-821, in which case the inmate shall be represented by counsel as specified in § 37.2-814. The hearing shall be held within 72 hours of execution of the temporary detention order issued pursuant to this subdivision. If the 72-hour period terminates on a Saturday, Sunday, legal holiday, or day on which the court is lawfully closed, the inmate may be detained until the close of business on the next day that is not a Saturday, Sunday, legal holiday, or day on which the court is lawfully closed. Any employee or designee of the local community services board or behavioral health authority, as defined in § 37.2-809, representing the board or authority that prepared the preadmission screening report shall attend the hearing in person or, if physical attendance is not practicable, shall participate in the hearing through a two-way electronic video and audio communication system as authorized in § 37.2-804.1. When the hearing is held outside the service area of the community services board or behavioral health authority that prepared the preadmission screening report, and it is not practicable for a representative of the board or authority to attend or participate in the hearing, arrangements shall be made by the board or authority for an employee or designee of the board or authority serving the area in which the hearing is held to attend or participate on behalf of the board or authority that prepared the preadmission screening report. The judge or special justice conducting the hearing may order the inmate hospitalized if, after considering the examination conducted in accordance with § 37.2-815, the preadmission screening report prepared in accordance with § 37.2-816, and any other available information as specified in subsection C of § 37.2-817, he finds by clear and convincing evidence that (1) the inmate has a mental illness; (2) there exists a substantial likelihood that, as a result of a mental illness, the inmate will, in the near future, (a) cause serious physical harm to himself or others as evidenced by recent behavior causing, attempting, or threatening harm and any other relevant information or (b) suffer serious harm due to his lack of capacity to protect himself from harm as evidenced by recent behavior and any other relevant information; and (3) the inmate requires treatment in a hospital rather than a local correctional facility. The examiner appointed pursuant to § 37.2-815, if not physically present at the hearing, shall be available whenever possible for questioning during the hearing through a two-way electronic video and audio or telephonic communication system as authorized in § 37.2-804.1. The examination and the preadmission screening report shall be admitted into evidence at the hearing.
G. Any health care provider, as defined in § 32.1-127.1:03, or other provider rendering services to an inmate who is the subject of a proceeding under this section, upon request, shall disclose to a magistrate, the court, the inmate's attorney, the inmate's guardian ad litem, the examiner appointed pursuant to § 37.2-815, the community service board or behavioral health authority preparing the preadmission screening pursuant to § 37.2-816, or the sheriff or administrator of the local correctional facility any and all information that is necessary and appropriate to enable each of them to perform his duties under this section. These health care providers and other service providers shall disclose to one another health records and information where necessary to provide care and treatment to the inmate and to monitor that care and treatment. Health records disclosed to a sheriff or administrator of the local correctional facility shall be limited to information necessary to protect the sheriff or administrator of the local correctional facility and his employees, the inmate, or the public from physical injury or to address the health care needs of the inmate. Information disclosed to a law-enforcement officer shall not be used for any other purpose, disclosed to others, or retained.
Any health care provider disclosing records pursuant to this section shall be immune from civil liability for any harm resulting from the disclosure, including any liability under the federal Health Insurance Portability and Accountability Act (42 U.S.C. § 1320d et seq.), as amended, unless the person or provider disclosing such records intended the harm or acted in bad faith.
1982, c. 653; 1986, c. 629; 1987, c. 96; 1990, c. 76; 1995, c. 844; 2005, c. 716; 2008, cc. 779, 782, 850, 870; 2010, cc. 340, 406; 2012, c. 801; 2014, cc. 499, 538, 691; 2016, cc. 357, 599; 2017, cc. 463, 468, 605; 2018, c. 144; 2022, c. 763.