genetic differences

It has long been known that different people react differently to opioid drugs, and by a wide margin. This means that the same dose may be too high for one person and too low for another. The difference can be due to genetic differences in metabolism. Can science be used to determine not only the dose but also the best opioid for an individual?