Log out?

Exercise 7.1 – Mapping From EDI

Purpose:

To practice transforming EDI X12 files to an XML Format.


Steps:

  • Create a Route
  1. From the eiConsole File Management screen, select the “Add Route” button.
  2. In the dialog that appears, enter the name “EDI to People XML” and select “OK”.
  3. The Route should now appear in the table on the screen. Double click it to open it.

A

 


  • Document Source System
  1. Select the “Source System” stage in the “Route Editing Grid”. The configuration panel will appear at the bottom.
  2. Change the “System Name” to “EDI File”
  3. Select the “Choose Source Icon” button, and scroll down to select one of the EDI icons

C

 


  • Configure the Listener
  1. Select the “Listener” stage in the “Route Editing Grid”. The configuration panel will appear at the bottom.
  2. Select “Directory / File” from the “Listener Type” selection box. Optionally, click the “…” button to open the Module Search Dialog, which provides a faster way to find the module you’re looking for.
  3. Assign a polling directory, using the “…” button to open the file chooser. The polling directory should NOT be the directory with all the sample files, since files will be moved/deleted by the listening process.

C

 


  • Add Source Format for EDI Transformation
  1. Select the “Source Transform” stage in the “Route Editing Grid”. The configuration panel will appear at the bottom.
  2. Click the “Add Format” button. In the dialog that appears, name the format “EDI to People”, and click “OK”. The transformation configuration panel will appear below.
  3. On the left hand side, in the “Transformation Module Configuration” panel, select the “EDI” transformer. Its configuration panel will appear below.
  4. On the right hand side, in the XSLT “To XML” configuration panel, uncheck the “Use Direct Relay” button. The options in that panel will now be enabled.
  5. Click the “New” button beneath the checkbox to open the “Data Mapper”.

B

 

C-E

 


  • Load Source and Target Formats
  1. Use the “Open Source Format” button above the “Source Format” panel to open the “Select Format” dialog. Choose “XML” from the “Format Reader” selection box.
  2. In the added dialog, browse and add the sample file “837_5010.xml”, then click “Read Format”
  3. Use the “Open Target Format” button above the “Target Format” panel to open the “Select Format” dialog. Choose “XML” from the “Format Reader” selection box again
  4. Remove the existing sample file and add “People.xml”, then click “Read Format”
  5. The source and target format panels should now be populated.

A-B

 

C-D

 

E

 


  • Map the Root Nodes and Add Iteration
  1. Select the “XCSData” Node that is the root of the tree in the source panel to the left. Drag it onto the center panel, and drop it on the “stylesheet” node that’s already there.
  2. Select the “People” node that is the root of the tree in the target panel to the right. Drag it onto the center panel, and drop it on the “XCSData” node that was just dropped there.
  3. Above the center mapping panel is the extensions panel. The currently displayed tab, “Filter by Pattern”, has a text field called “Pattern”. Type “for-each” into that field.
  4. A single item should be present in the panel. This item should also be called “for-each”. Select it and drag it onto the “People” node in the center mapping panel.
  5. In the source tree, expand the node called “ediroot” to see its children. Continue descending to find “interchange,” then “group,” then “transaction,” then “LOOP_2000,” then finally “LOOP_2010”.
  6. This element represents a loop with a “named entity,” which can be used to identify a patient according to the NM101 field
  7. Drag the found “LOOP_2010” element onto the “@select” node beneath the “for-each” node in the center mapping panel.
  8. Next, we’ll need to modify this mapping to conditionally select LOOP_2010 elements with a child NM1 and descendant NM101 having a value of “85” (patient)
  9. Double-click on the “@select” element you mapped the NM1 node onto; this will enable you to edit the XPath expression
  10. You should have something like: ediroot/interchange/group/transaction/LOOP_2000/LOOP_2010
  11. We’ll modify this by adding this to the end of the expression: [NM1/NM101 = ’85’]
  12. This is a “predicate”; it’s effectively saying “find the LOOP_2010 with a child element, NM1, with a descendant element, NM101, with a value of ’85′”
  13. In the target tree, select the “Person” node that is a child of the “People” node, and drag it onto the “for-each” node in the center mapping panel.

A-B

 

C-D

 

E-G

 

I-L

 

M

 


  • Finish the Mapping
  1. Select all of the nodes that are children of the “Person” node in the target format panel, and drag them onto the center panel and drop them onto the “Person” node.
  2. Click the “+” button next to the “Name” and “Address” nodes in the target format panel to expand them to show their child nodes, and drag them onto the center mapping panel as well.
  3. Now that the whole target format has been configured in the center panel, it’s time to map the source format to it. Map the nodes in the following way (all source nodes are children of the PID source node):
    1. Source: NM1/NM103 -> Target: Name/First
    2. Source: NM1/NM105 -> Target: Name/Middle
    3. Source: NM1/NM104 -> Target: Name/Last
    4. Source: NM1/NM109 -> Target: SSN
    5. Source: DMG/DMG03 -> Target: Gender
    6. Source: DMG/DMG02 -> Target: BirthDate
    7. Source: N3/N301 -> Target: Address/Line1
    8. Source: N3/N302 -> Target: Address/Line2
    9. Source: N4/N401 -> Target: City
    10. Source: N4/N402 -> Target: Address/State
    11. Source: N4/N403 -> Target: Address/Zip
  4. Now that the mapping is complete, select the button with a floppy disk icon from the top toolbar to save changes. When prompted for a name, use the default, “transform”.
  5. Click the “X” button in the top right corner to close the “Data Mapper” and return to the “Route Editing Grid”.

C

 

D

 


  • Configure the Transport
  1. Select the “Transport” stage in the “Route Editing Grid”. The configuration panel will appear at the bottom.
  2. Select “Directory / File” from the “Transport Type” selection box. Optionally, click the “…” button to open the Module Search Dialog, which provides a faster way to find the module you’re looking for.
  3. Select the “Target Directory”, using the “…” button to open the file chooser.
  4. Set “edi-people-output” as the “Target File Name”.
  5. Set “xml” as the “Target File Extension”.

C-E

 


  • Document the Target System
  1. Select the “Target System” stage in the “Route Editing Grid”. The configuration panel will appear at the bottom.
  2. Change the “System Name” to “People XML File”
  3. Select the “Choose Target Icon” button, and scroll down to select one of the XML icons

C

 


  • Prepare to Test
  1. In the menu bar at the top, select “Route” -> “Testing Mode”. Make sure the changes to the Route are saved.
  2. Copy the file called “837_5010.edi” from the “Samples” directory provided into the directory chosen as the polling directory.

A

 


  • Perform the Test
  1. At the top of the “Testing Mode” screen, select the “Execute Test” button.
  2. If the “Route” was configured successfully, all the Stages should light up with green checkmarks.
  3. In the OS File Explorer, open the directory selected as the “Target Directory”. The file “edi-people-output.xml” should be there, with the transformed contents produced by the XSLT.

B

 


  • Output Files
  1. Compare the results from the exercise with the following example output files to see if they are correct.
    1. edi-people-output.xml

This is a unique website which will require a more modern browser to work! Please upgrade today!

Thanks!

Our editors are notified.

Close