Change logic for duplicate patient entries