Tex. Code of Criminal Procedure § 21.31 — TX Code / Code cr / Chapter 21 / Section 21.31
§ 21.31. TESTING FOR AIDS AND CERTAIN OTHER DISEASES.
Status: in_force

(a) A person who is indicted for or who waives indictment for an offense under Section 21.02, 21.11(a)(1), 22.011, or 22.021, Penal Code, shall, at the direction of the court on the court's own motion or on the request of the victim of the alleged offense, undergo a standard diagnostic test approved by the United States Food and Drug Administration for human immunodeficiency virus (HIV) infection and other sexually transmitted diseases. If the person refuses to submit voluntarily to the test, the court shall require the person to submit to the test. On request of the victim of the alleged offense, the court shall order the defendant to undergo the test not later than 48 hours after an indictment for the offense is presented against the defendant or the defendant waives indictment. Except as provided by Subsection (b-1), the court may require a defendant previously required under this article to undergo a diagnostic test on indictment for an offense to undergo a subsequent test only after conviction of the offense. A person performing a test under this subsection shall make the test results available to the local health authority, and the local health authority shall be required to make the notification of the test results to the victim of the alleged offense and to the defendant.

(a-1) If the victim requests the testing of the defendant and a law enforcement agency is unable to locate the defendant during the 48-hour period allowed for that testing under Subsection (a), the running of the 48-hour period is tolled until the law enforcement agency locates the defendant and the defendant is present in the jurisdiction.

(b) The court shall order a person who is charged with an offense under Section 22.11, Penal Code, to undergo in the manner provided by Subsection (a) a diagnostic test designed to show or help show whether the person has HIV, hepatitis A, hepatitis B, tuberculosis, or any other disease designated as a reportable disease under Section 81.048, Health and Safety Code. The person charged with the offense shall pay the costs of testing under this subsection.

(b-1) If the results of a diagnostic test conducted under Subsection (a) or (b) are positive for HIV, the court shall order the defendant to undergo any necessary additional testing within a reasonable time after the test results are released.

(c) The state may not use the fact that a test was performed on a person under Subsection (a) or use the results of a test conducted under Subsection (a) in any criminal proceeding arising out of the alleged offense.

(d) Testing under this article shall be conducted in accordance with written infectious disease control protocols adopted by the Texas Board of Health that clearly establish procedural guidelines that provide criteria for testing and that respect the rights of the person accused and any victim of the alleged offense.

(e) This article does not permit a court to release a test result to anyone other than those authorized by law, and the provisions of Section 81.103(d), Health and Safety Code, may not be construed to allow that disclosure.