Any person who is confined or imprisoned in any state, county, or city prison of this State may be examined and treated for a sexually transmitted disease by the health authorities or their deputies. The state, county, and municipal boards of health may take over a portion of any state, county, or city prison for use as a board of health hospital. Persons who are confined or imprisoned and who are suffering with a sexually transmitted disease at the time of expiration of their terms of imprisonment must be isolated and treated at public expense as provided in § 44-29-90 until, in the judgment of the local health officer, the prisoner may be medically discharged. In lieu of isolation, the person, in the discretion of the board of health, may be required to report for treatment to a licensed physician or submit for treatment provided at public expense by the Department of Health and Environmental Control as provided in § 44-29-90.