Matt Rabus stood at the laboratory hood at Holyoke Medical Center and got ready to run a COVID-19 test. He prepared a sample from a nasal swab and then squirted it into a specialized test cartridge that contains a liquid reagent made up of enzymes and other things that will help determine if the RNA of the virus is present.

The test takes about 36 minutes. That is, as long as Holyoke Medical Center and other hospitals around the country can get their hands on those cartridges with the reagents. As more COVID-19 tests are being offered to anyone who wants one at places like CVS and other locations, hospitals are having a hard time getting crucial ingredients to conduct the same tests. And in some cases that’s preventing hospitals from providing important care.

“We’re on a very strict limitation of how many tests we can get per week,” said Jon Gronbach, the lab director at Holyoke Medical Center.

Gronbach said when they don’t have enough tests in-house, they have to use an outside lab, and it can take two days — not 36 minutes — to get those results. And that's a problem, because before anyone can be admitted to the hospital, they need to get tested, including psychiatric patients waiting in the emergency room.

“No patient wants to hang out in the E.R. for a day or two to wait for one test result, let alone someone with an altered mental status,” he said.

And Gronbach said they have to test all patients before surgery.

“We've also had to cancel surgeries two weeks ago when we had zero test kits,” Gronbach said. “And these aren't fun surgeries… When I say elective surgery, it gives you the false impression that, like, they don't need it. But a total knee replacement — that's needed.”

Several other small hospitals in the state report having the same problem getting tests. And while large hospitals like Massachusetts General Hospital and Tufts Medical Center say they’re facing the same challenge, Gronbach said this kind of thing really hits community hospitals like his.

“We can't perform surgeries,” he said. “We can't perform procedures. We can't service our community (for the hospital) to have any kind of income. So this is drastically crippling us financially.”

And he doesn’t understand why the outside labs can get the test materials, when hospital labs like his can’t.

Two of the companies that make the tests — Cepheid and Luminex — didn’t make anyone available for this story.

Michael Mina of the Harvard School of Public Health said he knows why outside lab companies are having an easier time getting tests than hospitals.

“The reason is we have a privatized health system,” Mina said.

Mina said the companies are more interested in selling tests to what he calls mega-labs, which have the volume to run a lot of them.

“They are going to prioritize the bigger contracts that they view as priority over individual labs that might get less throughput, for example, on each test,” he said. “And so they'll be smaller contracts overall.”

There’s also a shortage of the materials needed to collect test samples, including swabs and the liquid the samples go into. But in Massachusetts, the state has a stockpile of those, and has been able to help hospitals out. The state doesn't have any reagents, though.

The shortages are an issue across the country. In a national survey by the American Association for Clinical Chemistry, half of the labs that responded said they were having trouble getting reagents or swabs.

“I think, in short, we're not being very efficient or coordinated in how we're distributing the materials that are needed,” said Dr. Carmen Wiley, president of the AACC, which represents clinical laboratories. Wiley said this problem calls for some government oversight.

“That is one thing that AACC has been asking our federal government to do, is to coordinate the distribution of materials and supplies to the states and to the local hospitals and clinics, because we do need somebody to be organizing this effort,” she said.

So far, the federal government has opted not to do that.

In a written statement, a spokesperson for the U.S. Department of Health and Human Services called out the company Cepheid by name saying, “we recommend labs think about their workflows and optimize other instruments, using Cepheid only for those instances when a rapid result is imperative.”

At Holyoke Medical Center and other Massachusetts hospitals, they’re doing just that — investing in testing systems from other companies. But they’re running into shortages there, too.