You will lose the medical but you can get it back after you jump through a lot of hoops and prove there are no more problems. I know of a heart attack victim that got it back, but it could take a year or more.
That person does need to wait 6 months after the event and there are hoops to jump through like a stress test and an angiogram. I understand that reviews which used to be done at OK City are now done on a more regional basis. A cardiologist will need to make a statement saying that the pilot has have full capability of doing what needs to be done without any medical considerations. The review board will need a full copy of all the pilot's surgical records. An AME should have the necessary details to get point that individual in the right direction.
I had a car accident in 1986 at age 23 and among other things I had the aorta on my heart knocked loose from the heart muscle. I had a 2% chance of living. They did open heart (from my back) and put a Dacron woven patch on my heart/aorta. Within 4 months with the help of a great AME I passed my 1st class medical. No problems since. I recommend getting ahold of a AME who really knows the documentation and pleading to do on your behalf. Wish you luck.