“Let’s do the E.R.-visit game,” he went on. “This is a fun one.” He sorted the patients by number of visits, much as Jeff Brenner had done for Camden. In this employed population, the No. 1 patient was a twenty-five-year-old woman. In the past ten months, she’d had twenty-nine E.R. visits, fifty-one doctor’s office visits, and a hospital admission.

“I can actually drill into these claims,” he said, squinting at the screen. “All these claims here are migraine, migraine, migraine, migraine, headache, headache, headache.” For a twenty-five-year-old with her profile, he said, medical payments for the previous ten months would be expected to total twenty-eight hundred dollars. Her actual payments came to more than fifty-two thousand dollars — for “headaches.”

Was she a drug seeker? He pulled up her prescription profile, looking for narcotic prescriptions. Instead, he found prescriptions for insulin (she was apparently diabetic) and imipramine, an anti-migraine treatment. Gunn was struck by how faithfully she filled her prescriptions. She hadn’t missed a single renewal — “which is actually interesting,” he said. That’s not what you usually find at the extreme of the cost curve.

The story now became clear to him. She suffered from terrible migraines. She took her medicine, but it wasn’t working. When the headaches got bad, she’d go to the emergency room or to urgent care. The doctors would do CT and MRI scans, satisfy themselves that she didn’t have a brain tumor or an aneurysm, give her a narcotic injection to stop the headache temporarily, maybe renew her imipramine prescription, and send her home, only to have her return a couple of weeks later and see whoever the next doctor on duty was. She wasn’t getting what she needed for adequate migraine care — a primary physician taking her in hand, trying different medications in a systematic way, and figuring out how to better keep her headaches at bay.