You may have blood tests to check your white blood cell count or to look for viruses, bacteria, or other organisms. Your health care provider may examine a sample of your phlegm or your blood to help identify the cause of pneumonia.