It's perfectly normal for bowel movements to be on a schedule. If a student it leaving your class multiple time per week then have a discussion to see what's going on, you might learn something about their life that paints them in a new light. Or, maybe discuss the possibility of going before class starts if possible.
I think people are downvoting your original comment because referring a student directly to the nurse is a strange thing to threaten upfront.