I assumed it had to do with taking some kind of image of the uterous based on the "hystero" and "graphy" parts. According to wikipedia it's basically just a way of getting a good look at the uterus and fallopian tubes by introducing something into the uterous that allows them to take a high quality x-ray.
The entry also mentioned:
"The HSG can be painful and it's a good idea to take pain-killers both before and after the procedure to reduce the pain. Many doctors will also prescribe an antibiotic prior to the procedure to reduce the risk of an infection"