If you are lucky, your job is a consideration you can take into account in advance of your open heart surgery and do some planning to minimize any fallout financially and operationally. If you are less fortunate and you need immediate surgery your chances of being able to plan accordingly will be virtually nonexistent.
When to tell your company, who to tell, and how to tell them are all personal choices you will make with your family and your doctors. Perhaps you tell the whole company, or maybe only your boss. Telling your boss that you're broken and that you will have to be out of the office for an unanticipated couple months for open heart surgery is not something anyone takes pleasure in. Not only does it compromise your responsibilities in the office, but it is also ego shattering. This is especially true when an aneurysm is your only health issue because it is hard for you and others to wrap your heads around how you could be so sick, yet seemingly healthy on the outside.
We feel invincible; immortal until we are faced with something like this.
When you tell your boss; hope for the best but plan for the worst. Most people will have no idea what you're going through or what this is all about. You may not get the reaction or compassion you expect so it's better not to have any expectations. Some people who have been through life altering experiences like this will surprise you with their compassion and support, but generally people will not be able to relate. For example, people cannot understand what it's like to have children until they've had their own. One of the best expressions I ever heard about having children is that it is "like watching your heart walk around outside of your body". Don't expect anyone to understand how you feel, how this news has affected your family or anything else about it. If you have low expectations you'll be surprised by the people who are supportive instead of being disappointed by the ones who are clueless.
Shortly after I was officially diagnosed with a 5cm ascending aortic aneurysm I told my boss. I did so because I anticipated having to have surgery at some point in the future and I wasn't sure if it was going to be sooner or later. I wanted to plan logistically, and so I took the step. I talk about this whole ordeal in detail in my book "Barefoot in November", however suffice it to say that the news didn't go over well. He basically said he had a friend who he played hockey with who had a similar surgery and asked me if I wanted him to have the guy call me. I said sure, and the conversation ended rather abruptly. He never asked how I was doing after that and never said a word to me about it again. The friend he claimed had the same surgery also never called me. This was a guy who by his own admission had ruined his family life and was recently divorced due to lack of compassion, so I should have expected such a dull reaction. A couple months later I got informed that the company was downsizing and he was eliminating my territory. I was appalled. Luckily I had opened my own franchise while working at the company so I had a leg to stand on, but I knew I wouldn't be able to support the huge house I had just built if I had to undergo open heart surgery. To complicate matters my wife was pregnant and had recently dissolved her property tax business.
I delayed surgery as long as possible until I was forced to surrender or begin gambling with my life on a daily basis. By this time I had taken on a role at an Internet Marketing Company. I was prepared to delay surgery longer if necessary, however the principals I worked for were the most unbelievable people in the world. Upon hearing about my condition, they basically told me that I didn't have a choice and they forced me to make the appointment for surgery and told me not to worry about my responsibilities at the company. They were supportive in ways I couldn't begin to tell you. I knew the money was one of the reasons it was such a sought after company to work for, but this showed me that it went even deeper. I was beside myself. The people were truly amazing. It helped that I had signed on one of the biggest accounts in the country before my surgery thereby increasing my income; however the courtesy and compassion they extended me I will be eternally grateful for. I can only wish anyone a similar experience.
The bottom line is that life will go on. It will not wait for you. You'll need to plan around the surgery and execute to whatever extent that you can, and simply make the best of everything until you get back on track. Everyone's occupational situation is different, but in the scheme of things; as my brother in law said to me, the most important thing is having more time on earth with your family.