error[E0432]: unresolved import `rand`

It is not possible to call other canisters in queries (at least for now). There are composite queries in the works, which will allow you to call other canisters, but for now you shouldn’t write calls to other canisters in your queries