Envelope-Based TPA
Data | X12, EDIFACT, TRADACOMS |
Programs |
Validation, Response Generator, Docsplitter TIBCO Foresight® Translator can use partner automation to select a map rather than a guideline. Please For details, refer TIB_translator_<n.n>_usersguide.pdf for details |
Selects | Validation profile, validation guideline, validation output directory, Response Gen INI (X12 data), Docsplitter INI |
The selection criteria consist of values in the interchange or group enveloping. You create a lookup file that Instream validation consults at each X12 GS, EDIFACT UNG or UNH, or TRADACOMS STX … based on one or more values in the interchange or group enveloping.
Example:
These changes can be made:
-
X12: At each functional group.
-
EDIFACT: At each UNG if available, or the UNH otherwise.
-
TRADACOMS: At each STX.
The last output path selected will be used.
For flexibility, you can separately choose whether to use TPA when:
-
Validating
-
Using Docsplitter
-
Using Response Generator
Overview of Envelope-based TPA with Instream programs | |||
---|---|---|---|
|
Validating |
Docsplitter |
Response Gen |
Invoking TPA |
PARTNERAUTOMATION in $dir.ini (Windows) or fsdir.ini (UNIX). For details, refer Turning on Envelope-Based TPA for Validation |
-TPA command line parameter. For details, refer Docsplitter Command Line |
-TPA command line parameter. For details, refer Response Generator Command Line |
Identifying lookup file |
CSV file identified by PARTNERAUTOMATION in For details, refer Lookup File Format |
CSV file identified by Docsplitter command line -TPA parameter. For details, refer Lookup File Format |
CSV file identified by Response Generator command line For details, refer Lookup File Format |
What it selects |
Validation guideline Validation profile Validation outbound path |
Docsplitter ini |
Response Gen ini |
Command line |
Omit the -g parameter on the validation command line. For details, refer Validation Command Line
|
Omit all command line parameters except -i, For details, refer Docsplitter Command Line |
Omit all command line parameters except -i and For details, refer Response Generator Command Line |
Changes at |
Every GS (X12). Every UNG or UNH. (EDIFACT). |
First GS in file. This selection is used for the entire file. |
First GS in file. This selection is used for the entire file. |
Standards |
X12 and EDIFACT |
X12 |
X12 |
Unmatched files |
Best guess for guideline. Default APF. Output specified on the command line. |
Always use guidelines from the validation detail results file. |
Always use guidelines from the validation detail results file. |
Turning on Envelope-Based TPA for Validation
This step is not necessary for the TPA for Response Generator or Docsplitter.
To enable TPA during validation:
-
Go to Instream’s bin directory and edit $dir.ini (Windows) or fsdir.ini (UNIX).
-
Go to the PARTNERAUTOMATION line under [UserTables].
-
If the line starts with a colon ( : ), remove the colon.
-
Replace the filename and path with the one for the TPA lookup file that you are going to create. Retain the quotation marks around the path and filename.
-
If you are not using content-based TPA also, be sure that there is a colon at the front of the CBPARTNERAUTOMATION line.
If you are using the Instream API
C# and C++ API
You only have the ability to call the $dir.ini or fsdir.ini located in Instream/bin and that file can only have a single partner automation entry. There is no way to call an alternate $dir.ini or fsdir.ini location and no way to make a direct reference to a partner automation .csv file. The InStream_partnerautomation object is not available for C# and C++.
Java API
You are able to make a reference to the .csv file directly using the InStream_partnerautomation object.
Setting up a Lookup File for TPA
Tools for Editing a Lookup file
-
A text editor like Notepad
-
When editing your lookup file, avoid using a spreadsheet program, which may delete leading zeros, reformat numbers, and otherwise cause havoc with the content.
Big Picture
To set up your lookup table with a text editor:
-
Copy one of these:
Instream’s Bin directory:
SamplePartnerAutomation.csv
Instream’s DemoData directory:
SampleTPA_DS_RG.csv
-
Edit it to match your requirements:
-
Use the filename and path that you specified in $dir.ini or fsdir.ini if you are using TPA during validation.
-
This should be the same filename and path that you will use with the -TPA command line for Docsplitter and Response Generator if you are using TPA with them.
You can use the same lookup table for validation, Docsplitter, and Response Generator, or you can use separate lookup tables for each.
-
- Use a text editor to add a line for each scenario for which you want to specify a guideline, profile file, or output directory, as explained below.
-
Save as a text file.
Lookup File Format
The lookup table is a plain text file containing rows of comma-separated values.
Top line:
-
The top line in the file contains headings.
-
For validation, the top line must contain 13 or more headings
-
For Docsplitter and Response Generator, the top line must contain 15 headings
-
The actual text in the headings does not matter
Other lines contain the information shown below. Required fields are marked with an asterisk.
Selection Criteria | |
---|---|
Column |
Notes |
GS08/UNG7-1+2/ STX01 (Version/Release
|
Required. X12 Example:
If the data contains a GS08 value of EDIFACT Example: For EDIFACT, this value will be in the UNG07-01+02 or, if there is no UNG, in the UNH02-02+03. TRADACOMS Example: For TRADACOMS, this will be STX0102 + “0” + STX0101. Example:
Value is 10ANA: 1+0+ANA=10ANA |
GS01/UNB1-1/ STX07 (Functional Identifier Code)
|
Required. X12 Example:
If the data contains a GS08 value as specified (see GS08 criteria above) AND the GS01 value EDIFACT Example: For EDIFACT, this value will be in the UNB1-1. TRADACOMS Example: For TRADACOMS, this value will be in the STX07. |
ISA05/UNB2-2/ STX02-01 (Sender Qualifier) |
Optional. |
ISA06/UNB2-1/ STX02-02 (Sender ID) |
Optional; do not include trailing blanks. |
ISA07/UNB3-2/ STX03-01 (Receiver Qualifier) |
Optional. |
ISA08/UNB3-1/ STX03-02 (Receiver ID) |
Optional; do not include trailing blanks. |
GS02/UNG2-1/ STX05 (Application Sender) |
Optional. For the GS02 and UNG2-1, Response Generator and Docsplitter read these in the first group (GS-GE or UMB-UNE) in each interchange. These values are then applied to each group within the interchange. (Response Generator and Docsplitter do not operate on TRADACOMS data.) |
GS03/UNG3-1/ STX06 (Application Receiver) |
Optional. For the GS03 and UNG3-1, Response Generator and Docsplitter read these in the first group (GS-GE or UMB-UNE) in each interchange. These values are then applied to each group within the interchange. (Response Generator and Docsplitter do not operate on TRADACOMS data.) |
Start Date |
Date when this entry becomes active. The date must be in the format YYYYMMDD. Example: June 3, 2008 is 20080603. If validation takes place before June 3, 2008, then this entry is ignored. |
End Date |
Date after which this entry becomes inactive. |
Your Settings |
|
---|---|
Guideline Name
|
Required; do not include the file extension .STD. Additional Requirements for 278 Transaction Entries If the GS08 contains 278, such as Include the response guideline, a vertical bar, and then the request guideline:
Example:
For 278s, Instream is programmed to look at the data’s BHT-02 to determine if this is a request or response:
If the GS08 contains 215, such as Include the Inquiry guideline, a vertical bar, and then the ResponsetoInquiry guideline:
Example:
For 5010X215s, Instream is programmed to look at the data’s BHT-02 to determine if this is an inquiry or response:
If the GS08 contains 216, such as Include the Notification guideline, a vertical bar, and then the Acknowledgment guideline:
Example:
For 5010x216s, Instream is programmed to look at the data’s BHT-02 to determine if this is a notification or acknowledgement:
If the GS08 contains 217, such as Include the Request guideline, a vertical bar, and then the Response guideline:
Example:
|
Profile File |
Optional; Instream validation APF file. Defaults to the Bin directory if you don’t specify a full path. If you specify a path, enclose it in double quotes if it contains spaces. If it does not contain spaces, omit the quotes. Do not end with a backslash. |
OutboundPath |
Optional; enclose the path in double quotes if it contains spaces. Otherwise, do not use quotes. End with a backslash (\). Examples:
Overrides –o operator in instream. |
RespIni |
Not for TRADACOMS. Optional; path and filename for Response Generator INI file. Defaults to In stream’s Bin directory if you don’t specify a full path. Do not use relative paths. If you specify a path, enclose it in double quotes if it contains spaces. If it does not contain spaces, omit the quotes. Do not end with a backslash. Examples:
The same Response Generator INI file is used for an entire interchange. The Response Generator cannot change in mid-interchange. This INI file cannot be invoked by the Response Generator -z parameter. It is exclusively for TPA. |
DocSplitIni |
Not for TRADACOMS. Optional; path and filename for Docsplitter INI file. Defaults to Instream’s Bin directory if you don’t specify a full path. Do not use relative paths. If you specify a path, enclose it in double quotes if it contains spaces. If it does not contain spaces, omit the quotes. Do not end with a backslash. Examples:
The same Docsplitter INI file is used for an entire interchange. Docsplitter cannot change in mid-interchange. This INI file can be invoked by the Docsplitter -s parameter if you don’t want to use TPA. In that case, the [CommandLine Option] section is ignored. |
Example Lookup File
GS08/UNG7-12/STX01,GS01/UNB1-1/STX07,ISA05/UNB2-2/STX02-01,ISA06/UNB2-1/STX02-02,ISA07/UNB3-2/STX03-01,ISA08/UNB3-1/STX03-02,GS02/UNG2-1/STX05,GS03/UNG3-1/STX06,Start Date,End Date,Guideline Name,Profile File,Outbound Path 004010X091A1,HP,,,,,,,,,835AW120,,,, D.93A,UNOA,,,,,,,,,MYCUSCAR_D93A,,,, 004010X094A1,HI,ZZ,CASEY,,,,,,,PDA278RP|PDA278RQ,,C:\files\casey\,, 004010X096A1,HC,,,,,,,,,PDSA837I,,,RespGenDemo.ini,C:\setupfiles\DS837.ini 10ANA,ORDHDR,,,,,,,,,Trad93,,,, 005010X216,HP,,,,,,,,,PDSA5010-278X216N|PDSA5010-278X216A,,,,
Explanation
First line |
(Wrapped in the example above but not in the lookup file). Headings. Ignored by Instream. |
||||||||
Second line |
When validating, Instream uses guideline 835AW120 if the data contains both of these:
|
||||||||
Third line |
When validating, Instream should use MYCUSCAR_D93A if the data contains both of these:
|
||||||||
Fourth line |
When validating, Instream should use either PDA278RP or PDA278RQ and write output to c:\files\casey if the data contains all of these:
If BHT-02 contains a value of 11, then Instream uses PDA278RP. This logic is programmed into Instream; you do not have to set it up. If BHT-03 contains a value of 13, then Instream uses PDA278RQ. |
||||||||
Fifth line |
Instream should use all of these:
|
||||||||
Sixth line | Instream should use the guideline Trad93 if the STX0102 contains 0 and the STX0101 contains ANA. | ||||||||
Seventh line |
When validating, if the GS08 contains 005010X216 and the GS01 contains HP, Instream should reference the BH-02:
|
How Instream Matches
-
If only one row matches the criteria, that row is used.
-
If more than one row matches:
-
The row that matches the most criteria will be used.
-
If all match the same number of criteria, the first matching row will be used.
-
-
When using the Java API, if the ISA partner information is missing or not found in the lookup file, Instream issues a 191 return code and creates a TA1.
If the GS01 or GS08 are not found in the partner lookup file, Instream issues a 191 return code and creates a TA1 and a 997 or 999.
Example 1
The 1st row matches 5 criteria, the 2nd row matches 6 criteria, and the 3rd row matches 8 criteria, so Instream uses row 3.
Enveloping
ISA*00* *00* *14*ISA06Name1b *20*ISA08Name1b *030402*1426*U*00401*000000219*1*T*: GS*HC*GS02Name1b*GS03Name1b*20030402*1426*219*X*004010X096A1
Lookup file
1. 004010X096A1,HC,14,,20,,GS02Name1b,,,,PDSA837ITest7,,,
2. 004010X096A1,HC,14,ISA06Name1b,20,,,GS03Name1b,,,PDSA837ITest8,,,
3. 004010X096A1,HC,14,ISA06Name1b,20,ISA08Name1b,GS02Name1b,GS03Name1b,,,PDSA837ITest9,,,
Example 2
Row 2 and 3 match the same number of criteria, so Instream uses row 2.
Enveloping. Same as example 1
Lookup file
1. 004010X096A1,HC,14,,20,,GS02Name1b,,,,PDSA837ITest7,,,
2. 004010X096A1,HC,14,ISA06Name1b,20,,,GS03Name1b,,,PDSA837ITest8,,,
3. 004010X096A1,HC,,ISA06Name1b,20,,GS02Name1b,GS03Name1b,,,PDSA837ITest9,,,
Example 3
Row 2 and 3 match more criteria than row 1 but assume that the validation date does not match the start and end dates in these rows. Therefore, they are ignored and row 1 is used.
Enveloping: same as example 1
Lookup file:
1. 004010X096A1,HC,14,ISA06Name1b,20,ISA08Name1b,,GS03Name1b,,,PDSA837ITest7,,,
2. 004010X096A1,HC,14,ISA06Name1b,20,ISA08Name1b,GS02Name1b,GS03Name1b,20091101,,PDSA837ITest8,,,
3. 004010X096A1,HC,14,ISA06Name1b,20,ISA08Name1b,GS02Name1b,GS03Name1b,20091101,20091102,PDSA837ITest9,,,
Command Lines
Validation Command Line
Omit parameters that Instream can look up in the lookup file. Instead of having to change the command line for different partner scenarios, the command line can be implemented like this for all scenarios:
HVInStream.exe -iInFile -oOutPath
Where:
-i and -o | Always required on the command line, even if you include an output directory in the lookup file. Instream uses the one in the lookup file if possible. If not, it uses the one on the command line. | ||||
-s | Use -s on the command line when you want to override the profile name in the lookup file. | ||||
-g |
This parameter determines whether TPA will be used:
If you validate a file with a partner scenario that is not in the lookup table, and no –g parameter is used on the command line, then Instream uses best-guess estimation based on information in the GS-08. Example that uses TPA:
Example that does not use TPA:
|
Docsplitter Command Line
When using TPA with Docsplitter, the command line should look like this:
DocSplitter.exe -iDTLfile -dDataFile -TPALookupFile
About command line parameters:
-
The -i, -d, and -TPA parameters must be used for Docsplitter TPA.
-
The -TPA parameter points to the lookup file for TPA.
-
Do not use any other parameters. Instead, include the settings in the setup file.
Example:
DocSplitter.exe -i"c:\DTLfiles\6claims_Results.txt"
-d"C:\EDIfiles\6claims.txt" –TPA”c:\lookupFiles\lookup1.csv”
The TPA lookup file will point to a Docsplitter setup file:
This Docsplitter setup file must contain a [CommandLine Option] section with these parameters:
Required |
Optional |
---|---|
ValidEdiOutputPathName | LogLevel |
InValidEdiOutputPathName | ReportFormat |
ReportFilePathName | |
Guideline |
For an example file, see TPA_DocSplitter1.ini in the Instream DemoData directory.
The contents of the Docsplitter setup file are documented in TIB_fsp-instream_<n.n.n>_DocSplitter.pdf. See the Docsplitter setup file section.
Docsplitter Command Line when Splitting from a 997
When using a 997 as the source of error information, rather than the validation detail results file, the command line should be in one of these formats:
DocSplitter.exe -dDataFile -iDTLfFile -e997File -TPALookupFile
DocSplitter.exe -dDataFile -gGuideline -e997File -TPALookupFile
About command line parameters:
-
The -d, -e997, and -TPA parameters must be used.
-
Either -i or -g must be used.
-
The -TPA parameter points to the lookup file for TPA.
-
Do not use any other parameters. Instead, include the settings in the Docsplitter setup file.
Example using detail fileDocsplitter.exe" -d"C:\EDIfiles\835-Demo1.txt"
-i"C:\DetailFiles\835-Demo1_Results.txt" -e997"C:\997s\835-Demo1.997"
-TPA"TPAlookupFiles\SampleTPA_997split.csv"
Example using guidelineDocsplitter.exe" -d"C:\EDIfiles\835-Demo1.txt" -gPDSA835
-e997"C:\997s\835-Demo1.997" -TPA"TPAlookupFiles\SampleTPA_997split.csv"
The TPA lookup file will point to a Docsplitter setup file:
The Docsplitter setup file must contain a [CommandLine Option] section with these parameters:
Settings in [CommandLine Option] section | |
---|---|
Required |
Optional |
ValidEdiOutputPathName |
LogLevel |
InValidEdiOutputPathName |
ReportFormat |
ReportFilePathName |
Guideline |
Settings in other sections are optional |
For an example, see TPA_DocSplitter1.ini in Instream’s DemoData directory.
The contents of the Docsplitter setup file are documented in TIB_fsp-instream_<n.n.n>_DocSplitter.pdf. See the Docsplitter setup file section.
Response Generator Command Line
When using TPA with the Response Generator, the command line should look like this:
RespGen.exe
-iDTLfile -TPALookupFile
About command line parameters:
-
The -i parameter is required on all Response Generator command lines, including those for TPA.
-
The -TPA parameter points to the lookup file for TPA.
-
Do not use any other command line parameters. Instead, include the settings in the lookup file.
For an example Response Generator TPA INI file, see TPA_ResponseGen.ini
in Instream’s DemoData directory.
Sample Validation Output
The top of the detail results file will show TPA just before it processes the ST segment:
VER 2.0 STRT 010002 103/15/05 11:32:13Analysis requested on file C:\Foresight\Instream\DemoData\CBTPAdemo\cbt1.txt, 3754 bytes long GEN 015074 1 0Message file loaded : C:\Foresight\Instream\bin\FSANERRS.TXT GEN 015075 1 0Message file loaded : C:\Foresight\Instream\bin\FSBRERRS.TXT GEN 015010 1 0Message file loaded : C:\Foresight\Instream\bin\CustomerFSBRERRS.TXT GEN 015004 1 0Partner Automation Table Loaded C:\Foresight\Instream\Bin\SamplePartnerAutomation.csv GEN 015006 1 0Guideline Selected using Criteria: (004010X091A1,HP,,9012345720000,,,,,,) STRUS 1|ISA|0|1|0 GEN 111211 1 0Start of Interchange, Ctl. No. 000000001, From 9012345720000, To 9088877320000, At 020103 0944 STRUS 2|GS|0|1|108 GEN 211212 1 0Start of Functional Group, Ctl. No. 1, From 901234572000, To 908887732000, At 20020103 1615 STRUS 3|ST|0|0|173 GEN 311001 1 0Loaded Transaction Set 835 from Standard AAA (004010X091A1) GEN 311213 1 0Start of Transaction Set, Ctl. No. 0001
Demos
Envelope-based Validation Demo
-
Go to Instream’s Bin directory and check
$dir.ini
orfsdir.ini
. Be sure PARTNERAUTOMATION is uncommented (has no preceding colon) and points to SamplePartnerAutomation.csv in the Bin directory. -
Check
SamplePartnerAutomation.csv
. It will contain a header line and one or more lines used for matching. These will vary according to your specific installation but will have values from the enveloping and a guideline to be used for data that has that value, like this:004010X091A1,HP,,,,,,,,,835AW120,,
-
Run V_835_4010_TPA in Instream’s Scripts directory.
Demo Output (HIPAA Instream)
VER 2.0 STRT 010002 103/16/05 11:07:08Analysis requested on file C:\Foresight\Instream\DemoData\835-DEMO1.TXT, 2032 bytes long . . . GEN 015004 1 0Partner Automation Table Loaded C:\Foresight\Instream\Bin\SamplePartnerAutomation.csv GEN 015006 1 0Guideline Selected using Criteria: (004010X091A1,HP,,,,,,,,) STRUS 1|ISA|0|1|0 GEN 111211 1 0Start of Interchange, Ctl. No. 000000001, From 9012345720000, To 9088877320000, At 020108 1042 STRUS 2|GS|0|1|108 GEN 211212 1 0Start of Functional Group, Ctl. No. 1, From 901234572000, To 908887732000, At 20020108 1615 STRUS 3|ST|0|0|173 GEN 311001 1 0Loaded Transaction Set 835 from Standard 835AW120 (004010X091A1) GEN 311213 1 0Start of Transaction Set, Ctl. No. 0001
Envelope-based TPA Validation, Response Generator, and Docsplitter Demos
See these demos in Instream’s Scripts directory:
V_RG_837I_4010_TPA
V_RG_837P_4010_TPA
V_DS_837I_4010_TPA
V_DS_835_4010_TPA997split
V_Order_TRADACOMS_TPA