Legislators pass bill to limit opioid prescriptions