f.isUniqueTrial function

Calculate if record is unique for a study