Refs #2781 PR #121 Fixing regression the "distinct idvisit" was removed in the PR