Would it be to do harm when a patient is terminally ill, or ending the harm?
@Luis GonzalezGood question, any answer to which must be both philosophical and definitional. Which means: it's hard as hell.
A terminally-ill patient is by definition already suffering from a disorder that causes bodily harm. The philosophical question is two-fold.
First: by ending the patient's life, is the harm being ended, or accelerated (unto death)? One could reasonably make either argument.
By ending the patient's life, the harm caused by the disease ends along with the patient. But the harm caused by the illness to that point is simply being sped to its natural conclusion by the process of suicide. Unless... the disease or illness were to go into remission - which happens, sometimes for no known reason. Or a new drug suddenly makes what was once impossible, now possible. No matter how remote a chance may be, it is still a chance.
Secondly: to engage the services of a medical professional in ending one's life is to ask a practitioner to agree to act in defiance of their education, training, and professional ethics. Such a meeting of the minds between doctor and patient may clearly be made as a matter of voluntary choice. But the cost involved is not limited to a bill for services rendered, but necessarily has a moral and ethical dimension as well for the doctor, and also, perhaps for the family and friends of the patient, who might reasonably wonder: was this right, and what might have been, if...?
Finally: irrespective of pain and suffering - which are very real, tangible, awful things - second-guessing God is always a hazardous enterprise.
Once again - yours is a great question to which I will not claim to have a perfect and definitive answer.