It can be an infection as the pain is acute in nature.
However u need to do an xray chest to confirm whether there was really a pneumonia
I m sure they must have done when they had you admitted.
Furtther nothing can be said as you had no fever
, no cough
and no other problems except pain