A drug taker who subjected police to a foul-mouthed tirade in a Belfast hospital has been jailed for eight months.