The clinical biochemistry laboratory computer system as a simple calculator: a program in MUMPS

The hand-held calculator is ubiquitous in analytical laboratories. Its major use is for simple arithmetical manipulations, such as totalling the test numbers processed during a shift or converting a series of absorbance values to concentrations from the absorbance value of a standard. The same facility is not so readily available on a laboratory computer system. Therefore we have the frequent paradox ofa technologist sitting in front of a video terminal of the main computer system reaching for a hand-held calculator!


Introduction
The hand-held calculator is ubiquitous in analytical laboratories. Its major use is for simple arithmetical manipulations, such as totalling the test numbers processed during a shift or converting a series of absorbance values to concentrations from the absorbance value of a standard. The same facility is not so readily available on a laboratory computer system. Therefore we have the frequent paradox ofa technologist sitting in front of a video terminal of the main computer system reaching for a hand-held calculator! If access to the programming environment of the main laboratory computer can be gained, then, to calculate the value of the expression, say, 1"7 x 2"9 requires, in BASIC, the statement PRINT 1"7"2"9 or, in MUMPS, WRITE 1"7"2"9'. By contrast, with a hand-held calculator the same manipulation requires only two keystrokes using either conventional algebraic operations or reverse Polish notation. Therefore the hand-held calculator remains both more convenient and efficient than the main laboratory computer for simple but very common calculations.
We now describe a program written in MUMPS which can be called on the main laboratory computer system and which is as convenient and efficient as a hand-held calculator when used for simple calculations.

Materials and methods
The laboratory computer system is a 32-bit Data General Eclipse MV/6000 with one megabyte of core memory (Data General [Canada] Ltd, Mississauga, Ontario). We used the XL-87H video display terminal (Cybernex Ltd, Ottawa, Ontario) which emulates a Hazeltine terminal.
The computer operating and programming system was written in a dialect of MUMPS (Medical Information Technology Inc., Cambridge, Massachusetts) [3]. * Corresponding author.
" In certain versions of BASIC, PRINT can be replaced by P. [1] and in ANS MUMPS, WRITE can be replaced by W [2]. Therefore the expression then requires three or four keystrokes (in addition to the data) to process. 38 The operating system allows direct access to the MUMPS programming tnode by means of passwords. Operating in this direct mode does not interfere with the main laboratory system or its data-base.

STRING ADDITION
The string addition option allows the user to input a list of numbers to be totalled without the need to input the + operator between each number. With this option simply input each The initial operation is a number followed by an operator followed by a number (the same syntax rules apply as for ARITHMETIC). Subsequent operations on this result are input as an opertor followed by a number. In the example, the expression (((313"0"0"6)/2) + 100) has been evaluated.

MULTIPLY BY CONSTANT
This option allows you to enter a constant which will be used to multiply subsequent numbers by. The          The ARITHMETIC option allows the use of the common operators (addition, subtraction, multiplication and division) with two terms. If a multi-term manipulation is required it can be done, after paying due attention to the order of operations, by using the COMPOUND ARITHMETIC option. A common manipulation in an anal)tical laboratory is the conversion of a series of absorbance values to analyte concentrations using a factor derived from the absorbance of a standard. This is readily achieved using the MULTIPLY BY CON-STANT option. The converse operation, DIVIDE BY CONSTANT, is also available. The final option, STRING ADDITION, allows the addition (tally) of a sequence of numbers without the inclusion of the '+' operator. This routine is therefore more efficient than a hand-held calculator. The tally operation appears to be the most common one used in the University Hospital's laboratory.
These programs are contained in two modules--the Introductory Sequence (table 2)  DO, CALL or FOR command outputs specified carriage control instructions and/or string and accepts data to be placed in a specified variable. It is also used as a timing device to sign the program out ifno response has been given within 300 s (see line  CLB, table 3). assigns a value to a variable outputs variables, strings or carriage control commands executes code which has been stored in a string. The ease with which this program handles numeric manipulations is due to the use of 'indirection' [4].
MUMPS regards all data as variable length character strings. An arithmetic expression may be input as a string and become the value of a variable such as SET EXP '176 + 22'. If this is followed by WRITE _EXP, 198 would be printed. The indirection operator causes the variable immediately following (in this case EXP, which equals '176 + 22') to be evaluated. Another more complicated example is: * $M and $U are not ANS MUMPSfunctions; they are unique MILS, vendor-specific, functions. WRITE _A_' + '_B_' + '_C (where A 100, B 20, C 30) which is printed as 150. Within the code, the trailing underscores serve as concatenators and the indirection operators cause the concatenated results to be evaluated before it is written.

Discussion
The regular advertizing of programs for microcomputers that can emulate a hand-held calculator is clear evidence that there is a general need for a calculator capability on microcomputers. This present program provides only the four common arithmetical operators, as these are, by far, the ones most needed. Other operators, such as square root, logarithms, exponents and trigonometric functions, are not currently available but are being considered for inclusion in future rewrites of this program.
The almost universal acceptance of the calculator program in the University Hospital's laboratory shows that a pressing need has been met, particularly in areas using numeric data. Program details for the HELP routine may be obtained by writing to the authors.