There are over 250 diseases and disorders with the symptom of pain in the head. Some are very rare and never seen by most doctors. The variables are complicated. Pain is a subjective symptom and cannot be measured. There is great variability in people's tolerance of pain and their ability to describe their symptoms.
Psychological factors can make things worse.
The source of the problem may be remote from the location of the pain. The diagnosis of headaches may have so many variables that the task is too complex for the human mind to consider and it may be a task more suitable for a computer. Diagnostic reasoning is the process of assembling evidence to support disease identification or diagnosis. Diagnosis is an act of inferential logic. Diagnoses can be arrived at by many different reasoning processes.