It's often done with wild caught cichlids, especially discus. Some do it with any discus introduced into their fishroom, especially breeders. It's precautionary, but at times wise, and one of the few times a well fish should be medicated.
I have wormed my Discus in my planted tank with a product called Wormer Plus with no ill affects to the shrimp I have in there. Any snails on the other hand seem to be have been irradicated which is a bonus!!
Granted my shrimp hide an awful lot but much to my considerable surprise I found a few when I last moved some plants around.