As just mentioned, the patient module -- like all other modules --
first analysis the command line, and determines the desired output
format
. Then the needed
information from the table
diabetik is extracted.
The self-written function splitdb splits one
line of a dBASE table into a list of its fields. The
information is then stored in the hash of hashes
diabet. For instance, diabet{4711}{geschl}
contains the sex of patient 4711.
Next, the same procedure is done for the table progression (verlauf). The last medication of each patient in each quarter and each year he has been treated in is stored in the hash of hashes pat. The information about a whole year is stored as its fifth quarter.
Thereafter the desired information is determined. This is done in two
nested loops. The first one iterates over all periods of
time
, the second over all
patients
}.
In those loops the results are stored in the hash of lists erg
-- again the according period of time is used as the hash's key. This
is simply done by counting certain values of certain
fields
.
Last, but not least, the results are issued. The only calculations done in this part are the transformations of absolute values into percentages. The sort function in the loop condition is needed to display the results ordered the same way as by the graphical function of DPV .