What OpenEDI is
EDI implementation guides describe transactions in prose and tables. People can read them, but programs can't, so every EDI tool has its own private way to store a spec.
OpenEDI uses the OpenAPI 3 schema object instead. A message, its loops, segments, composites and data elements become schemas, and a small set of x-openedi-* extensions adds what EDI needs on top: IDs, syntax rules, situational rules and group types. Any tool that reads OpenAPI can read an OpenEDI spec, and the same file works with X12, HIPAA, EDIFACT and the other standards in the spec library.
The format is open source under the MIT license and published in the OpenEDI Specification repository on GitHub.
Extensions
A spec only needs components.schemas. All values in the extensions are case-sensitive. The OpenEDI format reference covers each extension in detail.
| Extension | Used on | Meaning |
|---|---|---|
x-openedi-message-id | Message | The transaction set ID, such as 835 or INVOIC. |
x-openedi-message-standard | Message | The standard, X12 or EDIFACT. |
x-openedi-message-version | Message | The version, such as 005010X221A1 or D96A. |
x-openedi-loop-id | Loop | The loop ID, such as 2100. |
x-openedi-segment-id | Segment | The segment tag, such as TRN. |
x-openedi-composite-id | Composite | The composite data element ID, such as C003. |
x-openedi-element-id | Data element | The simple data element ID, such as 127. |
x-openedi-syntax | Segment, composite | Syntax rules between elements: paired (P), required (R), exclusion (E), conditional (C) and list conditional (L), followed by two-digit positions, for example P0304. |
x-openedi-situational | Segment, composite | HIPAA situational rules: required if (R), exclusion if (E) or not used (N), with positions and the trigger codes. |
x-openedi-group-type | Group | A group of segments or loops that appear in any order (anyOf), only one of them (oneOf), or in a fixed sequence (seqOf). |
x-openedi-loop-seq | Segment | A segment whose counter must increase across loop repeats, such as LX. |
Lengths use minLength and maxLength, usage uses required, repeats use array with maxItems, data types use format, and code lists use enum.
Example
The 835 message and its TRN reassociation trace number segment, from the 835 spec. Schemas are shortened.
"TS835": {
"type": "object",
"required": [ "BPR_FinancialInformation", "TRN_ReassociationTraceNumber", "AllN1" ],
"properties": {
"ST": { "$ref": "#/components/schemas/ST" },
"BPR_FinancialInformation": { "$ref": "#/components/schemas/BPR_FinancialInformation_2" },
"TRN_ReassociationTraceNumber": { "$ref": "#/components/schemas/TRN_DependentTraceNumber" }
},
"x-openedi-message-id": "835",
"x-openedi-message-standard": "X12",
"x-openedi-message-version": "005010X221A1"
},
"TRN_DependentTraceNumber": {
"type": "object",
"required": [ "TraceTypeCode_01", "CurrentTransactionTraceNumber_02", "OriginatingCompanyIdentifier_03" ],
"properties": {
"TraceTypeCode_01": {
"type": "string",
"allOf": [ { "$ref": "#/components/schemas/X12_ID_481" } ],
"x-openedi-element-id": "481"
},
"CurrentTransactionTraceNumber_02": {
"type": "string", "format": "X12_AN", "minLength": 1, "maxLength": 50,
"x-openedi-element-id": "127"
},
"OriginatingCompanyIdentifier_03": {
"type": "string", "format": "X12_AN", "minLength": 10, "maxLength": 10,
"x-openedi-element-id": "509"
}
},
"x-openedi-segment-id": "TRN"
}
Complete specs for the HIPAA 5010 transactions:
Tools that use OpenEDI
Every tool below reads the same OpenEDI file, so a spec you customize once works for viewing, parsing, validating and generating EDI.
EDI Spec Library
Standard specs to browse and download as OpenEDI, ediFabric .NET templates and ediFabric Native models.
EDI Spec Builder
Copy a standard spec, change it for a trading partner, and upload your own OpenEDI specs. Free in EdiNation.
EdiNation
Open, parse and validate EDI files against standard or custom OpenEDI specs in the browser.
ediFabric Native
Convert EDI to JSON and back from Python, Java, C or C#, with the models generated from OpenEDI specs. See EDI models.
ediFabric Cloud
Parse, validate and generate EDI through a REST API, with your own specs uploaded as OpenEDI.
SEF migration
Convert existing SEF files into OpenEDI specs.