<分区>
我正在寻找 C# 代码,将 271 医疗保健资格福利响应转换为更有用的格式,以便我可以将某些段和值显示到数据 GridView 中。我正在寻找可以用来分解这个东西的代码,因为它并不难,只是非常乏味,想知道是否有其他人这样做过并愿意分享。
谢谢!!
<分区>
我正在寻找 C# 代码,将 271 医疗保健资格福利响应转换为更有用的格式,以便我可以将某些段和值显示到数据 GridView 中。我正在寻找可以用来分解这个东西的代码,因为它并不难,只是非常乏味,想知道是否有其他人这样做过并愿意分享。
谢谢!!
最佳答案
有一个开源 X12 解析器 (OopFactory X12 Parser: https://x12parser.codeplex.com) 可以为您完成这项工作。
将任何 X12 文档转换为 Xml:
FileStream fstream = new FileStream("Sample1.txt", FileMode.Open, FileAccess.Read);
var parser = new X12Parser();
Interchange interchange = parser.Parse(fstream);
string xml = interchange.Serialize();
将任何 X12 文档转换为 Html:
var htmlService = new X12HtmlTransformationService(new X12EdiParsingService(suppressComments: false));
Stream ediFile = new FileStream("Sample.txt", FileMode.Open, FileAccess.Read);
string html = htmlService.Transform(new StreamReader(ediFile).ReadToEnd());
要将 X12 271 响应加载到 .Net 对象中,您可以使用:
FileStream fstream = new FileStream("Sample1.txt", FileMode.Open, FileAccess.Read);
var service = new EligibilityTransformationService();
EligibilityBenefitDocument eligibilityBenefitDocument = service.Transform271ToBenefitResponse(fstream);
关于c# - 任何人翻译 X12 271 医疗响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/731591/