How is primary immunodeficiency diagnosed?