APIII - Advancing Practice, Instruction & Innovation Through Informatics

Marriott City Center, Pittsburgh, PA | September 20 - 23, 2009

A State Pattern Recognition and Extraction Engine Tool for Legacy System Interoperability

Michael Riben MA; UT MD Anderson Cancer Center; Mark J. Routbort MD; UT MD Anderson Cancer Center;

Content:

One of the factors that makes migration of legacy, terminal based hospital or laboratory information systems challenging is the complexity of the domain these systems manage, and the difficulty this provides for attempting big-bang system upgrades. In our institution, we wanted to provide an iterative approach for developing provider order entry by migrating the ordering, but not scheduling, of outpatient lab tests out of our legacy Siemens TN3270 system. At the same time, we wanted to preserve a tight functional coupling between the scheduling of patient appointments and the preexisting ordered tests. We examined developing a conventional macro-based scripting interface to accomplish the functional coupling, but found it poorly suited to what was essentially a pattern-recognition problem.

Technology:

In response, we have developed an tool named TermGen which is capable of autogenerating C# applications to enable state pattern recognition and data element extraction from legacy terminal-based systems. TermGen is written in C# and uses interfaces to enable it to generate code for multiple different terminal emulation programs. The main requirement is that a terminal emulation program expose an application programming interface capable of taking a coordinate based snapshot of the test in the current screen. In our use case, we are using WRQ Reflections for IBM.

Design:

A state pattern is defined by taking a snapshot of the terminal screen, defining a name for the state, and then using text selection to define the unique determining characteristics of that particular terminal state. The parameters of each selected fragment (position and length) is stored within the object model of the state as a collection of pattern segments. Next, extraction segments are defined in a similar manner by selecting areas of interest on the terminal screen and naming the extractor elements. Extractor elements, in addition to having position and length, may have repeating vertical segments, and can be associated with extraction rules, such as whitespace elimination or numeric enforcement. Upon creation of the graphical state model, TermGen will generate code capable of invoking an autonomous state pattern monitor. Briefly, the monitor polls the underlying terminal emulation program for the text of the current screen. Each defined state pattern is defined for matching, and if a match is found, an event containing the previously defined extractor elements is raised from the engine. Application code to process the extracted terminal data elements can then be easily hooked up to the autogenerated engine events.

Results:

Using the state pattern recognition model, we able to very easily generate code to perform tasks such as extracting lists of data from our legacy applications. State pattern recognition was also a robust and simple solution to our original use case, which was to recognize newly scheduled appointments for patients.

Conclusion:

State pattern recognition represents an alternative and potentially more productive approach to terminal based scripting interfaces built using a macro recording tool. The application and source code for TermGen is being released under the GNU General Public License.

Search