@Override protected boolean isIdentical( DataElementCategoryOption object, DataElementCategoryOption existing) { boolean codeMatch = true; boolean uidMatch = true; // if there is a code that must also match if (object.getCode() != null) { codeMatch = object.getCode().equals(existing.getCode()); } // if there is a uid that must also match if (object.getUid() != null) { uidMatch = object.getUid().equals(existing.getUid()); } return (object.getName().equals(existing.getName()) && codeMatch && uidMatch); }
@Override protected void importMatching(DataElementCategoryOption object, DataElementCategoryOption match) { match.setCode(object.getCode()); match.setUid(object.getUid()); match.setName(object.getName()); categoryService.updateDataElementCategoryOption(match); }
@Override protected DataElementCategoryOption getMatching(DataElementCategoryOption object) { return categoryService.getDataElementCategoryOptionByName(object.getName()); }
@Override public void importObject(DataElementCategoryOption object, ImportParams params) { NameMappingUtil.addCategoryOptionMapping(object.getId(), object.getName()); read(object, GroupMemberType.NONE, params); }