var edi = File.OpenRead(@"C:\837P_Claim.txt"); using (var reader = new X12Reader(edi, "EdiFabric.Templates.Hipaa")) { var claims = (await reader.ReadToEndAsync()).OfType<TS837P>(); foreach (var claim in claims) { if (claim.IsValid(out MessageErrorContext errors)) Console.WriteLine(claim.ST.TransactionSetControlNumber_02); else Console.WriteLine(string.Join("\n", errors.Flatten())); } }
import ctypes, json lib = ctypes.CDLL("./edifabric-x12-tools.so") lib.parse.restype = ctypes.c_int def parse(edi: bytes, mode: int = 1) -> str: cap = len(edi) * 12 out_len = ctypes.c_int(0); out_off = ctypes.c_int(0) while True: out = ctypes.create_string_buffer(cap) rc = lib.parse(edi, len(edi), mode, None, 0, out, cap, ctypes.byref(out_len), ctypes.byref(out_off)) if rc == 1: cap = out_len.value; continue if rc != 0: raise RuntimeError(f"parse failed: {rc}") return out.raw[:out_len.value].decode("utf-8")
curl -L -X POST 'https://api.edination.com/v2/x12/read' \ -H 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' \ -H 'Content-Type: text/plain' \ --data-binary '@/C:/purchase-order.edi'
{
"ST": {
"TransactionSetIdentifierCode_01": "837",
"TransactionSetControlNumber_02": "000000001",
"ImplementationConventionPreference_03": "005010X222A1"
},
"BHT_BeginningOfHierarchicalTransaction": {
"HierarchicalStructureCode_01": "0019",
"TransactionSetPurposeCode_02": "00",
},
"AllNM1": {
"Loop1000A": {
"NM1_SubmitterName": {
"EntityIdentifierCode_01": "41",
"EntityTypeQualifier_02": "2",
},
"PER_SubmitterEDIContactInformation": [
{
"ContactFunctionCode_01": "IC",
"ResponseContactName_02": "JERRY",
}
...
Fully managed C# library for .NET Core and .NET Framework, installed as a NuGet package. Translates between EDI and typed .NET objects. Covers all ten EDI standards, custom flat files and Entity Framework mapping.
One native library per platform (Windows, Linux, macOS), callable over a C ABI from C, C++, Rust, Go, Python, Node.js, Java and .NET. Translates EDI to structured JSON. X12 and HIPAA today, more standards to follow.
REST API for all 10 EDI standards - call it from any language, with nothing to install. Translates EDI to structured JSON. Hosted by us, or self-hosted on your own infrastructure when data must stay in your network.
Safely parse, validate, format, and edit EDI files directly in your browser.
Powered by WebAssembly, your sensitive EDI data never leaves your device.
Completely free. Unlimited files. No size limits. Works with EDI and JSON. No account or registration is needed.
Learn about EdiNation
TransactionSetControlNumber_02 instead of counting delimiters. Validate whatever it produces against the same templates before it reaches a trading partner.
Working with PHI or under SOC 2? ediFabric .NET and ediFabric Native run entirely inside your own application, so your EDI data never leaves your network. Self-host the Cloud API and you get the same guarantee - note that the Cloud API we host is not HIPAA or SOC compliant, because your files are sent to it.