When a prisoner eligible for discharge from the penitentiary or during his term of incarceration is alleged by the Commissioner of Public Safety to be mentally ill, and it shall be adjudged in accordance with the provisions of this chapter by the district court that such prisoner is mentally ill, he shall be conveyed to the mental hospital by the Commissioner of Public Safety or under his direction. All expenses incurred in the adjudication and in keeping and conveying the patient to the mental hospital, including clothing as may be necessary for his comfort, shall be paid by the government of the Virgin Islands upon the certificate of the Commissioner of Public Safety.