(a) When a person is initially arrested for violating § 39-13-502, § 39-13-503, § 39-13-506, § 39-13-522, § 39-13-531 or § 39-13-532 that person shall undergo human immunodeficiency virus (HIV) testing immediately, or not later than forty-eight (48) hours after the presentment of the information or indictment, with or without the request of the victim. A licensed medical laboratory shall perform the test at the expense of the person arrested. The person arrested shall obtain a confirmatory test when necessary and shall be referred to appropriate counseling.
(b)
(1) The licensed medical laboratory shall report the results of the HIV test required under this section immediately to the victim.
(2) The result of any HIV test required under this section is not a public record and shall be available only to:
(A) The victim;
(B) The parent or guardian of a minor or incapacitated victim;
(C) The attending physician of the person tested and of the victim;
(D) The department of health;
(E) The department of correction;
(F) The person tested; and
(G) The district attorney general prosecuting the case.
(c) If the arrestee is convicted, the court shall review the HIV test results prior to sentencing.
(d)
(1) For purposes of this section, “HIV” means the human immunodeficiency virus or any other identified causative agent of acquired immunodeficiency syndrome.
(2) For purposes of this section, “HIV test” means a test of an individual for the presence of human immunodeficiency virus, or for antibodies or antigens that result from HIV infection, or for any other substance specifically indicating infection with HIV. The department of health shall promulgate rules designating the proper test method to be used for this purpose.
(3) Nothing in this section shall be construed to require the actual transmission of HIV in order for the court to consider it as a mandatory enhancement factor.
(e) Upon the conviction of the defendant for a violation of § 39-13-513, § 39-13-514 or § 39-13-515, the court shall order the convicted person to submit to an HIV test. The test shall be performed by a licensed medical laboratory at the expense of the defendant. The defendant shall obtain a confirmatory test when necessary. The defendant shall be referred to appropriate counseling. The defendant shall return a certified copy of the results of all tests to the court. The court shall examine results in camera and seal the record. For the sole purpose of determining whether there is probable cause to prosecute a person for aggravated prostitution under § 39-13-516, the district attorney general may view the record, notwithstanding subdivision (b)(2). The district attorney general shall be required to file a written, signed request with the court stating the reason the court should grant permission for the district attorney general to view the record. If the test results indicate the defendant is infected with HIV, then the district attorney general may use the results of the test in a prosecution for aggravated prostitution.