Can you take morphine while pregnant?

Has anyone been given morphine during their pregnancy? If so were you and your baby okay?