My father did this to a patient at her request when he discovered that every other method of pain relief he could give her was actaully exacerabting her pain. It happened in hospital. She was aware, her family were aware, a priest present at the time was aware and he wrote what he had given her in the notes. When she died her family thanked him.
He was tried and convicted of attempted murder (CPS thought they wouldn't get a conviction if tried for murder), given a suspended sentence and allowed to continue practicing by the General Medical Council.
Do I agree? Yes, I think it should be legalised to avoid another Shipman sceanerio tho.