25
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.

Ed i File Validator

  • Upload
    azam563

  • View
    29

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Ed i File Validator

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 NumbersFramework 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.

RequirementFramework 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 RequirementFramework 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.

Page 2: Ed i File Validator

Minimum and Maximum LengthFramework 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 UsageFramework 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 RepeatFramework 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 RulesFramework 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 ListFramework EDI reads the Code List of data elements in a SEF file to determine if a

Page 3: Ed i File Validator

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.  

Page 4: Ed i File Validator

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

Page 5: Ed i File Validator

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.

Page 6: Ed i File Validator

TriggersFramework 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.

Page 7: Ed i File Validator

 

Page 8: Ed i File Validator

Validating EDIFACT FilesTo 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.

Page 9: Ed i File Validator

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

Page 10: Ed i File Validator

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(){

//

Page 11: Ed i File Validator

// 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//

Page 12: Ed i File Validator

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 effecientoSchemas = oEdiDoc.GetSchemas();oSchemas.EnableStandardReference = false;

// Load the SEF fileoSchema = oEdiDoc.ImportSchema(sPath + sSefFile, 0);

// Set termintorsoEdiDoc.SegmentTerminator ="~{13:10}" ; //tilde followed by a carraige return

line feedoEdiDoc.ElementTerminator ="*";oEdiDoc.CompositeTerminator =":";

// create the interchange segmentoInterchange = oEdiDoc.CreateInterchange("X", "004010");

Page 13: Ed i File Validator

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 segmentoGroup = 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 HEADERoTransactionset = 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 LEVELediDataSegment.Set(ref oSegment, oTransactionset.CreateDataSegment("HL\\

HL"));oSegment.set_DataElementValue(1, 0, "1");oSegment.set_DataElementValue(3, 0, "20");

Page 14: Ed i File Validator

oSegment.set_DataElementValue(4, 0, "1");

//---------------------------------------------------------------------------------

// INFORMATION SOURCE NAMEediDataSegment.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 LEVELediDataSegment.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 NAMEediDataSegment.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");

Page 15: Ed i File Validator

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 LEVELediDataSegment.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 NUMBERediDataSegment.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");

Page 16: Ed i File Validator

//------------------------------------------------------------// SUBSCRIBER ADDITIONAL IDENTIFICATIONediDataSegment.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 INFORMATIONediDataSegment.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 DATEediDataSegment.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 INFORMATIONediDataSegment.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 AMOUNTediDataSegment.Set(ref oSegment,

oTransactionset.CreateDataSegment("HL(3)\\NM1\\EQ\\AMT"));oSegment.set_DataElementValue(1, 0, "R");oSegment.set_DataElementValue(2, 0, "37.5");

Page 17: Ed i File Validator

//--------------------------------------------------------------------------------

//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"));

Page 18: Ed i File Validator

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");

//-------------------------------------------------------------------------------

//-------------------------------------------------------------------------------

Page 19: Ed i File Validator

//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 INFORMATIONediDataSegment.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 DATEediDataSegment.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");

}

}}