No..........no one will be punished for going to doctor. But female should go to female doctor. If no female doctor then can go to male doctor. For your info, going to doctor & showing body parts willingly to other men is far different. If a female sick then she must go to doctor for saving her life(Even it's depends on God). either female or male doctor whatever it is. Cause she bound to go there. But a female(Muslim) not bound to go outside without covering their body. So, if any muslim don't follow the islamic rules then she will be punished in judgement day.