The extensive article describing how to configure ICAP chaining of Web Safety ICAP web filter and Squid ClamAV has been published on https://docs.diladele.com/administrator_guide_4_9/antivirus/squidclamav.html
The scripts are available on https://github.com/ra-at-diladele-com/qlproxy_external/tree/release-4.9.0/src/va/scripts.clamav. Please fork and see if it works. Please note latest 4.9 build was tested from https://www.diladele.com/download_next_version.html
Thanks a lot to Gilles Darold for his marvelous work – see http://squidclamav.darold.net.