Вы находитесь на странице: 1из 20

How Can We Validate an EDI File Format

EDI Validation
Because computers do not have the flexibility of reading and translating documents like humans do, it is important to have a standard file format in EDI so that computers can read and translate EDI documents correctly. It is also just as important for users who are processing EDI files to adhere to the EDI standard. One method of enforcing the EDI standard is to validate any incoming EDI documents before they get translated. Validation not only ensures a more accurate EDI translation, but also ensures a more robust automated process by detecting and rejecting EDI files with anomalies that could break the translation program and interrupt production. Framework EDI is a powerful tool that gives its user almost unlimited ability to validate an EDI file. It uses Standard Exchange Format (SEF) files to obtain the EDI file's implementation guideline, which will be used against the EDI file itself during validation. This web page will briefly describe how-and-what Framework EDI validates in an EDI file. Position Numbers Framework EDI reads the position numbers of data segments and data elements in a SEF file to determine the correct positions and ordering of data segments and data element in an EDI file. Requirement Framework EDI reads the Requirement of data segments and data elements in a SEF to determine if a data segment, or data element is Mandatory or Optional in an EDI file. User Requirement Framework EDI reads the User Requirement of data segments and data elements in a SEF file to determine if a data segment, or data element is Must Use, Not Used, or Used in an EDI file.

Minimum and Maximum Length Framework EDI reads the Minimum and Maximum Length of data elements in a SEF file to determine if the value length of a data element in an EDI file is within the minimum and maximum length range. Maximum Usage Framework EDI reads the Maximum Usage of data segments in a SEF file to determine the maximum number of times an instance of a data segment can be repeated in an EDI file. Loop Repeat Framework EDI reads the Loop Repeat count of loops in a SEF file to determine the maximum number of times an instance of a loop can be repeated in an EDI file. Syntax Rules Framework EDI reads the Syntax Rules for each data segments in a SEF file to determine the relationship of their data elements in an EDI file. An example of a syntax rule is - if either data element(1) or data element(2) is present, then the other data element must be present. Code List Framework EDI reads the Code List of data elements in a SEF file to determine if a code

used in a data element. in an EDI file is valid. Value List (available only in FREDI version 5.0.2005.403 and after ) Framework EDI reads the Value Reference of data elements in a SEF file to make sure the values of associated data elements in an EDI file follow the value expression defined, or is included in the list of values defined. For example, a data element in a SEF file can have a Value Reference expression "[0-9][0-9][0-9][0-9][0-9]", which means that the format of the value of the same data element in the EDI file can only contain numeric characters and must be 5 characters long.

Another example of the use of Value List is to have a list of values that are allowable for a specific data element. This is similar to a code list, but a Value List is more flexible in that a conditional statement (semantic references) can call it.

Semantic References (available only in FREDI version 5.0.2005.403 and after ) Framework EDI reads the Semantic References of data segments and data elements in a SEF File to determine if a conditional value, or existence of a data segment or data

element in an EDI file is valid. An example of a semantic reference is - if data element(3) equals "FI" then data element(4) use value reference TAXIDFORMAT.

Another example of a semantic reference is - if data element(3) value in SVC segment is greater than 0, then data segment AMT must be used.

Triggers Framework EDI reads Triggers in SEF files (under PRIVATE EDIdEv) to identify and hold separately the schema for each instance of data segments and loops, thus enabling Framework EDI to validate instances (identified by their qualifier) of a data segment or a loop in an EDI file. For example, an EDI file can have a loop with two instances having different requirements: one loop instance having the Payer information and having data segments N3 and N4 as mandatory; while the second loop instance having the Payee information, but having data segments N3 and N4 as optional.

By using SEF files to obtain the EDI implementation guideline, Framework EDI can almost have no limit to what it can validate in an EDI file. Basically, if a rule can be specified in the SEF file, then Framework EDI (using the same SEF file) will enforce the same rule in an EDI file. SEF files are text files, which can be edited with any text editor, or with our SEF Manager utility. For more details about editing a SEF file with the SEF Manager, please read Creating an Implementation Guideline. Below is a sample Visual Basic program that demonstrates how the Framework EDI component uses a SEF file to validate an EDI file. [View and run similar VB.NET source code]
Dim Dim Dim Dim Dim oEdiDoc As Fredi.ediDocument oWarnings As Fredi.ediWarnings oWarning As Fredi.ediWarning nWarningCount As Integer i As Integer

Set oEdiDoc = New Fredi.ediDocument 'Load SEF file oEdiDoc.ImportSchema sPath & "837_X098.SEF", Schema_Standard_Exchange_Format 'Load EDI file oEdiDoc.LoadEdi sPath & "837OUTPUT.X12" 'Check if FREDI detected any errors Set oWarnings = oEdiDoc.GetWarnings nWarningCount = oWarnings.Count 'If error count is greater than 0 then errors were found If nWarningCount > 0 Then 'Display errors in a List box For i = 1 To oWarnings.Count Set oWarning = oWarnings.Warning(i) List1.AddItem oWarning.Code & " " & oWarning.Description Next Else 'No errors found End If Set oEdiDoc = Nothing MsgBox "Done"

Validating EDIFACT Files


To validate existing EDIFACT files to make sure they match the schema, you can use the adapter technology already built in. You can download an example EDIFACT file to validate from here. (.ZIP, 77 Kb) Open the example EDIFACT file as shown below. Ensure that "Convert to XML Using Adapter" is selected, since the EDI file is not an XML file.

Next, Select the built-in Electronic Data Interchange (EDI) XML Converter option, keep the default conversion options, then click OK - Stylus Studio performs the EDI-to-XML conversion.

Now you're ready to validate the EDI data against the XML Schema that was generated earlier. To do this, associate the converted EDI data to the

INVOICE.xsd XML schema that was previously generated.

You can do this by selecting "XML" -> "Associate with XML Schema" from inside Stylus Studio, as illustrated here:

XML validation is important to ensure that your data is both syntactically well-formed and semantically accurate. Now that you have associated the XML Schema with the converted EDIFACT data, validation is easy. Click on the green checkmark icon in the XML Editor, choose a validating XML Schema processor, for example, MSXML 3.0, MSXML 4.0, MSXML 6.0, Xerces, XSV, Microsoft System.XML, etc. Stylus Studio validates the data and reports the status to the Output Window.

Voil! We have all of the tools we need to not only generate XML from EDIFACT, but also to validate it. We can also take that same XML file and write it through the adapter, and turn it back into a well-formed

EDIFACT document. This is especially useful with the advanced XML mapping functionality which can generate XSLT and XQuery to map either XML, EDI or many other formats to and from each other

Verify Your EDI It is important to have a standard file format in EDI so that computers can read and translate EDI documents correctly. It is also just as important for users who are processing EDI files to adhere to the EDI standard. Your Trading Partner's EDI Software will require standard EDI data. You will leave a bad impression on your customer by sending ill formatted data. Your customer will be irritated and think that your IT capabilities are inadequate. Avoid this by validating your intial testing with Embassy Software's EDI Validation free service. Validation not only ensures a more accurate EDI translation, but also ensures a more robust automated process by detecting and rejecting EDI files with anomalies that could break the translation program and interrupt production. Click on the link below. Send your file as an attachment. Please limit the attachment to one file with only one exchange (ISA/IEA set) and file size less than 10 K. Within a few minutes, Embassy's EDI Software (Passport/EDIValidator) will send you back a report detailing any errors with your file. If you are a Hub company and are being overwhelmed by bad data from your vendors, please contact us. We can setup a special email that they can send their test EDI to. It will check specific requirements you may have and pretest the data for you. PassportXChange is EDI software designed for Vendors, Carriers and small to medium size organiztions. Embassy Software has a well-established record of offering not only EDI solutions but also mapping and compliance services. Sample Code In C#.NET: using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using Edidev.FrameworkEDI; namespace CSharpGen270 { /// <summary> /// Summary description for Form1. /// </summary> public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.Button btnGen; private System.Windows.Forms.Label label1; /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.Container components = null; public Form1() { //

// Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // } /// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.btnGen = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // btnGen // this.btnGen.Location = new System.Drawing.Point(96, 96); this.btnGen.Name = "btnGen"; this.btnGen.Size = new System.Drawing.Size(104, 32); this.btnGen.TabIndex = 0; this.btnGen.Text = "Generate"; this.btnGen.Click += new System.EventHandler(this.btnGen_Click); // // label1 // this.label1.Location = new System.Drawing.Point(24, 16); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(264, 56); this.label1.TabIndex = 1; this.label1.Text = "This program is just an example of how to use the Framework EDI component in C# s" + "o as to generate an EDI file."; // // Form1 //

this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(304, 150); this.Controls.Add(this.label1); this.Controls.Add(this.btnGen); this.Name = "Form1"; this.Text = "Gen 270X092"; this.ResumeLayout(false); } #endregion /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.Run(new Form1()); } private void btnGen_Click(object sender, System.EventArgs e) { string sSefFile, sEdiFile, sPath; ediDocument oEdiDoc; ediInterchange oInterchange; ediGroup oGroup; ediTransactionSet oTransactionset; ediDataSegment oSegment = new ediDataSegment(); ediSchema oSchema; ediSchemas oSchemas; sPath = AppDomain.CurrentDomain.BaseDirectory; sSefFile = "270_X092.SEF"; sEdiFile = "270OUTPUT.x12"; oEdiDoc = new ediDocument(); // Change the cursor type from dynamic to forward to improve speed performance oEdiDoc.CursorType = DocumentCursorTypeConstants.Cursor_ForwardWrite; // Disable the internal standard reference library to be memory effecient oSchemas = oEdiDoc.GetSchemas(); oSchemas.EnableStandardReference = false; // Load the SEF file oSchema = oEdiDoc.ImportSchema(sPath + sSefFile, 0); // Set termintors oEdiDoc.SegmentTerminator ="~{13:10}" ; //tilde followed by a carraige return line feed oEdiDoc.ElementTerminator ="*"; oEdiDoc.CompositeTerminator =":"; // create the interchange segment oInterchange = oEdiDoc.CreateInterchange("X", "004010");

ediDataSegment.Set(ref oSegment, (ediDataSegment) oInterchange.GetDataSegmentHeader()); oSegment.set_DataElementValue(1, 0, "00"); //oSegment.set_DataElementValue(2, 0, "00"); oSegment.set_DataElementValue(3, 0, "01"); oSegment.set_DataElementValue(4, 0, "SECRET"); oSegment.set_DataElementValue(5, 0, "ZZ"); oSegment.set_DataElementValue(6, 0, "9999"); oSegment.set_DataElementValue(7, 0, "ZZ"); oSegment.set_DataElementValue(8, 0, "7777"); oSegment.set_DataElementValue(9, 0, "930603"); oSegment.set_DataElementValue(10, 0, "1230"); oSegment.set_DataElementValue(11, 0, "U"); oSegment.set_DataElementValue(12, 0, "00401"); oSegment.set_DataElementValue(13, 0, "000000905"); oSegment.set_DataElementValue(14, 0, "1"); oSegment.set_DataElementValue(15, 0, "T"); oSegment.set_DataElementValue(16, 0, ":"); // create the functional group segment oGroup = oInterchange.CreateGroup("004010X092"); ediDataSegment.Set(ref oSegment, (ediDataSegment) oGroup.GetDataSegmentHeader()); oSegment.set_DataElementValue(1, 0, "HS"); oSegment.set_DataElementValue(2, 0, "SENDER CODE"); oSegment.set_DataElementValue(3, 0, "RECEIVER CODE"); oSegment.set_DataElementValue(4, 0, "19970101"); oSegment.set_DataElementValue(5, 0, "0802"); oSegment.set_DataElementValue(6, 0, "1"); oSegment.set_DataElementValue(7, 0, "X"); oSegment.set_DataElementValue(8, 0, "004010X092");

// HEADER // TRANSACTION SET HEADER oTransactionset = oGroup.CreateTransactionSet("270"); ediDataSegment.Set(ref oSegment, (ediDataSegment) oTransactionset.GetDataSegmentHeader()); oSegment.set_DataElementValue(2, 0, "1234"); ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("BHT")); oSegment.set_DataElementValue(1, 0, "0022"); oSegment.set_DataElementValue(2, 0, "01"); oSegment.set_DataElementValue(3, 0, "12345"); oSegment.set_DataElementValue(4, 0, "20070329"); oSegment.set_DataElementValue(5, 0, "1225"); oSegment.set_DataElementValue(6, 0, "RT"); //-------------------------------------------------------------------------------// DETAIL INFO SOURCE LEVEL ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL\\HL")); oSegment.set_DataElementValue(1, 0, "1"); oSegment.set_DataElementValue(3, 0, "20");

oSegment.set_DataElementValue(4, 0, "1"); //--------------------------------------------------------------------------------// INFORMATION SOURCE NAME ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL\\NM1\\NM1")); oSegment.set_DataElementValue(1, 0, "PR"); oSegment.set_DataElementValue(2, 0, "2"); oSegment.set_DataElementValue(3, 0, "WILSON"); oSegment.set_DataElementValue(4, 0, "BILL"); oSegment.set_DataElementValue(8, 0, "PI"); oSegment.set_DataElementValue(9, 0, "87728"); //---------------------------------------------------------------------------------// INFORMATION RECEIVER LEVEL ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(2)\\HL")); oSegment.set_DataElementValue(1, 0, "2"); oSegment.set_DataElementValue(2, 0, "1"); oSegment.set_DataElementValue(3, 0, "21"); oSegment.set_DataElementValue(4, 0, "1"); //---------------------------------------------------------------------------------// INFORMATION RECEIVER NAME ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(2)\\NM1\\NM1")); oSegment.set_DataElementValue(1, 0, "1P"); oSegment.set_DataElementValue(2, 0, "1"); oSegment.set_DataElementValue(3, 0, "PATRICK"); oSegment.set_DataElementValue(4, 0, "FITZGERALD"); oSegment.set_DataElementValue(5, 0, "M"); oSegment.set_DataElementValue(8, 0, "SV"); oSegment.set_DataElementValue(9, 0, "0202034"); //----------------------------------------------------------------------------//INFORMATION RECEVIER ADDITIONAL IDENTIFICATION. ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(2)\\NM1\\REF")); oSegment.set_DataElementValue(1, 0, "N5"); oSegment.set_DataElementValue(2, 0, "129"); //----------------------------------------------------------------------------// INFORMATION RECEIVER ADDRESS. ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(2)\\NM1\\N3")); oSegment.set_DataElementValue(1, 0, "Cross street Dr."); oSegment.set_DataElementValue(2, 0, "Suite 987"); //----------------------------------------------------------------------------// INFORMATION RECEIVER CITY, STATE ZIP ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(2)\\NM1\\N4")); oSegment.set_DataElementValue(1, 0, "NewYork");

oSegment.set_DataElementValue(2, 0, "NY"); oSegment.set_DataElementValue(3, 0, "10023"); oSegment.set_DataElementValue(4, 0, "USA"); //-----------------------------------------------------------------------------// INFORMATION RECEIVER CONTACT INFORMATION ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(2)\\NM1\\PER")); oSegment.set_DataElementValue(1, 0, "IC"); oSegment.set_DataElementValue(2, 0, "BILLING DEPT"); oSegment.set_DataElementValue(3, 0, "TE"); oSegment.set_DataElementValue(4, 0, "2065551212"); oSegment.set_DataElementValue(5, 0, "EX"); oSegment.set_DataElementValue(6, 0, "2104"); oSegment.set_DataElementValue(7, 0, "FX"); oSegment.set_DataElementValue(8, 0, "2065551214"); //-----------------------------------------------------------------------------// INFORMATION RECEIVER PROVIDER INFORMATION ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(2)\\NM1\\PRV")); oSegment.set_DataElementValue(1, 0, "PE"); oSegment.set_DataElementValue(2, 0, "ZZ"); oSegment.set_DataElementValue(3, 0, "207K00000X"); //-----------------------------------------------------------------------------// SUBSCRIBER LEVEL ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(3)\\HL")); oSegment.set_DataElementValue(1, 0, "3"); oSegment.set_DataElementValue(2, 0, "2"); oSegment.set_DataElementValue(3, 0, "22"); oSegment.set_DataElementValue(4, 0, "1"); //------------------------------------------------------------------------------// SUBSCRIBER TRACE NUMBER ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(3)\\TRN")); oSegment.set_DataElementValue(1, 0, "1"); oSegment.set_DataElementValue(2, 0, "98175-02157"); oSegment.set_DataElementValue(3, 0, "9877281234"); //-------------------------------------------------------------------------------// SUBSCRIBER NAME //oSegment.Set(oSegment, oTransactionset.CreateDataSegment()); ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(3)\\NM1\\NM1")); oSegment.set_DataElementValue(1, 0, "IL"); oSegment.set_DataElementValue(2, 0, "1"); oSegment.set_DataElementValue(3, 0, "JONES"); oSegment.set_DataElementValue(4, 0, "EDWARD"); oSegment.set_DataElementValue(5, 0, "S"); oSegment.set_DataElementValue(8, 0, "MI"); oSegment.set_DataElementValue(9, 0, "11122333301");

//-----------------------------------------------------------// SUBSCRIBER ADDITIONAL IDENTIFICATION ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(3)\\NM1\\REF")); oSegment.set_DataElementValue(1, 0, "1L"); oSegment.set_DataElementValue(2, 0, "19430519"); //-----------------------------------------------------------------------------// //SUBSCRIBER ADDRESS INFORMATATION ,SUBSCRIBER CITY STATE ZIP ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(3)\\NM1\\N3")); oSegment.set_DataElementValue(1, 0, "435 th Street"); oSegment.set_DataElementValue(2, 0, "435 th Street"); ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(3)\\NM1\\N4")); oSegment.set_DataElementValue(1, 0, "NewYork"); oSegment.set_DataElementValue(2, 0, "NY"); oSegment.set_DataElementValue(3, 0, "14008"); //------------------------------------------------------------------------------// SUBSCRIBER DEMOGRAPHIC INFORMATION ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(3)\\NM1\\DMG")); oSegment.set_DataElementValue(1, 0, "D8"); oSegment.set_DataElementValue(2, 0, "19430917"); oSegment.set_DataElementValue(3, 0, "F"); //------------------------------------------------------------------------------//SUBSCRIBER RELATIONSHIP // SUBSCRIBER DATE ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(3)\\NM1\\DTP")); oSegment.set_DataElementValue(1, 0, "102"); oSegment.set_DataElementValue(2, 0, "D8"); oSegment.set_DataElementValue(3, 0, "19980818"); //-------------------------------------------------------------------------------// SUBSCRIBER ELIGIBILITY OR BENEFIT INQUIRY INFORMATION ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(3)\\NM1\\EQ\\EQ")); oSegment.set_DataElementValue(1, 0, "98"); oSegment.set_DataElementValue(3, 0, "FAM"); //-------------------------------------------------------------------------------//SUBSCRIBER SPEND DOWN AMOUNT ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(3)\\NM1\\EQ\\AMT")); oSegment.set_DataElementValue(1, 0, "R"); oSegment.set_DataElementValue(2, 0, "37.5");

//-------------------------------------------------------------------------------//SUBSCRIBER ELIGIBILITY OR BENEFIT ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(3)\\NM1\\EQ\\III")); oSegment.set_DataElementValue(1, 0, "BK"); oSegment.set_DataElementValue(2, 0, "486"); //------------------------------------------------------------------------------//SUBSCRIBER ADDITIONAL INFORMATION ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(3)\\NM1\\EQ\\REF")); oSegment.set_DataElementValue(1, 0, "9F"); oSegment.set_DataElementValue(2, 0, "66045"); //------------------------------------------------------------------------------//SUBSCRIBER ELIGIBILITY/BENEFIT DATE ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(3)\\NM1\\EQ\\DTP")); oSegment.set_DataElementValue(1, 0, "472"); oSegment.set_DataElementValue(2, 0, "D8"); oSegment.set_DataElementValue(3, 0, "19990707"); //------------------------------------------------------------------------------//DEPENDENT LEVEL ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(4)\\HL")); oSegment.set_DataElementValue(1, 0, "4"); oSegment.set_DataElementValue(2, 0, "3"); oSegment.set_DataElementValue(3, 0, "23"); oSegment.set_DataElementValue(4, 0, "0"); //-----------------------------------------------------------------------------//DEPENDENT TRACE NUMBER ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(4)\\TRN")); oSegment.set_DataElementValue(1, 0, "1"); oSegment.set_DataElementValue(2, 0, "98175-02157"); oSegment.set_DataElementValue(3, 0, "9877281234"); oSegment.set_DataElementValue(4, 0, "RADIOLOGY"); //------------------------------------------------------------------------------//DEPENDENT NAME ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(4)\\NM1\\NM1"));

oSegment.set_DataElementValue(1, 0, "03"); oSegment.set_DataElementValue(2, 0, "1"); oSegment.set_DataElementValue(3, 0, "SMITH"); oSegment.set_DataElementValue(4, 0, "MARY LOU"); oSegment.set_DataElementValue(5, 0, "R"); //------------------------------------------------------------------------------//DEPENDENT ADDITIONAL IDENTIFICATION ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(4)\\NM1\\REF")); oSegment.set_DataElementValue(1, 0, "SY"); oSegment.set_DataElementValue(2, 0, "003221234"); //------------------------------------------------------------------------------//DEPENDENT ADDRESS ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(4)\\NM1\\N3")); oSegment.set_DataElementValue(1, 0, "WATERLOO"); oSegment.set_DataElementValue(2, 0, "32 PARK ST"); //------------------------------------------------------------------------------//DEPENDENT CITY/STATE/ZIP CODE ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(4)\\NM1\\N4")); oSegment.set_DataElementValue(1, 0, "NEWYORK"); oSegment.set_DataElementValue(2, 0, "NY"); oSegment.set_DataElementValue(3, 0, "10023"); oSegment.set_DataElementValue(4, 0, "032"); //------------------------------------------------------------------------------//PROVIDER INFORMATION ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(4)\\NM1\\PRV")); oSegment.set_DataElementValue(1, 0, "PE"); oSegment.set_DataElementValue(2, 0, "ZZ"); oSegment.set_DataElementValue(3, 0, "207K00000X"); //------------------------------------------------------------------------------//DEPENDENT DEMOGRAPHIC INFORMATION ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(4)\\NM1\\DMG")); oSegment.set_DataElementValue(1, 0, "D8"); oSegment.set_DataElementValue(2, 0, "19430121"); oSegment.set_DataElementValue(3, 0, "M"); //------------------------------------------------------------------------------//-------------------------------------------------------------------------------

//DEPENDENT DATE ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(4)\\NM1\\DTP")); oSegment.set_DataElementValue(1, 0, "102"); oSegment.set_DataElementValue(2, 0, "D8"); oSegment.set_DataElementValue(3, 0, "19500808");

//------------------------------------------------------------------------------//DEPENDENT ELIGIBILITY OR BENEFIT INQUIRY INFORMATION ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(4)\\NM1\\EQ\\EQ")); oSegment.set_DataElementValue(1, 0, "30"); oSegment.set_DataElementValue(3, 0, "FAM"); //------------------------------------------------------------------------------//DEPENDENT ELIGIBILITY OR BENEFIT ADDITIONAL INQUIRY ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(4)\\NM1\\EQ\\III")); oSegment.set_DataElementValue(1, 0, "BK"); oSegment.set_DataElementValue(2, 0, "486"); //------------------------------------------------------------------------------//DEPENDENT ADDITIONAL INFORMATION ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(4)\\NM1\\EQ\\REF")); oSegment.set_DataElementValue(1, 0, "9F"); oSegment.set_DataElementValue(2, 0, "660415"); //------------------------------------------------------------------------------//DEPENDENT ELIGIBILITY/BENEFIT DATE ediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL(4)\\NM1\\EQ\\DTP")); oSegment.set_DataElementValue(1, 0, "472"); oSegment.set_DataElementValue(2, 0, "D8"); oSegment.set_DataElementValue(3, 0, "19570807"); //------------------------------------------------------------------------------oEdiDoc.Save(sPath + sEdiFile); MessageBox.Show("Done"); } } }

Вам также может понравиться