Primary insomnia is diagnosed when difficulty falling asleep or staying asleep becomes a persistent problem. If there are decreases in work productivity, increased health problems, or difficulties in concentration and memory, a diagnosis of insomnia may be made. A complete medical history will be taken, and a physical exam will be done. The doctor will ask about average sleep habits and about anything that might be interfering with the ability to sleep.