If your health care provider suspects that you have this type of pneumonia, they may do a swab test of your nose or throat.