Vegetable plots and raised beds are open invitation to cats needing a toilet. They just love the bare soil and easy tilth. If you can't place cat proof nets over your beds, try scattering spiky sticks from your prunings.
A long term solution is a water scarecrow device which attaches to a hospepipe and has sensors that set off a spray when a cat, or fox or heron strolls by. They don't like the wetting and go elsewhere. The sensors beed to be moved regularly as cats learn where they are. However, this may not be a possible solution for those in hosepipe ban areas so the well aimed water gun is teh next best option.
As for danger to health, I had 7 cats in Harrow and grew veggies and salads with no problems but they needed careful washing. It wasn't till I moved to Belgium 20 years ago that I picked up the toxoplasmosis bug and that was 10 years ago. It lurks on inadequately washed salads and veggies and meat cooked rare. It's a bit like having flu and is not a a danger to healthy peope except pregnant women as it can damage the baby. Here on the continent, pregnant women are screened for the anti-bodies and if they don't have them they get monthly blood tests through the pregnancy in case action needs to be taken.