Here is an example of a report:
Search criteria:
msgtype = A60 allnm = ‘^[a-z]’
MID TIME visit allcd allnm
441864390 2011/11/04 12:53:31 11112222 00004812 ketorolac
441872516 2011/11/04 12:58:37 33334444 00004116 paclitaxel
441896182 2011/11/04 13:14:35 55556666 00001545 morphine
442022471 2011/11/04 14:26:43 77778888 00001545 morphine
442033306 2011/11/04 14:32:31 99990000 00001545 morphine
messages read from smat file 6726
messages found and matched 5
The visit number is changed but the rest of the information is the same as produced by the report. If you change the font to Courier New, all the columns will line up.
The query syntax that generated this report is ‘HL7-like’ :
msgtype.0 MSH#9[1]=A60 visit.12+1 PID#3[0] allcd.8+1 IAM#3[0] allnm.20+1 IAM#3[1]=’^[a-z]’
The attached documentation spells out the syntax, but basically you use pairs of header and element criteria, and the header specifies that column name and width. A width of 0 means it will not be printed but it will be used for matching. This case matches only A60 messages and looks for allergy names with a leading lowercase character.
This is more of a brute-force search tool than a small and elegant program. There is no capability to use OR conditions across segments but you can use regular expressions to match each data element. Equals and not equals is supported, as is exists and not exists.
I’ll also try to attach a crude GUI application that works in AIX and may work in other UNIX operating systems. Your mileage may vary. This tool works with ASCII and ebcdic smat files, but I can’t guarantee that your ebcdic conversion will work. This tool works with data coming from Invision on z/os and accomodates length encoding and some Invision control metadata that you may have to change the program to make work with your own ebcdic data.
I have borrowed from many posters here including Charlie Bursell, Jim Kosloskey, Russ Ross and others, and I thank you for your posts and contributions. The errors here are my own.
If you use the smatr GUI TCL, you need to edit the program to point to your own property files and locations. These are tested on Cloverleaf 5.8.4 and AIX 6.1.
I’ve added more global variables in the smatrpt.tcl than necessary but I had to make it executable from the other TCL, the smatr.tcl GUI. I’ll be at a Cloverleaf class next week but I can answer questions at night.
Peter
Peter Heggie