Customizing GNUmed client startup and shutdown
There are several hooks for customization of the startup/shutdown process built in. One can, of course, always write custom shell scripts/batch files to launch the client and/or hack the Python source code itself to achieve any needed behaviour.
shell command line
The GNUmed client accepts a few command line options. They are documented in the man page. The options are passed to the /usr/bin/gnumed
launcher shell script and eventually to the gnumed.py
Python launcher script.
In particular, it may be convenient to use --conf-file
to tell the GNUmed client to use a certain configuration file.
(/usr/bin/)gnumed
launcher shell script
The client is usually launched with the /usr/bin/gnumed
shell script which is included in the release tarball. This script looks for
-
/etc/gnumed/gnumed-startup-local.sh
- can be used for site-wide "local" customization
-
~/.gnumed/scripts/gnumed-startup-local.sh
- can be used for user-specific customization
and executes them (in that order) if they exist. Both scripts can do anything the user launching /usr/bin/gnumed
can do (unless they are setuid-root). GNUmed as a project will never overwrite those files (but your package manager may decide to provide an updated /etc/gnumed/gnumed-startup-local.sh
from time to time).
gnumed.py
launcher Python script
When this script has been called the client as such is running. During startup two hooks provide for customization:
- hook
startup-before-GUI
- this is called before the wxPython GUI is initialized
- hook
startup-post-GUI-init
- this is called after the wxPython GUI has been initialized but before flow control is handed to user input
Among other things connecting to the backend (which can be customized as well) happens between those two hooks.
Plugin configuration
GNUmed stores as much as is reasonable in the database, with as little possible locally - including configuration.
At startup a configurable list of plugins is loaded depending on which workplace the client is started as. The workplace to use is set in the configuration file.
Workplace plugin configuration
GNUmed has the concept of "workplace". A workplace groups configuration items, well, per workplace, say "Ultrasound room", "exam room 3", "front desk", "medical records clerk" - whatever you want.
One such configuration item is which plugins to load for which workplace.
Henceforth, plugins to load per workplace are configured IN THE DATABASE, not in any config file.
To configure the plugins go to the menu item "Office > Manage master data > Workplace profiles". You will then see a list of available workplaces. The one that is active is selected. Press the "edit" button. You will see a list of plugins which are available. Those which are configured to be loaded are preselected. To alter this,
- select the plugin(s) to be loaded the next time the client is restarted:
- a discontinuous selection may depend on your holding down a modifier key, or key combination (ctrl-shift, space etc.) while clicking
- if you wish to set the position (left to right) among them, you can do so by adding one at a time, exiting the editor and re-entering it e.g inside the "GNUmed default" workplace:
- select only one plugin (the one you want loaded first... suggest either gmProviderInbox or gmWaitingListPlugin )
- click OK (alt-O) which exits you to the list of workplaces
- click Edit (alt-E) to re-open the "GNUmed default" workplace
- hold the correct key combination (Gnome currently likes ctrl-shift) to discontinuously add the plugin you would like positioned second
- click OK (alt-O) to exit to the list of workplaces
- repeat until you have finished selecting the plugins that you want loaded, in the order that you want them loaded
- you will need to exit the GNUmed client and re-open it for the change to take effect
You can also create and name your own "workplace" but in order for it to get loaded, you will need to open the file named gnumed.conf
located in your user home directory's (hidden) .gnumed folder. To this file, you will need to add the lines:
[workplace]
name = <workplace name>
spelt exactly, case-sensitive, without "<" or ">". A machine-wide default profile can be set (assuming root or sudo privileges) in /etc/gnumed/gnumed-client.conf
.
Default startup plugin
The first (ending up leftmost) plugin in the workplace plugin list will be the one displayed right after startup so it is better to not be one requiring a patient to be active. In the default configuration, this is set to the provider Inbox. You can influence which plugin is displayed either by editing the plugin load order or by hooking into startup-post-GUI-init
.
During shutdown the hook shutdown-post-GUI
is called when the wxPython GUI has been closed.