I have to say a few things, one I was an ER nurse for several years, for a few of those years I specifically worked in a Pediatric ER/Trauma center. CF is one of many horrible diseases children are affected with, You were there for an after hour x ray, nothing more. There are children who could have been in dire need of care. An ER is just that, for emergency's. Unless your child is in distress, and or they are not busy you are going to wait.
I do think that you can do things to protect your own child such as put a mask and gloves on them. you could request to go to a separate area if one is available.
I know you are new to ER's, hopefully you can avoid them for a long time. I will tell you as a patient who has been to the ER, when I am sick, I go right back, no questions. I am well taken care of. You just have to remember it is your job to protect your child. The hospital can only do so much.
I had to stop working in the ER because I caught everything under the sun there, it is a very germy place and it is almost impossible to control the environment. Sick people everywhere.
I don't think it was wise of your doctor to send you to the ER just for an x ray , unless your child was really ill.
I am sorry for your bad experience, There just is not a place that is totally germ free and safe in an ER, buy some masks and gloves, have your child wait in the car in between being triaged and being treated etc.