Plans to allow patients' prescriptions to be changed in the event of shortages under a no deal Brexit are set to be challenged in court.

Health campaigners claim newly introduced Serious Shortage Protocols (SSPs), which give pharmacists the power to change prescriptions, could cause serious problems for patients with serious long-term conditions - even proving fatal for some.

The new powers were introduced by the UK Government earlier this month but ministers have been accused of rushing them through without proper consultation.

Legal group The Good Law Project now plans to challenge the move in court on behalf of patients and will issue judicial review proceedings next week unless the government cancels the powers.

Jolyon Maugham QC, director of the Good Law Project, said: "Both doctors and patients have proper concerns about their safety in the event of medicine shortages. We want the Government to withdraw the prospect of SSPs until it has complied with its legal duties and consulted properly on their use. 

"If the Government does not take this step, the Good Law Project will launch judicial review proceedings in the High Court."

The protocols, which will only be used in exceptional circumstances, allow ministers to permit pharmacists to provide an alternative to the item prescribed.

However, the new powers have caused a split in the medical world.

The Royal Pharmaceutical Society (RPS) in Scotland describe them as a "sensible step as part of Brexit contingency planning", while the Academy of Medical Royal Colleges say it is "inexplicable and unacceptable" that they have not been the subject of wide consultation.

A range of health charities and patient groups, including those dealing with sufferers of diabetes, epilepsy and HIV have also raised concerns.

After facing pressure from epilepsy groups, the government accepted that replacement drugs were unsuitable for epilepsy patients, but pharmacists could still be allowed to reduce the strength or dosage of the medication.

Charities say this will still leave patients at risk.

Jane Hanna OBE, Chief Executive of SUDEP Action, who is supporting the judicial review, said: "Patients, doctors and pharmacists are used to prescriptions & the processes surrounding them. 

"For people with long-term conditions, like epilepsy, what is on the prescription may represent months and years of trying out the best medication schedule. Changes made to this delicate balance can for some, undo this in an instant. 

"For epilepsy this could lead to less seizure control, impacting on quality of life and significantly for some this can prove fatal."

She added: "We are leading a coalition of epilepsy charities who are extremely concerned that this new law has been rushed in with such speed and no one knows how patient safety will be properly protected. 

"Lives cannot be risked because of short deadlines."

The National AIDS Trust is also concerned about the way and speed with which the new powers were introduced.

Deborah Gold, chief executive of the trust, said: "We are deeply concerned that these changes were made without proper consultation. Prescribing HIV medication is a complex process which must take account of a multitude of factors. 

"The only person qualified to safely alter the medication prescribed to a person living with HIV is that person’s HIV consultant."

The UK Health Secretary Matt Hancock has said that SSPs would "allow our highly-trained pharmacists to provide an appropriate alternative should there be a shortage of certain types of medicines".