An HSG is a test that can demonstrate whether the fallopian tubes are open (patent) or blocked (occluded). It involves the injection of x-ray contrast into the cervix with a catheter under x-ray fluoroscopy. The procedure is often associated with some cramping and discomfort, and many practitioners recommend taking ibuprofen or another pain medication prior to the procedure. Most patients do tolerate the procedure well, however. If the test shows that the tubes are blocked or abnormal, then further testing may be necessary. Treatment of tubal blockage at the beginning of the tubes (proximal tubal occlusion) may be done radiologically (recanalization) by inserting small wires or catheters into the tubes directly transcervically, or sometimes may be done surgically (hysteroscopic tubal cannulation). Treatment of distal tubal occlusion (at the ends of the tubes) may require a laparoscopy or IVF.