as it says is a hypersensitive reaction to some foreign antigen which u have inhaled.
Its difficult to know exactly what and when has caused it but certainly if it was so bad that u had to resect your right lung then the exposure may have been since very long.
In an office with closed HVAC systems you never know what has affected you and caused this problem. A lymphocyte
proliferation test can be done if you are suspecting an antigen that can cause it