A dying child should not only receive the three initiation sacraments, but celebrate the full rites, not just emergency abbreviated forms:
172. If it is appropriate, the priest should discuss with the parents the possibility of preparing and celebrating with the child the sacraments of initiation (baptism, confirmation, eucharist). The priest may baptize and confirm the child (see Rite of Confirmation 7b). To complete the process of initiation, the child should also receive first communion.
According to the circumstances, some of these rites may be celebrated by a deacon or lay person. So that the child and family may receive full benefit from them, these rites are normally celebrated over a period of time. In this case, the minister should use the usual rites, that is, the Rite of Baptism for Children, the Rite of Confirmation, and if suitable, the Rite of Penance. Similarly, if time allows, the usual rites for anointing and viaticum should be celebrated.
Of course, only the priest can confirm, hear confession, and anoint. Obviously, there’s a preference for the celebration of Mass with confirmation and first communion. It should also be equally obvious that these sacraments are celebrated with a child earlier in the dying process rather than later.