Hello,
You can go for an up front medical exam by contacting the nearest panel physician's office. You cannot go for any other doctor other than the ones listed by CIC. Check the CIC's website for the list and contact information. After you've booked your appointment, take the test on the scheduled date. The physician's office will provide you with a receipt of payment and a reference number. You will have to scan and upload these documents along with your online application.
Please note that the physician will not provide you with a medical test result report.
I would recommend going for an up front medical test as it will save time and help process your application faster.
Good luck!