Patients look at him, stricken and indignant, when asked to sign a pain contract. “Do you think I’m an addict?” they say. Or, “I don’t need a contract for my heart medicine, so why this?”

Why? When a random drug test of one longtime patient showed no trace of prescribed opioids, Dr. Wergin had to “fire” him for breaking the contract. Instead of taking the pills, the patient had been selling them.

Dr. Wergin has learned to be even more wary during his emergency room shifts at the hospital 15 miles away. There, he has seen firsthand a growing number of overdoses and opioid-related deaths.

The scenario has become so familiar that now when a nurse reports that the patient in Room 3 is complaining of excruciating back pain and asking specifically for Percocet, Dr. Wergin will reply, “And is he about 31, single or divorced, and insisting he is allergic to nonsteroidals?”

These are “seekers ’n’ sellers,” he explained, who peel off I-80 and head for the hospital “thinking we’re just ignorant hayseeds.” A few months ago, state troopers pulled guns on one such man, who had stormed into the hospital demanding pain medications and threatening Dr. Wergin and other staff members.

As Dr. Wergin recounted this, driving through the fog-shrouded back roads of winter-stubble prairie, where patients are rushed to the emergency room after being crushed by forklifts and tractor tipovers, he recoiled against his own cynicism.

“You don’t want to become so jaded that you assume everyone in the E.R. is a drug-seeker,” he said.

Still, he has made adjustments. He now rarely writes prescriptions for oxycodone, which is prized on the street. For other painkillers, he logs into an electronic pharmacy registry to view the patient’s other medications. Although every state but Missouri has such a system, Nebraska’s, like many, is not foolproof: patients can opt out for privacy reasons and not all insurers, who supply the data, opt in.