将 XML 转换为 X12 以及 X12 转换为 XML 的最佳方法

发布于 2024-07-12 02:41:32 字数 165 浏览 15 评论 0原文

正在寻找一个工具/库来将 XML 转换为 X12(270 - 医疗资格请求),然后将 X12 响应(271 - 资格响应)转换回 XML。 这将嵌入到服务器应用程序中(将考虑任何目标语言)。 我曾考虑过编写自己的 X12 解析器和生成器,但这个项目很可能会扩展到其他 X12 事务,我想找到一个可扩展的解决方案。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

虐人心 2024-07-19 02:41:32

我遇到过这个:
OopFactory X12 解析器 - https://x12parser.codeplex.com/releases/view/106524

极好的。 源代码结构良好,所有内容都建立在首次开放的基础上,甚至有单元测试。

拉入我的项目,它转换了我尝试过的所有文件。

它包含一个可以运行的命令行 exe - 但作为一个 .Net 人员,这个库确实令人印象深刻。

-更新-

简短的版本可以归结为这样的:

var fstream = new FileStream(fileName, FileMode.Open, FileAccess.Read);
var parser = new X12Parser();
var interchange = parser.ParseMultiple(fstream).First();
var x12Xml = interchange.Serialize();

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();
无声静候 2024-07-19 02:41:32

我最终创建了自己的 XML <-> x12 转换工具。 我遇到过一些商业产品(其中一个来自 EtaSoft,值得一试,因为它们的性能很好文档),但最终本土解决方案的优势太大了。

我确实使用 X12::Parser 中的配置文件作为基础对于 X12 解析器,本质上是将配置文件转换为代码,并消除管理配置文件的开销和错误处理,而理论上这些配置文件几乎永远不会改变。

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.

魂牵梦绕锁你心扉 2024-07-19 02:41:32

我可以说您应该不惜一切代价避免使用的一款产品是 EcMap。 我现在在 EDI 部门工作,已经有大约一年的使用经验了,我可以说,我很少见过界面设计更糟糕的应用程序(也许 Lotus Notes 除外)、更混乱的用户文档以及绝对荒谬的应用程序。许可计划。 它本质上是按 CPU 进行许可的(CPU 指的是核心,所以如果你有一个新的四核 CPU,你真的会很沮丧),并且根据我听到的最后一个报价,每个许可证超过 10K。

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.

吻风 2024-07-19 02:41:32

查看 pyx12

它包括 X12 到 XML 和 XML 到 X12 的脚本。

为什么选择Python? 因为您经常需要自定义 X12 文档来处理付款人和提供商之间允许的差异。

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.

困倦 2024-07-19 02:41:32

以下是使用 pyx12 写入 XML 文件的示例

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)

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)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文