-
Notifications
You must be signed in to change notification settings - Fork 16
Documentation
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.
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.
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.
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.
- 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.
The most common use case of this parser is to transform the XML into a flat representation to be pushed into a database or into flat files to be consumed by other applications. See Creating a flat file or Excel file from the X12 xml using XSLT and XslCompiled Transform to see how to create a flattened version of the x12 transaction.
Other transaction sets can be parse by creating and injecting your own specification file. See Injecting your own X12 Specification.
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.
- Deidentifier for removing PII and PHI (http://etasoft.com/ot.htm) especially for creating test files.
- If you are new to EDI this a good place to start: http://www.xtranslator.com/prod/beginguidex12.pdf. This is a pretty decent product too if you have a few thousand dollars to spare.
- FO Processor for transforming FO-XML into PDF http://fonet.codeplex.com.