Question
· Oct 24, 2017

Route X12 837 files based on format (4010 vs. 5010)

Hi Community. I have a vendor sending us X12 837 claims, they are sending a mixture of 4010 and 5010 formatted claims. Is there a way I can examine the file contents and determine the message format and route to two separate folders based on format (4010 vs 5010). I've tried setting up a record map, stream container and vdoc services and processes with no luck. Any help would be appreciated.

Discussion (1)0
Log in or sign up to continue

Yes, this should work.  You need to create an X12 File Business, but do not use a "Doc Schema Category", as this will force Ensemble to inspect the ISA segment for what DocType and Category it should be in.  Also, set this to send "Whole Batch" so everything stays together.  Create a Router and a rule that will have the following constraint: 

msgClass=EnsLib.EDI.X12.Document

This will only accept an X12 formatted document.  Next you want to check the Document Type Version with a "When" node with a condition where Document.TypeVersion Contains "401" for 4010 (NOTE:  These seem to no have the leading zero and we could have simply used Contains "4" for the same effect).  You can pass the message through a DTL or you can pass it directly to another Business Process or Operation to do the specific work for that type.  Make sure you include a "Return" at the end of your "When" logic, then create a second looking to see if Document.TypeVersion Contains "501" and send it to it's corresponding Business Process or Operation.  This should work given you are getting a well formed Interchange (ISA) segment with everything in the right place.  If not, you may have to create a DTL just to pull that piece out of the ISA, then you can set it to the version by creating a "Set" target.TypeVersion=4010 or target.TypeVersion=5010, which you can just pass back into your router with this set appropriately.    Lots of folks don't realize you can set properties in the DTL since it doesn't show the properties in the visual diagram, but you can ... and you can also set variables which I may cover another time, if someone else hasn't already.

You could even create a DTL to convert 4010 to 5010, so that you don't have to have two completely different, but almost the same "wheels" to work with, where the "wheel" is the business logic.  It will allow you to not have to sift through two versions of the same logic if a change needs to be made, although,  I have not fooled with any 4010, so I'm not sure how do-able that would be, but I would expect your 4010 -> 5010 DTL logic to be pretty static once you worked it out, while your 5010 processor would continuously be updated due business logic changes over time.  Just food for thought.  Good luck, and let me know if you encounter any issues.