Sample Data

Introduction

One of the most useful features of the Iguana Translator is the ability to work with sample message data while you write or edit the mapping script. You can quickly navigate through many sample messages to test your code against different message types, and against messages with missing and/or invalid data. This enables you to ensure that your script is doing exactly what you want it to do.

The Sample Data screen allows you to add, delete and manually edit the sample data currently loaded into a Translator instance. This immediate access gives you the power to customize the sample messages being passed through your code, giving you more control over the type of testing performed.

To open the Sample Data screen, simply click the Sample Data hyperlink in the Translator toolbar:

Import Sample Data [top]

You can import new sample data, at any time, for your script to work with.

To import:

  1. Click the Sample Data link, at the top left of the Editor toolbar:
  2. The sample data management screen opens, click the Import button to load a data file:
  3. Click Browse to choose the data file, and then click Import:
  4. Use the arrow buttons to scroll through the sample data messages:
  5. Click the “Back to: Script” link to return to the mapping script.
  6. Use the navigation controls to scroll through the sample messages in the Translator Editor:

Enter Sample Data [top]

The Sample Data Management screen also allows you to create sample data messages from scratch!

To enter data:

  1. Click the Add button:
  2. Enter or paste your sample message:
  3. To convert all line endings to CR, select CR from the EOL Type listbox and click Convert.
    Note
    : You can also select just the line(s) you want to convert.
  4. To add CRLF at the end of line 8, select CRLF from the EOL Type listbox and press the Enter key.
  5. The message is now in HL7 format:
  6. You can also (optionally) give your new message a name for easier lookup later.
  7. Click Save to create the message and append it to the sample data as the active message (in this case the 283rd message):

Navigating Sample Data [top]

There are two ways to navigate through the sample data.

The first method is to scroll through messages using the arrows in the toolbar Navigation control:

The second method is to click the Go To Message button:

Then enter the number of the message that you want to select and click Go:

Tip: Annotations and data dialogs are synchronized with script and data changes, when you navigate through sample data the annotations and dialogs are updated in real time.

Edit or Delete Sample Data [top]

You can edit or delete any sample message that you have imported into your script.

To edit a message:

  1. Select the message to edit using the Navigation buttons:
  2. Then click the Edit Message button to edit the current message in a floating window:
    Note: Editor annotations and data changes are synchronized.
  3. Alternatively click the Sample Data link and choose a message from the Sample Data screen:

  4. Use the Message Editor to make your changes:
  5. Save your changes to return to the script with the edited message as the active sample message.

To delete a message:

  1. Click the Sample Data link and check the message(s) to delete in the Sample Data screen:
  2. Then click Delete button:

Import From The Logs [top]

From the Iguana Translator window, you can import sample message(s) from the Iguana log files.

To import:

  1. Click the Go To Message button in the navigation control:
  2. Then click Add From Logs:
  3. Fill out search information to locate the message that you want to import:
    • In the Search Text field, type filter text to match messages
    • From the list box, select the channel through which the messages were sent
    • You can also filter by date and time
  4. Click Search to display the matching messages:
  5. Click the message that you want to import:
  6. The message is added to the sample data for the script, and becomes the currently selected message in the Editor.

Tip: You can also use the Logs screen to select a message to be imported:

This method is very useful for debugging processing errors. When you see an error in the log you simply choose the offending message and import it directly into the desired channel.