Original: By 1949, when he was diagnosed as having prostate cancer, he had written most of the material that would be published after his death as Philosophische Untersuchungen (Philosophical Investigations).
Simplified: When in 1949 one found out that he had cancer, he had written most of the material that would be published after his death as Philosophische Untersuchungen (Philosophical Investigations), which might be his most important work.