advice please!!

Kirsty • I'm a young mother of 2 boys with my third son due oct 8, 2017. I am a stay at home mom for right now!!
I'm currently 11 weeks and 4 days .. I was diagnosed with uti not sure where but there was blood in my urine at 8 weeks. Doctor prescribed Macrobid and I took it as I was supposed to. Day 6 I called with complaints of migraines due from the medication. She advised me to discontinue the medication as it should be enough in my system. 6 days ago I was still in pain so again I went back and was prescribed Bactrim 2x a day. Of course I take it constantly sick but I Grin and bear it. I go for my follow up today and it's still there. This is 2 round of antibiotics and the blood is still there and it's not looking as if it's getting better. I eat healthy and I drink plenty of water. I have 1 caffeinated drink a day, which I now will not.. I need advice because I don't see how it can be good for my baby or myself to constantly be on a medication and def not good to risk preterm labor... ANY TIPS??