I know a local rider who lost a pedal on an out of the saddle sprint just like you did. He was injured even worse. He spent some time in critical care in a level 1 trauma center.
It is easy to have happen. I hope you manage to heal up and put it behind you.