John,
Here is my take:
hciX12splitinterchange is used on mesages as they arrive and splits the X12 message into transaction sets each transaction set becoming a single message.
It also extracts the Envelope (ISA, GS, IEA, GE) and places the needed information in the Metadata USERDATA. The separator cahracters (which are in the ISA) are extracted and placed in another keyed entry in the USERDATA (SEPCHARS is high level key).
In the Xlate you see each 278 as a separate message and do whatever you need to.
If you are generating another X12 message then hciX12buildinterchange will be used as the message is sent (OB TPS) to reassemble the messages with the envelope. It appears batching is handled at this point as well.
Both of the above procs use the package X12lib which is in $HCIROOT/tcl/lib/X12lib/X12lib.
IF you are building an X12 mesage from a non X12 message (like HL/7 or FRL, or…) then you need to write a proc to put the appropriate information for the envelope and the desired SEPCHARS in the metadata yourself.
The Xlate appears to use a default set of separator characters for X12. Field = *, Segment = ~, Component = .
IF you do not want to use those separators it appears (I am in the process of confirming this now) that the message’s metadata USERDATA field needs to have a SEPCHARS keyed list entry with your desired separators.
If the above is true, that means one cannot use the XLate tester to acurately build an X12 message with other than the default separators. That is kind of a bummer!
Jim Kosloskey
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.