A new oral swab test reveals the best choices, and possible side effects, for antidepressant medications.

An oral swab test that gives doctors an easy-to-read report to help guide decisions about prescribing depression medications is now available to 50 million Americans on Medicare.

The test is GeneSight Psychotropic and is made by Assurex Health of Mason, Ohio. The Centers for Medicare and Medicaid Services (CMS), the nation’s largest healthcare payer, last month agreed to begin paying for the test for seniors who have tried at least one depression medication without success.

Bryan Dechairo, senior vice president of medical affairs and clinical development for Assurex, told Healthline that the company’s goal is to test 1 million patients by 2018.

“It took over a year working through a rigorous review process with Medicare,” he said, noting that GeneSight is the first test of its kind to win Medicare approval, at least in the psychiatric space. Medicare commonly pays for genetic tests to determine treatments for cancer.

About 120,000 tests have been administered in the four years since the company launched the product, Dechairo said. “That number has been doubling year over year even before the Medicare approval,” he said.

So far, 8,500 doctors in the United States are registered to offer the test, which measures how different genes influence the way a person may react to 38 FDA-approved psychotropic medications on the market today.

Within 36 hours, GeneSight gives doctors a color-coded report that puts each of the medications into one of three categories. Green means “use as directed,” yellow advises doctors to “exercise caution,” and red warns doctors to use “increased caution and frequent monitoring.”

Next to each drug listed in the yellow and red categories are footnotes offering additional information about why the drug might not be the best choice for a particular patient.

Read More: Gene Testing for Cancer Patients Reveals the Best Course of Treatment »

A normal dose of an antidepressant for most people can be too much for people with genes that cause the compound to be metabolized more slowly. One the other hand, a drug may not work well for someone with genes that cause the body to metabolize the compound very quickly. A person’s genetic makeup also can determine whether a drug is likely to cause side effects.

The GeneSight test took about two decades to develop, Dechairo said. The technology originated at the Mayo Clinic in Rochester, Minnesota, and Cincinnati Children’s Hospital. Cincinnati Children’s licensed the technology from Mayo in 2000.

“Mayo has very top-tiered clinicians, and their report was around 30 pages long. The experts could understand it, but nobody else knew what to do with that,” Dechairo said.

Clearly, the confusion is beginning to wane. Clinical trials published in peer-reviewed journals have shown that GeneSight works. Research published in 2013 in Pharmacogenetics and Genomics showed in an open-label trial of 227 patients that those tested with GeneSight before being treated had significantly better outcomes, in line with previous study results.

Read More: Genetic Testing Leads to Increased Survival Rates for Lung Cancer Patients »

Dr. Allan Anderson is vice president for dementia care practice and a clinical medical director at Episcopal Ministries to the Aging. He told Healthline he has had great success using GeneSight and is glad to see it become more widely available.

Older people seeking depression treatment usually aren’t lucky enough to have a doctor prescribe the right medication the first time, Anderson said. The problem is compounded by the fact that it takes longer for seniors to respond to such medications.

“In the primary care world, they often change horses mid-stream in the process. The elderly can take 12 weeks to respond to a medication, so it makes it even more important to get the right selection from the get-go,” he said.

For years, doctors have relied on past experience when prescribing psychiatric medications to older adults, Anderson said, and they have seen less than optimal responses. Besides making decisions based on what worked or didn’t work with other patients, they would look at a patient’s family history.

“If you fumble your way through a trial and error method, with no good scientific data on what the next treatment should be, [the patient] begins to lose confidence and wonders why they’re being experimented on,” Anderson said.

He explained the case of one patient he referred to a psychiatric facility. The doctor there wanted to put the patient on Celexa. He said the patient had undergone a GeneSight test, however, which indicated her body would metabolize it poorly.

The U.S. Food and Drug Administration issued updated treatment guidelines on Celexa in 2012 after research showed it could cause heart problems in people at high doses. “She said she felt comfortable prescribing it,” Anderson said. “I said do you feel comfortable with having a dead patient?”

The doctor ended up not prescribing the medication, he said. He emphasized that many doctors still are not aware of the GeneSight test.

GeneSight also has developed genetic tests for choosing ADHD medications and pain relievers in adults. Clinical trials are ongoing for those products.

Read More: Could Iron Levels in the Brain be a Biomarker for ADHD? »