Best way to convert XML to X12 and X12 to XML

2020-02-08 05:33发布

Looking for a tool/library to convert XML to X12 (270 - medical eligibility request) and then to convert the X12 response (271 - eligibility response) back to XML. This will be embedded in a server application (will consider any target language). I've toyed with idea of writing my own X12 parser and generator but this project will most likely expand to other X12 transactions and I'd like to find a solution that will be extensible.

标签: xml edi x12
5条回答
女痞
2楼-- · 2020-02-08 05:54

One product I can speak to that you should avoid at all costs is EcMap. Having had about a year of experience with it now in my own employment in an EDI department, I can say I have seldom seen an application with a more poorly designed interface (except perhaps Lotus Notes), more confusing user documentation, and an absolutely ridiculous licensing scheme. It's essentially licensed per CPU (by CPU they mean core, so you're really hosed if you've got a new quad-core CPU) and it's more than 10K per license by the last quote I heard.

查看更多
走好不送
3楼-- · 2020-02-08 05:56

Look at pyx12.

It includes scripts for X12 to XML and XML to X12.

Why Python? Because you'll often need to customize X12 documents to handle the allowed variations between payers and providers.

查看更多
Melony?
4楼-- · 2020-02-08 06:07

I came across this: OopFactory X12 Parser - https://x12parser.codeplex.com/releases/view/106524

Incredible. Source code was well structured, everything built on first open, even had unit tests.

Pulled into my project, it converted all the files I tried.

It includes a command line exe which worked - but as a .Net guy the library was really impressive.

-Update-

The short short version comes down to something like this:

var fstream = new FileStream(fileName, FileMode.Open, FileAccess.Read);
var parser = new X12Parser();
var interchange = parser.ParseMultiple(fstream).First();
var x12Xml = interchange.Serialize();
查看更多
smile是对你的礼貌
5楼-- · 2020-02-08 06:11

Here is an example of using pyx12 to write to an XML file

import pyx12.x12n_document
fd_source = "/path/to/edi/file"
output_file = "result.xml"
with open(output_file, 'w') as fd_xml:
    result = pyx12.x12n_document.x12n_document(param=param, src_file=fd_source,
                                               fd_997=None, fd_html=None, fd_xmldoc=fd_xml, xslt_files=None)
查看更多
唯我独甜
6楼-- · 2020-02-08 06:19

I ended up creating my own XML <-> x12 transformation tool. There were some commercial offerings that I came across (one of which, from EtaSoft, is worth checking out for their fine documentation) but ultimately the advantage of a homegrown solution was too great.

I did use the configuration files from X12::Parser as the basis for an X12 parser, essentially turning the config file into code and eliminating the overhead and error handling for managing configuration files that should in theory almost never change.

查看更多
登录 后发表回答