Tuberculosis as a primary cause of respiratory failure requiring mechanical ventilation.