I am a doctor and work in ICU. This ventilator issue is a huge problem and I have had countless discussions on this topic. It is an extremely complicated and difficult situation to be in and scholars do say that removing the ventilator is equivalent to murder. There is therefore a tremendous debate on this issue and many doctors have, over the last 2 decades discussed this matter with scholars but unfortunately there is no solution yet. This is an issue which has haunted Shia doctors esp. ICU doctors as well as families of patients for years.
Some important points to be considered are what constitutes as "death" in Islam? How does Islamic law define death because there is discrepancy in what scholars consider as death vs. what is death medically. Brain death is not considered death by the scholars as long as the heart is beating even if by artificial means. Some individuals can be brain dead but their hearts may go on beating for even months. If they are on ventilator, then switching it off would imply that the doctor is a murderer. Many times the family simply cannot afford to pay for the ventilator for even a few days, but scholars even then strongly believe that no matter what, even if the family has to sell everything they own and end up on the street, the ventilator must still continue. If the family refuses to pay for the ventilator, and the hospital switches it off because they cannot afford to bear the expenses themselves, then who is the murderer?
What if a hospital has only a limited number of ventilators and one of them is being used on a brain dead individual who has been on the ventilator for many weeks with no signs of recovery. If another patient comes in who needs a vent and there is hope that the vent. will save his life, isn't it sad that the patient who could be saved would die as the vent is being used by a patient who is already medically dead.
The one thing that scholars do allow is that a patient or his family can give orders for DNR/DNV - do not resuscitate, do not ventilate. Allowing the patient to die without putting him on the ventilator in the first place is permissible, but removing the patient from vent is not allowed, unless the heart stops. In other words, de-escalation of treatment is forbidden.
Many doctors remove the vent. by saying that we should not prolong the misery of the patient. This is a wrong concept because every second of life is a very big blessing of Allah, even if it may appear as miserable to the person himself or to the doctors. A doctor or his relatives may feel that the patient is in misery, but the disease may be a great reward from Allah on that person because the disease may be nullifying many of the person's sins. Termination of life prior to the time Allah has decided for the patient would mean we have robbed that person of precious days of his life, even if he appears brain dead to us.
Perhaps in the future, Shia scholars and marjas will come up with practical solutions to this extremely, critical matter. Anyone of us can face such situation in life and should be prepared before-hand.
May Allah protect us all.