I've been working on "my first XML application" for the prescription files for Tk_familypractice. I'm using a package called tDOM-0.4 done by Jochen Loewer from Germany. It is a Tcl/Tk front end to Expat by James Clark. I posted the whole thing including expat and source code to http://www.medmapper.com/tDOM-0.4.tar.gz It's about 900kb. It has already been compiled on Linux so if you are running Linux and have Tcl/Tk on your system you could try it out. Other Unix users could re-compile it for their system. If you unpackage it you can cd into tDOM-0.4 and look for the file practice.tcl You need to edit the first line of practice.tcl to point to the Tk "wish" interpreter on your system. Then you should be able to exectute it. What it does is open the file drug_refill.xml and parse it using expat. I have used the SAX event handling model defined by the W3C to case the PCDATA sections of the XML data to be inserted into a Tk text widget. I then apply what are called in Tk "tags" - not to be confused with XML tags - to various parts of the data as they are inserted into the text widget. These Tk tags basically correspond to the XML tags. I can then bind mouse events to the ranges of text enclosed within these sets of Tk tags. In this example, I just cause the color of the medication name to turn blue and the sig to turn brown. I applied a binding to the medication tag to respond to a left mouse click and bring up a top window with the medication name and sig extracted from the record. This is not what it will be doing in the application - it's just a demo but the display will look pretty much like this in Tkfp when ready to be added to the application. I will be using it for prescription refills. When a patient wants a refill on the same medication I can click on it and a form will be generated for transmition to the pharmacy. In our case it goes by faxmodem because no pharmacies in this area have any network capablity. Alex Caldwell M.D.
