Imodium?

I am currently 21 weeks pregnant and wondering is it safe to take Imodium for diarrhoea?