I'm not the best person to give advice about the cord blood thing, but I know that if you look online, it says that drug has a certain half life and it's out of your system only 2-3 days after you take it. I imagine if any crosses over to baby, it would be out in the same time frame.
Do you have the bottle from the pain medicine? If you do, you shouldn't worry. It was prescribed to you. If not, as long as you stop taking it you should still be ok in a few days.
Your doctor prescribed you opiates knowing you were pregnant. I do not think that was right for him to do. You took them under his insturction, trusting that he knew what is best. I say that this is in no way your fault, but the prescribing doctor's. I pray for your baby's health. And I pray that this doctor is at the very least reprimanded severely for doing this. Keep us updated, please! Blessings - Blu