Perhaps you are developing asthma. I'd need to know your symptoms in more detail, but if the cough is painful, and productive (i.e. lots of yukky phlegm), you probably have an infection that you're struggling to shake off. If the cough is dry and wheezy, it's more symptomatic of asthma.
If you have asthma, hayfever, excema, or any other allergies in your immediate family, you are more likely to develop asthma yourself. So thats something to bear in mind.
Good luck with your x-ray. I am sure they'll get it under control!