going to the hospital pregnant

I'm going to the hospital for a possible infection
I'm having green discharge and cramps
Will they know if it's an infection the same day? Or will they need to send off swabs 
Thank you