The unpleasant truth is that, other than in cases of complete brain death, there is effectively no way to do a heart transplant without murder. If a heart can be made to beat again, it can be made to beat again. There is not any version of this issue that isn't a particularly morbid form of the trolley problem.