  We consider perfect 1-error correcting codes over a finite field with $q$
elements (briefly $q$-ary 1-perfect codes). In this paper, a generalized
concatenation construction for $q$-ary 1-perfect codes is presented that allows
us to construct $q$-ary 1-perfect codes of length $(q - 1)nm + n + m$ from the
given $q$-ary 1-perfect codes of length $n =(q^{s_1} - 1) / (q - 1)$ and $m =
(q^{s_2} - 1) / (q - 1)$, where $s_1, s_2$ are natural numbers not less than
two. This construction allows us to also construct $q$-ary codes with
parameters $(q^{s_1 + s_2}, q^{q^{s_1 + s_2} - (s_1 + s_2) - 1}, 3)_q$ and can
be regarded as a $q$-ary analogue of the well-known Phelps construction.
