Help me

I had sex before my spotting but idk if it’s an early period , implantation , ovulation spotting so I scheduled an HSG.. if I’m pregnant will the HSG harm the baby or any sperm to fertilize the baby