Assuming the pain meds are opioids, there is a prescription medication designed to allow the pain relief while blocking the constipating effects of opioids.
Relistor (methylnaltrexone)
http://www.drugs.com/relistor.html
It also might negate the potential problems of opioid pain relievers interfering with chemotherapies:
http://her2support.org/vbulletin/showthread.php?t=42074