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.

Startup

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

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:

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,

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.


Shutdown

During shutdown the hook shutdown-post-GUI is called when the wxPython GUI has been closed.