MWB Message Generation

 

The MWB Message generation feature permits the creation of an unlimited number of unique but semantically correct HL7 messages for testing. The generated messages conform to the currently loaded message profile. It is intended to serve developers primarily as a bench level testing tool which hopefully will add to their productivity and reduce the cost of testing at more expensive venues such as formal test labs and on-site testing.

 

It supports both ER7 and HL7 2.XML message encoding. The Messages Created may be saved to a file manually or automatically as part of a generation session. The messages may also be sent to a receiver via a socket connection using the Minimum Lower Layer protocol (MLLP) framing.

 

This feature is actually a combination of 2 tools. One incorporates the ability to create and manage a values repository, the other allows the user to establish a connection and generate messages.

 

The MWB Message Generation feature is invoked from the Main Menu, Tools option as illustrated by the cutaway of the MWB main screen below.

 

 

 

MWB Tools Menu – Generate Message Instances

 

Values Repository Management

 

Before message generation can begin, a Values Repository must be loaded. These files have a ‘.mvr’ extension and are stored in the MWB’s root\Lib folder by default. As illustrated below by the Message Instance Generation File menu, there are several options that facilitate the creation, extension and management of these files.

 

 

Message Instance Generation File Menu

 

 

 

Ordinarily the first step after invoking the Message Instance generation is to Open a Repository File (first option on menu) or create a new one. If however the repository was saved as an integral part of the profile (as the ‘Save Repository with Profile’ option implies), the repository is immediately loaded as the feature is activated. Once a repository is loaded, messages may be generated.

 

To create a new repository from scratch, there are a few options as indicated on the File menu. One might start by harvesting the values from the currently loaded profile. This will add all of the example values from the profile to the value repository. Another option is to harvest values from message instances.

 

Harvesting values from multiple message instances requires that he messages be stored in a text file, each message separated by a blank line. The message files gathered from MWB Validation sessions are perfectly formatted for this feature.

 

The message instances used to build a repository need not be the same as the loaded profile. The values in the repository are stored by element name, and since HL7 messages share elements in general, any message instance can add values to the repository.

 

Another method of building up a values repository is to merge existing repositories together. Use this feature to select and merge another ‘.mvr ‘ files contents into the one presently loaded. This feature may be especially beneficial if two or more groups each of which have individual values repositories decide to collaborate. Note that whatever method is used to build repositories, including the manual entry option discussed below, the MWB filters the input to ensure that all elements and all values for a given message element are unique.

 

Note that the File menu options permit saving the currently loaded Values Repository file, or to save it to another file name after editing.

 

Referring to the figure below, we’ll examine the tools for managing an existing repository file, generating messages, and managing the generation session.

 

 

MWB Message Generation form

 

Area (1) on the diagram provides a visualization of the values repository. Note that at the highest level of the tree is the name of an HL7 element (e.g. address type). Beneath each named element is a list of values for that element (e.g. P, C,O,..B).

 

The buttons beneath the repository tree designated as area (2) above, facilitate management of an existing repository. From left to right, the buttons facilitate the following actions:

 

 This button erases the entire currently loaded values profile from the repository tree.

 

 This button will erase the currently selected tree node. If an element name is selected, then the element and all of its values will be deleted from the tree. If a value node is selected, only that value will be deleted from the tree.

 

 This button in conjunction with the ‘Add/Edit Node Text’ window permits the addition of a new message element to the repository tree.

 

 This button in conjunction with the ‘Add/Edit Node Text’ window permits the addition of a new value to an element in repository tree.

 

 Enter a number into this window, and click the associated button to highlight all element nodes which have fewer than the number of values entered. Use this to determine which elements may need to have values added in order to meet a predetermined minimum number of alternative values in the generated messages.

 

As an example, in the illustration below, all of the elements with fewer than 3 alternative values have been highlighted blue, while those meeting the criterion retain yellow folders.

 

 

Highlight all elements with fewer than 3 alternative values

 

 

 Use this button to reconcile the loaded profile elements with the Values Repository elements. This feature searches through all elements in the profile with a non-NS usage, and adds them as elements to the repository tree if they are not already represented in the repository tree. This may be used in conjunction with the button above to determine if there are any element value deficits that would affect the message instance generation process.  Note that the ‘Add element Values from Profile’ option on the File menu produces the same effect.

 

There is one other feature that facilitates building and managing the values repository. It may sometimes be the case that several values need to be added for a particular message element. For example, the VA requires that all names in a message instance be obscured, and of a particular format. To assist in quickly adding a list of values, the MWB will insert a list of values from the system clipboard.

 

Insertion from the clipboard is accomplished by first creating a simple list of values in a text editor like NotePad then selecting the list. In the MWB, select  the element to which the list of values should be added, and then right click on the message tree. This action will cause all of the values to be added to element in the tree.

 

Message Generation/Transmission

 

The steps necessary to setup a connection, build and send messages will be described below in relation to the numbered areas of the ‘MWB Message Generation form’ figure shown above.

 

In section (3), the ‘Server IP’ and ‘Server Port’ fields must be filled in. These values are determined by the Receiver of the message. Once they have been entered, click the connect button to establish the socket connection. The indicator ‘led’ will change from red to green if the connection is successful.

 

The check boxes in section (4) determine whether or not the receiver requires that the MWB should release the connection between each send event (check the Disconnect box). This is normally not the case, and so the box is unchecked by default.

 

The ‘Accept Ack’ box in this session determines whether or not the MWB should expect an Accept Acknowledgment from the receiver. Accept Acknowledgements received will be displayed in the ‘Ack Response” text box below.

 

The Radio Group in section (5) determines the encoding used for the generated messages to be sent. Currently only ‘ER7’ the traditional delimited form of HL7 and the normative HL7 2.xml encodings are supported.

 

The checkbox in section (6) determines if a generation session will be maintained. If the box is checked, a unique session folder will be establish in the MWB’s ‘[root]\Projects\ --MsgGenSessions’ folder. This folder will contain a file that records each of the messages sent, a file that records each of the Ack’s received and a file that records statistics for the session.

 

The button labeled (8) will cause the number of messages entered into the filed labeled ‘Send#’ to be built and sent out the socket connection if one is established. Note that it is not necessary to establish a socket connection. If one is not established the messages will still be generated, and if a session has been established, the messages will still be recorded in the session file.

 

The button labeled (7) performs the same function as above in regard to sending messages however, the message instances are not generated by the MWB, but instead read from a file selected after clicking the ‘Read/Send Messages’ button. This allows the MWB to be used to send messages generated by another message generator such as NIST’s ‘Message Maker’ product, or to resend messages gathered in MWB message generation or validation sessions.

 

 Area (9) is used to report the number of messages sent/generated, and the number of ACK’s received.

 

Message Windows

 

Area (10) contains the Generated Messages window and the Acknowledgment responses window. Each message sent or received is recorded in the appropriate window, and each message is separated by a blank line. This same content is also recorded in the corresponding session file.

 

The adjacent buttons operate on the selected message window, either Generated or ACK. The content of the selected window will be bolded to provide a visual cue. The eraser button  will erase all of the messages in the selected message window. The save button will save the selected message window as a file. Note that this feature may be used in lieu of starting a message generation session.

 

 

Notes on MWB Internal Generation Rules

 

Currently the rules described below are hardcoded in the MWB. In the future most if not all of these will be made user selectable.

 

  1. The MWB will randomly select a number of repetitions for Seg Group, Seg, and Field elements depending on the min and max cardinality specified in the profile.  If the max cardinality is infinite (i.e. 0 in the MWB) then the workbench will impose a max cardinality of 6.
  2. The values in the MSH are not randomly selected from the corresponding elements in the Values Repository (VR). Instead, they are copied from the example values in the profile. This ensures that MSH.1 and 2 as well as sending and receiving applications etc. are consistent among message elements.
  3. Values for elements associated with a table are randomly selected based upon a lookup into the table file as opposed to a value randomly selected from the VR. If the table library is constrained within the profile then only the local table library will be consulted for values. If there is no profile specific table library, then the values will be selected from the table in the default table library. The ability to create profile localized table libraries is a new feature introduced in this release (6.3).
  4. If a value is not available for an element in the VR, the example value in the profile will be used.
  5. If an element is defined to be ‘fixed’ in the value will come from the profile, not the VR.

 

Other rules will inevitably be introduced over time, but the intent is that they will all be user selectable as opposed to hard codes as they are currently.