Primary immunodeficiencies (PID) are commonly undiagnosed. Patients with frequent bacterial infections (sinusitis, otitis, skin infections or pneumonias), fungal or viral infections  should be evaluated for immunodeficiencies.
This evaluation primarily is done by blood work including measurement of antibody levels as well as measurement of cell mediated immunity. 

While treatment varies depending on the type of PID , the commonest therapy involves antibody infusion therapy (either through the vein or beneath the skin) on a regular basis to decrease the frequency of these infections.  This treatment has dramatically improved the quality of life of patients with PID as well as their longevity.