Linking group tables in patient search