Updated UID creation for encounters/adoptions.