Do the targets of Prayer of Healing need to be present during the casting time?

Prayer of Healing has a casting time of 10 minutes. The typical case for this spell would be a cleric casting this on injured members of a party while they rest. But what if one more fellow drops in right before the casting time is done?

That is, do the targets of the spell need to be chosen when the spell casting is started? Or upon completion of the casting time?