Stomach issues

Amanda
I am 37 weeks and had my Dr. Appointment & check up today. I am 2 1/2 cm dilated and 70% effaced..the past couple days my bowel movements have totally been off.. I am experiencing diarrhea all day today and a lot of gas which makes everything painful. I haven't had any issues with constipation or diarrhea throughout my whole pregnancy and wondering if this is something leading up to labor possibly or if I just have a bug? I am staying hydrated with water and sticking to the BRAT diet. Has anyone else experienced this before late in their 3rd trimester or is currently going through it?