Have you ever taken antibiotics why pregnant like Keflex for urine infection?

In the ER department they prescribed it tome 4 times a day for 7 days and I'm nervous about taki g it because I'm pregnant.

Should I stop taking it??