A Belfast man who attacked two paramedics after they rushed him to hospital has been jailed for five months.