The practice of laying a person flat to speed up their death is an unwritten practice that goes on in hospitals and at the homes of people who are terminally ill.
I have observed this practice while at the bedside of a lady suffering with advanced stage cancer.
Jewish Ethical and Legal Sources on the Treatment of Terminally Ill Patients; and, Jewish Medical Ethics: An Outline of Principles
Source:
www.aishdas.org/rygb/medical.htm
Rabbi Yehoshua Boaz (16th century)6 records a disagreement he had with his teachers as to the extent to which one may change circumstances that impede the demise of a dying patient. The conclusions of this discussion are codified by his contemporary, Rabbi Moshe Isserles, in his glosses on Rabbi Yosef Karo's definitive code, Shulchan Aruch7: "It is forbidden to cause a dying person to expire more hastily, i.e., if one is dying slowly, it is forbidden to remove pillows and mattresses from underneath him.
or grains of salt placed on the dying man's tongue... may be removed. This removal is not active hastening of death, but rather the removal of an impediment."