Intercourse before hsg?

Reem
I have scheduled an hsg test on Monday, when I went to the fertility specialist they gave me a paper of what to do, with the medicine and it says no intercourse between day 1 of cycle and the hsg test.. When I made the appointment no one told me anything. 
For the ones that did had it done, did it matter if you had sex or not?