private ItemType Convert(Sushi.DataType dataType)
        {
            switch (dataType)
            {
            case Sushi.DataType.Book:
                return(ItemType.Book);

            case Sushi.DataType.Collection:
                return(ItemType.Collection);

            case Sushi.DataType.Database:
                return(ItemType.Database);

            case Sushi.DataType.Journal:
                return(ItemType.Journal);

            case Sushi.DataType.Multimedia:
                return(ItemType.Multimedia);

            case Sushi.DataType.Platform:
                return(ItemType.Database);
            }

            throw new ArgumentException("dataType");
        }
        private CounterIdentifier Convert(Sushi.Identifier identifier, String itemPlatform, Sushi.DataType dataType)
        {
            IdentifierType resultType;
            String         resultValue = identifier.Value;

            switch (identifier.Type)
            {
            case Sushi.IdentifierType.DOI:
                resultType = IdentifierType.Doi;
                break;

            case Sushi.IdentifierType.ISBN:
                resultType  = IdentifierType.Isbn;
                resultValue = resultValue.Replace("-", "");
                break;

            case Sushi.IdentifierType.Online_ISBN:
                resultType  = IdentifierType.OnlineIsbn;
                resultValue = resultValue.Replace("-", "");
                break;

            case Sushi.IdentifierType.Online_ISSN:
                if (resultValue.Length > 9)
                {
                    Regex regular = new Regex("[0-9]{10}|[0-9]{13}");
                    if (!regular.IsMatch(resultValue))
                    {
                        return(null);
                    }
                    resultType = IdentifierType.PrintIsbn;
                }
                else
                {
                    Regex regular = new Regex("[0-9]{4}-?[0-9]{4}");
                    if (!regular.IsMatch(resultValue))
                    {
                        return(null);
                    }
                    resultType = IdentifierType.OnlineIssn;
                }
                break;

            case Sushi.IdentifierType.Print_ISBN:
                resultType  = IdentifierType.PrintIsbn;
                resultValue = resultValue.Replace("-", "");
                break;

            case Sushi.IdentifierType.Print_ISSN:
                if (resultValue.Length > 9)
                {
                    Regex regular = new Regex("[0-9]{10}|[0-9]{13}");
                    if (!regular.IsMatch(resultValue))
                    {
                        return(null);
                    }
                    resultType = IdentifierType.PrintIsbn;
                }
                else
                {
                    Regex regularx = new Regex("[0-9]{4}-?[0-9]{4}");
                    if (!regularx.IsMatch(resultValue))
                    {
                        return(null);
                    }
                    resultType = IdentifierType.PrintIssn;
                }
                break;

            case Sushi.IdentifierType.Proprietary:
                resultType = IdentifierType.Proprietary;
                if (dataType != Sushi.DataType.Platform && dataType != Sushi.DataType.Database)
                {
                    resultValue = $"{itemPlatform}:{identifier.Value}";
                }
                break;

            default:
                throw new ArgumentException("identifier");
            }

            return(new CounterIdentifier {
                IdentifierType = resultType, IdentifierValue = resultValue
            });
        }