They can't have a blanket do not prescribe on some items, paracetamol for example, you can only buy 32 at a time and for very good reasons, but some people need to take full dose of 8 a day everyday so they get it prescribed as they cannot just go buy the 224 they'd need each month.
Gaviscon changed many years ago, Gaviscon cannot be prescribed but Gaviscon Advance can be.
So whilst yes many things that can be bought over the counter will no longer be prescribed by some doctors it would be extremely difficult to have a blanket ban on prescribing all items that can be bought over the counter.