* * * * * * * HELP * * * * * * *




docplan makes duty-plans automatically for 2 duties (e.g. day and night) a day, is optimized for groups of about 30 doctors (or other professions) and of arbitrary length up to 3 months.
It calculates calendar-based and personal plans which can be printed or mailed.
docplan can not be tipped, tries to be just, works with a dynamic priority list and a random generator in case of equal priorities. It uses a clear-text database which can be edited also directly, if carefully. You can enter permanent duty wishes as: whished number of duties at all, preferred weekdays and -nights, if double duties are wished, and special wishes as: 2 off-terms like holidays with a wish to do more duties, 5 off- and 5 power-days.
The programm takes respect on holidays, birthdays, and can print out telephome-, holiday- on-call- and mail lists.
The pilot version in text mode has self-explaining menus for linux and dos (also dos window in windows). The program menus are in German only, but might be understood quite easily for english-speakers and other languages. It can be downloaded at


Linux: After download, copy it into your homedir,
' tar -zxvf docplan-0.1.tar.gz '
A directory ~/docplan- will be made. In it there is the docplan binary, an example database docbank, a configuration file docplan.cfg (do not edit) and this help text in German hilfe.txt. If you want, you can copy this english file as hilfe.txt, so you can use it also within the program.

Dos / Windows: There is a self-extracting archive:
Just click on the file docplan-install.exe
or say at the dos-prompt:
docplan-install .
A directory c:\docplan- will be made, in it... see above.


CD to the docplan- directory, say 'docplan', and you are going.


Only at first use, go to the basic settings mode by "g" in the main menu. It will ask for your favourite editor, the command to clear the screen (clear for linux, cls for Dos/Windows), the name of your working group and (if wished) variable holidays.
For quickness, use an editor like notepad or wordpad, in linux kedit.
In windows, with these settings of notepad I had good prints:
Font: terminal, bold, size 9.
After these settings restart docplan.


At first, input the participants' dates and wishes. See the examples.

You do not need to enter all dates, name and number of duties is enough. If you do not input some data, just press the enter key. Strings are preset with "-".

calendar dates:
To clear a date, enter 00.00.00.
(Just a birth date can is to be cleared with 00.00.0000)
Every date is checked at input. So it is e.g. not possible to enter past vacancies. A birthday on 29.2. is set to 1.3 in normal years. Vacancies and special wishes are deleted after they pass.

Permanent Wishes:
Docplan can work best if the sum of all "day" and "night" duties a month fits to the number of participants, e.g. 2 + 2 for 15 collegues. Then a budget routine will set down one's relative priority when he reached this desired number. As in real life. first you might get used to this number chain for the weekday priority wishes:
(1 = NEVER, 2 = DO NOT LIKE, 3 = O.K. 4 = LIKE, 5 = MUCH DESIRED).
This mask makes input easy

*T: TN: N: NT:* <- day, day-night, night, night-day
*MDMDFSSMDMDFSSMDMDFSSMDMDFSS*<- Monday, tuesday, wednesday, thursday, friday, saturday, sunday

E.g. a 4 in block TN at F means: I like day-night double duty beginning at friday.
Or: A 2 in block N under the second S:
I do not like night duty beginning on sunday (who else likes?) The prepared setting in new datasets is for a 'normal' doctor who works in hospital or clinic and has most time on weekends. If one is very flexible, input is easy, just fill the line with '3' = o.k.
In my trials a 'normal' doctor gets a bit fewer duties than a flexible one, so let him wish some special wishes like "i like night-> day on tuesdays". and give the flexible ones lower priorities (2) on weekends.
Holidays - if you input them - are treated like sundays, and the deys before holidays are treated like saturdays.

If you do not want to use the input menu (which is preferrable!) you may visit the database and edit it carefully, do not destroy the structure. The first number in the first line is the index = the number of datasets. If you delete one set by hand, also change the index.


This can print lists. The holiday list and the on-call list asks for a day, default is today. If helpful, you can print them on paper also via the editor.


If basic settings o.k., docplan calculates your plan very quickly. At the beginning of a new year, it will ask you again for the variable holidays. It will work without them, however. Plans over diferent years are not possible. Plans last maximal 1 quarter. If you want more, please lodge a complaint, with a small modification I can increase the memory reservation.
The plans are stored as plain text with tabs as:
planmmmm.jj and ppmmmmjj,
e.g.: plan0103.03 for calendar plan from January to March 2003
e.g.: pp0103.03 for personal plan from January to March 2003
The last statistics is stored as statliste.
Note: The plans can be edited naturally by hand, but changes of the the calendar plan do not affect the personal plan, also not in reverse, and also not the statistics!
Note: The current (freshly computed) plans and its statistics remain only in the main memory, so run the program, compute a plan, look at the statistics, and if content, go back to the plan menu to "k = calendar plan", print it, then "p = personal plan" and print it. Old plans and the last statistics can be looked at and printed with any editor.


This is my first larger project in c. No warranty. Dear C-programmers, please put a night cap on before reading the source text, so that you do not loose all your hair. The source texts and the Makefile are also on the website. Unpack them with
' tar zxvf docplan-linux-src-0.1.tar.gz '
there is gives linux optimized and (only slightly different) DOS (Windows) optimized source text. It has been made under drug influence (coffee only) with the good the old SuSe Linux 6,3, Kernel 2.2.13, with gnu C++ compiler egcs 2,91,66 (egcs-1.1.2-Release) (Linux) and mingw32, Vth 2.0.0 (DOS). Of course, it runs even with newer versions... For suggestions I am open, please mail them to me!
Debug: The program writesan "errlog" with each plan computation. In the source text there are still more out-commentated debug messages prepared.

Devoted to my former boss, leading emergency physician Dr. Herbert Gerstacker.

Dear non--programmer-only-users, please reports application observations, risks and side effects and cases of allergy suspicion to me. >
The program is freeware, if you want beerware, but since I do not drink so much beer, I am pleased about feedbacks and symbolic acknowledgments like reports, books on nostalgic radios, tubes, oscillographs, programming, relativity theories of Einstein, systemic family therapy, as well as all kinds further of chocolate for me and my 2 sons Aaron and Josias, who towered above me in programming and helped providing the website.

If encouraged I am planninf a graphic user surface under Linux, then data base binding, and perhaps even for Windows. This, however only if Bill Gates converts to Linux .

Dr. med. Guenther Montag
Schmiedberg 11
D-86510 Baindlkirch