Out-of-the-Box Usage:

X12Parser is a collection of simple command line console applications for transforming an X12 file.

X12Parser.exe

X12Parser transforms an X12 file into a more domain easily readable xml file.

The 2 arguments to the command line are input filename and output filename.  Only the input filename is required. If the second argument (output filename) is not present, X12Parser will use the input filename and add a ".xml" to create the output filename.

Example:
X12Parser "D:\Test.clm" "D:\Test.xml"

See Parsing an 834 Transaction or Parsing an 837 Transaction to see an example of what the output will resemble and how to write more code to output to html or back to a formatted x12.

UnbundleX12.exe

UnbundleX12 separates an X12 file into multiple valid X12 files at a specified X12 loop ID. When loops are separated their header information (parent loop or segment) is retained. The SE transaction trailer segment and GE function group segment, however, is updated to correctly reflect the number of segments in the transaction and the number of transactions in the function group so the resulting x12 is still valid.

The 5 arguments to the command line are input filename, X12 loop ID, output directory, output filename format and include whitespace. The first 3 arguments are required. If the fourth argument is not present, UnbundleX12 will use the input filename and add a 3 digit incrementing counter to create the output filename.  If the fourth argument is specified it can use the following special tokens:

Token Description
{0} Output directory specified on the command line
{1} Input filename including extension
{2} Counter incremented for every unbundled loop
{3} File extension of input file

The fifth argument will toggle on or off the include whitespace option when creating the X12 file.  If not specified it is set to "true". If set to "true", this option adds carriage returns and indentation to the loop structure to make it more human readable. Note that adding whitespace may make the file unreadable with some EDI applications.

3 argument example:

UnbundleX12 "D:\837Test.clm" "2300" "D:\Output"

If the 837 input file had 2 claims in it, then "837Test.clm_001.clm" and "837Test.clm_002.clm" would be created in the D:\Output directory.

4 argument example:

UnbundleX12 "D:\837Test.clm" "2300" "D:\837Unbundle" "{0}\{1}_Output_{2:000}{3}"

If the 837 input file had 2 claims in it, then "837Test.clm_Output_001.clm" and "837Test.clm_Output_002.clm" would be created in the D:\Output directory.

5 argument example:

UnbundleX12 "D:\837Test.clm" "2300" "D:\837Unbundle" "{0}\{1}_Output_{2:000}{3}" "true"

If the 837 input file had 2 claims in it, then "837Test.clm_Output_001.clm" and "837Test.clm_Output_002.clm" would be created in the D:\Output directory formatted with whitespace indentation.

Unbundling Tips:

  • To unbundle 837 files into individual claims, use loop ID 2300
  • To unbundle 835 files into individual remittance EOBs, use loop ID 2100
  • If the resulting X12 file is "unreadable" by an EDI application try turning off the whitespace option (see fifth argument)

For further technical explanation of the unbundle feature, see Unbundling an X12 file by Loop ID.

Usage as development tool:

Supported Transaction Sets:

See a full list of supported transactions here: https://x12parser.codeplex.com/wikipage?title=Transaction%20Set%20Configuration.

To request another transaction set, please add an issue to the issue tracker http://x12parser.codeplex.com/WorkItem/Create.

Other Discussions

Other Useful Tools

Last edited Sep 15, 2013 at 11:20 AM by dstrubhar, version 68

Comments

lstorie Sep 24 at 9:22 PM 
I'm having trouble with this - the HL segments on my unbundled claims are wrong. Sometimes the hierarch id number starts with 1 as it should (HL*1**20*1~), other times it's coming out with random HL id value higher than 1 - (HL*3**20*1~). With only one claim per ISA-IEA envelope, the first HL segment should always be ID 1. Any ideas?

EdiGuy411 Jan 2 at 3:59 PM 
Excellent work!

bobmihada Jan 28, 2012 at 9:45 AM 
WOW THIS IS SWEET. THANK YOU!!!