Pharmacists will be obliged to give patients the cheapest available medicines under new legislation aimed at saving millions on the State's drug bill.

Irish Medicines Board Chief Executive Dr Pat O'Mahony said that patients will be able to avail of cheaper generic drugs, even if their doctors prescribe branded products.

Speaking on RTÉ's Morning Ireland, Dr O'Mahony said the first list of drugs that may be substituted will be supplied to pharmacists within the next two months.

The HSE will determine the reference prices for the generic products.

At present pharmacists are legally obliged to dispense the exact medicine prescribed by doctors.

But under the new legislation, they will be obliged to offer patients the cheapest version of a drug, even if a doctor has prescribed a well-known branded medicine.

However, patients will still have the option of buying the more expensive branded alternative and paying the difference.

Epilepsy Ireland Chief Executive Mike Glynn has expressed his reservations with plans to allow pharmacists dispense substituted generic drugs rather than branded ones.

Speaking on RTÉ's News at One, Mr Glynn said the switch from branded to generic drugs could have "devastating consequences" for people with epilepsy.

"The switch from branded to generic drugs has the potential to cause breakthrough seizures which can have devastating consequences ... such as putting people with epilepsy off the road and even sudden deaths", he said.

He said his organisation would be encouraging doctors to write "Do not substitute" on the prescriptions of epilepsy sufferers once the legislation comes into operation this summer.

Dr. Pat O'Mahony, said following consultation with Epilepsy Ireland, many anti-epilepsy drugs will not be put on the list of substitute drugs.

“We will judge all of these medicines on a case by case basis,” he said.