Hello sunbeam: Having undergone a few surgeries in the past myself, I have some idea of how you're probably feeling.

This is such a difficult time to also be facing the loss of a close friend. Hopefully you have others in your life you can reach out to for support.
Will there be an opportunity to spend time with your friend? If not, sending a heartfelt note or card might be of some comfort. Perhaps continuing to post here on PC can help too. Sometimes simply writing about how you feel can be of some comfort... hope you begin feeling better soon.