Remove patient.id from get ukt patients sql to remove duplicates

Can this removal of the patient.id from the sql to fetch the patient for the UKT export be checked to ensure that it doesn't break anything?

The reason for removing the patient.id is that it makes the DISTINCT clause in the sql useless and adds lots of duplicates to the patient list for UKT.