According to the AMA's code of ethics "Doctors are obliged to respect the right of a severely and terminally ill patient to receive treatment for pain and suffering, even when such treatment may shorten a patient's life".
Some doctors object to voluntary assisted dying on the basis of the Physician's or Hippocratic Oath which instructs "do no harm". Yet, others see leaving a dying patient to suffer as the opposite of "do no harm".
Under the voluntary assisted dying framework in Victoria, and the one to be implemented in Western Australia in July 2021, doctors can choose not to take part. This can be for any reason which they need not divulge.
A voluntary assisted dying law respects and protects the rights of those doctors who object. Just as it protects and respects the rights of those doctors with a different ethical view.