Medical ethics is a system of moral principles that apply values to the practice of clinical medicine and in scientific research. Medical ethics is based on a set of values that professionals can refer to in the case of any confusion or conflict. These values include the respect for autonomy, non-maleficence, beneficence, and justice.
We must do everything possible to keep the patient alive. We should not remove life support under any circumstance as it can cause an earlier death.
Muslim healthcare provider must save the life of the patient in every possible way even if the patient does not want that help by directing DNR or DNI. Saving the life of the patient does not depend on his will but it is absolutely obligatory in Islam.