dotnet add package EdiFabric
License.EnsureToken("bd96a836feca45cb91c86ee65d281f52", seconds: 3600); 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 json import edifabric_x12 as ef serial = "bd96a836feca45cb91c86ee65d281f52" ef.load_library() ef.ensure_token(serial, 3600) ef.set_map(json.dumps({"default": serial, "maps": {}})) edi = open("837P_Claim.txt", "rb").read() output, offset = ef.parse(edi, ef.ParseMode.JSON_VALIDATE) report = json.loads(output[offset:]) if report["errors_count"] == 0: print(output[:offset]) else: print(report["errors"])
import com.edifabric.nativex12.EdiFabricX12; import com.edifabric.nativex12.ParseMode; import com.edifabric.nativex12.ParseResult; String serial = "bd96a836feca45cb91c86ee65d281f52"; EdiFabricX12.loadLibrary(); EdiFabricX12.ensureToken(serial, 3600); EdiFabricX12.setMap("{\"default\":\"" + serial + "\",\"maps\":{}}"); String edi = Files.readString(Path.of("837P_Claim.txt")); ParseResult result = EdiFabricX12.parse(edi, ParseMode.JSON_VALIDATE); System.out.println(result.getTransactions()); System.out.println(result.getReport());
const fs = require("fs"); const ef = require("edifabric-x12"); const serial = "bd96a836feca45cb91c86ee65d281f52"; ef.loadLibrary(); ef.ensureToken(serial, 3600); ef.setMap(JSON.stringify({ default: serial, maps: {} })); const edi = fs.readFileSync("837P_Claim.txt"); const { output, offset } = ef.parse(edi, ef.ParseMode.JSON_VALIDATE); const report = JSON.parse(output.slice(offset)); if (report.errors_count === 0) console.log(output.slice(0, offset)); else console.log(report.errors);
import ef "github.com/EdiFabric/edifabric-go-bindings" import _ "github.com/EdiFabric/edifabric-go-bindings/native" serial := "bd96a836feca45cb91c86ee65d281f52" ef.LoadLibrary("") ef.EnsureToken(serial, 3600) ef.SetMap([]byte(`{"default": "` + serial + `", "maps": {}}`)) edi, _ := os.ReadFile("837P_Claim.txt") output, offset, _ := ef.Parse(edi, ef.ParseJSONValidate, nil) var report struct { ErrorsCount int `json:"errors_count"` Errors json.RawMessage `json:"errors"` } json.Unmarshal(output[offset:], &report) if report.ErrorsCount == 0 { fmt.Println(string(output[:offset])) } else { fmt.Println(string(report.Errors)) }
use edifabric_x12 as ef; let serial = "bd96a836feca45cb91c86ee65d281f52"; ef::load_library(None)?; ef::ensure_token(serial, 3600)?; ef::set_map(&format!(r#"{{"default": "{serial}", "maps": {{}}}}"#))?; let edi = std::fs::read("837P_Claim.txt")?; let (output, offset) = ef::parse(&edi, ef::ParseMode::JsonValidate, None)?; let report: serde_json::Value = serde_json::from_str(&output[offset..])?; if report["errors_count"] == 0 { println!("{}", &output[..offset]); } else { println!("{}", report["errors"]); }
#include "edifabric_x12.h" const char *serial = "bd96a836feca45cb91c86ee65d281f52"; ef_parse_result result; if (ef_load_library(NULL) != 0) return 1; ef_ensure_token(serial, 3600); ef_set_map("{\"default\":\"bd96a836feca45cb91c86ee65d281f52\",\"maps\":{}}"); char *edi = read_file("837P_Claim.txt", NULL); /* helper in example_all_functions.c */ if (ef_parse(edi, EF_PARSE_JSON_VALIDATE, NULL, &result) == 0) { /* transactions = output[0 .. offset), report = output[offset .. length) */ fwrite(result.output.data, 1, (size_t)result.output.length, stdout); ef_free(result.output.data); }
# Parse, validate and get the 999 in one call (one operation) curl -X POST 'https://api.edination.com/v3/x12/parse?mode=3' \ -H 'Ocp-Apim-Subscription-Key: bd96a836feca45cb91c86ee65d281f52' \ -H 'Content-Type: application/octet-stream' \ --data-binary '@837P_Claim.txt' # Build EDI from JSON curl -X POST 'https://api.edination.com/v3/x12/build' \ -H 'Ocp-Apim-Subscription-Key: bd96a836feca45cb91c86ee65d281f52' \ -H 'Content-Type: application/json' \ --data-binary '@837P_Claim.json'
# Add the local server to Claude Code: files stay on your machine claude mcp add edifabric -- npx -y @edifabric/mcp # Or the hosted server, with nothing to install https://mcp.edifabric.com/mcp # Then ask in your own words > Validate claims.837 at SNIP level 4 and explain each error. validate_edi(input_path: "claims.837", snip_level: 4) valid: false, error_count: 1 segment 9, element 2: Invalid EDI code PRV*BI*PX*203BF0100Y
# Install, then validate a folder at SNIP level 4 npm install -g @edifabric/mcp edifabric validate inbound/ --snip 4 837p-claim.txt: valid (1 transaction set, 46 segments) 837p-claim-error.txt: 1 error segment 9, element 2: Invalid EDI code PRV*BI*PX*203BF0100Y # Split by claim, drop some, build the rest back edifabric split claims.837 --segment CLM --depth 4 --loop 2300 edifabric build claims.837-split -o claims-out.837
EDI inST*837*0021*005010X222A1~ BHT*0019*00*147383*20251015~ NM1*41*2******46*FWJ23~JSON out{ "ST": { "TransactionSetIdentifierCode_01": "837", "TransactionSetControlNumber_02": "0021", "ImplementationConventionPreference_03": "005010X222A1" }, "BHT_BeginningOfHierarchicalTransaction": { "HierarchicalStructureCode_01": "0019", "TransactionSetPurposeCode_02": "00", "SubmitterTransactionIdentifier_03": "147383", "TransactionSetCreationDate_04": "20251015" }, "AllNM1": { "Loop1000A": { "NM1_SubmitterName": { "EntityIdentifierCode_01": "41", "EntityTypeQualifier_02": "2", "IdentificationCodeQualifier_08": "46", "ResponseContactIdentifier_09": "FWJ23" } } } }

https://mcp.edifabric.com/mcp to Claude on the web, desktop or mobile, Claude Code, ChatGPT or Codex, and sign in with your ediFabric account. Best for checking and explaining a claim, order or invoice.
@edifabric/mcp, which also installs the edifabric command for scripts and CI.
edifabric command in every build, and see the segment that broke. When AI writes the mapper, its output is checked in every pull request.
# GitHub Actions: fail the build on invalid EDI - name: Validate the EDI our code generates run: npx -y -p @edifabric/mcp edifabric validate out/ -r --snip 4 env: EDIFABRIC_SERIAL: ${{ secrets.EDIFABRIC_SERIAL }} # The log shows each error and its segment 837p-claim-error.txt: 1 error segment 9, element 2: Invalid EDI code PRV*BI*PX*203BF0100Y Error: Process completed with exit code 1.
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, up to EF Core 10.
Explore ediFabric .NETOne native library per platform (Windows, Linux, macOS), callable over a C ABI from C, C++, Rust, Go, Python, Node.js, Java and .NET, with official packages on PyPI, npm, Maven Central, crates.io, Go modules and NuGet. Translates EDI to structured JSON. X12 and HIPAA today, more standards to follow.
Explore ediFabric NativeREST 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.
Explore ediFabric CloudSafely parse, validate, format, and edit EDI files directly in your browser.
EdiNation runs on WebAssembly, so your EDI data stays on your device.
Free, with unlimited files of any size. Works with EDI and JSON. Open it and start working right away, with no account or registration.
Learn about EdiNation
TransactionSetControlNumber_02 by name. 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 for the same guarantee. The Cloud API we host receives your files: on Enterprise it is available under a HIPAA Business Associate Agreement, and it is not SOC 2 certified.
bd96a836feca45cb91c86ee65d281f52.