You need to speak to the class teacher - DD has x medical issue and needs y actions to accommodate it.
As obvious as it may seem, teachers are not medical professionals, and may not realise that having repeated antibiotics (if the teacher is even aware that is what she is taking as it is unlikely they are actually administering the medication) means that your DD needs to go to the toilet more often, unless you tell them.
If DD is uncomfortable using the toilets for some reason a solution needs to be found, e.g. if she dislikes using the toilet whilst other children are there, she needs to either be encouraged to go just before break times or be allowed to use the accessible toilet.
In addition, she should be allowed to go out of class, with a discreet system in place so the teacher knows where she is (either leave a card on the teacher's desk or have a silent signal). DD needs to know that this is what she should do and that if the teacher speaks to the other children about using going to the toilet as an excuse it does not apply to her.
Maybe suggest DD has the routine of always having a drink when she goes to the toilet so there is only one "disruption". You may find she is able to drink more fluid from a cup or a bottle that doesn't have a sports cap on it. You need to make sure the bottle/ cup is taken home and washed out properly so the water doesn’t get tainted and off-putting to her, but provide a spare to keep in school so she is never without.
If you don't get anywhere with the class teacher, ask at the Office to speak to the named person responsible for children with medical needs. Every school must have one. It may be the headteacher, or the Senco, or somebody else e.g. an admin assistant or TA, but if you are in England the role must exist.
If you Google Managing Medical Needs in Schools, you will find the DfE guidance which sets out what the school (and the parent) should be doing to support your DD in managing her medical condition.
The information should get passed onto her next class teacher in September, but it's worth checking that it has and that teacher knows the situation is still on-going, if that is the case.