pip install edifabric-x12
bd96a836feca45cb91c86ee65d281f52.import json
import edifabric_x12 as ef
serial = "YOUR_SERIAL_KEY" # or the demo key 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)
transactions = output[:offset]
report = json.loads(output[offset:])
print(report["errors_count"])
Mode 3 validates, here at HIPAA SNIP level 4, and returns the acknowledgment with the report.
config = json.dumps({
"validate": {"snip_level": 4, "max_errors": 0},
"ack": {"gen997": False, "supress_ta1": False},
})
output, offset = ef.parse(edi, ef.ParseMode.JSON_VALIDATE_ACK, config)
report = json.loads(output[offset:])
print(report["errors_count"], report["ack"]) # the 999 as X12
Change the JSON, or create it from your own data, and build the X12 file.
edi_text = ef.build(transactions, postfix="\r\n")
The JSON property names come from each transaction's model. See them in the EDI spec library, or in the transaction guides below. The full API, configuration and error codes are in the Python bindings on GitHub and the ediFabric Native docs.
Parse an interchange to JSON with readable property names, change it in Python, and build valid X12 again with the right delimiters and trailers.
Validate up to HIPAA SNIP level 4: codes, lengths, required segments, loops and situational rules, with the segment each error is in.
Generate the acknowledgment your trading partner expects in the same call that validates the file.
Split an interchange into transaction sets and merge them back with iter_split and iter_merge generators, without loading the whole file.
One native library, bundled in the PyPI package. No runtime, no service to call, and EDI files and PHI stay on your servers.
Use the standard models from the EDI spec library, or a partner-specific model built in the EDI Spec Builder.
| X12 837P | Health care claim: professional |
| X12 837I | Health care claim: institutional |
| X12 837D | Health care claim: dental |
| X12 835 | Claim payment/advice |
| X12 834 | Benefit enrollment and maintenance |
| X12 270 | Eligibility inquiry |
| X12 271 | Eligibility response |
| X12 276 | Claim status request |
| X12 277 | Claim status response |
| X12 277CA | Claim acknowledgment |
| X12 278 | Services review |
| X12 820 | Premium payment |
ctypes wrapper that grows output buffers and retries for you, and raises EdiFabricError on failure.Yes. ediFabric Native is included in the free Community plan, which never expires: unlimited operations for the first 14 days, then 250 a day, for non-production use. To try it without an account, use the demo serial key bd96a836feca45cb91c86ee65d281f52. Production use starts with the Developer plan at $179 a year.
No. The library runs inside your Python process and parses, validates and builds files locally. Only the license check goes over the network, and the EDI file is never part of it. With an Enterprise or Perpetual offline token, translation runs fully offline.
Any X12 transaction set that has a model: HIPAA 5010 claims, remittances, enrollment and eligibility, and supply-chain transactions such as 850, 856 and 810, in the X12 versions the EDI spec library covers. Models download on demand from the EDI spec library, or you map local OpenEDI JSON models, including ones customized for a trading partner.
Yes. It validates up to HIPAA SNIP level 4 and returns each error with the segment it's in, and it generates 999, 997 and TA1 acknowledgments in the same call.
ediFabric Native supports X12 and HIPAA today. For EDIFACT, EANCOM, HL7, NCPDP, VDA and flat files, use ediFabric .NET or the ediFabric Cloud REST API, which come with the same plan.
Also for Node.js · Java · Go · Rust, C# and C, in ediFabric Native. For typed C# objects and all ten EDI standards, see ediFabric .NET.