The paper deals with perfect 1-error correcting codes over a finite field with q elements (briefly q-ary 1-perfect codes). We show that the orthogonal code to a q-ary non-full-rank 1-perfect code of length $$n = (q^{m}-1)/(q-1)$$ is a q-ary constant-weight code with Hamming weight equal to $$q^{m - 1}$$ , where m is any natural number not less than two. Necessary and sufficient conditions for q-ary codes to be q-ary non-full-rank 1-perfect codes are obtained. We suggest a generalization of the concatenation construction to the q-ary case and construct a ternary 1-perfect code of length 13 and rank 12.