When any person has been transferred from the Connecticut Correctional Institution, Somers, the York Correctional Institution, or its maximum security division, the John R. Manson Youth Institution, Cheshire, or a community correctional center to a state hospital, such person’s hospital expense prior to the termination of his sentence shall be charged to the state. If any person, transferred from a correctional institution or community correction center is committed to or otherwise remains in a state hospital after the expiration of his sentence, such person’s hospital expense shall be paid to the state in the manner provided for payment in sections 17b-122, 17b-124 to 17b-132, inclusive, 17b-136 to 17b-138, inclusive, 17b-194 to 17b-197, inclusive, 17b-222 to 17b-250, inclusive, 17b-263, 17b-340 to 17b-350, inclusive, 17b-689b and 17b-743 to 17b-747, inclusive.