Is it safe to harvest rainwater that fell on solar panels?
If you plan to use that collected water for drinking and cooking then you will need a proper filtration / treatment system... Ingesting diluted bird-droppings is not a good idea...

So, a simple filter may not be enough, you may well need UV treatment, but you should consult the authorities for the standards in your location you are legislated to meet and consult some just for your own health and others who may drink your water...