G-Queries CSV File Example for EDI
This lesson will provide an example of using G-Queries for EDI. The instructions for completing each of the steps within this lesson can be found in the Software Tester Intermediate Flight Plan G-Queries Training Module.
Story:
For this example, a Tester needs to generate EDI 837P Documents that contain data queried from two CSV Files. The CSV Files are displayed below:
CSV File 1 – Claim Information
CSV File 2 – Claim for Service Line
A separate G-Query will need to be created and set up for each CSV File. Within each G-Query, complete the following steps:
- Configure the G-Query Parameters (e.g., output directory, file subdirectory, file name, etc.).
- Import the CSV File Column Names into GenRocket.
- Map each CSV File Column Name to a Segment/Loop (i.e., Domain) and Element (i.e., Attribute)
Once set up, G-Queries can be added to a G-Case. The data will be queried automatically when the G-Case is used to generate EDI data.
Step 1: Create Claim CSV File G-Query
The first G-Query in this example is titled “ClaimQueries” and is displayed below. To create a new G-Query, click on the Add G-Query button within the G-Queries Management Dashboard.
Complete the following steps to add the G-Query:
Step 1: Enter a Name and Description (optional but recommended).
Step 2: Select the Type of Query.
Step 3: Click the Save button.
Step 2: Configure the Claim CSV File Query Parameters
The following Query Parameters have been configured within the Claim CSV File G-Query:
- path – Defines the path for the CSV File.
- subDir – Defines a subdirectory where the CSV File is located.
- fileName – Defines the name of the CSV File.
- Delimiter – Defines the delimiter used within the CSV File.
Remember to click the Save button after making any changes to the Query Parameters.
Step 3: Import the Claim CSV File Column Names
The Claim CSV File column names will need to be imported to map them to Segments/Loops (i.e., Domains) and Elements (i.e., Attributes).
Complete the following steps within the CSV File Column Names Pane:
- Click on the Import button.
- Browse to and select the CSV File.
- Click the Save button.
The column names will appear within the CSV File Column Names Pane after the import has finished.
Step 4: Map Each CSV Column Name to a Segment/Loop and Element
Each column within the CSV File that will be queried will need to be mapped to a Segment/Loop (i.e., Domain) and an Element (i.e., Attribute).
Complete the following steps for each CSV Column within the Domain Attributes Pane:
- Click the Add button.
- Select the EDI Segment.
- Select the EDI Element.
- Select the Column Name.
- Click the Save button.
The Domain Attributes Pane will appear as shown below once the needed CSV Columns have been mapped to a Segment/Loop and Element.
Step 5: Create the Claim for Service Line CSV File G-Query
The second G-Query in this example is titled “ServiceLineQueries” and is displayed below. To create a new G-Query, click the Add G-Query button.
- Enter a Name and Description (optional but recommended).
- Select the Type of Query.
- Click the Save button.
Step 6: Configure the Claim for Service Line CSV File Query Parameters
The following Query Parameters have been configured within the Service Line CSV File G-Query:
- path – Defines the path for the CSV File.
- subDir – Defines a subdirectory where the CSV File is located.
- fileName – Defines the name of the CSV File.
- Delimiter – Defines the delimiter used within the CSV File.
Remember to click the Save button after making any changes to the Query Parameters.
Step 7: Import the Claim for Service Line CSV File Column Names
The Claim for Service Line CSV File column names will need to be imported to map them to Segments/Loops and Elements.
Complete the following steps within the CSV File Column Names Pane:
- Click on the Import button.
- Browse to and select the CSV File.
- Click the Save button.
The column names will appear within the CSV File Column Names Pane after the import has finished.
Step 8: Map Each CSV Column Name to a Segment/Loop and Element
Each column within the CSV File that will be queried will need to be mapped to a Segment/Loop and an Element.
Complete the following steps for each CSV Column within the Domain Attributes Pane:
- Click the Add button.
- Select the EDI Segment.
- Select the EDI Element.
- Select the Column Name.
- Click the Save button.
The Domain Attributes Pane will appear as shown below after mapping the needed CSV Columns to the appropriate Segments/Loops and Elements.
Step 9: Add the G-Queries to a G-Case
G-Queries can be added to a G-Case within the G-Case Management Dashboard by completing the following steps:
- Select the G-Case Suite, G-Case Category, and G-Case.
- Select the G-Queries Tab.
- Click on the Add G-Query button.
- Select the Q-Query and click the Save button.
Step 10: Run the G-Case Command with the Scenario Chain Set
To generate EDI data using G-Queries, a user will need to download the G-Case Suite or a Test Data File with selected G-Cases. Additionally, users will need to download the EDI Configuration File and Scenario Chain Set.
Once downloaded to a user’s local computer, they will need to copy the G-Case Command within the G-Cases Management Dashboard and complete these steps:
- Place the EDI Config File within the config subdirectory and rename to Config.xml.
- Open a Command Prompt or Terminal window.
- Change the directory to match the resource.home.directory path.
- Paste the command into the Command Prompt or Terminal window.
- Replace
with the name of the Scenario Chain Set. - Press the Enter Key to run the command.
Note: For detailed steps on how to generate EDI data, please see Module 8 of the EDI Flight Plan.