For the past month I’ve been working on a complete rewrite of APK for Windows, something which was sorely needed.
APK was written in Delphi 3 some 12 years ago. I’ve kept it under Delphi 3 to keep the code base stable and to keep the executable light weight. But D3 lacks a few features, and is not compatible with some newer extensions. So, I finally took the plunge and converted the code base over to Delphi 2007. I was dreading the re-compile because some of the older extensions would need to be rebuilt, fortunately they converted over with very few problems: TFindFile, TRecNoLabel, TBackupFile.
The first coding challenge was to convert the various dialogs over to one consistent style. In previous versions I had used all three Delphi dialog functions (ShowMessage, MessageDlg, and MessageBox) in a haphazard way. They have now all been converted to the Project Jedi overloaded MessageDlg component which provides a consistent look/feel and form centering.
The first new feature I implemented was form re-sizing. My first choice, the freeware TFormResizer, did not re-size the toolbar correctly and the caption would appear at random places. I read good things about TElasticForm so I purchased it. This component worked perfectly except when maximized, so I decided to set the max width/height constraints to values that looked good on my monitor. But I’m not sure if their appearance will be consistent on all monitors.
Then I wasted a lot of time on various labeled data controls. The controls from SoftSci were very buggy. Then I found some freeware labeled db editors on Torry which worked fine, but really didn’t add much to the experience and took too much busy work to change them over. I am using them on the patient data tab, but nowhere else.
The next huge task was to update the Greatis print preview component. I had been using Dimitri’s original PRNserv from 2000, and it was a little quirky. I tried installing the most recent version I had, from 2008, but it would not install. I shot an email to Dimitri who wrote back immediately and sent an update. The code hadn’t changed much, the changeover went smoothly, and the reports are much nicer.
With everything updated I could finally work on some improvements. Password protection is a farce, a false sense of security, but for HI-TECH Act compliance I added a password to the log in screen. Another client (not a pharmacist) wanted to add a 6 month expiration to the password. But, in the real world, when Pyxis and Cerner ask to reset the password, I do, then change it right back to the one I always use. A complete waste of time.
The consult report was something else I wanted to improve, some of the changes are:
- Added time of consult (request)
- Added ability to edit checked comments (request)
- Added a barcode printing option
The monitoring form was changed to a Word template, similar to Antibiotic Kinetics, with allergies and chief complaint added.
The population analysis report was improved with something I’ve been wanting to implement for years: a graph of Kel vs CrCl with points and a regression line.
Next I added a access log viewer to the workload/consult report. Then added an export to Excel function on this dialog as well.
There are only two major things left to do, one simple, one daunting.
Something I’ve always felt a need for is a “levels scheduler” dialog. For example, input the regimen starting date/time, and the program will calculate the appropriate date/time for levels, based on either “x” number of doses, or arrival at steady-state.
The most complicated thing yet to do is data encryption. I’m really not sure how to even go about it yet. Unfortunately there is no built-in encryption function in Topaz. So, I will have to code encrypt/decrypt functions for each. Well I just had an epiphany while writing this blog entry. I will only need to encrypt one field, patient name. Without a name, the rest of the data is meaningless, that will make the task a little easier.