Community-acquired pneumonia ( CAP ) is considered the leading cause of death from infectious disease in developed countries , while complications of CAP - sepsis being the most common and challenging - increase the risk of mortality .