Is this considered receiving medical treatment in the UK for the spouse visa question 6.17 - Have you ever received medical treatment in the UK?
If so, then for question 6.18 -Did you have to pay for treatment ? Would I answer "yes" since I paid for my prescription at the local pharmacy ?
The answer is yes to 6.17, because you visited a GP and you also received a prescription.
You should have paid for both of these (or at least attempted to pay for the GP visit) and you must declare the treatment on the form.
How much did you pay for the prescription? You were not eligible to pay the subsidised £8.40 prescription charge so you should have paid the full price for the medication.
Also, did you have health/travel insurance during your visit? If not, you should have been charged 150% of the fee for both the GP visit and for the prescription.
If you didn't get a bill, you will need to contact the GP and get a bill from them, then include the payment receipt with your application. If they insist that you didn't need to pay, you will need to include a letter from them confirming this.
If you have more than £500 of unpaid NHS debt, it will be an automatic visa refusal, so this is pretty important to get sorted out (not that a GP visit and prescription should be more than £500 though).