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:

The last output path selected will be used.

For flexibility, you can separately choose whether to use TPA when:

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 $dir.ini (Windows) or fsdir.ini (UNIX).

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
-TPA parameter.

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,
-d
, and -TPA.

For details, refer Docsplitter Command Line

Omit all command line parameters except -i and
-TPA.

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:

  1. Go to Instream’s bin directory and edit $dir.ini (Windows) or fsdir.ini (UNIX).

  2. Go to the PARTNERAUTOMATION line under [UserTables].

  3. If the line starts with a colon ( : ), remove the colon.

  4. 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.

  5. 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

Big Picture

To set up your lookup table with a text editor:

  1. Copy one of these:

    Instream’s Bin directory:    SamplePartnerAutomation.csv

    Instream’s DemoData directory:     SampleTPA_DS_RG.csv    

  2. 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.

  3. 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.
  4. Save as a text file.

Lookup File Format

The lookup table is a plain text file containing rows of comma-separated values.

Top line:

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
/Industry Identifier Code)

 

Required.

X12 Example:

005010X279A1,HB,,,,,,,,,271-X279,,,,

If the data contains a GS08 value of 005010X279A1 AND the value specified in the GS01 (see GS01 criteria that follows), Instream uses the 271-X279 guideline for validation.

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:

STX=ANA:1+5000000000000:KAVERCORP …

Value is 10ANA:   1+0+ANA=10ANA

GS01/UNB1-1/ STX07

(Functional Identifier Code)

 

Required.

X12 Example:

005010X279A1,HB,,,,,,,,,271-X279,,,,

If the data contains a GS08 value as specified (see GS08 criteria above) AND the GS01 value HB, Instream uses the 271-X279 guideline for validation.

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 005010X278A1

Include the response guideline, a vertical bar, and then the request guideline:

278response|278request

Example:

PDA278RP|PDA278RQ

For 278s, Instream is programmed to look at the data’s BHT-02 to determine if this is a request or response:

  • Response:

    If BHT-02 contains 11, the first guideline (response) is used.

  • Request:

    For 4010, if the BHT-02 contains 13, the second guideline (request) is used.

    For 5010, if the BHT-02 contains 01, 13, or 36, the second guideline (request) is used.

If the GS08 contains 215, such as 005010X215:

Include the Inquiry guideline, a vertical bar, and then the ResponsetoInquiry guideline:

215Inquiry|215ResponsetoInquiry

Example:

PDSA5010-278X215I|PDSA5010-278X215R

For 5010X215s, Instream is programmed to look at the data’s BHT-02 to determine if this is an inquiry or response:

  • Inquiry:

    If BHT-02 contains 28 or 51, the first guideline (215Inquiry) is used.

  • ResponsetoInquiry:

    If the BHT-02 contains 49 or 52, the second guideline (215ResponsetoInquiry) is used.

If the GS08 contains 216, such as 005010X216:

Include the Notification guideline, a vertical bar, and then the Acknowledgment guideline:

216Notification|216Acknowledgment

Example:

PDSA5010-278X216N|PDSA5010-278X216A

For 5010x216s, Instream is programmed to look at the data’s BHT-02 to determine if this is a notification or acknowledgement:

  • Notification:

    If BHT-02 contains 14, 22 or CN, the first guideline (216Notification) is used.

  • Acknowledgement:

    If the BHT-02 contains 44 or 53, the second guideline (216Acknowledgement) is used.

If the GS08 contains 217, such as 005010X217:

Include the Request guideline, a vertical bar, and then the Response guideline:

217Request|217Response

Example:

PDSA5010278X217Q|PDSA5010278X217R
For 5010X217s, Instream is programmed to look at the data’s BHT-02 to determine if this is a request or response:

  • Response:

    If BHT-02 contains 13, the first guideline (217Request) is used.

  • ResponsetoRequest:

    If the BHT-02 contains 11, the second guideline (217ResponseToRequest) is used.

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: 

C:\files\casey\  or “C:\my files\casey\”

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:

RespGen837.ini  or  “C:\setupFiles\RespGen837.ini”

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:

DS837.ini  or “C:\setupFiles\DS837.ini”

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:

GS-08 004010X091A1
GS-01 HP
Third line

When validating, Instream should use MYCUSCAR_D93A if the data contains both of these:

UNG7-12 D.93A
UNB01-01 UNOA
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:

GS-08  004010X094A1
GS-01 HI
ISA-05 ZZ
ISA-06 CASEY

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:

  • When validating: guideline PDSA837I

  • When using Response Generator: INI file RespGenDemo.ini (which is in Instream’s Bin directory)

  • When using Docsplitter: INI file DS837.ini, which is in C:\setupfiles.

    …if the data contains both of these

    GS-08 004010X096A1
    GS02 HC
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:

  • If it contains 14, 22, or CN, Instream should use the first (notification) guideline specified: PDSA5010-278X216N.

  • If it contains 44 or 53, Instream should use the second (acknowledgment) guideline specified: PDSA5010- 278X216A.

How Instream Matches

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 g is present TPA is not used for validation.
If g is absent

TPA is used and you must have a lookup file identified in your $Dir.ini (Windows) or fsdir.ini (UNIX).

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:

HVInStream.exe -i "C:\Foresight\Instream\DemoData\6claims.txt"

-o "C:\ Foresight\Instream\Output\6claims_Results.txt"

Example that does not use TPA:

HVInStream.exe -i "C:\Foresight\Instream\DemoData\6claims.txt"

-o "C:\ Foresight\Instream\Output\6claims_Results.txt" -gPDSA837I

Docsplitter Command Line

When using TPA with Docsplitter, the command line should look like this:

DocSplitter.exe -iDTLfile  -dDataFile -TPALookupFile

About command line parameters:

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:

Example using detail file
Docsplitter.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 guideline
Docsplitter.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:

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

  1. Go to Instream’s Bin directory and check $dir.ini or fsdir.ini. Be sure PARTNERAUTOMATION is uncommented (has no preceding colon) and points to SamplePartnerAutomation.csv in the Bin directory.

  2. 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,,
  3. 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