Using Hooks to make GNUmed do what you want
At various points in the workflow (such as directly after activating a patient) GNUmed can invoke a script to allow you to customize what is happening. This is both powerful and possibly dangerous: You can make GNUmed do nearly anything you want - but an attacker might also find a hole to exploit that for evil deeds. GNUmed has, however, taken a few precautions to try to thwart the average
script kiddy or
wannabe E7EET haxxor.
The documentation which comes with your package holds an example script
hook_script_example.py
. It shows a dialog box for each hook it receives.
The hook script
One single script is used for all hooks.
This script must meet the following conditions:
- saved as
~/.gnumed/scripts/hook_script.py
- must be owned by the user running GNUmed
- must have permission bits set to
100600
(- rw- --- ---
)
- must have a module level function
run_script(hook=None)
GNUmed will then at various times import that file and execute the
run_script()
function. The single argument passed into this function is named =hook?. It will hold the actual hook name the script was called from. This way appropriate action can be taken depending on the hook the script is called from. It can then do pretty much anything Python can do within the GNUmed framework - including finding out which user it is running for and which workplace it was called from.
Note that some hooks may be callled before or after the wxPython GUI is available.
Known hooks
Note that some hooks may not yet be available in the currently released version.
|
Das Urheberrecht © liegt bei den mitwirkenden Autoren. Alle Inhalte dieser Kollaborations-Plattform sind Eigentum der Autoren. Ideen, Anfragen oder Probleme bezüglich TWiki? Feedback senden
|