ALthough more information is needed such as length of headache, actual onset, family history of migraines (very important - quiz your wife and your own family), does your child look pale or ill when he has the headache, relief with sleep, etc... it sounds like your son may be having migraines. Not sure how or even if the knee pain is related. I think it's ok for you to proceed with the GI specialist as planned, especially with the weight issue, but you should also consider a pediatric neurologist for a formal neurological exam just to make sure everything is ok. If the headaches have affected his life in that he never returned to baseline status, pain is getting worse, or has protracted vomiting or visual changes, he should get into a neurologist ASAP. But if it's just the headache with vomiting towards the end of the pain that gets better with sleep, then it does sound like a migraine which can be treated with child dose motrin or tylenol. Our pediatric headache specialist tries about 12mg of Benadryl (or child strength) which make the child fall asleep. Typically, this is what helps them feel better. Other medications include Promethazine (prescription) which helps with nausea and also makes the kid sleepy. What's reassuring about your child is the implication in your post that he's otherwise normal and active/happy in between episodes. See what the GI says, but also talk to your peds doc about a possible neuro referral. GOod luck.