mobui / gs1_barcode_parser

MIT License
5 stars 11 forks source link

Company Internal Identifiers #9

Open EnsinsM opened 1 week ago

EnsinsM commented 1 week ago

Hello guys :)

First, thank you for your package. It works fine, but now I have found a limitation.

Is it possible to return a list of multiple GS1ParsedElements with the same identifier? GS1BarcodeParser.defaultParser().parse(gs1Code);

We are using the identifier 95 for internal usage as intended. But it seems like it can't be used more specified like 9501, 9502, ... . So we have that many different cases, that we use the first two characters of the actual data to make this specification. But your parse method ignores entries if they are already in the map.

image

image

image

Can you change that? Should I change the way we use the GS1? I'm looking forward to find the best solution :)

sachebotarev commented 1 week ago

Hi, EnsinsM

Unfortunately, I can't add support for AI 95XX elements to the library. Since there is a standard AI 95 and it will overlap these elements, that is, they will all be interpreted as 95.

As it is now, your barcode will not be interpreted correctly by other tools for working with gs1 (for example https://www.npmjs.com/package/gs1-barcode-parser-mod) I recommend using AI elements from 91-99, they are specifically designed for internal custom fields.

image

Or concatenate elements use your own character delimiters (max length of AI 95 - 90 characters), for example (95)017C4N-04SLOC-06.... (dash as delimeter)

I see familiar field names from SAP ))