I remember getting the same treatment by a male doctor. After prodding around my shoulder he handed my husband a pack of painkillers.
My husband handed them back and said, "We'll find another doctor," and without thinking put his arm around my shoulder. I screamed in agony.
We eventually were seen at another hospital where the doctor asked, "are you pregnant by any chance?"
Turns out many women suffer bursitises in pregnancy. I can relate to your pain.
I can also add, your doctor had NO idea about period pain.
So glad you are now well.