You will need to provide some details about what the doctor did and how that affected you to get some useful responses. However, I can tell you this much: yelling profanity is not itself illegal and certainly does not amount to malpractice.
If the profanity included attacks against you because of your race, color, national origin, religion, or disability then that might be illegal discrimination under federal law.
Certainly a profanity laced rant is unprofessional and, assuming you didn't prompt that rant (you didn't use profanity and insults towards the doctor first) then you may wish to report the doctor's rant to whomever his/her superiors are in the medical organization.