how is insomnia diagnosed