Jason Wolfe's 'Listpat' Homepage
*** Written by Dr Jason Wolfe ***
Copyright © Jason Wolfe 1993-2001 (Version 1.48)
[ Compatible with Psion Series 3a & 3c. (Not Series 3). ]
Updates of this program are available on-line at http://www.jwolfe.clara.net
|The patients in the dummy file have for the most part real diagnoses, but the names, hospital humbers, dates of birth, dates of admission and dates of discharge have been changed to protect their identity.|
|(Note that it appears that most of the printouts are so wide that they could never fit on one page, but this is achieved because with Epson & Hewlett Packard printers, control codes are sent to the printer which make the output condensed. Thus, all of the important details such as name, hospital number date of birth, date of admission, and sometimes date of discharge are seen at a glance on one line, whilst the diagnosis is placed in a column next to these details. The ward names too would be emphasized in the real printout because control codes are sent which make them 'double width, 'emphasized' and 'underlined'. Basically, the real thing looks even better.)|
'Register' this program.
Boring Legal Message
This Program is distributed as 'Shareware' - This means it may be freely copied and distributed. However if you find the program useful, you are REQUIRED to register yourself as a user of the program, and INVITED to contribute an appropriate registration Fee. The registration fee is not compulsory and is basically what you think the program is worth.
Registration entitles you to free technical support and upgrades. If you have any genuine questions about this program or need any alterations made, I am contactable by email using the address above. For major alterations or rewrites I may charge a suitable 'Consultation Fee'. Please DO contact me to register , even if you do not intend paying, as I am anxious to find out how many people are out there using my program.
You may not change ANY part of this program or use ANY part of it in any other products without my express permission. The program must be distributed in its entirety, with the 'help' file and 'dummy' file included. This Program is Not Public Domain.
(You can of course change the program variables relating to the Filename, Wards, Search Dates, Consultants, and various Printer & Formatting Defaults)
Finally, this program is supplied as is. I cannot be held responsible for computers crashing, patients dying, the world ending, and the like. You use the program at your own risk. All I know is that it works on my Psion fine, has helped me a great deal, and has never damaged anything.
WHAT THE PROGRAM DOES :
WHAT THE PROGRAM DOES NOT DO !
This is not one of these ward round assistant programs which will store and manipulate the details of patients in its own database format. For one of these programs you should look elsewhere - there are plenty of them available. It uses the standard Psion database for holding the patient details and analyses that file to produce a pretty printout. I don't know about you, but I would rather scribble notes down on paper during a ward round than use a bulky palmtop computer for entering notes in real time.
HOW I USE THIS PROGRAM :
The way I use this program is to produce a paper printout of all of my patients at the beginning or the end of the day and use that paper to continuously scribble notes and updates to patients management. Once a day, I sit down for 5 - 10 minutes and update all the computer records ready for the next printout.
I have 3 files on my Psion relating to patients: One called 'TCI' with patients still awaiting admission. Another called 'Pat' which contains all current inpatients. Finally, there is a file called 'Old' which contains all patients who have been discharged. As well as printing out lists of current patients, I can print out the full list of patients waiting to be admitted, and also I can carry out audit by printing out neat lists of patients who have been discharged in recent months.
JUST WHAT CAN THIS PROGRAM DO FOR YOU ?
Well, its not going to do all your work for you!! It might however give you that overall view of your patients, so you can prioritise the problems. It also is helpful on ward rounds because the list can be configured to the order of wards you generally go on.
The Patient List can be ordered according to :
- Date of Admission
- Date of Discharge
- or may simply keep the order the same as the Data File.
(Which you may have pre-sorted into alphabetical order).
If a printer is connected, then the Program will detect it, and send the appropriate codes to the printer. Three printer Drivers are already installed: One for Epson Printers, one for Hewlett Packard, and one for Canon Printers. If you do not have any of these printers, and your printer is definitely incompatible, then the 'General' Printer Driver should work for practically all printers, including Laser Printers. Note that the printer drivers have been written to output data via the parallel port cable and so won't work with a serial port printer cable. You will need a 'parallel' printer cable to print direct to a printer.
If you do not have a printer and you wish to transfer the formatted document printout to another computer, then you can choose the option 'Print To File'. This file can later be transferred to a PC or Macintosh using the appropriate serial link software.
INSTALLING THE PROGRAM
Transfer the file 'listpt/opl' to the OPL Directory on your Psion using whichever transfer program you have. On PC's this will be 'PsiWin', on Macintosh's it will be 'PsiMac', and on Acorns it will be 'PsiRisc' or the 'A-Link'. It is also suggested that you also transfer the file named 'Dummy/dbf' to the DAT Directory on your Psion, since this file shows the format of database file which Listpat expects to see.
Once the file is loaded onto the Psion, view the file in the OPL Program editor. Before being able to run the program, you will need to 'Translate' the file into a OPL 'run' file. This is very easily achieved by pressing <Psion-T>, or you could also select translate from the program menu. This will create a new version of the program which the Psion can 'run' - It may take a minute or so for translation to be finished. Finally, once it is finished you will be able to run the program.
The program is set up so that it should immediately be able to work on the attached 'Dummy/dbf' file, and it is suggested that you both look at the 'dummy' file in the database application to check the format the program expects to see, and experiment with Listpat's handling of the dummy file to see exactly how the program works.
The Dummy file contains the details of 50 patients with real diagnoses, but all identifiable information such as names, hospital numbers and dates of birth have been changed to protect their identities.
THE DATA FILE FORMAT
The data file should take the format of :-
|In order to create a 'Data file' of this format, you will have to carry out the following operations :|
|1.||Go into the system screen and place your cursor over the 'Data' application.|
|2.||Press <Psion N>, which will create a new database file. Give the new file a name. (I call mine "Pat" for current patients, "Old" for discharged patients, and "TCI" for those patients still awaiting admission). Then press <Enter> to enter the Data application.|
|3.||Now press <Psion L>, which will allow you to edit the field labels.|
|4.||Allocate the labels as follows and then press <Tab>.
|5.||You are now ready to start entering patients' details.|
See the attached file 'Dummy/dbf' for examples. It has 50 patient
records, most of which have originated from real admissions, but some
of which I have created out of thin air. All the names and hospital
numbers have been changed to protect the innocent (and prevent me from
being prosecuted under the Data Protection Act).|
RULES OF LAYOUT
|1.||The Name can be any length, but will be clipped to 18 Characters.|
|2.||The Bed Number is Optional and should be separated from the ward
by a Single Space. |
|3.||All Dates take the Format : Day.Month.Year (Eg. |
The Year should be two numbers only - NOT 4 or 1
The Date Separator should be a Full Stop - Nothing else is allowed.
|4.||By Convention, Dates of Admission are Preceded by a Capital 'A'.|
By Convention, Dates of Discharge are Preceded by a Capital 'H'. (Home)
By Convention, the DOA & DOD are Separated by the '2 Spaces, a Hyphen sign, and then another 2 Spaces. (Ie.
|5.||By Convention, a patient which has died is entered on the Dates Line as|
'RIP H' followed by the date they died. (Eg:
This enables the Program to pick this up, and append the information to the end of the Diagnosis / Notes Line. (Rest In Peace)!
|6.||By Convention, if a Patient is admitted more than once, then each|
admission should be on a Separate Line. This is achieved with the use of <Shift Return> in the Data File. In this case, both the Dates Line and the Diagnosis Line should be introduced by the Number of the Admission, a Full Stop, and a Single Space.
|7.||If there is a note relating to the Date of Discharge, then this can be
entered in Brackets after the Date of Discharge on the Dates Line.|
This note will be appended to the end of the Diagnosis / Notes Line.
|8.||If there is extra information on the Consultant Line which is in
to the Consultants Name, then this too will be appended to the end of the Diagnosis / Notes Line. This might be useful for example for storing specific Audit Information.
(Forster is the consultant, the rest means the patient is postop and the operation was classed as major.)
You can enter any audit information you want on the consultant line.
|9.||To Enter information on more than one line (in the Data File), but keep that information still under a Single Label - Use <SHIFT RETURN>.|
|10.||Each Label can contain up to 255 Characters - Any more will confuse the Program and cause errors. (The reason being that Characters over the 255 character limit are treated by the Database Program as if they are associated with the next Label down).|
If there is an error of Layout, the program will stop and advise you
on which Patient the error is associated with. You must exit the
program, correct the Layout in the Data File, and then try again.|
Please use the Conventions I have mentioned above - The Program relies on finding those particular layouts to work correctly.
CUSTOMISING THE PROGRAM
To alter the Program for use with new hospitals and consultants, you will need to alter (as necessary) the Filename (file$), the List of Wards, the default Dates, and the Names of the Consultants. These are all found between the two sets
of ******** Asterisks ******** 's close to the beginning of the OPL file, in the program editor.
Change all the details as necessary and when finished, you will need to translate the program again into run code. This is done by pressing <Psion T> as explained above in the section on installation. Once this is done, your program will be customised to run with your consultants, your patients, your wards, and your printer.
The following section is a direct copy of the OPL programming code, so you will be able to see what you will need to change in the actual OPL file for customisation prior to running. Every aspect which will ever need to be customised can be found between the two sets of asterisks. I wouldn't advise changing anything else in the program unless you are an experienced programmer, and besides, it is against my copyright!
Generally, everything which needs to be changed will be found within a set of "quotes". Apart from the printer type default, you should only ever change what is found within these quotes.
Here follows the OPL section :-
The default name of the data file which contains the Patients
My default file is called 'Pat', but you can use whatever you want.
Adds the File Suffix and Sets the Default Location where Files are
Found. Only change this Default Path if you know how - Consult the Manual.
The Default Listing Option
Ward = 1, Simple Order of Data File = 2, Full Audited List = 3,
Date of Admission = 4, Date of Discharge = 5
Here Follows the List of Wards:
To Change the Wards, delete what is between the quotes and add the
appropriate new name of the ward. Add or delete extra lines as
is necessary. The number in Brackets should go up sequentially.
The Order of Wards here is the Order of Wards which will be Printed.
The names of up to five consultants
If there are less than 5 consultants, leave the entry 'null'
(Eg : cons5$="")
The Start Date & End Date Defaults (used for lists sorted by date)
The Default Printer
General = 1, Epson = 2, Hewlett Packard = 3, To File = 4
HOW TO USE THE PROGRAM
|1.||Select your choices from the initial menu, and then press
Thats all. It's as simple as that.
|2.||If a printer is connected, the program will send the information to the printer. If no printer is connected, the text is just outputted to the screen. See note at the end of this file about switching off serial port communications.|
|3.||The initial Dialogue Box Menu is like any other Psion dialogue box.
Choose the file to list using the cursor keys. You can also navigate around the filing system to choose files in different directories by pressing <Tab>.
|4)||The 'List by' options:|
|a)||If you choose to list by 'Ward', the printout will include all the patients on one ward before moving onto the next one. The order of the wards will be the same order as was defined at the time of customisation. This printout will also (uniquely within this program) include the bed number of the patients, useful for finding patients quickly during a ward round.|
|b)||If you choose to list by 'Order of Data File', the order of patients
listed is basically the same as the order you left the file in when you
last used the file in the 'Data' application. If you have previously
sorted the file into alphabetical order using a sorter program, then
'Listpat' will print the patients in this alphabetical order.
(Note that Psion Series 3c Data application sorting facility doesn't actually 'SORT' any files into alphabetical order ever. It merely finds correct alphabetical order and 'DISPLAYS' them in this order. Thus, even if you have alphabetical sorting on by default in the Data application, you won't find 'Listpat's' printout in alphabetical order. To get a proper alphabetical printout, you will need to use a separate Sorting application, which, as luck would have it, I have also written. It is called 'Sort' and is also available for download from my website.)
'Simple Order' prints out the Name, Consultant, Hospital number, Date of birth, and the most recent Date of admission and Diagnosis. This is generally used for printouts of patients who are still in-patients.
'Full Audit' prints out all of the above, but also includes the Date of Discharge as well. In addition, if the patient has been admitted more than once, then the program will produce a separate entry for each admission. This option is more suitable for printouts of patients who have already been discharged.
|c)||If you choose to list by 'Date of Admission' or 'Date of Discharge'
the program will search through the Data file and produce a printout
with the patients listed according to the dates they were admitted and
discharged respectively. To do this, you must select a 'Start Date'
and 'End Date' as criteria for the search, and enter these dates in
the space provided in the menu. Note that the correct working of this
function depends on keeping the convention that a date of admission is
preceded by an 'A' and a date of discharge is preceded by an 'H'
within the Data file.
I have found this option useful for printing out lists of patients for medical and surgical audit which is often based on patients discharged over one or more months. To list all the patients discharged in the month of February 1995, you just set the start and end dates to be 1.2.95 and 28.2.95, and select printout to be by date of discharge.
|4.||Finally, you can change the printer driver from Epson to Hewlett Packard
or whatever, depending on what printer you have in front of you. Most
printers have output which is compatible with one of these two printers.
Canon printers will work with Epson Codes.
If you do not have a printer and you wish to transfer the formatted document printout to another computer, then you can choose the option 'Print To File'. The file created will be called 'P.lis' and will be placed in the Psion root directory. This file can later be transferred to a PC or Macintosh using the appropriate serial link software, and then printed from your desktop computer.
If none of the specific printer drivers seem to work, then choose the 'General Printer Driver'. This should work with virtually every printer under the sun, because it sends only ASCII characters to the printer and no control codes.
|5.||When the program is running, it will only list a single line of patient information on the screen. It is done this way because the Psion screen is quite small and it is difficult to display large amounts of information all on the screen at once tidily. This means that the diagnosis is often cut short on the screen, but note that whenever a printer is connected, it will always send all of the relevant details to the printer, despite what is seen on the screen. 'Listpat' is not primarily a patient viewing program - For this you should use the Data application. If however you want to see all the details on the screen as the program runs, then change the printer driver to 'General' or 'To File', and what comes up on the screen is exactly what would be printed if a printer was connected.|
|6.||When the program has finished printing or displaying your patients, it will then helpfully display the number of patients it has printed and also the numbers of patients under each of your selected consultants. This tells you how many patients you have, and on a daily basis will tell you whether your number of patients is moving in the correct direction. (Ie. Down)!|
HINTS & TIPS
|1.||To help with tidy Printing, pressing any key will halt the listing until another key is pressed. If the Program is listing by ward, then if you press <Space> the listing will stop at the end of the ward. This is useful if you want to keep all the patients on one ward together on one side of the page. You print your page ward by ward until the paper is almost full; you then press 'Form Feed' on the printer and then press space or another key on the Psion to resume printing.|
|2.||If you have already stopped the listing by pressing <Space>, you can restart the listing at a different ward. Just press a number (between 1 & 9), and then listing will continue at the ward which has that Number (as defined by the Ward List found above). This is useful if you want to skip a few wards or want to repeat a ward again. Please note that in this case, the counting of the Number of Patients will be incorrect!|
|3.||To break out of the Program while it is running: Press <Psion Esc>.|
|4.||The program will work on the Psion Siena, but it is not directly designed to do this. The screen output will be all jumbled, but the printer output should be fine.|
|5.||If you move hospital, you will have to go back and change the customisation options to suit your new wards and consultants. However, it would be good sense to save a version of the OPL program file with all your old settings under a new filename. This will save you having to update all the settings back to their original state if you ever choose to go back to your original hospital.|
|6.||Patients where you don't know yet which ward they are on should have the ward entry in the 'Data' application set to 'Unknown'. This will prevent those patients from being missed out in the final printed version.|
|7.||Certain of the ward names at the end of the customised ward list
should probably be left alone and available for the program, as they
have special significance. These include areas like A&E, Admissions,
Daycase, etc... The program will identify patients in these areas
and when printed out, will alter the named areas to make the printout
tidier and more appropriate. Thus:
'TCI' becomes 'Patients To Come In'
'ITU' becomes 'Intensive Care Unit'
'OPD' becomes 'Outpatients Department'
'A&E' becomes 'Accident & Emergency'
'CCU' becomes 'Coronary Care Unit'
'SCBU' becomes 'Special Care Baby Unit'
'Review' becomes 'Patients to Review'
'Other' becomes 'Patients on Other Wards'
'Unknown' becomes 'Unknown Location'
'Daycase' becomes 'Daycase Unit'
'Admissions' becomes 'Admissions Unit'
|1.||The only potential problem with this program occurs if the Psion
Communications Option is set to 'Serial port'. If you try to run
the program on a Series 3c with communications on serial port, then
the program will come up with the error 'File or device in use'.
This is not my error! It stems from the fact that the Series 3c
expects to get serial communications *only* when 'Serial port' is
selected. If you try to use the same serial port to print using a
'parallel' cable or even test to see if a printer is connected through
a parallel cable, the computer will come up with this error.
The simple solution to this problem, is to set communications to 'Psion IR' (infra-red) or to 'None'. This menu can be brought up in the system screen by pressing <Psion L>. The program should then work as normal.
|2.||This program will suffer from the 'Millennium bug', but only when printing out lists of patients according to Date of Admission or Discharge and where the patients in the Data file were admitted one side of the millennium and discharged the other side. On either side of the millennium the program will work as normal.|
|3.||Each individual Psion Series 3a or 3c 'Data' record can be up to exactly
4K long. The maximum length of record for the Psion Series 3 was 1K.
Similarly, the maximum length of a single line in a Series 3a & 3c
record is 1K. The maximum length of a line on the Series 3 was
256 bytes or characters (a quarter of 1K).
Psion in their infinite wisdom forgot to update the OPL programming language to allow for these increases in record size. This means that if you try to access a Data file which has any record greater than 1K in length using standard OPL routines, or any line which is longer than 256 bytes, the OPL program will crash.
If the record is longer than 1K, the error flashed on the screen is 'Record too long'. If this is the case, I cannot even access the file at all - the OPL programming routines won't allow me to do so. There are ways around this by using machine code and direct file access, but I don't have access to these methods because I don't have the 'Psion Developers Toolkit', which costs 200ukp. You will just have to search through your Data file for records which seem to be too long and shorten them.
If a line on the record is greater than 256 characters long, then the error flashed on the screen is 'String too long'. Here, the operating system does allow me to access that particular file, so I can tell you which is the offending record. The solution is to go back to your 'Data' file and shorten that particular line of the offending record.
Fortunately, these errors are very rare under normal Psion use.
|4.||Be careful to include in your list of the default wards all the possible wards that your patients could ever be on. The program will only search for patients who are in those list of wards. If you have a patient who is on an outlier ward, and you have not mentioned this ward on the default ward list, then that patient will not be printed out in the final hard copy. Don't blame me then if you forget about your patient for a week. For the same reason, make sure that you spell the ward on the default ward list exactly as you spell it in the data file.|
(Experienced Programmers Only)
|1.||If you wish to have the Labels in the Data File in a different order to the one I have chosen, you will need to change the order of the variables in the line which begins OPENR. You will also have to change the two variables 'wardpos%' and 'datepos%', which indicate the respective positions of the labels of the ward and dates in the data file.|
|2.||If you wish to add a new Printer Driver, you will need to know the various printer codes relating to underlining text, making text condensed, etc. I suggest you replace one of the Printer Drivers already on this Program with your own codes. printer% is the relevant variable to look for.|
|3.||If you want to fit more or less characters on one line, then you will need to alter the Variable 'rmargin%'. This is equal to the maximum number of characters allowed on one line. It will be different for different printers.|
|4.||If you want to change the Maximum Width (in characters) allowed for each column on the screen / printout, then the appropriate variables are namelen%, bedlen%, conslen%, hosplen%, doblen%, doalen% and dodlen%. This might be necessary for example if you had a Consultant whose name was longer than 7 Characters.|
MY OWN IDEAS FOR IMPROVEMENTS
|1.||Improve the GUI (Graphical User Interface).|
|2.||Activate the 'help' key within the program.|
|3.||Include alphabetical sort options within this program.|
|4.||Include a trap when listing 'by ward', to ensure that patients who are on unknown unknown wards are still printed.|
|5.||Write some more printer drivers for different printers.|
|Thats all. Happy computing and happy doctoring.|
(Please send all bug reports and suggestions to my email address).
© Dr. Jason Wolfe (1993 - 2001)
To contact me : Email
My Website is at http://www.jwolfe.clara.net. You're already there !!
Back to Top of Homepage
Last Modified : 31st March 2001