That is always a problem with inattentive drivers. Wouldn't wish that that you've been trough to anyone, but it is good that you came out relatively ok. For the future consider two things I never ride on the road without - a rear view mirror, and a good strong rear blinky. Both of them can help to avoid situations like that - blinky to make sure drivers see you - by attracting their attention, even in the middle of a sunny day - and a rear view mirror to spot those that do not seem to notice you, so that you can get off the road quickly if needed. I wish you a quick recovery.