That is despite existing NHS guidance saying there "appears to be no clinical reason to restrict the number of tablets" of Viagra prescribed to an individual.
It said NHS boards should target areas for further improvement, such as identifying where particular drugs are over or under-prescribed and supporting GPs to review patients who take a number of different medicines.
Earlier, Stuart Denney, prosecuting, told the court Gilliard had suffered from depression a number of years earlier but had stopped taking tablets prescribed by doctors.