A violent offender who spat in the eyes of a doctor treating him at a Belfast hospital has been jailed for five months.