adding cursor pointer to merge patient