Parasites have life cycles. So you check life cycles of common parasites and then add a week to the longest one you find. Farm raised fish are as likely to have some common parasites as wild caught fish are, if not more so, since they can't escape to cleaner water.
If by tank raised you mean a local fish hobbyist raised them in his tank, then they are less likely to be infested, but it's still not a guarantee. If he sells them to a fish store, they could well put them in a tank that's got Ick.. or other fish species.. some mix several in one tank if they are short on space. Then all are exposed to whatever one might have had.
So QT is the best idea for all fish, since you don't know what they were exposed to unless you buy from a local breeder, perhaps.
I'd say five weeks minimum for safety. 3 weeks is often mentioned, but I don't think that is long enough to cover all the possibilities.