Auto-Completion Rules
This topic provides information about auto-completion rules that apply to various EDI standards. In EDI, auto-completion rules determine what missing, incomplete, and conditionally required data elements in EDI transactions are automatically filled in with before transmission. These rules ensure compliance with EDI standards and prevent rejected transactions due to missing or incorrect data.
EDI auto-completion rules are closely correlated with standard-specific validation checks: If validation detects missing or incorrect data, auto-completion rules fill in the missing values to ensure data accuracy and compliance.
The auto-completion rules are described below. To disable auto-completion, clear the Auto-complete missing fields check box in the EDI Component Settings.
Auto-completion rules for UN/EDIFACT
Depending on the type of UN/EDIFACT messages, MapForce may automatically create certain fields and values, using the auto-completion rules described below.
Standard EDIFACT messages
The UNA segment is written at the beginning of an output file unless the Suppress UNA segment option (EDI Component Settings) has been set.
If something is mapped to the UNB segment, the following fields are completed:
•UNB/S001/F0001 is set to the Component Settings/Extended/Controlling Agency + Component Settings/Extended/Syntax Level. The default value is UNOA.
•UNB/S001/F0002 is set to the Component Settings/Extended/Syntax Version Number. The default value is 4.
•UNB/S002/F0004 is filled in with the Sender.
•UNB/S003/F0010 is filled in with the Recipient.
•UNB/S004/F0017 is set to the current date.
•UNB/S004/F0019 is set to the current time.
Only in generated code is the UNG segment completed as follows:
•UNG/S004/F0017 is set to the current date.
•UNG/S004/F0019 is set to the current time.
•UNG/F0051 is set to the Component Settings/Extended/Controlling Agency (the first 2 characters are taken).
For each message, the following segments/fields are auto-filled:
•UNH/F0062 is auto-completed with 0.
•UNH/S009/F0065 is auto-completed with the message type, for example, ORDERS.
•UNH/S009/F0052 is set to <Config>/<Meta>/<Version>.
•UNH/S009/F0054 is set to <Config>/<Meta>/<Release>.
•UNH/S009/F0051 is set to the Component Settings/Extended/Controlling Agency (the first 2 characters are taken).
•UNT/F0074 is auto-completed with the count of segments (including UNH and UNT) in the message.
•UNT/F0062 is copied from UNH/F0062 which in turn is completed with 0.
The UNE segment is written if the UNG segment has something mapped to it:
•UNE/F0060 is auto-completed with the count of messages in the group.
•UNE/F0048 is copied from UNG/F0048.
The UNZ segment is written if the UNB segment has something mapped to it:
•UNZ/F0020 is copied from UNB/F0020.
•UNZ/F0036 is auto-completed with the count of messages in the interchange or with the number of groups if at least one group is present.
Interactive EDIFACT messages
UNA is written at the beginning of an output file unless the Suppress UNA segment option (EDI Component Settings) has been set.
If something is mapped to the UIB segment, the following fields are auto-completed:
•UIB/S001/F0001 is set to the Component Settings/Extended/Controlling Agency + Component Settings/Extended/Syntax Level (UNOA by default).
•UIB/S001/F0002 is set to the Component Settings/Extended/Syntax Version Number (the default value is 4).
•UIB/S002/F0004 is filled in with the Sender.
•UIB/S003/F0010 is filled in with the Recipient.
•UIB/S300/F0338 is set to the current date.
•UIB/S300/F0314 is set to the current time.
For each message, the following segments/fields are auto-filled:
•UIH/S306/F0065 is completed with the message type (e.g., ORDERS).
•UIH/S306/F0052 is set to <Config>/<Meta>/<Version>.
•UIH/S306/F0054 is set to <Config>/<Meta>/<Release>.
•UIH/S306/F0051 is set to the Component Settings/Extended/Controlling Agency (the first 2 characters are taken).
•UIH/F0340 is auto-completed with 0 only in generated code.
•UIT/F0074 is auto-completed with the count of segments (including UNH and UNT) in the message.
•UIT/F0340 is copied from UIH/F0340.
The UIZ segment is written automatically if the UNB segment has something mapped to it.
•UIZ/F0036 is completed with the count of messages in the interchange.
ODETTE EDIFACT
The same rules apply as for EDIFACT, with the addition of the completion of single code values and conditions defined in the configuration file, in compliance with <Completion singleConditions="1" singleValues="1" />.
ASC X12 auto-completion rules
The ISA segment is auto-completed if something is mapped to it; otherwise, it is not written.
•ISA/FI01 is auto-completed with 00.
•ISA/FI02 is filled with spaces.
•ISA/FI03 is completed with 00.
•ISA/FI04 is filled with spaces.
•ISA/FI05_1 is auto-completed with ZZ.
•ISA/FI05_2 is auto-completed with ZZ.
•ISA/FI08 is auto-completed with the current date.
•ISA/FI09 is auto-completed with the current time.
•ISA/FI10 is filled with a space.
•ISA/FI65 is filled with a repetition separator.
•ISA/FI11 is filled with the interchange control version number from the Component Settings/Extended/Interchange control version.
•ISA/FI12 is set to zero.
•ISA/FI13 is filled with 1 or 0, depending on the Component Settings/Extended/Request Acknowledgment.
•ISA/FI14 is auto-completed with P.
•ISA/FI15 is auto-completed with a composite field separator.
The IEA segment is written if something is mapped to the ISA segment.
•IEA/I16 is auto-completed with the number of function groups in the interchange.
•IEA/I12 is auto-completed with the value from ISA/I12.
The GS segment is written and completed if something is mapped to it; otherwise, it is not written.
•GS/F373 is auto-completed with the current date.
•GS/F337 is auto-completed with the current time.
The GE segment is written if something is mapped to the GS segment.
•GE/F97 is auto-completed with the number of messages in the function group.
•GE/F28 is auto-completed with the value from GS/F28.
The ST and SE segments are always written for each message:
•ST/F143 is auto-completed with the first 3 characters of the message type from the configuration file.
•ST/F329 is filled with 4 spaces.
•SE/F96 is auto-completed with the number of segments in the message including ST and SE.
•SE/F329 is auto-completed with the value from ST/F329.
HIPAA X12
Includes all the X12 rules (see above).
The HL segment is auto-completed if the group it is in has something mapped to it.
•HL/F628 receives a hierarchical ID number.
•HL/F734 receives a parent hierarchical ID number.
•HL/F735 receives the value from the configuration file (single value code list).
•HL/F736 receives a hierarchical child code (1 if it contains children; otherwise, 0).
NCPDP SCRIPT
The UNA segment is written at the beginning of an output file unless the Suppress UNA segment option (EDI Component Settings) has been set.
The UIB segment is always written, and the following fields are auto-completed:
•UIB/S001/F0001 is set to the Component Settings/Extended/Controlling Agency + Component Settings/Extended/Syntax Level (UNOA by default).
•UIB/S001/F0002 is set to the Component Settings/Extended/Syntax Version Number (0 by default).
•UIB/S002/F0004 is filled in with the Sender.
•UIB/S003/F0010 is filled in with the Recipient.
•UIB/S300/F0017 is set to the current date.
•UIB/S300/F0114 is set to the current time.
•UIB/S045/F8006 is set to “Altova GmbH”.
•UIB/S045/F8007 is set to “MapForce”.
•UIB/S045/F8008 is set to the MapForce release version (e.g., 2025r2).
For each message, the following segments/fields are auto-filled:
•UIH/S306/F0329 is set to SCRIPT.
•UIH/S306/F0316 is set to <Config>/<Meta>/<Version> (e.g., 010 for 10.6).
•UIH/S306/F0318 is set to <Config>/<Meta>/<Release> (e.g., 006 for 10.6).
•UIH/S306/F0326 is auto-completed with the message type from the configuration file (e.g., GETMSG).
•UIH/S300/F0017 is set to the current date.
•UIH/S300/F0314 is set to the current time.
•UIH/F0062 is auto-completed with 0.
•UIT/F0062 is copied from UIH/F0062 which in turn is auto-completed with 0.
•UIT/F0074 is auto-completed with the count of segments (including UIH and UIT) in the message.
The UIZ segment is always written:
•UIZ/F0036 is completed with the count of messages in the interchange.
TRADACOMS
The STX segment is always written and auto-completed:
•STX/STDS/STDS-1 is auto-completed with ANA. Manually map the ANAA value if the RSGRSG group is mapped.
•STX/STDS/STDS-2 is set to 1.
•STX/TRDT/TRDT-1 is set to the current date.
•STX/TRDT/TRDT-2 is set to the current time.
For each message, the following segments/fields are auto-filled:
•MHD/MSRF is auto-completed with an auto-incrementing number, starting with 1.
•MHD/TYPE/TYPE-1 is auto-completed with the message type from the configuration file (e.g., ORDHDR).
•MHD/TYPE/TYPE-2 is auto-completed with the message version number from the configuration file (e.g., 9).
•MTR/NOSG is auto-completed with the count of segments (including MHD and MTR) in the message.
For each Batch group where something is mapped to the BAT segment, the following happens:
•EOB/NOLI is auto-completed with the count of messages in the batch.
The END segment is always written and auto-completed:
•END/NMST is auto-completed with the count of messages in the interchange.
VDA FIXED
In all segments, the F02 field is completed with the segment version number based on which the configuration file was created. In addition, the last segment XX9 or the record counter has fields that are auto-completed with the count of each segment type.
HL7 2.31 and above
Headers for a message, batch and file are auto-completed with mandatory fields:
•FHS/FHS-1, BHS/BHS-1, MSH/MSH-1 is each auto-completed with the field separator that is used throughout the message.
•FHS/FHS-2, BHS/BHS-2, MSH/MSH-2 is each auto-completed with the encoding characters that define the separators, excluding the field separator.
Only in generated code are time stamps for the FHS and BHS segments auto-completed:
•FHS/FHS-7 is auto-completed with the current date and time.
•BHS/BHS-7 is auto-completed with the current date and time.
For each message, the following segments and fields are auto-completed:
•MSH/MSH-7 is auto-completed with the current date and time (v2.31 and above).
•MSH/MSH-9/MSG-1 is auto-completed with what comes before ‘_’ in the message type in the configuration file (v2.31 and above).
•MSH/MSH-9/MSG-2 is auto-completed with the trigger event that comes after ‘_’ in the message type in the configuration file (v2.31 and above).
•MSH/MSH-9/MSG-3 is auto-completed with the message type from the configuration file (v2.31 and above).
•MSH/MSH-12/VID-1 is set to <Config>/<Meta>/<Release>.
The FTS segment is written if something is mapped to FHS.
•FTS/FTS-1 is completed with the count of groups.
The BTS segment is written if something is mapped to BHS.
•BTS/BTS-1 is completed with the count of messages.
HL7 2.30 and below
Headers for a message, batch and file are completed with mandatory fields containing separators:
•FHS/FHS-1, BHS/BHS-1, MSH/MSH-1 is each completed with the field separator that is used throughout the message.
•FHS/FHS-2, BHS/BHS-2, MSH/MSH-2 is each completed with the encoding characters that define the separators, excluding the field separator.
Only in generated code are time stamps for the FHS and BHS segments auto-completed:
•FHS/FHS-7/TS-1 is auto-completed with the current date and time.
•BHS/BHS-7/TS-1 is auto-completed with the current date and time.
MSH/MSH-7/TS-1 is auto-completed with the current date and time only if the next field in the composite is mapped. In 2.30 and earlier versions, the field is optional and therefore not auto-completed unless something else, for example, the next field in the composite is mapped.
The FTS segment is written if something is mapped to FHS.
•FTS/FTS-1 is auto-completed with the count of groups.
The BTS segment is written if something is mapped to BHS.
•BTS/BTS-1 is auto-completed with count of messages.