EDI Tools for .NET is a .NET library that developers can easily install from Visual Studio or Code. .NET 8, .NET 6, and .NET Framework are supported.
EDI API is organized around REST and allows developers to utilize and automate all EDI file operations, such as read, write, validate and acknowledge.
Validate EDI syntax to immediately identify any issues in your EDI files with a visual highlight. Then correct and verify all errors in the EDI or the JSON editor.
var stream = File.OpenRead(@"C:\ClaimPayment_837P.txt"); List<IEdiItem> ediItems; using (var reader = new X12Reader(stream, "EdiFabric.Templates.Hipaa")) { var items = await reader.ReadToEndAsync(); ediItems = items.ToList(); } var claims837P = ediItems.OfType<TS837P>();
var claim837P = new TS837P(); // build claim var isa = new ISA(); // build ISA var gs = new GS(); // build gs using (var stream = new MemoryStream()) using (var writer = new X12Writer(stream)) { writer.Write(isa); writer.Write(gs); writer.Write(claim837P); }
var stream = File.OpenRead(@"C:\ClaimPayment_837P.txt"); using (var ediReader = new X12Reader(stream, (ISA isa, GS gs, ST st) => typeof(TS837P).GetTypeInfo(), new X12ReaderSettings { Split = true })) { while (ediReader.Read()) { var claim837P = ediReader.Item as TS837P; } }
var claims837P = ediItems.OfType<TS837P>(); foreach (var claim837P in claims837P) { MessageErrorContext errorContext; if (!claim837P.IsValid(out errorContext)) { var errors = errorContext.Flatten(); } }
var stream = File.OpenRead(@"C:\ClaimPayment_837P.txt"); List<IEdiItem> ediItems; using (var reader = new X12Reader(stream, "EdiFabric.Templates.Hipaa")) { ediItems = reader.ReadToEnd().ToList(); } var claims837P = ediItems.OfType<TS837P>(); foreach (var claim837P in claims837P) { var json = Newtonsoft.Json.JsonConvert.SerializeObject(claim837P); }
var stream = File.OpenRead(@"C:\ClaimPayment_837P.txt"); List<IEdiItem> ediItems; using (var reader = new X12Reader(stream, "EdiFabric.Templates.Hipaa")) { ediItems = reader.ReadToEnd().ToList(); } var claims837P = ediItems.OfType<TS837P>(); foreach (var claim837P in claims837P) { XDocument xml = claims837P.Serialize(); }
var stream = File.OpenRead(@"C:\ClaimPayment_837P.txt"); using (var reader = new X12Reader(stream, "EdiFabric.Templates.Hipaa")) while(reader.Read()) { var claim837P = reader.Item as TS837P; if(claim837P != null) { using (var db = new HIPAA_5010_837P_Context()) { claim837P.ClearCache(); db.TS837P.Add(claim837P); db.SaveChanges(); } } }