The columns of each EDI Section within the same EDI Target File are defined by a collection of EDI Field records. The Field_Name defines the column name in the target file. The Section_ID, Data_Element_Name, Qualifier_Position, and Qualifier_Value comprise the Qualified Data Element which is used to identify if the source EDI record contains the value to be mapped.
For example, the MEA data element defines a measurement. The second position value is the Measurement Qualifier and may have the value "LN" for "Standard Length". So, to define the EDI Field named "Width", the Section_ID would be set to the ID of the appropriate section, the Data_Element_Name would be set to "MEA", the Qualifier_Position would be set to "2" and the Qualifier_Value would be set to "LN". When each MEA data element is processed, only the one with the LN qualifier found in the current EDI Section (or for an inherited EDI Field from a parent section) will be stored in the Width field. More than one qualifier can be specified with the Qualifier_Position and Qualifier_Value containing a matching delimited list of entries. The Qualifier fields will be empty if there is not a qualifier for the Data_Element_Name. For recurring fields (see Is_Recurring below) the Qualifier_Position is relative to the Recurring_Qualifier_Position and Recurring_Interval.
If an EDI specification has two "MEA" "LN" data elements that must be mapped to separate EDI Fields (e.g., Package Width and Width), then two EDI Section entries need to be defined and contain Qualified Data Elements that precede the two "MEA" data elements. Then the specification will have two EDI Fields with the Data_Element_Name of "MEA" and Qualifier Position of 2 and Qualifier Value of "LN" but one will point to the first EDI Section and the second will point to the second EDI Section. Then when the EDI file is processed, the Current EDI Section will be set to one, then the other. When the "MEA" "LN" data element is encountered, the value for the measurement will be mapped to the appropriate target field.
The Is_Inherited flag specifies that if the matching data element is found in a child EDI Section, it will still be processed for the parent EDI Section containing it.
The Data_Position identifies the position in the data element from which the EDI Field is populated. The first position following the Data_Element_Name is 1. For recurring fields (see Is_Recurring below), the Data_Position is relative to the Is_Recurring_Base_Position, with 1 being the first position.
If the Literal_Value is defined, then the Data Position is ignored, and the specified value is saved in the EDI Field instead. The value "[blank]" (without quotes) can be used to specify an empty literal value.
In cases where the output file needs to have the fields in a specific order (i.e., position-dependent format), the Field_Position attribute can be set to the column position, starting with the number 1. If this field is not populated, then the order of the columns will be non-deterministic.
In some cases, the EDI file may have multiple records (or occurrences) with fields representing the same data whose values need to be stored in numbered columns. For example, a file may have multiple records, each of which defines a Feature Bullet and the corresponding values need to be stored the columns Feature Bullet 1, Feature Bullet 2, etc. Such fields would be defined once in the EDI_Field repository with the Field_Name containing the name of the field without the number (such as "Feature Bullet") and the Is_Numbered field set to Yes. The Max_Numbered field specifies the total number of columns to be defined for the field, regardless of how many values are in the EDI file. For example, if a product only has 2 values for Feature Bullet x, and the Max_Numbered is set to 8, then the file will contain 8 numbered columns for Feature Bullet with only the first two columns having data. If there are multiple fields that are interleaved, (such as Certification Agency 1, Certification Number 1, Certification Agency 2, or Certification Number 2), the Numbered_Group attribute must be set to the same name for each field to be interleaved and the Numbered_Sequence attribute specifying the order those fields are to be listed. When a Numbered field is processed, no matter how each value is retrieved (such as from multiple EDI records, or multiple/recurring fields in a single EDI record, or a combination of both), the values will be stored in the order they were encountered.
Some EDI records may contain recurring fields in the same record, each being identified by a qualifier followed by the value. Any one specific qualifier may appear in any of the possible recurring field positions. For example, the following LIN record all need to populate the same target fields:
LIN*099977543214*EN*2099977543217*VN*ABC001*CH*USA*UP*099977543214*HD*AA10211002^
LIN*099977543214*VN*ABC001*UP*099977543214*EN*2099977543217*HD*AA10211002*CH*USA^
LIN*099977543214*HD*AA10211002*UP*099977543214*EN*2099977543217*VN*ABC001*CH*USA^
With using fixed mapping, each field to be extracted above would need to be defined five times, one for each possible position. Instead of a single EDI_Field can be defined for a given field with the flag Is_Recurring set to Yes along with the following Recurring attributes set to provide the specifics and the EDI Preprocessing will pick up the field in any of the possible positions. When Is_Recurring is set to Yes, the following EDI_Field attributes are applied differently:
- Qualifier_Position – relative position of the recurring qualifier. Typically, Qualifier_Position is an absolute and fixed value. For recurring fields, it is relative to the base position as describe below. The values for the qualifier position for recurring fields should be consecutive and start with 1.
- Data_Position - relative position of the recurring value. Typically, Data_Position is an absolute and fixed value. For recurring fields, it is relative to the base position as described below.
The additional fields are:
- Recurring_Interval – specifies how many positions each recurrent field requires (this is typically 2: one for the data qualifier and one for the value). This value should be one more than the total number of Qualifier_Position and Qualifier_Value pairs defined for the field.
-
Recurring_Base_Position – base position of the first recurring qualifier. This will be the position of the first qualifier for the first recurring field. The
position of each recurring qualifier can be calculated with the formula:
actual_qualifier_position = (Recurring_Interval * occurrence-1) + (Recurring_Base_Position -1 ) + Qualifier_Position.
For example, in the three example LIN records shown above, to extract the EN field, the Recurring_Base_Position would be set to 2, the Recurring_Interval set to 2, Qualifier_Position set to 1, the Qualifier_Value set to EN, the Data_Position set to 2, and the Recurring_Max_Values set to 5.
- Recurring_Max_Values – maximum number of occurrences of a recurring field in a record.
The Concatenate_Consecutive_Elements flag indicates whether the data value from consecutive qualified Data Elements should be concatenated. If set to Yes, they will be concatenated. If the Maximum_Consecutive_Elements is set, then only the specified number of elements will be concatenated. Any additional consecutive elements will be ignored.
Each EDI File has a designated repeating field delimiter. If this delimiter is encountered in a value, it will be converted to the delimiter defined by Repeating_Field_Delimiter. If it is undefined, then no conversion will take place.