pulling code
changes for duplicate removal and patient update check