A 19-year-old university student presents with a 3-week history of productive cough, night sweats, weight loss, and haemoptysis. He recently returned from visiting family in a TB-endemic country. Chest X-ray shows upper lobe cavitating lesions. What is the most appropriate next step?