Index
Loading Typed Document
After validation an entire EDI document can be converted to a Typed Document.
Example
ediValidator.Validate();
// The EDILightWeightDocument will contain all the data of a loaded EDI file, for example
if (ediValidator.EDILightWeightDocument != null)
{
// Creates and loads a TypedDocument
Typed5010Document doc = newTyped5010Document(ediValidator.EDILightWeightDocument);
DocumentLoop interchange = doc.MainSection.GetLoop(“INTERCHANGE HEADER”);
// From here on you can access objects rather than indexes from arrays to get data
DisplayInterchangeHeader(interchange);
DisplayFunctionalHeader(interchange.GetLoop(“FUNCTIONAL GROUP”));
ISA header = interchange.GetSegment<ISA>();
DocumentLoop functionalHeaderLoop = interchange.GetLoop(“FUNCTIONAL GROUP”);
DocumentLoop stHeaderLoop = functionalHeaderLoop.GetLoop(“ST HEADER”);
// Get the submitter loop. In an 837 file the submitter loop is 1000A
DocumentLoop submitterSection = stHeaderLoop.GetLoop(“1000A”);
DisplaySubmitterInformation(submitterSection);
// Get the receiver loop. In an 837 file the receiver loop is 1000B
DocumentLoop receiverSection = stHeaderLoop.GetLoop(“1000B”);
DisplayReceiverInformation(receiverSection);
// Get the 2000A BILLING/PAY-TO PROVIDER HIERARCHICAL LEVEL
// In an 837 file this loop is 2000A
DocumentLoop bpHierLevel = stHeaderLoop.GetLoop(“2000A”);
DocumentLoop billingProviderLoop = bpHierLevel.GetLoop(“2010AA”);
DisplayBillingProviderInformation(billingProviderLoop);
// Get all the subscribers and claims information
List<DocumentLoop> subscriberAndClaimsSections = bpHierLevel.GetLoops(“2000B”);
DisplayAllClaims(subscriberAndClaimsSections);
}
A potential display procedure can be
private void DisplayBillingProviderInformation(DocumentLoopbillingProviderNameSection)
{
// Get the Billing Provider’s name
NM1 nm1 = billingProviderNameSection.GetSegment<NM1>();
txtBillingProviderName.Text = nm1.NameLastOrOrganizationName + nm1.FirstName;
// Get the street address
N3 n3 = billingProviderNameSection.GetSegment<N3>();
txtProviderStreet.Text = n3.AddressInformation1;
// Get the city state and zip code
N4 n4 = billingProviderNameSection.GetSegment<N4>();
txtProviderAddress.Text = n4.CityName + “,” + n4.StateOrProvinceCode + “,” + n4.PostalCode;
}