Cough?

I have had a consistent cough for about two-three weeks. I’ve noticed that I only get sick whenever I start to cough and then I throw up. Has anyone ever had this happen during pregnancy? Should I go to the doctor?