Prospective study of epidemiology and prognostic factors in community-acquired pneumonia