At the UCSF Health — a San Francisco hospital system at the heart of one of the nation’s coronavirus outbreaks — officials said they would have to stop testing patients in about five days because they will run out of nasopharyngeal swabs, which are inserted into patients’ nasal passages to get samples for testing. Other hospitals elsewhere in the country were ending their practice of using a second swab to test for the flu in an effort to preserve their supply.

The main manufacturer of the swabs, Copan, is an Italian company whose manufacturing plant is in Northern Italy, a region that has itself been hard hit by the coronavirus outbreak. It says it has ramped up manufacturing to deal with the extraordinary demand for an otherwise unassuming product to which many doctors gave little thought, until now.

“We weren’t really thinking about, ‘Wow, what’s our swab supply?’ because we haven’t really faced anything that depleted our swabs before,” said Dr. Josh Adler, the chief clinical officer of U.C.S.F. Health. Making matters more difficult, the swabs must have just the right ingredients — the shafts cannot be wood, for example — or the virus might not be properly detected. “You can’t go to your local store and get Q-tips,” he said.