What is the history behind the development of Autodispens? How was the idea conceived and what was the motivation?

In 1985 Pal teamed up with Roshan Lal to find a new site for a pharmacy as they did not have the finances to buy an existing business. They plotted doctor’s surgeries against pharmacies on a map and found that there was potential on Canvey Island. This application and subsequent ones for new sites were turned down and Pal fought at National Appeal level and won. They themselves shop fitted this and subsequent premises to their specifications.

One of the key challenges for a pharmacist is to accurately and efficiently dispense medications. Before their new pharmacy was opened, Pal had made a pill counting machine out of a broken down calculator, photocells, pharmacy plastic bottles and odd pharmacy plastic products by welding them with a soldering iron. The counting machine worked but sometimes missed count because calculators are not designed for high speed input.
This idea was abandoned as they found a ready made weighing / parts counting machine made by Ohaus Scales. This scale could be interfaced to a PC which gave Pal an idea that a Pharmacy Computer System could be produced which stored the piece weights of the tablets / capsules which  can then be downloaded onto the scale to accurately count tablets and capsules. Pal met an Ohaus representative at their office in Cambridge (UK) and purchased a suitable model for this application in July 1987.

The pharmacy labels prior to this computer program were produced in the new pharmacy by an electronic typewriter which Pal had adapted to hold pharmacy labels. Dr Jena, a local doctor asked Roshan to employ his son Rajesh for the summer holidays. Rajesh started work as a 16 year old in the summer of 1987. It was apparent he had a gift for programming and is now a Consultant Oncologist having graduated from Cambridge University. He programmed in Basic on the BBC Acorn computer which had no hard drive. Pal and Rajesh in a few weeks produced their first pharmacy labelling system which was linked to a laboratory scale which counted the pills as the drug was accessed. There was a small database of drugs which was accessed by typing the first 3-4 letters of the drug name and the loose pills were counted fast and accurately by the laboratory scale. There was not enough memory to incorporate patient records. Rajesh suggested purchasing a Winchester hard drive for the BBC micro so patient records could be incorporated.

Pal incorporated another idea into the system. An ambiguous search for the drugs was performed when the drug name could not be read from a hand written prescription. Several clues were given according to what could be read accurately from the parts of the name, strength and form of the drug. This was a lengthy search but it usually found the drug or produced a short list. This was later incorporated into the main search for the drug search including other logical algorithms such as priority flags and learning modes. This worked really well but there was still a ‘hit or miss’ element to it. It took about 18 seconds to access a drug which seemed too long.

Since the system worked really well and was user friendly it was marketable. The problem was that it was written in Basic, a translation language so the source code could be seen. It was suggested by Rajesh to rewrite the program in a language like Turbo Pascal which is a compiled language and run it on the basic PC. Later PCs were upgraded to 286, 386, 486 and Pentium processors. Professional programmers were approached to convert the code who decided they could not do it without significantly slowing the system down. To progress this Pal bought a PC and a set of textbooks on Turbo Pascal and Rajesh successfully converted his program from Basic to Turbo Pascal in the following summer holidays. Using this new program the time taken to access a drug took 11 seconds which Pal felt was still too long!

Shortly after that Pal went to see a demonstration of their wholesaler McCarthy’s prescriptions labelling system called Autoscript. This gave Pal the idea of calling his system Autodispens since it also counted the pills. Pal enquired from the demonstrator if the system was fast. The demonstrator was able to access Amoxil 250mg Capsules almost instantly from over 10,000 drugs by typing in AMO2. The speed of access impressed Pal and he wondered how that was achieved.  At that stage Pal had little knowledge of programming and did not realise that the drug was indexed to AMO2. The search he wanted to do was ‘search by query’ involving a lot of string manipulations and comparisons which inevitably would be slower. Pal slept on the problem and came up with a possible solution.

The following day Pal asked Rajesh the all important question “Can’t the computer search while you type?” It should be faster because the list is being reduced constantly so at each stage there is less to process. The term ‘Search-As-You-Type’ was thus coined! Rajesh felt that this process would be slower since the computer would not know what you mean by each key press, where the clues separate and when you actually stop the search. The computer will continually go in and out of the disk actually slowing the search. Rajesh produced a small program to illustrate this. Pal, however was not convinced.

Before Rajesh left for his holidays Pal asked him to write a small program to show him how to access the drugs from the hard drive. This was a small program about 10 lines of code called Rajeshdemo. Before Rajesh came back Pal had converted Rajeshdemo to Paldemo which was over 150 lines of code. This was the beginning of Search-As-You-Type. This was the drug access program and it became bigger and more complex. It was incorporated into the main program and is called Palcode for historical reasons.  Although the drug search was very fast and accurate there was still a certain ‘hit or miss’ element to it as the results of each key press were not being displayed. This feature was incorporated so the results of the search were then displayed at each key press. The fear was that this would slow the system down but it did not make any noticeable difference.

The next major task for Pal was to rewrite all the front end applications like Quantity, Directions and Patient Record as ‘Search-As-You-Type’.  Apart from the tremendous speed gained from this approach the other main benefit was that it made the program a lot more user-friendly. The user could see the results of each key presses and it was easier to figure out what to do to achieve the desired result at each stage of the prescription labelling process.

The original motivation for developing the Search-As-You-Type algorithm was speed of use but later it was ‘the user friendly’ aspect of it and much later it was its ability to incorporate the ‘over the shoulder’ approach. While the user keys in the input to do a particular task, the computer in the background would cross check other relevant data for safety and legal reasons. The latter as stated in our advertisement in the Pharmaceutical Journal gives “a new era of intelligence”. One day all software will be written like this!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: