I always end up in the same situation you're in whenever I get scripted opiates for an injury. For future reference, there is a cheap OTC laxative that you can buy at your local drug store call Magnesium Citrate that will clear you out in 20 minutes guaranteed. I don't care how doped up you are, this shit will open the flood gates. It's like $2 a bottle and you have to drink the entire thing.
Otherwise, it is important to maintain adequate hydration when on pain killers (opiates) so this doesn't happen. It's a pretty common side effect of opiates.