how to you detect pneumonia