Yes and no. I researched this extensively last year as my significant other had a heart valve replaced and she wants to learn to fly. True, the medical is gone as soon as the procedure is done. But, it can be reissued in many cases with a "Special Issuance" which is renewed every year or two with the medical. There are some conditions about what meds are permissible, and there can be no atrial fibrillation, etc. Your AME can explain the procedures for getting a Special Issuance.