Yes. Although the law on taking a loo break is vague in many cases, you do have a right to take a break if you need to for medical reasons.