She died after being prescribed fentanyl and codeine for chronic pain, an inquest hears.