A total of @ patients who had undergone cardiothoracic surgery , of which coronary artery bypass , valvular repair , and pulmonary thromboendarterectomy were the most common , were included when they developed acute respiratory failure ( failure of a spontaneous breathing trial or successful breathing trial but failed extubation ) or were deemed at risk for respiratory failure after extubation due to preexisting risk factors .