It's not mandatory. But, quality of medicines varies. And in case of combination of medicines (if applicable) then patient might face a trouble. So, I recommend to get it by doctor as he/she better knows on the quantities of mixture to be used.
But, you can go for prescribed medicines as well that you can get it from a nearby store.
Next Steps
Book an appointment, if you want either way to cure your disease.