British scientists are testing a prototype of the device, which could be on the market in two years.
The SNP (pronounced snip) Doctor can analyse DNA to tell if a patient has the right genetic fit for a particular drug from a drop of saliva or cheek swab.
It looks for known single nucleotide polymorphisms (SNPs) - single letter changes in the genetic code - that can affect a person's response to medical treatment.
Each year the NHS spends around£460 million dealing with the 250,000 patients who are admitted to hospital suffering adverse reactions to prescribed drugs, from dizziness and nausea to heart palpitations or loss of consciousness.
Being able to predict these responses to drugs such as antidepressants or cholesterol-lowering statins would allow doctors to tailor treatment to individual patients.
Professor Chris Toumazou, who heads the Imperial College team, said: 'It could provide another layer in the treatment process that could help GPs to personalise treatments according to the genetic requirements of each patient.'
Related article: DNA could predict and prevent heart attack