I do not think it much of a stretch to say that deliberately causing a person's death (as opposed to alleviating pain in such fashion as may as a side-effect hasten death) is not a legitimate medical function. It is certainly contrary to the Hippocratic Oath which is supposed to underly the practice of medicine.
That isn't to suggest that people should suffer in agony. Alleviating pain is a legitimate medical function, even when doing so may shorten a person's life. Very large doses of pain killers may cause a person to die in minutes who would otherwise have lasted days, but if they allow the person to have a few minutes of quality time free from pain, that would be fine. But there's a difference between prescribing painkillers in a situation like that, and prescribing drugs whose specific purpose is to cause death.
Too bad the government seems wont to go after the doctors who prescribe pain killers when they serve a legitimate medical purpose, but can't go after doctors who prescribe poisons.
I do not think it much of a stretch to say that deliberately causing a person's death (as opposed to alleviating pain in such fashion as may as a side-effect hasten death) is not a legitimate medical function.