As described in Chapter 20 you can use Premvet 5 to print a number of common forms such as consent, euthenasia, recovery, etc., etc. Another of the forms is user-definable, you can set it up to complete any documenting task.
Chapter Contents:
Some of the other forms (recovery, consent, etc.) prompt the user to enter more details by asking questions before printing the document. In the general form, you can specify which questions you would like to ask. This enables you to have customised forms that allow for parameters to be added, e.g. prescription forms. In addition the following options can also be specified:
This is done by inserting codes at the start of the definition file:
| .cp X | The number of copies (where X is the number to print). |
|---|---|
| .pl X | Paper length (X) |
| .pr A | Printer letter to print to (in this case printer A). |
| .dp A | As .pr above |
| .SY printer | Ask which printer to print to |
| .SY copies | Ask the number of copies to print, you can specify a zero value to suppress the form. |
| .SY append | Prints another form |
| .qu Text | Question to ask, See below |
Normally you will be asked the number of copies and the printer to print to. If either the .cp or .pr codes are used then these questions will be by-passed. So if you still want the facility to redirect the output to a different printer then you would NOT specify .pr in the definition file.
If you use the Dot Command .DP (pr .PR) in the definition file it will always sent the job there. If you want to specify at the time it is being printed where it should go you can use the .SYstem command.
This currently has three options:
| .SY printer | Ask which printer to print to |
|---|---|
| .SY copies | Ask the number of copies to print |
| .SY append form | Generates the 'form' specified, this can be used to print labels for leads etc or address labels for debt control. |
With the .qu code, you can specify up to 10 questions
that will be asked. The system will assign the reserved word
&var(0-9) to the answer i.e.
The first question will be assigned &var0
The second question - &var1
The third question - &var2
and so on - right up to the 10th question which will be assigned
&var9.
The questions will be asked in the order in which they appear in the definition file. The answers will be printed where you have placed the variable reserved words - and these do not need to be placed in the same numerical order (so you can have &var2, followed by &var0, for example).
The normal behaviour when the question is asked will be to include
the text specified followed by a number of 'dots' indictation the amount to
type. This is fine for most of the questions, however if you are
expecting a numeric answer then having all the dots is confusing.
If you include [number] in the question the number
of dots will be reduced to 10 e.g.
.qu How many legs affected [Number] ........Another situation may be where you ONLY want the user to pick a specific answer from a list. This can by handled using the format:
.qu <R>ight <L>eft <B>oth <N>oneIn this case the only options allowed are the 4 provided.
This will force the users to answer - but what are they answering?, in the above was that a question relating to eye's, ears, legs? You can expand these a little further as per:
.qu !Eye drops for <R>ight <L>eft <B>oth <N>one .In this case the text after the ! and before the 1st < will displayed along side the answers.
Note: The ! and < characters have a 'special' meaning only when as shown above as such these characters cannot be used at the beginning of a question in any other circumstances.
Example:
This is a copy of a gen.def that will ask 3 questions (.qu),
'Enter the drug dispensed', 'Any side effects' and 'What is the
dose?'. Two copies will be printed (.cp 2) onto printer 'E' (.pr E).
The paper length is not specified so the document length will be used.
.cp 2 .pr E .qu Enter the drug dispensed .qu Any side effects? .qu What is the dose? Client : &client Date : &date Drug supplied : &var0 Dose : &var2 Side effects (if known) : &var1Notice that the answer to the first question 'Enter the drug dispensed', is held in the reserved word &var0. Also, the answer to the third question 'What is the dose?', is assigned the reserved word &var2, and is used in the definition file before &var1.
You can perform calculations within definition files. We will illustrate this functionality with the following example: (the numbers in square brackets [] appear so that we can explain the example, they would not appear in a real definition file)
.qu State reason for administration:
[1] .qu Estimate % dehydration [Number] (enter only figures):
.qu Enter clinician's initials
[1] .qu Number of vomits today [Number] (enter figures only)
.qu Identified electrolyte abnormalities?
[2] Volume to correct hydration: @{&var1*&weight}
[2] Losses from vomiting: @{&weight*0.04*&var3}
[2] Maintenance requirements: @{&weight*0.05} /24hrs
[3] Total fluid requirement = @{&a + &b + &c} Litres during next 24hrs
[2] Initial administration rate = @{(&var1*&weight)/4} litres/hr
Lines marked with:[1] As the answer you are expecting is numeric, if the phrase [Number] is included, this will reduce the length off answer you are prompted for to 10 characters and will if the user just presses RETURN store the result as Zero (0). If this is not included, and nothing is entered, the result will be a blank string and the resulting formula will be invalid.
[2] These show the formula layout, it MUST be @{ .... }, with the calculation enclosed within the {} bracket. This is mainly to indicate where the formula starts and finishes but also allows the user to enter @ elsewhere in the file that is not used for calculations.
Note: On the last calculation, you may note the use of parentheses, these can be used to group which calculations are performed in which order. (As the formula is being passed to the Unix command bc, see the man page for bc for the other options you can use.)
[3] Calculation based on an earlier calculation. In this case the answer is based on the sum of the previous 3 calculations. This can be achieved by the special reserved words &a (1st), &b (2nd), &c (3rd), &d (4th) etc. etc. up to &z.
Note: An invalid formula will cause the word Error to be included rather than a zero or other number.
| Top | Classic | New-Style | Chapters | Sections | Index | Search |