289.6. (a) (1) An employee or officer of a public entity health facility, or an employee, officer, or agent of a private person or entity that provides a health facility or staff for a health facility under contract with a public entity, who engages in sexual activity with a consenting adult who is confined in a health facility is guilty of a public offense. As used in this paragraph, “health facility” means a health facility as defined in subdivisions (b), (e), (g), (h), and (j) of, and subparagraph (C) of paragraph (2) of subdivision (i) of, Section 1250 of the Health and Safety Code, in which the victim has been confined involuntarily.

(2) An employee or officer of a public entity detention facility, or an employee, officer, agent of a private person or entity that provides a detention facility or staff for a detention facility, a person or agent of a public or private entity under contract with a detention facility, a volunteer of a private or public entity detention facility, or a peace officer who engages in sexual activity with a consenting adult who is confined in a detention facility is guilty of a public offense.

(3) An employee with a department, board, or authority under the California Department of Corrections and Rehabilitation or a facility under contract with a department, board, or authority under the California Department of Corrections and Rehabilitation, who, during the course of his or her employment directly provides treatment, care, control, or supervision of inmates, wards, or parolees, and who engages in sexual activity with a consenting adult who is an inmate, ward, or parolee, is guilty of a public offense.

(b) As used in this section, the term “public entity” means the state, federal government, a city, a county, a city and county, a joint county jail district, or any entity created as a result of a joint powers agreement between two or more public entities.

(c) As used in this section, the term “detention facility” means:

(1) A prison, jail, camp, or other correctional facility used for the confinement of adults or both adults and minors.

(2) A building or facility used for the confinement of adults or adults and minors pursuant to a contract with a public entity.

(3) A room that is used for holding persons for interviews, interrogations, or investigations and that is separate from a jail or located in the administrative area of a law enforcement facility.

(4) A vehicle used to transport confined persons during their period of confinement, including transporting a person after he or she has been arrested but has not been booked.

(5) A court holding facility located within or adjacent to a court building that is used for the confinement of persons for the purpose of court appearances.

(d) As used in this section, “sexual activity” means:

(1) Sexual intercourse.

(2) Sodomy, as defined in subdivision (a) of Section 286.

(3) Oral copulation, as defined in subdivision (a) of Section 288a.

(4) Sexual penetration, as defined in subdivision (k) of Section 289.

(5) The rubbing or touching of the breasts or sexual organs of another, or of oneself in the presence of and with knowledge of another, with the intent of arousing, appealing to, or gratifying the lust, passions, or sexual desires of oneself or another.

(e) Consent by a confined person or parolee to sexual activity proscribed by this section is not a defense to a criminal prosecution for violation of this section.

(f) This section does not apply to sexual activity between consenting adults that occurs during an overnight conjugal visit that takes place pursuant to a court order or with the written approval of an authorized representative of the public entity that operates or contracts for the operation of the detention facility where the conjugal visit takes place, to physical contact or penetration made pursuant to a lawful search, or bona fide medical examinations or treatments, including clinical treatments.

(g) Any violation of paragraph (1) of subdivision (a), or a violation of paragraph (2) or (3) of subdivision (a) as described in paragraph (5) of subdivision (d), is a misdemeanor.

(h) Any violation of paragraph (2) or (3) of subdivision (a), as described in paragraph (1), (2), (3), or (4) of subdivision (d), shall be punished by imprisonment in a county jail not exceeding one year, or in the state prison, or by a fine of not more than ten thousand dollars ($10,000) or by both that fine and imprisonment.

(i) Any person previously convicted of a violation of this section shall, upon a subsequent violation, be guilty of a felony.

(j) Anyone who is convicted of a felony violation of this section who is employed by a department, board, or authority within the Youth and Adult Correctional Agency shall be terminated in accordance with the State Civil Service Act (Part 2 (commencing with Section 18500) of Division 5 of Title 2 of the Government Code). Anyone who has been convicted of a felony violation of this section shall not be eligible to be hired or reinstated by a department, board, or authority within the Youth and Adult Correctional Agency.