I am pretty sure they can't treat you like that. Per law...
FMLA and Employment Laws
The Family and Medical Leave Act protects employees who qualify from losing their job because of absences from work -- for example, for drug infusions or surgery.
“I’ve filled out many forms for people with UC since the Family Medical Leave Act went into law,” says Johnson. “They let their supervisor know that from time to time, the person may need to miss a few days or even a week to get their disease under control.”
The Americans with Disabilities Act (ADA) -- and particularly the ADA Amendments that went into effect in 2009 -- can help people with UC to get “reasonable accommodations” from their employers to do some aspects of their job. An accommodation for someone with UC could be:
Extra breaks
A modified work schedule
Easier access to a bathroom
These laws require that your employer know about your ulcerative colitis. But some employers will be empathetic and helpful regardless of the law. They may be open to flexible hours, working from home, or other accommodations that help you get the job done.