Gillen Washington, a student at Northern Arizona University, had been getting medication for an immunodeficiency disease since 2011.

But when he went to his clinic in November 2014 for the monthly dose, a nurse told him his insurance company had denied it.

Soon after, the plan sent him a letter saying his bloodwork was outdated and didn't show that the treatment was medically necessary, Washington's attorney said.

Over the next few months, as Washington appealed the insurance company's decision, he developed a cough that wouldn't go away. He moved home to Huntington Beach, Calif., and ended up in the hospital with pneumonia and a collapsed lung.

"It was terrifying," said Washington, 22. "I have never felt so depressed and so scared in my entire life."

In 2015, Washington filed a breach of contract lawsuit in Orange County Superior Court against his insurer, Aetna, arguing that the company had improperly denied him the medication. The case is set for trial this month.

Gillen Washington, here as an Eagle Scout in high school, had been getting medication for an immunodeficiency disease since 2011.

From 35,000 to 50,000 people in the U.S. are estimated to be dependent on medications to treat primary immunodeficiency diseases -- about 300 rare conditions in which the immune system doesn't function properly, or at all. The medication, known as immunoglobulin replacement therapy, replaces antibodies that the body doesn't make. It can cost tens of thousands of dollars each year.

In recent years, patients with these diseases have faced increasing difficulty getting their insurers to approve treatments, according to clinicians and patient advocates. In some cases, insurers interrupt treatments that are already underway. In others, they deny it at the outset. Without medication, patients can get infections or even suffer organ failure.

Aetna, one of the nation's largest insurers, with a 2016 net income of $2.3 billion, declined to answer questions about Washington's case, citing the pending litigation. In court documents, attorneys representing the company argued that it didn't breach its contract with Washington.

Dr. Rebecca Buckley, a professor of immunology and pediatrics at Duke University Medical Center, said insurance companies often require patients with immunodeficiency diseases to stop taking their medication and undergo new lab work to demonstrate they still need it. That interruption is a "serious problem" for people with a definitive diagnosis, she said, because the consequences can be so devastating.

"If you stop the treatment, they are going to get sick," Buckley said. "There are no spontaneous recoveries from any of these genetic defects."

Buckley acknowledged that some people are put on the medication unnecessarily. But those who definitely have the diseases can't make antibodies on their own and have no protection without treatment.

The Immune Deficiency Foundation , a national patient advocacy organization, regularly advises patients who receive insurance denials. President and founder Marcia Boyle said the foundation is getting a growing number of calls each year from patients who face treatment delays because of insurance company decisions. Insurers are also more frequently shifting costs to patients by requiring higher copays and coinsurance or using restrictive formularies, she said.

"Some insurers are creating unnecessary roadblocks because of the costly therapy," she said. "More often than not, when you have someone with a lifelong, preexisting condition that needs very good medical care and expensive therapy, you are going to have issues with access to care and insurance."

Washington's treatment for the condition known as Common Variable Immune Deficiency costs $20,000 each month, his attorney said.

In a 2014 case , the Immune Deficiency Foundation said it intervened after a Blue Cross-Blue Shield insurer with members in Illinois, Montana, New Mexico, Oklahoma and Texas required patients to stop treatment and re-establish their need for it. The foundation was able to work with the insurer to change the policy so patients would not face delays in care, Boyle said.

Foundation staffers said that not all cases end on such a happy note.

"It's a never-ending game of whack-a-mole" for patients, said John Boyle, Marcia's adult son, who is vice president of external relations for the foundation and suffers from a primary immune disease called X-linked agammaglobulinemia. Denying care can lead to more costly treatment later, he said.

Without medication, he said, "we become, frankly, a drain on the system."

The American Academy of Allergy, Asthma & Immunology has issued recommendations (PDF) on primary immunodeficiency diseases, including that treatment shouldn't be interrupted after a definitive diagnosis. It also says having recent bloodwork shouldn't be a requirement for treatment.

The foundation is developing guidelines for insurers on the basis of those standards so health plans make decisions based on science and not just cost, Marcia Boyle said.

Washington's lawyer, Scott Glovsky, said the Aetna physician who declined to authorize the continuation of his client's medication knew "virtually nothing" about the disease. During a deposition late last year, the doctor couldn't answer basic questions about Washington's illness, Glovsky said. The physician also admitted in a deposition that he had not reviewed the medical records himself before making his decision.

Aetna's trial brief noted that while the doctor is not an expert on the rare disease afflicting Washington, he is a "trained physician with years of experience" and he agreed with a nurse's findings that the company needed more up-to-date blood tests to continue covering Washington's medication. The doctor was following Aetna's policies and his own clinical judgment, the documents said.

It is not uncommon for doctors employed by health plans to make coverage decisions without conducting their own comprehensive reviews, said Shana Alex Charles, assistant professor at Cal State University-Fullerton. And the process of review -- especially at for-profit insurance companies -- is "designed to reduce costs, not necessarily to improve quality of care," she said.

Aetna's attorneys argued that the company wasn't to blame for Washington missing his treatments. The patient had a "long history of failing to properly monitor his own health and seek appropriate medical care," they said.

Glovsky countered that his client was getting his treatment regularly before the denial.

Washington, who had frequent bronchitis and sinus infections growing up, was in high school when diagnosed.

When he was in college, Washington received his medication every month at Flagstaff (Ariz.) Medical Center. That changed in November 2014, when Aetna told the medical center that Washington's blood tests were outdated.

Join the conversation See the latest news and share your comments with CNN Health on Facebook and Twitter.

Aetna said in court papers that it was standard for people with the disease to get regular blood tests and that Washington had failed to do so. But Glovsky said that his client clearly needed the medication and that Aetna's action was in violation of its contract with Washington.

After Washington's hospitalization in April 2015, Aetna approved the medication for the following year. Washington, who returned to college that fall, said he's thankful to be back on his medication, which he calls a "lifeline." But his lungs still hurt in the mornings, and fighting his insurance company was extremely frustrating, he said.

"I was so confused and so upset that an Aetna doctor who had never seen me denied me this care," Washington said.