Question: If the patient is under modern medical machines in a condition such that, were the machines to be removed from him, he would certainly die, then what is the ruling?
The answer: If the matter is indeed certainly as described, then the patient is to be considered legally dead, so his property is inherited, his wife observes her waiting period, and so on.
This is according to what the scholars of the madhhab have mentioned concerning one whose body has been severed into two halves, or one whose jugular vein has been cut: he is like the dead, even if he remains alive for some time; thus his estate is inherited, and his wives observe the waiting period, and so on.
Branch issue: If the patient would certainly die were the machines to be removed from him, is it permissible to remove the machines from him, knowing that he will die when they are removed? Or is that not permissible, even if leaving them (running) involves financial loss for the heirs?
What appears is that it is permissible to remove the machines, because he is, in the legal ruling, dead, and his life under the machines is not (true) life. Thus, he does not die by the removal of the machines from him; rather, his death had already in fact occurred beforehand.
Source: Min Thimār al-ʿIlm wa al-Ḥikmah vol.2