This project has moved and is read-only. For the latest updates, please go here.

Parser Utilization

Jun 10, 2011 at 8:58 PM

I have a use case where I bring in an EDI document that has claims for multiple providers.  The file parses correctly.  Each provider wants only thier messages from within that EDI message.  Is there an easy way to do this?  I would like to just use XML and delete those that are not from a provider, but I can't see how to move the XML back to X12 EDI.  The next thought was to look at the Parsed Interchange document.  This is not really easy because each segment and transaction sets are IEnumerable and thus can't be removed if I check it out.

1.  What's the story on XML back to EDI X12?

2.  Is there a way to remove parts of a parsed EDI and then I can just serialize it back out as EDI?  It's just easier in XML but I can do it that way.  My vision is to clone the current parsed document, go through and just leave one providers claims and then serialize it back out.

Thanks in advance for any guidance.

Jun 10, 2011 at 9:14 PM
Edited Jun 10, 2011 at 9:21 PM
The easiest way to do what you want is to unbundle by the provider loop. Please review the documentation here, if that does not solve your problem then please further elaborate.

I also agree that there isn't an easy way to get it back to X12, so I will add that as a feature request, it shouldn't take more than a day of work to write an xslt to transform the XML back.  I'll make that my next priority.
Jun 12, 2011 at 7:18 PM

It's wierd - the Unbundle is giving me the same Interchange twice - detecting it as a Loop and a Hierarchical Loop.  I can see why, I'm just trying to figure out the difference of the two routines on my EDI document.  I'm learning.

I really appreciate the willingness to get the XML back to a parseable Interchange object.  The XML is so easy to manipulate, but I think that is more from familiarity with Linq to XML than anything with the Parser object model.

Great work in this project.

Jun 12, 2011 at 11:17 PM

I have added a method called TransformToX12 on the X12Parser class so that you can modify your xml and turn it back into X12.

I had to update the parser to add the delimiters to the xml so that it could be picked up on the transformation back.

See unit test ParseAndTransformToX12 for syntax.

It should be available in changeset 8796.

I will do a release by the end of the month with this change.

If you think the UnbundleByLoop method is not behaving as expected, you are welcome to shoot me an example to troubleshoot.

Jun 14, 2011 at 3:29 AM

Excellent work - validating it out now.

Jun 14, 2011 at 2:00 PM

BTW, I am going to ramp up getting the 837 fully defined for the 5010.  Has your company decided when they are going to start transitioning to that version?  I am trying to figure out what my urgency should be.

I am also going to have to do some compromises with the Institutional since some of their entity codes map to different Loop Ids than the Professional implementation guide.  I will probably have to create a separate SpecificationFinder implementation that will point to an 837I specification.  Are you doing work with both Institutional and Professional 837s?  I would like a second opinion on these design considerations.

Jun 14, 2011 at 5:14 PM

Right now I'm doing the imports of 835's.  We do work with Professional 837's but I'd be willing to look over whatever you are doing.