20
Inner Harbour Software HL7Spy 1.1 Getting Started Nov 14, 2009 DRAFT

HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Inner Harbour Software

HL7Spy 1.1Getting Started

Nov 14, 2009

DRAFT

Page 2: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

Main Areas of HL7Spy's User InterfaceThe figure below shows the main areas of the HL7Spy user interface. The two main regions of the UI are the Message Editor region, and the Tool region.

Each tab in the Message Editor region represents a collection of messages, often referred to as a Message Collection in this document. Messages can come from:

• a File

• a TCP/IP port

• the result of a query against an existing collection

• a Database query

• or generated programatically using the Custom Code feature

It is not uncommon to have 100,000 or more messages open within a single tab in HL7Spy. The larger the sample of messages is, the better chance statistically, that you will find anomalies in the HL7 stream. The Message Editor functionality is described in the next section in detail.

The second main area of the UI is the Tool area which contains some of the tools that are available for acquiring, describing, editing, and manipulating messages in the currently selected Message Editor tab.

As shown in the figure below, windows within the tool area can be pulled out of the tool area, and moved to the desktop by clicking and holding the mouse button on the tab portion of the tool window. Tool windows that are dragged to the desktop “remember” their position between invocations of the product.

Page 3: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

Each tool in the Tool Area has a dedicated section describing its functionality, however; a short description of each follows.

1. Segment Editor – The Segment Editor provides a human readable view of the current segment in the Message Editor window. Fields modified in the Segment editor are reflected in the Message Editor and vice-versa.

2. Watch List – Allows users to configure which fields are displayed for a message. Up to 3 user defined message views are available. Exporting and Report creation are also part of this tool.

3. Statistics View – Provides detailed statistics of all messages in the active message collection. Statistics are available for each message type, for all message types, as well as each field, component, and sub-component.

4. HL7 Standard View – Provides a search-able reference to the HL7 2.x Standard including field names, cardinality, type, and defined values.

5. Custom Code Editor – This feature is a mini-programming environment for developing custom functions. Custom functions can be used to generate a CSV file of patient attributes matching some complex criteria, file data into a database, analyze complex message

4 Getting Started

Mes

sage

Edi

tor

Tool

Are

a

Message Offset / Size

Tab OverflowMessage CollectionTabs

Drag Tool WindowsOut of the Tool Area

Tool Windows

Page 4: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

exchanges, or any task that isn't directly supported by HL7Spy.

6. SQL Loader – Provides a mechanism to retrieve HL7 messages directly from a database by writing SQL select statements. The SQL Loader is able to automatically detect which column contains the message data, and pipes this data to the Message Editor window.

Opening File(s)For your convenience, there are many ways to open a file in HL7Spy. These are enumerated below:

1. Using the File/Open menu option, Ctrl-O, or clicking on the “Open File” button in the Message Editor window.

These three options cause the standard Windows File Open dialog to be displayed. Multiple files can be opened by (a) holding down the Control key and selecting 1 or more files, or by (b) holding down the Shift key clicking on a file in the list, then while still holding the Shift key, clicking on a file further down in the list, to select a range of files.

2. Dragging and dropping files from Windows Explorer to the HL7Spy title bar.

3. Using the “File/Open Folder” menu option

This option displays the following dialog. Which allows some specificity over which files in a particular directory are opened.

It is recommend to use “Open Folder” over options (1) or (2) if the number of files is over 100. Windows File Open dialog has some limitations on the number of files which can be opened whereas Open Folder can open thousands of files.

The options in this dialog are described here:

1. Directory – Specify the path of the folder where the HL7 message files

Getting Started 5

Page 5: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

are located, or click on the folder icon to select a path.

2. Files - Specify the extension of the files to be opened. More than one extension can be specified by separating extensions with a semicolon.

3. Search Pattern – Allows you to specify a regular expression that will be run on the text of each file. If the regular expression finds a match the file will be included, otherwise it will be ignored.

4. Merge Files into a temporary file before loading – If you know the files are text, i.e. not gzip, bzip2, or zip format, then using this option will dramatically decrease the time it takes HL7Spy to open thousands of files.

5. Recurse Subdirectories - If selected, files files in subdirectories of the selected directory will be included; otherwise, only files in the directory will be included.

6 Getting Started

Page 6: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

A Quick Tutorial of HL7SpyIf you're like me, reading a feature-by-feature description in a reference manual is about as exciting as a trip to the dentist. This section is for those of you that want a quick tour of HL7Spy of the most commonly used features.

HL7Spy was developed to have a discoverable user interface, so we believe if you go through this tutorial you will have a good feel on how to use most of the features. If you need a more detailed explanation of a particular feature, just go to the reference manual and read the gory detail.

Assuming you have HL7Spy open in front of you and the sample HL7 data file that comes with HL7Spy, follow along with the tutorial below.

Note: The sample file can be loaded from the “Help/Load Sample Data” menu option.

Message Navigation

1) Click on PID-5 in the “SampleHl7.zip::Data.hl7” tab.

✔ Notice that the Segment Editor follows the movement of the cursor in the Message Editor tab

✔ Notice that as you click on different fields within the message, tooltips are displayed giving you further details about the field.

2) Hold down the Control key while moving the mouse over fields within the message.

✔ Notice that tooltips are displayed for fields under the mouse pointer.

Page 7: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

3) Use the arrow keys to move around the message.

✔ Notice that the Segment Editor follows the current segment and field

✔ Notice when you hold the Control key while hitting the left and right arrow keys, the cursor jumps from one non-empty field to the next.

4) While holding down the Control key, type in a number in on the keypad.

✔ Notice the editor's cursor moves to the field within the current segment matching the number that was typed in.

5) Use Control-Tab to move from the Message Editor to the Segment Editor

✔ Notice that the context switches between the two editors and that hitting Control-Tab toggles which editor is active.

6) Select the button labeled “F” (for Fields)

✔ Notice that this toggles the display of empty fields

7) Select the button labeled “C” (for Components)

✔ Notice this toggles the display of empty components

✔ Notice using the keystroke combination Control-T toggles the Show/Hide Empty Fields and Show/Hide Empty Components options.

8 A Quick Tutorial of HL7Spy

Page 8: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

8) Edit one of the fields in the Message Editor

✔ Notice that the edited field is automatically updated in the Segment Editor

9) Control-Tab to the Segment Editor and edit one of fields

✔ Notice that the edited value is automatically updated in the Message Editor.

10) Click on PID-8 (Patient Sex) in the Message Editor

✔ Notice that the Segment Editor's know values window displays the available codes for PID-8 and their respective descriptions

11) Click and drag the blue ball in the Navigation Bar (1) shown below

✔ Notice that as you drag the blue ball, the Message Index (2) changes and the Message Editor updates to reflect message at the specified index.

✔ Notice that if you change the value in the Message Index TextBox, you can goto any message index.

Searching

1) Type “Smith” (without the quotes) into the Quick Search TextBox (3) and hit the enter key.

✔ Notice that the Message Editor displays the first message that contains the text “Smith”.

✔ Notice that if you click on the blue triangles on either side of the Quick Search TextBox that the Message Editor will move to the previous or next message that contains the text “Smith”.

2) Select the PID-5 (Patient Identifier) field in the Message Editor and hit Control-F, or click on the “Search” button in the toolbar of the Message Editor.

✔ Notice the following dialog is displayed with the search value and Path set from the context of the Message Editor.

Getting Started 9

(1) (2)(3)

Page 9: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

✔ Notice that both the active field in the Message Editor, and the value are automatically populated in the HL7 Path, and search text respectively. If an HL7 Path is not specified the search will apply to the entire message.

✔ Notice there are many options available for searching for specific messages, including searching for NULL fields, and lengths of fields.

✔ Notice that if you click on the “Find Next” button, that the Message Editor moves to the Next message where PID-3 contains the value specified in the Search TextBox.

✔ Notice that if you click on the “Find All” button that the dialog disappears and a new Message Tab appears populated with all messages matching the specified criteria.

Sorting

1) Select the “Sort Messages” button in the Message Editor toolbar. This option allows you to sort messages within the active message collection.

✔ Notice the sort options available in the following dialog.

10 A Quick Tutorial of HL7Spy

Page 10: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

2) Select the “Message Size” option, and click the “Sort” button.

✔ Notice the messages in the Message Editor are displayed from the message with the smallest size, to the message with the largest size.

✔ Notice at the bottom right hand corner of HL7Spy, the message offset and size are displayed.

✔ Notice if you click the last button in the Navigation Bar the Message Editor will display the last message in the message collection which will be the largest message in the stream.

Message, Field, and Component Statistics

Double-Click on PID-5 in the Message Editor Window, right-click on a field and select “Component Statistics”, or select the “Component Statistics” button in the Message Editor toolbar.

✔ Notice that the following window is displayed along side the Message Editor.

✔ Notice the summary display which gives you overall statistics on how many unique, null, not null, and messages missing the requested segment.

Getting Started 11

Page 11: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

✔ Notice that this window contains a list of all unique values found for PID-5.1.1 and for each value, it displays the number of times that value was found (Num).

✔ Notice that if click on the Len column it will sort the results by the field length and you can find the maximum or minimum length of a give field.

✔ Notice that if you double click on a row within the list, the Message Editor will display the next message where PID-5.1.1 equals the value of the row clicked on.

✔ Notice if you right click on one of the rows in the list, several options for searching are provided.

✔ Notice if you click the blue arrows , the Message Editor moves forwards, or backwards to corresponding matching messages.

✔ Notice if you click the “All” button, that a new Message Tab is opened containing all messages that have the value of the currently selected row in the Statistics window, at the specified path. In the figure above, all 18 messages with the field

PID-5.1.1=”GLANVILLE” would be displayed in a new Message Tab.

3) Double-Click on PID-5 in the Message Editor 2indow while holding down the Control key, right click on a field in the Message Editor and select “Field Statistics”, or select the “Field Statistics” button from the Message Editor toolbar.

✔ Notice that instead of seeing the values for a single component of a field, that values for the entire field are displayed. See below.

12 A Quick Tutorial of HL7Spy

Page 12: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

4) Active the Statistics Tool by clicking on the Statistics Tab as shown below.

✔ Notice that statics for the current message collection are calculated when you click on the tab.

✔ Notice the tree structure on the left-hand-side of the statistics window containing the distribution of each message type found in the current Message Collection.

✔ Notice in this example that 10,000 messages were sampled (the first 10,000).

✔ Notice that 1913, or 19.1% of the messages sampled were ADT^A08 messages.

✔ Notice that if you select the ADT^A08 node that the distribution

Getting Started 13

Page 13: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

of all segments and fields for ADT^A08 messages are displayed in the grid on the right.

✔ Notice that if you expand the tree by clicking '+' of the ADT^A08 message type, that each segment was present in every message.

✔ Notice in the grid display, that for each field, the Count, min-max field length (Len), description, and sample data are displayed.

✔ Notice fields that are always NULL are omitted.

✔ Notice the first message type denoted by “***”. This is the all messages group as can inferred by the 10,000 messages making up 100% of the message type distribution. Selecting segments under this node will give statistics for segments/fields across all message types.

✔ Notice that if you right-click on a row in the grid that options for getting more detailed statistics on the selected field are displayed.

Watch List

1) Select the Watch List Window by clicking on the “Watch” tab.

✔ Notice the following window is displayed.

2) Add PID-5 to the watch list by typing in PID-5 into the last row of the watch list.

✔ Notice PID-5 is added to the watch list with the “Full” checkbox checked. This denotes that the entire field should be displayed and not just the first component.

14 A Quick Tutorial of HL7Spy

Page 14: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

✔ Notice that if you uncheck the “Full” that just the first component of PID-5 (PID-5.1.1) is displayed and not the entire field.

✔ Notice that fields can be added to the watch list by clicking the “Add to Watch List” in the Message Editor, or by right-clicking on a field in the Message Editor.

✔ Notice that rows in the Watch List are hyper-linked to fields in the Message Editor so when you click on a row in the Watch List, the corresponding field in the Message Editor is highlighted.

✔ Notice that Watch List items can be re-ordered by dragging and dropping rows within the Watch List.

✔ Notice items in the Watch List can be deleted by selecting a row and hitting the delete key.

✔ Notice that the descriptions of each Watch List item can be edited.

✔ Notice that up to 3 Watch List can be configured. Watch lists are preserved across application invocations.

3) Click on the “Export” button

✔ Notice that options to export Watch List fields for all messages in either Excel, or CSV format are displayed.

✔ Notice if you have Excel installed and you export the Watch List that Excel is automatically launched with the Watch List descriptions as columns and a row for each message in the message collection.

4) Click on the “Report” button

✔ Notice that a report is generated containing statistics for each field in the Watch List.

HL7 Send & Receive

In this section we will be sending data from one Message Tab to another using HL7 MLLP to demonstrate the HL7 Send and Receive functionality.

1) Click on the “Receive Messages” button in the Message Editor toolbar, or select “Tools/Receive Messages (MLLP) from the main menu.

Getting Started 15

Page 15: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

✔ Notice the “Receive HL7 via MLLP” dialog is displayed as shown below.

2) This dialog allows you to configure the port which the HL7 Receive service will listen to (Welcome Port) and the network interfaces that will be active, as well as the Message Framing and character encoding. The defaults are fine for this demonstration, so just click the “OK” button.

✔ Notice that a new tab is created with a name something like “Mllp:12000”. This is now an active HL7 MLLP server.

3) Now it is time to send some data into our server. Click on the “SampleHl7.zip::Data.hl7” tab, and click on the “Send HL7 Messages” button, or select “Tools/Send Messages (MLLP)” from the main menu.

✔ Notice the “Send HL7” window is displayed directly adjacent to the Message Editor containing the messages to be sent.

16 A Quick Tutorial of HL7Spy

Page 16: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

4) Click on the “Add Destination” button. This will display the “Add/Edit Destination” and allow us to create a profile for our HL7 Receive Server.

✔ Notice the following dialog is displayed. This dialog allows you to set up the client aspects of the MLLP protocol.

✔ Notice that you can change the Host Name (or IP address), the Port, Message Framing, and character encoding. These should be set to match those configured on the server side of the communication.

5) If you selected the defaults in step (2) above, then just click the “OK” button; otherwise, ensure the configuration matches what was configured on the server side.

✔ Notice that the drop-down list in the “Send HL7” dialog displays “New Entry – (localhost:12000)”. You can edit the name, or any of the communication settings by clicking on the “Edit Destination” button to re-display the “Add/Edit Destination” dialog.

✔ Notice the options to control whether ACKs are displayed and under which conditions. For instance, if check the “AA” option, then a new Message Tab will be created containing a corresponding ACK for every message sent. If just “AE” is selected, then only ACKs containing an error will be present in the tab.

✔ Notice if you click on the button labeled “Single” , that the HL7 Message currently displayed in the Message Editor was sent to our HL7 Server and that the Message Editor was moved to the

Getting Started 17

Page 17: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

next message in the Message Collection. This allows you to repeatedly send the next message by clicking the “Single” button.

✔ Notice the “Accept (AA)” textbox displays “1”.

✔ Notice if you click on the tab “Mllp:1200”, that the message is the first (and only) message in the message tab.

✔ Notice that if you click on the “All” button in the “Send HL7” window that all the messages in the “SampleHl7.zip::Data.hl7” Message Collection are sent to the “Mllp:12000” tab and that the Send statistics are updated.

✔ Notice that you can switch to the “Mllp:12000” tab and navigate through the messages as they are being sent/received.

HL7 Standard

With the HL7 Standard Window you can perform searches for information on specific fields defined within the HL7 Standard.

1) Select the HL7 Standard Window by clicking on the “HL7 Standard” tab.

✔ Notice the following tool window is displayed.

1) Type in the word “sex” into the search textbox as show in the figure above.

✔ Notice that all fields within the HL7 Standard that contain the word “sex” are displayed in the results grid.

✔ Notice the location, description, data type, minimum and maximum cardinality, table number and item number of all matching fields are displayed.

✔ Notice by clicking on a row in the results grid, that known values for the selected field are displayed to the right of the results grid.

18 A Quick Tutorial of HL7Spy

Page 18: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

✔ Notice by clicking on the “Include Components” button that the search results now include matching components as well as fields.

Custom Code

The custom code feature is a powerful tool for performing tasks that HL7Spy does not support out-of-the-box. Although having some programming knowledge is beneficial, it is not necessary to follow along with this section of the tutorial.

1) Select the Custom Code Window by clicking on the “Custom Code” tool tab.

2) Pull the Custom Code Window out of the tool window area and onto the desktop by clicking and holding the “Custom Code” tab and dragging it outside of the tool area. This will allow you more room to work with.

3) Add a new custom function by clicking on the “Add” button in the Custom Code toolbar.

4) Type the word “foo;” followed by the enter key twice, followed by “bar;” in between the “{“ and “}” brackets.

5) Click the “Compile” button.

✔ Notice the red marker to the left of the word “foo;” as shown in the figure below. This indicates an error with the typed in

program.

Getting Started 19

Page 19: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

✔ Notice that if you hover the mouse over the marker, that a more detailed explanation of the error is given.

✔ Notice that if you click on the ”Previous/Next Error” buttons that the editor's cursor will move between the two compilation errors.

✔ Notice that if you click/unclick the “Show Line Numbers” button that it will toggle the display of line numbers in the editor window.

20 A Quick Tutorial of HL7Spy

Page 20: HL7Spy 1.1 Getting Started - ihs.48thave.comihs.48thave.com/downloads/GettingStartedGuide.pdf · you go through this tutorial you will have a good feel on how to use most of the features

Getting Started

6) Replace the entire contents of the editor with the following:

public override void Run() { // Get an HL7 Message in parsed format Hl7Message message = GetParsedMessage(); // Get the first PID segment PID pid = message.GetFirstSegment<PID>(); if(pid!=null) { string name = pid.PatientName_05.First.FamilyName_01.Value; bool match = name.StartsWith("A"); if(match) { // add the message to a new message tab. SaveMessage(Message, "Code Query"); } }}

7) Click the “Run” button.

✔ Notice the progress bar advances as HL7Spy calls your “Run()” function for each message in the active Message Collection.

✔ Notice that a new tab is created in the Message Editor called “Code Query”. This message collection contains only those messages where the patient name started with “A”.

8) Next, we will change this code to find all male patients that were born in the years 1965 and 1966.

9) Delete the following two lines

string name = pid.PatientName_05.First.FamilyName_01.Value; bool match = name.StartsWith("A");

and type the following in manually. (Don't use cut and paste or you will miss the intellisense feature.)

bool match = pid.AdministrativeSex_08.Value=="M" && (pid.DateTimeOfBirth_07.Value.StartsWith("1965") | pid.DateTimeOfBirth_07.Value.StartsWith("1966"));

✔ Notice when you type the “.” after pid, a drop down off all available properties for the pid segment are displayed.

✔ Notice if you click the “Run” with the active Message Collection being “SampleHl7.zip::Data.hl7”, that a new Message Tab is created with 257 matching results.

Getting Started 21