Thursday, December 31, 2009

Packages ready for testing

Packages for the 0.6 release candidates are ready for testing. If you want a stable EMR choose GNUmed 0.5.2 instead of 0.6 series. Go to or use this link. Please report any issues you encounter.


Packages for GNUmed 0.6 series in the making

Hi all,

I am currently active trying to package GNUmed 0.6 release candidates for Opensuse and other rpm based distributions. If all goes well that should be finished before Karsten releases 0.6 final.

If anyone can help out let me know.


GNUmed 0.5.2 packaged

Hi all,

GNUmed 0.5.2 has been packaged. It can be gotten directly from our download page.

Happy New Year everyone,

Wednesday, December 30, 2009

Medication list printouts from GNUmed

Printing is one are that GNUmed did not provide. That has changed. Karsten has implemented printing of medication lists for patients from within GNUmed. One can store patient's medication in GNUmed and print it to hand it to the patient.

Technically it involves creating a pdf file via LATEX and handing that pdf to the local print feature like kprinter in Linux. Works nicely.

Saturday, December 19, 2009

GNUmed user interface toolkit considerations

Historically wxpython has been the only user interface toolkit that was available for MS Windows, GNU/Linux and Apple Mac OSX under a sufficiently free license (GPL in our case). GNUmed founders decided to go for wxpython as the primary GUI toolkit. That has worked out so far but brings some challenges as well.
Things have changes since. Many toolkits have appeared, some previously available have seen their source made freely available. QT comes to mind. It is perceived as a viable alternative by the occasional mailing list poster but few understand what a switch would involve.WxPython and PyQT are both mature tookits. They have both been used in large software projects and are actively developed. The basic features are not really different.
There are however some special features that GNUmed could make use of which are not present in both toolkits.

Feature WxPython PyQT

backing community Nokia

wxpython relies on few individuals, if they go away wxpython might die
browser widget wxmozilla webkit widget

html support in wxpython is very basic
GUI designer wxglade, wxDesigner QTDesigner

wxglade is very basic and wxDesigner is non-free
community active, medium sized active, large

developer pool for wxpython is limited, few highly skilled individuals exist, small medium skilled pool, QT is more widely used because of KDE
printing support decent mature

printing support is a tough issue for wxpython and GNUmed, probably easier with QT
device support PC, other : limited PC , other : various mobile devices

QT is available for N900 , Nokia mobile phones, maybe not a huge issue for GNUmed
Linux support great great

no issues
Windows support some issues few issues

because of smaller team wxpython has issues keeping up with Vista and Windows 7
Mac support few issues few issues

QT has probably fewer issues on Mac
3rd party connectivity n/a n/a

QT is used for KDE so it could be easier to interact/integrate with KDEPIM, KMAIL
issues for new devs some some

novice coders would probably get going faster with QT because of the tools provided, maybe less an issue for experienced devs
documentation good good

QT probably has more demo code/apps to look at and more coders to help out on mailing lists or IRC
cost of switch none high

all code for wx is there , now, going for QT involves a complete GUI rewrite

All in all the GNUmed project has no resources , neither in terms of staff nor financial resources to switch from WxPython to PyQT even if that was seen a beneficial. As long as there is only 1 main coder for GNUmed no resources will be allocated to this. That would mean GNUmed development would efectively be stoped until the rewrite is complete. This currently is no option.
It is estimated that an experienced python developer would need roughly one year to rewrite and document the GUI code done in QT.
The GNUmed project acknowledges the issue and will provide all support it can to third parties that will evaluate a GUI rewrite using QT.

Friday, December 18, 2009

GNUmed wants your input on medication lists

Hi all,

We need your help. What is your prefered format/design for a medication list/schedule. We are currently building the medication list feature and need feedback.

If you have a favorite design let us know at or here in this blog. Get your list, have a look and let us know.


Saturday, November 21, 2009

GNUmed 0.4 series in Ubuntu

Karmic ships the GNUmed electronic medical record application. Both the client and the server part are included. Jaunty shipped a buggy version which would (user approved) call home and report the bug. That way we had a feeling how many people attempted to use GNUmed.

Karmic ships GNUmed client 0.4 series which is a lot more stable. So far noone has called home. That either means that GNUmed is indeed stable or noone is trying it :-)

As far as I know there are no statistics available on the downloads of the packages. Even the PPA don't have the feature unless I have missed something.

It is a little sad to be left in the dark how many people are looking at GNUmed.

GNUmed 0.6 release candidate out now

Hi all,

Karsten Hilbert has announced the first release candidate for GNUmed client 0.6. Major new feature for this release is prescription handling. We need your input and help.

GNUmed has communicated with many doctors around the globe to implement prescriptions the way those physicians would like to have it in daily practice.

Join us and find out if it suits your prescribing needs well.

All info on how to get it can be gotten from

Don't hesitate to contact us at if you have any questions.

Take care,
Sebastian Hilbert
- for the GNUmed team -

Sunday, November 01, 2009

GNUmed adds medication management and prescription handling

The current , work-in-progress state of the new medication handling in GNUmed is captured in this screenshot showing a health issue with associated medication.

Thursday, October 29, 2009

Gelbe Liste Medikamentendatenbank unter Linux

Die Medikamentendatenbank Gelbe Liste von MMI lässt sich auch unter Linux nutzen. Dazu benötigt man Wine. Es lässt sich problemlos installieren. Man sollte auf die eingesetze Wine-Version achten. Die Testversion 1.3.21 scheint zu neu und produziert einen Absturz. Die Version 1.1.9 funktioniert prächtig.

Monday, October 19, 2009

GNUmed billing feature for US healthcare providers

Unofficial word has it that a company is working on a billing feature for GNUmed for US healthcare providers. Stay tuned. This could be a significant move for GNUmed.

Cardiac device plugin revisited

Unfortunately I haven't had time to work on the Cardiac device plugin. First GNUmed 0.5 had to be released. Then private activies consumed most of my free time. Not to mention rotating to another hospital.

Looking back I wanted to know why work has not progressed the way I would have liked it. I guess most of it is due to wanting everything at once. My dream plugin is so complex it just takes too much effort to implement. This is going to change. I have restarted in simpler steps. A first working version will be provided. Building on top of it I hope to be able to release a better one over time.

Keep it stupid simple is what I should have done from the beginning.

Sunday, October 04, 2009

GNUmed electronic medical record 0.5.1 released

GNUmed - the electronic medical record for physician's offices has been updated to version 0.5.1. It helps physicians, physiotherapists or occupational therapists as well as chiropractors keep track of their patient's health, diseases, treatments, hospital stays, medications. It provides an episode view which helps to keep on top of multiple episodes of multiple illnesses.

If you want the latest feature packaged for Ubuntu visit

Let us know if you run into trouble installing and running GNUmed.
You can try GNUmed with a publicly available data source or set up your own local database.

Help is available via our GNUmed for Ubuntu guide.

Saturday, October 03, 2009

GNUmed needs a press kit

Hi all,

I am looking for a voluteer to write up non-technical about GNUmed. If you can spare a minute please write a page or so that can be distributed to press and press-alike people.

Background: I was talking to the openSUSE guys about including it into the distribution and writing about it in the suse blogs.

They asked me to provide some non-technical information on GNUmed.

I believe this document should include:

- GNUmed is an electronic medical record program

- Targeted at medical offices - not hospitals

- aimed at record keeping - not billing

- talk about some features

- talk about use cases

- who creates it and why

- what is desired for the future

Any help is really appreciated. I believe GNUmed's current feature set is big enough to raise awareness that GNUmed can be used in certain settings today.


Saturday, September 26, 2009

GNUmed on Ubuntu 8.10 Intrepid Ibex

It seems quite a few people still use Ubuntu 8.10 aka Intrepid Ibex. When those users try to run GNUmed electronic medical record they are presented with a crash dialog right away.

GNUmed's crash handler catches those errors and sends them off for us to fix. So we did. Unfortunately there is no easy way to replace the broken GNUmed in Ubuntu or Kubuntu 8.10 with a fully fucntional one.

Ubuntu provides a place for updates. This is called a PPA and GNUmed provides updates for all major versions there.

Have a look at to find updates for Intrepid (8.10), Jaunty (9.04), Karmic (9.10).

This is obvious to techies but few users seems to be aware of it. I bet a lot of them think GNUmed crashes and that is it.

Users using Jaunty are in a similar situation. Karmic is the first release that ships a fairly stable version of GNUmed.

Hopefully many users will make the switch to Karmic to have a chance to evaluate GNUmed out of the box.

However, if you want the latest feature set even with Karmic be sure to visit

GNUmed 0.5.1 has been release a few days ago and brings quite a few neew goodies.

Wednesday, September 23, 2009

GNUmed Live CD 0.5.1 available

GNUmed Live CD 0.5.1 is available from


Saturday, September 19, 2009

Follow GNUmed on

A new experiment.

Follow GNUmed on


GNUmed EMR server 'dead easy ' now available

Hi all,

Not everyone is a computer wiz. Moreover it seems that a lot of people are interested in GNUmed. Many of them do not handle the installation very well. While technically sound the installation up to this day required that you took the time to learn a bit about PCs and Operating systems. Over time we were drawn into a conversation along the lines 'Everyone else has an easier installation'. Engaging the user into a technical discussion is often pointless.

In the end I have decided to give the user what he or she wants. The current client and server installation packages now bring along everything needed. This has been the case for the client for quite some time and it has been largely successful.

Now the same is true for the server. GNUmed relies on the high quality database server PostgreSQL. It has always been the case that the administrator had to install and configure PostgreSQL. Most users are not administrator and failed right there. I therefore decided to take care of the PostgreSQL installation.

The advantage is that boostraping now runs without user interaction. The disadvantage is that I had to set a default password for the postgres account. I repeat I had to set a default password for the postgres account.

If you prefer to configure everything yourself (like you should) you still can.


Thera-Pi Physiotherapieprogramm kommt voran

Habe heute mal wieder auf den Seiten des Open Source Physiotherapieprogramms herumgeschaut. Sieht vielversprechend aus. Im Forum ist ordentlich Aktivität, der Downloadbereich bietet eine aktuelle Version.

Wer es sich anschauen möchte sollte besuchen. Wir wünschen Herrn Steinhilber viel Kraft bei der weiteren Umsetzung.

Sebastian Hilbert

Wednesday, September 16, 2009

GNUmed server v11.1 is about to make its appearance

Windows is easier then Linux you say ? Think again.

On Linux all it takes is
'apt-get install gnumed-server'

On Windows it is a pain in the behind. No automatic dependency resolution. 5 to 6 prerequisite packages to track down, download and install.
To make it short. The avarage user interested in GNUmed did not manage to pull it off despite video installation guides.

Times are about to change. After countless hours of testing a first version of all in one GNUmed server package is available internally and will be made available shortly. This packages detects all missing dependecies including PostgreSQL and will do a silent installation of PostgreSQL for you. It will then proceed to copy the GNUmed server files to the disk and will attempt to boostrap. When using the supplied install of PostgreSQL the config files will be patched to provide for a unattended bootstraping.

Stay tuned.

GNUmed client 0.5.1 and server v11.1 now available

Hello all,

there's been precious little bugs in GNUmed 0.5 so far.
Fortunately, Thad recently found two which I fixed. So
there's the 0.5.1 release now:

Client changelog:

0.5.0 -> 0.5.1

FIX: be more careful when deleting measurement types - they could be in use
FIX: faulty access to "pk" column after creating measurement type from phrasewheel
FIX: missing "import os" in measurement widgets code
FIX: improved starting of new encounter from SOAP widget

NEW: install ARRIBA jar into /usr/local/bin
NEW: man page for gm-install_arriba

Database changelog:

11.0 -> 11.1

FIX: SQL: add missing view clin.v_narrative4search

If you wanted to search the EMR for a string you know you
need the database fix ;-)

Here are the tarballs:

There is a fixup shell script provided with the server
tarball which when run will apply all the needed fixes.


Monday, September 14, 2009

GNUmed EMR 0.5.0 Live CD is available for download

Hi all,

GNUmed EMR Live CD is available for download from

(md5sum 9af2a609b80a92109643c53b904896c1 gnumed-live-0.5.0.iso)

It includes a fully configured and bootstraped local database.

One can use this CD to testdrive the GNUmed EMR without installing anything or the need for an internet connection.

BTW. Thanks Andreas for the quick fixes to the GNUmed packages.

Take care,


Sunday, September 13, 2009

Vmware mouse grab problem and losing focus outside 640x480

I have been updating my system (OpenSUSE) and suddenly my Vmware virtual machines stoped working. I search the web but did not find a lot. The problem is that the virtual machine cannot get focus when clicking in it with the mouse. The only thing that help was Ctrl-G to grab the mouse but it would lose focus when moving the mouse outside the area of 640x480 pixels.

This apparently is a problem with Vmware and GTK. There is a fix as I have learned.

Use "export VMWARE_USE_SHIPPED_GTK=force" in a shell prior to starting vmplayer.

Details are here in the Vmware forums (but hard to find)

GNUmed client 0.5.0 and server v11.0 now available for Ubuntu

Hi all,

Apparently the call for packages did not yield any response. To provide existing users with upated packages I have taken the time to do it. Good part about it. There are now up to date packages. Sad part. Most likely Ubuntu will fall behind as I cannot promise I will have the resources to keep up in the future. That would really be a pity.

Anyway. For now add the GNUmed PPA to your sources list and install the GNUmed Open source electronic medical record.

More info visit the GNUmed website at

Monday, September 07, 2009

GNUmed Ubuntu packages

The GNUmed team has had Ubuntu packages for some time now. Fortunately version 0.4.7 of the client and v10 of the server will ship with Karmic. Those are pretty stable versions and hopefully this time it is diffent from Jaunty where GNUmed would crash on every user.

None of the core developers use Ubuntu on a day to day basis. Most of them use Debian which make Ubuntu packages a breeze since one can simply convert the Debian packages.

As more OSs and distros are supported the packaging job puts a heavy burden on a few people.

The GNUmed team is looking for a volunteer to spend around 30 minutes per release ( every 3 months or so) to Ubuntunize the Debian packages.

The procedure is laid out in the Wiki in the Ubuntu section. Any help is appreciated.

Sunday, September 06, 2009

GNUmed 0.5.0 ready for openSUSE and Debian

Hi all,

GNUmed client 0.5.0 and server v11 are now ready for download for openSUSE at

Client 0.5.0 is ready for Debian at

If you have any questions or problems don't hesitate to see

What's new in GNUmed 0.5.0:

Take care,

Tuesday, August 25, 2009

GNUmed 0.5.0 for MacOS X released

The GNUmed team has started an effort to bring the latest release (0.5.0) to the Mac platform. This has resulted in beta quality packages which let any user try GNUmed on a Mac. It has been tested on Mac OS 10.4 aka Tiger and should work on Mac OS 10.5 as well.

Anyone willing to help out by improving the package and packaging future versions is welcome to join the team.

There are a few features that could potentially enhance the GNUmed on Mac OS experience such as an OSIRIX Dicome viewer integration but that is left to the inclined Mac user.

Download and enjoy GNUmed 0.5.0 from

Direct download from:

Wednesday, August 19, 2009

GNUmed Live CD 0.4.7

A new live CD that contains version 0.4.7 of the GNUmed client and a fully configured GNUmed database inside PostgreSQL has been released and can be gotten from

When using this Live CD no installation is neccessary. The PC and the operation system will not be altered in any way. Simply use the CD to boot up you PC and enjoy

Have fun discovering GNUmed.

Sunday, August 16, 2009

GNUmed 0.4.7 has been synced for Karmic

My sync request has been processed and we are happy to announce that the latest stable version in the 0.4.x series of GNUmed (0.4.7) has been synced for the Karmic release.

This is good news as this version is in good shape and will hopefully spare us from the many but reports that 0.3.9 in Jaunty has brought us.

For some reason it has been virtually impossible to refer users to the updated versions in the GNUmed PPA so it is most important that the version shiped in Karmic is in good shape.


GNUmed is an electronic medical record target at primary care physicians , physiotherapists and occupational therapists.

The GNUmed team

GNUmed 0.5.0 und Server v11 erschienen

GNUmed 0.5.0 wurde veröffentlicht. Die List an Neuerungen umfasst.

- kann Krankenhausaufenthalte verwalten
- kann Grundkrankheiten nach beliebigen Schlagworten gruppieren
- kann alle Besuche eines Patienten anzeigen / ändern
- kann einzelne Karteizeilen zwischen verschiedenen Patientenkontakten hin- und herbewegen
- kann Verlaufsnotizen (Karteieinträge) löschen
- kann Arbeitsplatzkonfigurationen (Anmeldung, Sprechzimmer ... ) via Oberfläche löschen
- kann aus dem Laborblatt ein (frei konfigurierbares ) Laborlexikon aufrufen
- kann Laborwerttypen verwalten
- kann Metatypen für (unterschiedlich benannte aber inhaltlich gleiche) Laborwerttypen verwalten
- kann einen externes Programm zur Berechnung des Myokardinfarkt / Schlaganfallrisikos starten
- kann ARRIBA Schlaganfallrechner installieren
- kann LOINC ( herunterladen und installieren
- kann ATC Daten importieren
- kann sich im Begrüssungsdialog der Datenbank abmelden
- kann Personen / Patienten ohne Geburtsdatum handhaben
- kann das Geburtsdatum/Sterbedatum einer Person besser handhaben
- kann Personen aus der Datenbank entfernen

- hat einen neuen/einfacherern Platzhalterstil für OpenOffice-Dokumente
- hat einen besseren Schutz gegen fehlerhafte Übersetzungen
- hat eine verbesserte Laborwertdarstellung
- hat eine verbesserte Programmfehler-Meldefunktionalität
- hat eine verbesserte Patienteneingabemaske
- die Krankheitsepisoden werden bessert formatiert angezeigt
- zeigt einen informativeren , konfigurierbaren Start/Datenbankdialog

- zeigt Änderungen der Karteikarte in der chronologischen Karteikarte
- ist robuster gegen fehlkonfigurierte Arbeitsplätze

- Windowspakete installieren und konfigurieren nun bei Bedarf den Datenbankserver
- Windowsversion und Sever laufen nun von einer Festplatte oder vom USB-Stick

Pakete erscheinen in den nächsten Tagen als Demo-CD, Windows-Version, Linuxversionen (Debian, Ubuntu, openSUSE) sowie MacOS X, USB-Stick-Mobilversion

Die neuesten Infos gibt es jeweils unter

Thursday, August 13, 2009

GNUmed 0.5.0 and server v11 released

Dear colleagues,

I am proud to announce GNUmed 0.5.0 "The Lil' Louis" Release.

This has taken much longer than I would have hoped. There
has been a lot of functionality and usability testing going
on with tons of bugs getting fixed and lots of issues
straightened out.

Here's a rundown on what this new GNUmed version has to

- can track hospital stays
- can group health issues by arbitrary grouping tag
- can display/edit all encounters of a patient in a list
- can move individual soap rows between encounters
- can delete progress notes
- can delete workplaces from GUI
- can show measurements encyclopedia from grid
- can manage measurement types
- can list meta measurement types
- can start external MI/stroke risk assessment calculator
- can install ARRIBA MI/stroke risk assessment calculator
- can download and import LOINC data
- can import ATC data
- can disconnect from database welcome message dialog
- can handle persons without DOB
- can display deceased person's age properly
- can remove persons from the database

- new/simpler placeholder style for OOo documents
- protection against translation errors (%s-count mismatch in _())
- improved display of measurement types in grid
- improved sending of bug reports (log = attachment)
- improved new-patient dialog
- improved sorting of documents in formatted episode summary
- improved "About Database"/startup banner
- improved episode formatting

- has some revision info in EMR Journal view
- has built-in fallback workplace for problem situations

Beyond that there are a host of little improvements here and
there generally making GNUmed a better place to work in.

You can grab tarball packages here:

Note that you will have to run the database upgrade
procedure if you want to keep using an existing database.
This is described here:

You can upgrade from any v10 fixup level to v11.0.

So, please download and enjoy and report the bugs !


Saturday, July 18, 2009

There is more than one way to write code

CVS systems are great. You can check in your work and others can change it e.g. for coding style. gmDeviceWidgets py was cleaned up by Karsten.

Change is here :

Needless to say I did not even recognize it anymore since huge chunks of the code have been replaced :-)

Friday, July 17, 2009

GNUmed plugin development - part 13

Be aware that some things have changed. The file has been moved from test-area/shilbert/ to business/

There are now four files involved in this plugin.
- in /business - responsible for the XML data extraction part
- in /wxpython - responsible for calling and compiling the ui widgets
- in /wxGladeWidgets - is the python code representation of the ui widgets
- gmCardiacDevicePluginPnl.wxg in /wxg - is the xml representation of the ui widgets

If I need to change the plugin's appearance I need to touch first gmCardiacDevicePluginPnl.wxg with wxGlade and transfer it into the python code representation This files gets imported and the controls filled with data in The business logic of data compilation from and to screen is handled in

Next up is getting the device data from the database instead of an XML file. For the time being it was agreed that the xml file is simply stored as yet another document. To store it GNUmed was started and the plugin 'Document import' was used. I was asked for an associated episode. 'Routine postop cardiac device checkup' was entered. 'Device check up' was chosen as document type. This was entered via the menu item 'GNUmed>Manage master data>document types'.

A quick chat with Karsten revealed the basic code:

pat = gmPerson.gmCurrentPatient()
doc_folder = pat.get_document_folder()
docs = doc_folder.get_documents()
This returns a list of cMedDoc objects which can be parsed like that:
for doc in docs:
    doc['comment'] = ... etc.
doc_folder.get_documents() returns elements ordered by clin_when so the first element is the newest one I am looking for.
for doc in docs:
             if doc['type'] == 'cardiac device checkup report':
if not len(selected_docs) == 0:
             # since get_documents() is sorted I simply get the first one as the most recent one
             # for now assume that the xml file provide the cardiac device context.
             # that pretty much means logical connection of leads and generator is provided in the xml
             xml = selected_docs[0].get_parts()[0].export_to_file()
             tree = etree.parse(xml)
             DevicesDisplayed = gmDevices.device_status_as_text(tree)
             for line in DevicesDisplayed:
                        text = text + line
   'There are no device checkup reports in the database')
             text = _('There are no device checkup reports in the database')
To construct the line
xml = selected_docs[0].get_parts()[0].export_to_file()
one has to take a good look at the file in /business. Using that code it is now possible to get the XML from the database and display the current device status.

Currently the XML is entered via the default the 'attach document' plugin. There is a nifty solution to a problem. How to check for documents of a type that might not yet exist in the database ?

When the cardiac device plugin is initiated the document type is automatically added to the document types in the database. The file gmDeviceWidgets holds the following code for that.
def __init__(self, *args, **kwargs):
         # check if report types exist in db, if not create them
         dtype = gmMedDoc.create_document_type('cardiac device checkup report')
         dtype.set_translation(_('cardiac device checkup report'))
The next step is to get rid of saving to a file and reading from that. Another issue is to get refresh going when entering new data.

Thursday, July 09, 2009

GNUmed plugin development - part 12

Show me the code. Part 11 talked about the xml handling. I put everything in the CVS to make it available.
That was almost two months ago. Due to time constraints I only recently picked up again. I had to realize that my python skills are very rusty and that I had to learn to read and write at the same time.

In the meantime both the XML files as well as the Parser have gone through 2 rewrites. I threw the code out where I felt it became too complex for me to handle. Check out the latest version now.

now run:
and observe the following output:
Device(ICD): St. Jude Medical Atlas DR (active)   Battery: St. Jude Medical (St. Jude Medical)  Implanted: 23.03.2002

RA-lead in RA-position: Medtronic Sprint XL (active,no comment on lead) Implanted: 23.04.2009
last check: 23.04.2004 Sensing: 7mV Threshold 1.4mV Impedance: 300 Ohm

RV-lead in RV-position: Medtronic Sprint fidelis (inactive,no comment on lead) Implanted: 23.04.2009
last check: 23.04.2009" Sensing: 7mV Threshold 1.4mV Impedance: 300 Ohm

LV-lead in LV-position: St. Jude QuickSite XL (active,no comment on LV lead) Implanted: 23.04.2009
last check: 23.03.2004 Sensing: 7mV Threshold 1.4mV Impedance: 300 Ohm
Now what you see here has been parsed from the XML. No more fake input. Next step is to first replace all hardcoded English strings with gettext-equivalents so translators can have a go at them. To achieve that we will take a look at other plugins that already have that feature.

Take a look at The first few lines look like this.

import logging

from Gnumed.wxpython import gmPlugin, gmMeasurementWidgets
from Gnumed.pycommon import gmI18N

_log = logging.getLogger('gm.ui')
All of the above but the second and third line were added to the top of the parser. To tell gettext where to replace I marked them like this:
_('this is a string that needs a translation') vs. 'this is a string that needs a translation'
So the _() construct identifies the strings to gettext. The following lines were added to the main section.
from Gnumed.pycommon import gmI18N
Running the parser now displayes the same result even after all 'I am a string' occurences having been replaced by _('I am a string'). The next part will try to get the parser connected to gmCardiacDevicePlugin and get this plugin displayed in GNUmed. Once this has been accomplished the XML needs to be read from the database instead of a file.

Wednesday, July 01, 2009

How to build GNUmed packages for Windows

A few people have responded to my call for regarding packaging. Despite the fact that this only touches the Mac as no volunteers showed up for Windows or any distribution besides Debian I have continued to put up documentation on how to package GNUmed for various OS and distributions.

The last few hours I have rebuilt packages for Windows. It should have taken only 20 minutes but this time I decided to document everything in a step by step guide.

The guide can be found in the Wiki at

If you follow that guide you should be able to roll Windows packages yourself. Anyone willing to help out with packaging new releases please let us know at


Tuesday, June 30, 2009

How to build GNUmed packages for Ubuntu from Debian

Packaging for multiple distributions and operating systems is quite some work. Our Ubuntu packages are based on the fine work of the Debian-med team.
I order to attract contributors to the GNUmed project (and to get some work off our backs :-) we have published a guide on how to build GNUmed packages for Ubuntu. Anyone willing to help us out is welcome to take a look at our Wiki.

GNUmed EMR client has been updated

The client for the electronic medical record GNUmed has been updated to version 0.4.6. There are no database fixups to apply for this release. Packages are available through the Launchpad PPA at:

Feedback is always welcome.

Tuesday, June 16, 2009

GNUmed update tricks

Hi all,

Every so often a new GNUmed series is released. This time it changes from the 0.4.x series to the 0.5.x series. This involves two major changes. The client has new features and possibly regressions. But more important is that a new database might be needed. In this case there is a major version change in the database version.

This involves a database upgrade during the installation process and is described at Last but no least it involves upgrading you client config file so it will let you select the new database at client startup.

More info on how to edit your config  files can be found at:

So after upgrading to client 0.5.x you will need to select version 11 of the GNUmed database.

GNUmed 0.4.6 and 0.5.rc1 released

As announced on the mailing list GNUmed Updates have been published. The stable 0.4.x series is now at version 0.4.6.

Futhermore the first release candidate of the 0.5.x series is out. This series brings new features and hopefully no new bugs. We need help to test these release candidates.

Packages for OpenSUSE , Fedora, Mandriva are available from the OpenSUSE Build service at

Installation instructions are available from

Please report any problems to or

Sunday, June 14, 2009

OpenPhysio für die Physiotherapie

Es scheint als gäbe es noch einen zweite Bestrebung eine OpenSource Software für die Physiotherapie zu entwickeln. DIe Lösung findet sich als Alpha-Version unter Die Macher von sind darüber informiert.

Obwohl Konkurrenz das Geschäft belebt ist es im Anfangsstadium extrem schwer ein Projekt auf die Füsse zu stellen. Vielleicht finden beide Projekte ja zusammen und schaffen eine knackige Alternative.

Mindestens zwei Physiotherapiepraxe nutzen GNUmed. Da stellt sich die Frage ob man nicht alle Projekte irgendwie vereinen kann.

Saturday, June 13, 2009

Dicom viewer (X)medcon packaged for Linux

Xmedcon has been packaged in its latest version 0.10.5. Apart from providing the latest version there now is a packages for OpenSUSE 11.1 as well which previously did not build.

Get it from via 1-click installation from

Tuesday, June 02, 2009

When overengineering fights getting things done

When I had some days off from work a few weeks ago I started to hack on a GNUmed plugin for cardiac device management. The idea was simple. Avoid all the mistakes done by the software I currently use and make it even better (TM). Back then I decided to document my steps toward the goal. Those of you having followed the series are aware that the planning stage went well. Having ideas and putting them on paper or mindmaps is the easier part. When the coding started it became quiet.

Let me explain why I think that is quite natural. One has to learn new tools. In my case that means learning python and wxglade. One has to learn about the existing code. In my case that is learning about database connections and getting patient information from the database. The single most critical issue howerver is the overengineering disease.

I work with a system that takes on pacemaker management. It has some flaws. Some of them I consider serious. Producing a new system involves finding and avoiding those flaws. I got trapped however by the desire to handle every use case in the first iteration of the plugin.

The only solution is to take a step back and reduce the initial feature set without cutting down on the possibilities. The plan is to get a working version out and enhance it gradually.

Another round of ICU shifts is coming up so this will have to wait for two weeks or so.

Friday, May 29, 2009

GNUmed mobile edition updated to version 0.4.5

The GNUmed mobile edition has been updated to client 0.4.5 and server v10.5

What is the mobile edition you might ask ? GNUmed mobile edition is a carefully crafted version that requires no local installation. It is a Windows version that is installed (copied to) a removable drive such as a USB drive. It can then be started from that drive in (hopefully) any Windows-Computer on the go. The data is stored on the removable drive as well.

While updating I have not simply updated GNUmed but added some features as well.

1.) The GNUmed client is integrated with the PortableApps laucher
2.) The PortablePostgres systray launcher is intergrated with the PortableApps launcher
3.) The PortablePostgres systray launcher provides access to the portable PG config files
4.) PortablePostgres is configured to run on port 5433 rather than 5432 so it will run alongside a locally running PostgreSQL. Useful for backup/restore feature
5.) Client size has been reduced to 25MB from 88MB
6.) Server Size has been reduced to 171 MB from 288MB

On my todo list:
1.) show active/inactive status for PostgreSQL through colored systray icon
2.) add backup/restore scripts specifically for GNUmed for pre/post house call situations
3.) Talk to Karsten about display option of server one is connected to in the GNUmed window

Grab it from

Thursday, May 28, 2009

FOSS EMR visibility

Thanks to the great work Andreas Tille from Debian is doing I was able to quickly supply packages for various Ubuntu releases.
Every once in a while I search for GNUmed via Google. I am always surprised that it will come up at a number of places when people are looking for alternatives to closed source EMR packages.

I was even able to find threads that indicate that users we are not aware of through the mailing list actually have succeeded in getting GNUmed to run in their machines. Most of the time they use Ubuntu which is only possible because of the work of Andreas and the Debian-med team.

But there is another side of the coin as well. When putting in Linux and EMR into google the interested searcher is not directed to a site that presents the FOSS EMRs in a light that would make one try it.

FOSS EMR are as badly represented as possible. There is no room for the 'not invented here' syndrome. It is a small market and we better make damn sure we represent the FOSS EMR ecosystem as good as possible.

This primarly involves to allocate ressources at
1.) user friendly packaging
2.) user friendly package distribution
3.) user targeted software descriptions

At GNUmed we have come a long way and even put some serious cash from our own pockets behind this. Unfortunately not all projects seem to understand this issue.
First they (users and competitors) ignore you. Then they will laugh at you. Then the fight you. Then you win. FOSS EMR are barely beyond the ignore phase.

Wednesday, May 27, 2009

GNUmed for Ubuntu updated

Packages for Ubuntu have been updated to provide the latest upstream version. Available via the PPA is client version 0.4.5 and server v10.5. This version fixes a nasty bug that in some cases would write an incorrect date of birth to the database.

Packages are available from

Sunday, May 24, 2009

OpenSource Physiotherapiesoftware Thera-Pi

Bin vor einigen Tagen auf die Software Thera-Pi gestossen. Dabei handelt es sich um eine Software, die eine Verwaltung einer Physiotherapiepraxis bzw. eines Rehazentrums ermöglichen soll.

Welche positiven Aspekte sind schon jetzt zu bemerken.

1.) Start soll der 1.1.2010 sein. Bis dahin soll es fertig sein.
2.) Es soll OpenSource sein - der Quelltext ist schon jetzt verfügbar
3.) Es bildet ein Programm nach, dass schon jetzt existiert und vom selben Programmierer stammt

Programmiert wird in JAVA. Helfer und Tester werden noch viele gesucht.

Aktuell besteht das Henne/Ei-Problem. Weil noch unfertig finden sich nur wenig Helfer und daher wird es nicht so schnell fertig wie geplant. Ich empfehle allen potentielle Interessenten den Besuch der Internetseite

Wednesday, May 13, 2009

GNUmed - please support a stable release update (SRU)

Since Jaunty was released we are getting about two automatic bug reports a week because GNUmed crashes on the same version and error in Ubuntu. The reason has been known for a while but a fix did not make it into Ubuntu because of feature freeze.

I have filed a bug with the intent to get a stable release update published. See this bug.

The solution is to either update GNUmed to a fixed version in our PPA or set a supported timezone in GNUmed (this needs a timezone which PostgreSQL can handle).

Please try gnumed-client and gnumed-server from Jaunty (version 0.3.9) and if it crashes please update to 0.4.4 and report your finding on the bug report. That way MOTU might get a better impression if a SRU is worth the effort or not.

If it does not work out we will at least have a better version in Karmic :-)

The GNUmed team

Sunday, May 10, 2009

On handling software updates in Ubuntu

GNUmed - one of the FOSS electronic medical records has seen quite a few bugfixes since Ubuntu 9.04 was released. The sad part is that many (potential) users never find out about that.

GNUmed updates are available through the GNUmed team's PPA but few users will search for a PPA. It is documented on the webpage but often when you encounter a bug in a software you are trying you are not investing to much energy into getting it run. It either runs or one moves on.

All we can do about it is wait for the next Ubuntu release to ship an update. I know there is a backports repository but we have been down that road. Until enough people verify that the package should go in backports a new release is out.

I really believe there should be a mechanism that lets Ubuntu users search for software updates and include the PPAs should include the PPAs such as the search on does.

GNUmed support for OpenSUSE 10.3 fading out

As I am not aware of anyone still using GNUmed on OpenSUSE 10.3 I have upgraded to openSUSE 11.1. This means packages are still built but not heavily tested. If you rely on 10.3 and experience problems in the future let us know.

Upgrade to 11.1 went flawless. GNUmed client and server were installed through the one-click-feature. A simple gm-bootstrap_server call on a root shell bootstraped a complete database.


Saturday, May 09, 2009

Can Ubuntu save the electronic medical record ?

There are a number of Open Source electronic medical record software packages (EMR). There are even more proprietory EMR packages. Many of the FOSS EMR can compete with the commercial ones. Despite the fact that they mostly run on free OS such as Linux they are mostly invisible.

When you try to sell a FOSS EMR on a free OS it gets difficult. Few FOSS EMR have bothered to package for any given distribution. GNUmed is one of the few that provides packages for Ubuntu , Debian, openSUSE, Fedora and others.

Since the inception of Debian packages a lot more people have been able to try GNUmed on a free platform. It is about the users. EMR are valuable to very few people but the that look for Linux EMR have not been greeted by nice installation methods so far.

Ubuntu has received a lot of buzz lately. Seems like a lot of people are getting introduced to Free Software by means of Ubuntu. We are prepared for that. GNUmed provides easy to install packages.

Is it enough ? We don't know yet. It would certainly help if more medical and scientific software was visible. There is a project called Debian-med which takes care of aggregating scientific and therefore medical packages in Debian. I believe a medical derivative of Ubuntu could benefit both sides.

Increase visibility for Ubuntu as a commecially viable OS in medical offices and certainly expose FOSS EMR to a wider audience.

Friday, May 08, 2009

Free your mind with mindmapping

While I am wraping my head around the details of the cardiac device pluging I realize just how complex it is to get it right. The software i currently use solves that by ignoring corner cases like a lead being implanted at the right ventricular apex but being paced fom the atrial channel of the generator. It does not cater for the case that a patient has an left ventricular and right ventricular lead but both being connected to the RV channel through an Y-connector.

The XML file is changing almost every minute a new thought comes up. I have been toying with the idea of how to group devices. To do that one has to define what a device is. I have settled for the definition that an ICD-device is actually a virtual device consisting of a generator and a number of leads. Actually the generator consists of a battery, a number of output/input channels and a mainboard that does the signal processing and therapy delivery.

Why so overly complicated. Because you will want to know which of your patients have a device that has just been recalled or if the ICD shocks are related to the lead being flaky. You might also be interested in the fact that the program you applied two years ago led to less shocks than the currently active one.

To even have a chance to get this done right I have started to use a mind mapping tool called vym. It exports to various formats. The map itself is in the test-area for shilbert in the CVS.

Have a look. Right-Click-Display-Image to enlarge it.

Thursday, May 07, 2009

GNUmed plugin development - part 11

Python comes with various XML tools. Fortunately there is a library called ElementTree which makes XML mangling quite a bit easier. The task is to extract the information on each device from the XML file and format a string that can be fed to the display.

I had to tidy up my pyhon skills a lot and started with a standalone python script that reads in an XML file and parses it for a number of known tags such as 'vendor', 'model' and much more. The next step is to format this into the string I would like to display on the screen. The benefit of seperating the data extraction from the data formating part is that many different display options can be catered for.

In short my preferred mode of display it to group by logical device unit. Each device such as a pacemaker and its leads make up a device. Each device has subparts such as the generator consisting of a mainboard and battery. This is not mandatory but makes sense because I would like to have the option to document software updates and battery types. Not every pacemaker of the same model has the same battery model over time.

I admit the demo-XML file changed a number of times and will most likely see some more restructuring until the plugin is complete.

They say it is best to commit often and early to not lose work on one hand and get feedback on the other.

Having said that I am going to check in the XML file and standalone XML-parser into CVS. It is wise to use the folder 'test-area' in the CVS tree for that.

cvs add GNUmed6.xml

Enter passphrase for key '/home/basti/.ssh/id_rsa':

cvs add: scheduling file `GNUmed6.xml' for addition

cvs add: scheduling file `' for addition

cvs add: use `cvs commit' to add these files permanently
cvs commit GNUmed6.xml
Enter passphrase for key '/home/basti/.ssh/id_rsa':

/sources/gnumed/gnumed/gnumed/test-area/shilbert/GNUmed6.xml,v  <--  GNUmed6.xml
initial revision: 1.1
/sources/gnumed/gnumed/gnumed/test-area/shilbert/,v  <--
initial revision: 1.1
When you update your CVS tree you get my work located in the folder gnumed/gnumed/test-area/shilbert

to try it run:
Reading the XML file GNUmed6.xml it will output this:
The file has the following devices: <Element CardicacDevice at b7bfb20c>:
The device has the following parts: <Element DevicePart at b7bfb18c>
hey we are dealing with a generator here:-)
('St. Jude Medical', 'Atlas DR', 'active')

Seems like we are getting there. Next up is to finish the parsing. While this is getting done Karsten needs to write the routine to store and retrieve and xml object in the database.

GNUmed 0.4 series hat arrived in Ubuntu

Standing on the shoulders of the Debian giant I have updated GNUmed in Ubuntu. GNUmed 0.4 series is now available from the GNUmed launchpad PPA at

If you would like to install these packages you will have to add a line to your software sources.

deb hardy main
deb-src hardy main

deb intrepid main
deb-src intrepid main

deb jaunty main
deb-src jaunty main

deb karmic main
deb-src karmic main

depending on which version of Ubuntu you are using. If are running the latest as of May 7th it is most likely version 9.04 aka jaunty.

Thursday, April 30, 2009

Vmware Tools in Ubuntu Linux

There seems to be an number of tutorials availalble. Most are outdated.

sudo apt-get install xserver-xorg-input-vmmouse open-vm-tools

is all you need.

Wednesday, April 29, 2009

GNUmed plugin development - part 10

It has taken some time to tackle part 10 of my way to a GNUmed plugin. A new GNUmed version has been released. Release dude duties have taken up most of my freetime.

Anyway I am back. The widget user interface loads in GNUmed but does not do anything useful yet. The time for clicking UI elements is over. The hard labor to code in python is about to begin. Here is where most idealists have left off and left GNUmed.

I was fortunate enough to have a face to face meeting with Karsten to ask all my newbie questions.

1.) How to proceed ?
2.) How to extend the database tables to house my data ?

His answer wasn't straight forward. First he wanted to know exactly what I intended to do. I told him my vision but visions don't amount to code. I had to break the vision down into manageable pieces.

Turns out there are many ways to store the input gathered via the the plugin user interface. There is the option to extend the database structure which is more work for him and involves a lot of new code (potentially buggy that is) or store the input as a XML document like any other document.

I did not understand the concept of storing the input as a document at first so he had to explain the concept to me. It comes down to this. Instead of storing any value gotten from the user interface in a table/field in the database one stores the values in an xml file and stores the xml file in the database. The xml file is a datbase more or less which gets stored in the the PostgreSQL database.

This means I can reuse the document plugin's classes and functions and do the content storage via python's XML routines.

I first constructed an XML file to work with. The editor used was EditiX - a cross-platform and multi-purpose XML editor, XSLT debugger and Visual Schema Editor. It provides editing support for XML, DTD, XHTML, XSLT, XSD, XML RelaxNG, ...

Here is the manually crafted XML file.

<?xml version="1.0" encoding="UTF-8"?>

<!-- New document created with EditiX at Wed Apr 29 15:37:23 CEST 2009 -->

        <DevicePart type="generator">
                <implantregion>right subclavian</implantregion>
                        <GeneratorPart type="CPU" >
                        <GeneratorPart type="Battery">

        <DevicePart type="lead">
                <manufacturer>          </manufacturer>
                <isexplanted>   no</isexplanted>

This is a simplified version. It lacks the actual measurements. Next step is to learn how to transfer that XML to a human readable form so I can display it in the left upper section of the plugin.

Monday, April 27, 2009

Order your GNUmed USB drive today

We are now offering ready to run USB thumbdrives to let you experience GNUmed. One has the choice between GNUmed in Windows Portable Apps (TM) format or GNUmed for Linux ready to boot from the USB drive.

The thumbdrives are 4GB devices which can be reused in case GNUmed does not fit. They come at a price of 20 Euros excluding shipping.

We will try to fulfill internationational orders. Payment methods can be negotiated but PayPal is preferred. Contact me directly at A dedicated website will be up later.

GNUmed Wiki updated to TWiki 4.3

In an effort to increase security our main source of information - our wiki - has been updated to release 4.3. Along comes a new skin.

Take a look at our wiki now.

Friday, April 24, 2009

Live CD: updated to GNUmed Version 0.4.3

Since GNUmed 0.4 has been released a new Live-CD was needed. Thanks to the Debian-Live tools a CD containing GNUmed 0.4.3 and database 10.3 was quickly made available. It boots right into a graphical Desktop environment (XFCE) ready to run GNUmed.

Thursday, April 23, 2009

Installationspaket für MS Windows

Die Installationspaket für den Klienten und Server sind in der aktuellen Version 0.4.3 und v10.3 verfügbar.

Jetzt Klient und Server herunterladen.

Video: Installation unter Windows

Die Installation unter Windows ist noch einfacher geworden. Demonstriert wird das in einem Video auf

ARRIBA - Risikorechner auch unter Linux lauffähig

Die in JAVA programmierte Software ARRIBA zur Abschätzung des Risikos sowie Beratung im Rahmen der Herzinfarkt- und Schlaganfallvorsorge läuft problemlos auch unter GNU/Linux.

Auf Anfrage kann direkt unter ein JAR-Archiv bezogen werden. Pakete für Fedora, openSUSE sowie Mandriva habe ich erstellt. Ob ich diese verteilen darf muss erst noch mit den Autoren geklärt werden.

Wednesday, April 22, 2009

Video: Einführung in GNUmed

Unter finden sich zwei neue Videos. Das erste Video gibt allgemein Auskunft zu GNUmed. Das zweite Video zeigt wie die Live-CD unter Windows ausprobiert werden kann. Am Besten ist die Darstellung im Vollbildmodus.

GNUmed lab measurements

The measurements plugin received a small goodie recently. In the upper left corner there is now a configurable link. Clicking on it will open a webbrowser and take you to the configured website.

Why is this worth the blog entry. While looking at lab results I sometimes want to know more a bout a test itself. So I configure the link to point at a lab encyclopedia to look up the information.

Monday, April 20, 2009

PDFshuffler for GNUmed

Today I found out about pdfshuffler. It is a tool to split, merge or generally manipulate PDF files.

For GNUmed this can be handy when archiving documents.

Sometimes there is the issue of having information on multiple patients in one documents. For scans of paper documents this is less of an issue since you can split the content while scanning.

For FAX transmissions this is not so easy. I am not aware of a tool (on Linux) that can split documents by content.

Here is one possible workflow:

1.) Receive fax transmission and have it convert to pdf. Hylafax can do this or one could use tiff2pdf.
2.) Have it displayed in the GNUmed inbox - how does one do that ?
3.) on double click open pdfshuffler, actually two instances of it as you might want to drag 'n drop files between the windows for splitting the document.
4.) save the pdf in a folder on your harddrive
5.) open the pdf in the document archive plugin or drag it there

A few things come to mind.

1.) pdfshuffler has not been tested on windows.
2.) pdfshuffler should be 3rd-party (GNUmed) aware. much like with OpenOffice there should be a way to open a pdf in pdfshuffler from within GNUmed. Pdfshuffler needs a button 'save to GNUmed' next to 'save to file'. One would then feed the pdf back to GNUmed and associate it with the currently active patient.

PDFshuffler actually does not need to know anything about GNUmed. It should simply have the feature to hand the pdf to any program. GNUmed running in remote-control mode should then detect the call (made by a shell script 'gm-fax-importer'), raise the document archive plugin for the currently active patient and display the pdf as document part. Later versions could even extract the pdf metadata and hand those to GNUmed as well.

Monday, April 13, 2009

GNUmed plugin development - part 9

Karsten Hilbert and I had a little chat to help me plan the next steps. The current status of the plugin is as follows

a) it loads fine in GNUmed
b) it crashes when trying to load data
c) an incomplete class cCardiacDevicePluginPnl has been partially implemented

Karsten advised me to move the device specific bits to a seperate file called gmDeviceWidgets in /usr/foo/gnumed/gnumed/client/wxpython

I did so. I forgot to add the import of gmDeviceWidgets to the top of gmCardiacDevicePlugin in /usr/foo/gnumed/gnumed/client/wxpython/gui but that was quickly resolved after reading about the 'global gmDeviceWidgets undefined' stuff in the log file.

It now does not crash anymore but does not yet load the SOAP notebook. Apart from missing soap entry which does not need to be a notebook but rather a single soap editor the right column needs to house an ICD data entry widget.

This widget will be produced in the next step in the wxg file. See screenshot below for current state of the plugin.

GNUmed plugin development - part 8

Remember I left off with a problem rather than a solution ? Well I had a little chat face to face with Karsten who happens to be the author of the SOAP plugin I borrowed so much code from.

Turns out he added some special code to the file which normally gets autogenerated from the wxg file. Looking at the file I found I had to add

class wxgCardiacDevicePluginPnl(wx.ScrolledWindow):
    def __init__(self, *args, **kwds):

        from Gnumed.wxpython.gmNarrativeWidgets import cSoapNoteInputNotebook
        from Gnumed.wxpython.gmDateTimeInput import cFuzzyTimestampInput
        from Gnumed.wxpython.gmEMRStructWidgets import cEncounterTypePhraseWheel
        from Gnumed.wxpython import gmListWidgets

        # begin wxGlade: wxgCardiacDevicePluginPnl.__init__

The import statements to my It now actually shows up in GNUmed. Horray. But it crashes when trying to load data. this should be easy to fix.

Here is the error:

gm.gui (/home/basti/sources/gnumed/gnumed/Gnumed/wxpython/ #49): unhandled exception caught:
Traceback (most recent call last):
  File "/home/basti/sources/gnumed/gnumed/Gnumed/wxpython/", line 231, in _on_notebook_page_changed
  File "/home/basti/sources/gnumed/gnumed/Gnumed/wxpython/", line 183, in receive_focus
  File "/home/basti/sources/gnumed/gnumed/Gnumed/wxpython/", line 128, in repopulate_ui
  File "/home/basti/sources/gnumed/gnumed/Gnumed/wxpython/", line 66, in __repopulate_ui
    self._data_stale = not self._populate_with_data()
  File "/home/basti/sources/gnumed/gnumed/Gnumed/wxpython/", line 79, in _populate_with_data
    raise NotImplementedError, "[%s] _populate_with_data() not implemented" % self.__class__.__name__
NotImplementedError: [cCardiacDeviceMeasurementsPnl] _populate_with_data() not implemented

That is no surprise since I decided to put the class cCardiacDeviceMeasurementsPnl into and did not copy all stuff from gmSoapWidgets. What I effectively missed is to copy all the needed functions like _populate_with_data().

What this effectively shows is that I need to get a better idea on what to put where. Up till now it has mainly been a process of duplicating content of other files.

One issue is if it makes sense to put more stuff into gmMeasurementWidgets or rather a seperate file along the lines of gmDeviceAssessmentWidgets.

From the feedback received on the mailing list it is recommended to leave it in gmMeasurementWidgets and import the relevant stuff from gmNarrativeWidgets in order to avoid code duplication.

It was further recommended to rename cCardiacDeviceMeasurementsPnl into cCardiacDevicePluginPnl to avoid namespace confusion for the day I really want a class representing the measurement specific bits.

Thursday, April 09, 2009

GNUmed plugin development - part 7

Now on to the real stuff. Looking at

class gmCardiacDevicePlugin(gmPlugin.cNotebookPlugin):

        def GetWidget (self, parent):
                self._widget = gmMedDocWidgets.cSelectablySortedDocTreePnl(parent, -1)
                return self._widget
in tells me that in the case of the Document archive plugin we borrowed from the class cSelectablySortedDocTreePnl is located in the file gmMedDocWidgets. The name implies that this is a collection of classes of medical document widgets. The device parameters are essentially measurements.

There is a file called gmMeasurementWidgets available and I am going to extend that one. I added a class cCardiacDeviceMeasurementsPnl to the file just before the __main__ statement.

class cCardiacDeviceMeasurementsPnl(wxgCardiacDevicePluginPnl.wxgCardiacDevicePluginPnl, gmRegetMixin.cRegetOnPaintMixin):

        """Panel holding a number of widgets to manage implanted cardiac devices. Used as notebook page."""

        def __init__(self, *args, **kwargs):

                wxgCardiacDevicePluginPnl.wxgCardiacDevicePluginPnl.__init__(self, *args, **kwargs)
        # event handling

An extended import is needed as well.

from Gnumed.wxGladeWidgets import wxgMeasurementsPnl, wxgMeasurementsReviewDlg
from Gnumed.wxGladeWidgets import wxgMeasurementEditAreaPnl
from Gnumed.wxGladeWidgets import wxgCardiacDevicePluginPnl

Now back to to reflect the changes.

class gmCardiacDevicePlugin(gmPlugin.cNotebookPlugin):

        def GetWidget (self, parent):
                self._widget = gmMeasurementWidgets.cCardiacDeviceMeasurementsPnl(parent, -1)
                return self._widget

A change in the import statements is needed here too.
from Gnumed.wxpython import gmMeasurementWidgets, gmPlugin
instead of

from Gnumed.wxpython import gmMedDocWidgets, gmPlugin, images_Archive_plugin
If you followed the above steps you might notice that the plugin throws many errors in the file gnumed.log. This file can be viewed directly from within GNUmed. It does not show up. The reason is simple. I use a complex set of widgets that are scattered across the files gmMeasurementWidgets and gmNarrativeWidgets.

The errors are that widgets found in gmNarrativeWidgets are not found, most likely because I put the class cCardiacDeviceMeasurementsPnl(parent, -1) in gmMeasurementWidgets. It could help to move the class into narrative widgets but that is not what I want. I could as well start another file called gmDeviceWidgets.

Lets see what the mailing list has to say about that.

What I have learned so far. First I need to create a mockup gui, store it in the wxg directory, create python code from it and store it in the directory wxGladeWidgets. Then in the wxpython/gui directory a file called gmPluginName is needed. When created from scratch or copied over from a template make sure to have the class name reflect the filename, the tab name set and the menu entry configured.  Last but not least the GetWidget line needs to be filled to reflect what GUI code to load.

GNUmed plugin development - part 6

So I joined the GNUmed mailing list and immediately received feedback. The data storage aspect will be tough to tackle but we will get to that later.

The goal for today is to get our mockup GUI displayed within GNUmed. There will be no database connection but at least it will display (hopefully).

I selected /home/user/sources/gnumed/gnumed/client/wxGladeWidgets/ and pressed 'generate code'.

This code cannot be simply run inside GNUmed so I need to find out how GNUmed makes use of the code inside its plugins. There is a slight chance that this is documented in the development section of the GNUmed wiki. There seems to be no relevant information so I will try to piece it togehter and document it.

There are example plugins. Let's take a look and learn from there. The names of the plugins to load are stored in the database.

I reason since I got some code from existing plugins I should look there. The file is called I copied that file to

Now it is time to run a local instance of GNUmed and a local database. You should really install it now. Do not try to cut corners by not bootstraping a local database. We need that to work on our plugin.

I recommend you run GNUmed via the script in the CVS source tree and bootstrap a database from the CVS tree as well. Change to the server/bootstrap directory and run Extensive information is available here and here.

Be aware that the source code in a CVS tree is a moving target. You might want to consider getting the source for the stable version 0.4.2 and server v10. All files mentioned before like the wxg files and the renamed plugin file should be created in that cvs directory then. The benefit is that your plugin will be developed against the latest stable version.

However if your plugin requires database changes there is no way around using the latest development code since changes to the database made against the stable version might not work with the latest development code.

I did not run into trouble but if you do don't hesitate to contact

I started GNUmed (from CVS) with the local database (v11) and added my new plugin (still containing the SOAP stuff) to the database. GNUmed evidently scans the directory foo/gnumed/client/wxpython/gui for available plugins. If the file is there it will show up for activiation. I activated it from within GNUmed via 'Office' > 'manage master data' > 'Workplace profiles'.

GNUmed does not show it immediately. A restart of GNUmed is neccessary. The plugin does does not show up and throws an error in the log file.

Traceback (most recent call last):
File "/home/basti/sources/gnumed/gnumed/Gnumed/wxpython/", line 121, in __load_plugins
plugin = gmPlugin.instantiate_plugin('gui', curr_plugin)
File "/home/basti/sources/gnumed/gnumed/Gnumed/wxpython/", line 333, in instantiate_plugin
plugin_class = module_from_package.__dict__[plugin_name]
KeyError: u'gmCardiacDevicePlugin'

This is due to the fact that the class name and the file name (gmCardiacDevicePlugin) due not match. Open the file and change the class name.
class gmCardiacDevicePlugin(gmPlugin.cNotebookPlugin):
"""Plugin to encapsulate document tree."""

tab_name = _("Documents")

def name (self):
return gmCardiacDevicePlugin.tab_name

The section 'Menu Info' is responsible for the name of the plugin in the GNUmed menu. I changed it like this and while we are at it the notebook tab name as well.
class gmCardiacDevicePlugin(gmPlugin.cNotebookPlugin):
"""Plugin to encapsulate document tree."""

tab_name = _("Cardiac Device")

def name (self):
return gmCardiacDevicePlugin.tab_name
def GetWidget (self, parent):
self._widget = gmMedDocWidgets.cSelectablySortedDocTreePnl(parent, -1)
return self._widget
def MenuInfo (self):
return ('tools', _('Show &cardiac devices'))

I restarted GNUmed and saw the new Cardiac Device plugin. Next step is to load my GUI instead of the Document archive stuff. The line starting self._widget = ' ' needs to be changed.

But this will be the next part of our journey towards a GNUmed plugin. So far it wasn't that hard and I learned quite a bit where files are located in the source tree , what files are involved in creating a plugin and how to add a plugin to the workplace in a database.

GNUmed plugin development - part 5

Now that I have the source code available I can load an existing wxg file in wxglade as a start for my own plugin.

I opened /home/user/source/gnumed/gnumed/client/wxg/wxSoapPluginPnl.wxg and started to changed it to my fit my needs. I then saved it as /home/user/source/gnumed/gnumed/client/wxg/wxCardiacDevicePluginPnl.wxg

The result looks like this:

What you can see here is the complexity we are getting into. There can be more than one device not to mention a combination of active and inactive devices. Active and inactive leads. Why is all this important ? Because the life of a patient may depend on it. Hospital might call in and ask how long the leads have been in to decide whether to cap or extract a lead. There should be a device history. It is important to know which of you patients have which leads and generators when a recall is issued.

Now that we have a GUI we need to produce python code for it. There is a feature in wxglade to produce python code. This will be described in the next part.