Whenever a convict in a state prison becomes mentally ill, the warden shall proceed in accordance with section thirty-one, article five, chapter twenty-eight of this code.
Whenever a convict in a state prison needs medical attention, other than mental care, not available at said prison, the warden or superintendent of said prison shall immediately notify the commissioner of public institutions, who, after proper investigation, shall cause the transfer of said convict to a hospital within the state of West Virginia properly equipped to render the medical attention necessary. Such a convict, while receiving treatment in said hospital, shall be under guard at all times and shall forthwith be returned to prison upon his recovery.