Various tests and examinations will be conducted, which may include X-rays, chest CT scan and radiography, blood test, sputum and fluid examination, and MRI scanning. Based on the outcome of these tests, the doctor will be able to identify the exact cause of the infection, and the treatment would then be advised accordingly.