Incidentally, someone said on another thread that it is illegal in some countries to remove/turn off a ventilator. I just thought I'd make comment on that. I recently wrote an assignment and had to do a lot of comparative research on withdrawal of care and ethics for it. In some cultures, it is deemed unethical to withdraw treatment that has already been started, but not to withhold treatment that has not begun. Legally, there is a difference between withdrawing and withholding, and you can do one, the other, or both.
People often talk about having a "DNR" form (Do Not Resuscitate), which moved on to "DNACPR" (Do Not Attempt Resuscitation) to emphasise that many Resuscitation attempts are just that, and an attempt is no guarantee of success. Now, thanks to David Cameron's "No decision about me without me" movement, we have "ReSPECT" forms (Recommended Summary Plan for Emergency and Critical Care) which all seriously ill patients should have completed. The doctor discusses the range of treatments that very sick patients can have, discusses the patient's feelings on the balance between life preserving treatment and comfort persevering measures (accepting that death would occur) and then makes a recommendation on the treatments that should be offered in the event of critical illness.
Treatment plans could say "DNACPR; for ventilation, not for filter, for vasopressors." Or "Full active treatment" or "DNACPR, not for ICU, not for antibiotics, not for NIV" (typical for a stroke patient who feels that they are really ill, and are likely to die of a chest infection, but don't want treatment).
Back to withdrawing care. In countries where it is illegal/against culture to "turn off" a ventilator once started, there are ventilators with timers on them, that can be set to run for a period of time, then have to be reset to continue. If the doctor chooses not to reset the ventilator to run, it will stop. Because the doctor isn't manually stopping the ventilator, he/she will not have withdrawn treatment, so will not have violated any rules.