Log out?

Exercise 6.2 – Mapping To HL7

Purpose:

To practice transforming an XML Format to HL7 files.



Steps:

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


  2. 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 “XML File”
    3. Select the “Choose Source Icon” button, and scroll down to select one of the XML icons


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


  4. Add Target Format for HL7 Transformation
    1. Select the “Target 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 “HL7 to People”, and click “OK”. The transformation configuration panel will appear below.
    3. On the right hand side, in the “Transformation Module Configuration” panel, select the “HL7 v2.X” transformer. Its configuration panel will appear below.
    4. Under “HL7 Version to expect”, select “2.3” from the drop-down menu.
    5. On the left hand side, in the XSLT “To XML” configuration panel, uncheck the “Use Direct Relay” button. The options in that panel will now be enabled.
    6. Click the “New” button beneath the checkbox to open the “Data Mapper”.


  5. Load Source and Target Formats
    1. Use the “Open Target Format” button above the “Target Format” panel to open the “Select Format” dialog. Choose “HL7 v2.x” from the “Format Reader” selection box.
    2. Under “HL7 Version”, select version “2.3”.
    3. Check the box towards the bottom that says “Use Sample File”, then click the “Browse” button that is now enabled. In the File Chooser, navigate to where the sample files are located. Choose the file called “ADT_A05.hl7”. Click “OK”, and then click “Read Format”
    4. Use the “Open Source Format” button above the “Source Format” panel to re-open the dialog. Select the “XML” format reader, and click the “Add” button to re-open the File Chooser and select the file called “people.xml”. Click “OK”, and then click “Read Format”.
    5. The source and target format panels should now be populated.


  6. Map the Root Nodes and add Iteration
    1. Select the “People” 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 “XCSData” 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 “People” 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 “XCSData” node in the center mapping panel.
    5. Select the “Person” node that is a child of the “People” node from the source tree to the left. Drag it onto the center panel, and drop it onto the “@select” node that is the child of the “for-each” node that was just dropped there.
    6. Select the “ADT_A01” node that is a child of the “XCSData” node from the target tree to the right. Drag it onto the center panel, and drop it onto the “for-each” node.


  7. Hardcode the MSH segment
    1. Expand the “ADT_A01” node in the target panel to the right. Select the node called “MSH” and drag it onto the center mapping panel, and drop it onto the “ADT_A01” node.
    2. Expand the “MSH” node in the target panel to the right. Select “MSH.1” and drag it onto the center mapping panel, and drop it onto the “MSH” node.
    3. Right click on the “MSH.1” node in the center panel, and select “Add Text Content”. In the dialog that pops up, type in the bar “|” character and press “OK” to add that value to “MSH.1”.
    4. Populate more “MSH” child elements in the center panel in the same way, dragging them from the target format panel on the right into the center panel, then adding a text content value to them:
      1. Target: MSH.2, Text: “^~\&”
      2. Target: MSH.3, Text: “AccMgr”
      3. Target: MSH.4, Text: “1”
      4. Target: MSH.9/CM_MSG.1, Text: “ADT”
      5. Target: MSH.9/CM_MSG.2, Text: “A05”
      6. Target: MSH.10, Text: “599102”
      7. Target: MSH.11, Text: “P”
      8. Target: MSH.12, Text: “2.3”
    5. After those are populated, drag “MSH.7” from the target format panel onto the center mapping, and drop it on the “MSH” node.
    6. In the top extension panel, type “date” into the “Filter by pattern” “Pattern” text field. Of the options that appear, select “Current DateTime”, and drag it onto the “MSH.7” node in the center mapping panel to assign the current date/time to it.


  8. Map the PID Information
    1. Expand the “PID” node in the target panel to the right. Select the “PID” node and drag it onto the center mapping panel, and drop it onto the “ADT_A01” node.
    2. Begin mapping the child nodes of “PID” from the target format tree onto the center mapping panel, dropping them all onto the “PID” node in that tree. Map child nodes of the “Person” node in the source tree to the child nodes of the “PID” target node. Map them in the following way:
    3. Target: PID.5/XPN.1 -> Source: Name/Last
    4. Target: PID.5/XPN.2 -> Source: Name/First
    5. Target: PID.5/XPN.3 -> Source: Name/Middle
    6. Target: PID.7 -> Source: BirthDate
    7. Target: PID.8 -> Source: Gender
    8. Target: PID.11/XAD.1 -> Source: Address/Line1
    9. Target: PID.11/XAD.2 -> Source: Address/Line2
    10. Target: PID.11/XAD.3 -> Source: Address/City
    11. Target: PID.11/XAD.4 -> Source: Address/State
    12. Target: PID.11/XAD.5 -> Source: Address/Zip


  9. Save the Mapping
    1. 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”.
    2. Click the “X” button in the top right corner to close the “Data Mapper” and return to the “Route Editing Grid”.


  10. 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 “people-output” as the “Target File Name”.
    5. Set “hl7” as the “Target File Extension”.


  11. 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 “HL7 File”
    3. Select the “Choose Target Icon” button, and scroll down to select one of the HL7 icons


  12. 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 “people.xml” from the “Samples” directory provided into the directory chosen as the polling directory.


  13. 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 “people-output.hl7” should be there, with the transformed contents produced by the XSLT.


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


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

Thanks!

Our editors are notified.

Close