'Obey now, grieve later': court upholds prison official's dismissal for refusing hospital duty