Added customized merge patient logic to remove multiple identifiers of the same type

(cherry picked from commit d8b7f963e2f11968cf57ae3f4b2f91797fd02b24)