Question

X12 is a flat-file type of format for exchanging documents between companies. I'm working with 204 Load tender type. This is format used by companies to send load tenders to carriers. Most questions on Stack Overflow here focus on how to parse. By parsing we talk about reading and converting into XML or object. Which is OK as a first step but I wonder what to do with this data...

Problem is - there is like 15 different versions of this document. Let's say I parse all this no problem. But what is the best practice to map this documents to fields in my database? I have specific fields and I need to map 204 into those fields. Because of differences in versions I can't cover this completely.

Another question. I'm new to EDI, correct me if I'm wrong. Each partner will send it's specs for specific type of transaction. They do have some freedom on what data and how they put there. Can they add their own elements? Or if it's version 4030 then all partners sending 204 type of version 4030 will be the same?

I know how to do mapping programmaticaly for each version but I wonder how this issue solved globally or on more generic level. Or it's common that when new trading partner added - custom development needed to map it's data properly? I wonder if it's possible to create more or less "plug and play" mapper..

Was it helpful?

Solution

A lot/most edi software indeed does have not only the 'parse' function but also the mapping. You do need both! A lot of the edi questions here are asked by 'edi starters', looking for a quick one-partner solution. If you use 'parse-only' edi software, you will need to build the mapping functionality yourself, re-building what is already available in all serious edi-software.

The guidelines of partners can indicate a different usage of the same transaction (like 204). Added elements is not allowed (but sometime they even do that:-( Some build a new mapping for every partner, some try to do this in one (complicated) mapping. I usually try to build one mapping, make it suitable for 'most' edi partners. But sometimes the usage is so different that it is better to build a specific mapping for that one partner. There is no magic formula to do what you want, I am afraid.

OTHER TIPS

"I wonder if it's possible to create more or less "plug and play" mapper." - This has already been done. There are universal data translators on the market that can do this for you. In your example, I would have a separate EDI to Database map, where my source would "model" the 204 document, and then my target would be the database. Then it is as easy as drag-drop from source to target.

Also, any translators worth their salt will allow you to edit (or create) a X12 dictionary to add segments / elements. This is NOT the norm. You could do EDI for 2 decades and only see that once or twice. Bastardization of the standards do happen, but it's not as frequent as you think. It only gets mentioned because it is usually painful to work around and because someone went out of their way to ignore a standard.

There's also nothing stopping you from making a generic map per version. The variations between the implementation guides are going to be slight, and you can create a generic "mega map" to handle every scenario.

Again, this wheel has already been created. There's a ton of good questions here on SO that could point you in the right direction of a good translation engine. My personal favorite is Liaison Delta.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top