Tuesday, March 30, 2010

GNumed 0.7 release preparations

Hi all,

Please help with making this release the best so far. For this to happen please read the documentation that is specific for your distribution and improve it. The docs for Ubuntu are in pretty good shape I think. Fedora lacks behind. Mandriva could be updated with the information posted on the Mailing list, especially the server section for Mandriva.

Debian:
http://wiki.gnumed.de/bin/view/Gnumed/DebianGuideShort

Ubuntu:
http://wiki.gnumed.de/bin/view/Gnumed/UbuntuGuideShort

openSUSE:
http://wiki.gnumed.de/bin/view/Gnumed/ServerInstall#open_SuSE_rpm_packages

Fedora:
http://wiki.gnumed.de/bin/view/Gnumed/FedoraGuideShort

Mandriva:
http://wiki.gnumed.de/bin/view/Gnumed/MandrivaGuideShort

PCLinuxOS
http://wiki.gnumed.de/bin/view/Gnumed/PCLinuxOSGuideShort

Windows:
http://wiki.gnumed.de/bin/view/Gnumed/InstallerGuideWin
- change ahead, no more dependencies

MacOSX:
http://wiki.gnumed.de/bin/view/Gnumed/InstallerGuideMac
- any chance to have packages for that ? Pyinstaller I use for Windows or py2dmg should be able to produce binaries that need no system wide installation of python and the like.

PortableApps:
http://wiki.gnumed.de/bin/view/Gnumed/InstallerGuidePortable
- needs cleanup. there will be a portable client but no server. If anyone wants to work on the portable server I have some great code on disk that needs polishing.

Live-CD:
http://wiki.gnumed.de/bin/view/Gnumed/GnumedLiveCD
If you care about GNUmed on your favorite platform spend a minute an get the documentation for fellow users in best shape possible. If you have any question don't hesitate to contact the mailing list or myself.


Regards,
S. Hilbert, MD
GNUmed team

Thursday, March 25, 2010

GNUmed on MS Windows with better support starting at 0.7

With the release of GNUmed electronic medical record 0.7 series only days away considerable effort was put into polishing the GNUmed client and server on MS Windows. For the background on this I direct you to my recent article GNUmed server on MS Windows - changes ahead.

All changes have been tested against the 0.6 series but will make its debut in the 0.7 series. The major changes include:

1.) The client will no longer require any dependencies installed
2.) The client can be run directly from an USB thumb drive
3.) The database installation and bootstrap process requires no user interaction at all

So far noone has responded to my call for testing so I guess Windows as a platform is not important for the electronic medical record.

Wednesday, March 24, 2010

Sed is you friend - managing the passwords for the boostrap process

For MS Windows we have opted to preseed a set of passwords so users don't have to type all those passwords. That however involves changing a bunch of config files in the bootstrap directory. Doing that manually for every release was just out of the question. Sed comes to the rescue.
echo off

SET SED=C:\bin\sed.exe
SET VER=12.2
SET WORKINGDIR=C:\workplace\gnumed-server.%VER%\server\bootstrap
SET GMDBOPWD=gm-dbpass
SET PGPWD=postgrespassword

cd %WORKINGDIR%
echo # patching files in %WORKINGDIR%
for %%f in (*.conf) do %SED% -i "s/password = /password = %GMDBOPWD%/g" %%f
for %%f in (*.conf) do %SED% -i "s/#password =/password = %PGPWD%/g" %%f
echo # clean up
del sed*
That is magic. No more messing around and screwing up.

Wednesday, March 17, 2010

GNUmed client on MS Windows - please test

Hi all,

Thanks to pyinstaller there is now another version of GNUmed.

If you happen to still have a Windows PC anywhere please test the new GNUmed client.


http://www.gnumed.de/downloads/client/0.6/GNUmed-client.0.6.2-1frozen.exe


As the name implies it should run without prior installation of python, wxpython, mxtools, psycopg2.

In other works the client should run out of the box.

Please report any problems.




Tuesday, March 16, 2010

GNUmed server on MS Windows - changes ahead

In the beginning it was virtually impossible to get the GNUmed server running on MS Windows. Over time we have managed to advance from pure documentation to all-in-one packages to silent installation of PostgreSQL. For the majority of the users that has worked. For some it did not. The problems are not easily sorted out and all sides have their share in this. Basically it boils down to PostgreSQL being what it is - a sophisticated database server. Our user could not care less. If I was a user I would ask for the best database server out there and flawless installation at the same time. And they do.

Different from the client there is no easy solution for this. I have decided to go the extra mile and provide both the easiest and best practice installation method. This is possible but not at the same time. There will be one version we could call demo version. This version will install a client and server fully preconfigured. It will be just that - a demo version. You can try GNUmed on a Windows PC but you cannot (better should not) turn that a network wide database installation. There will be roadblocks to prevent this such as running the demo server on port 5433 instead of the default port 5432.

If at a later time one decides to go for a full GNUmed deployment then he or she needs to invest the time to properly install PostgreSQL and bootstrap a database. The boostrap process will change as well. The boostrapper will be frozen and no longer require a python installation.

Hopefully this will be a stable base for many upcoming GNUmed versions

GNUmed client on MS Windows - changes ahead

In the beginning it was virtually impossible to get GNUmed running on MS Windows. This was partly solved by producing manuals and video howtos. Still many people failed at that stage.
Then NSIS installer came into play. For the first time there was one single file to download which would put everything in the correct directory. Still many people were missing essential dependencies GNUmed would not run without.
Down the road the installer was enhanced. It would check for the dependencies and install them. While that opened GNUmed to a much broader audience it still had some drawbacks. Never versions of GNUmed would potentially conflict with older ones when being installed in a system-wide Python installation. For reasons not fully understood the installation would still fail on one or the other PC. This is most likely not an issue when the installation is performed by a professional service provider. The reality is however that non-IT personell attempts the installation and likely is to fail.

To get rid of this once and for all time and to make deployment of the standalone USB-thumbdrive version easier I have again changed the process quite a bit. From now on (GNUmed 0.6.2) GNUmed is shipped and installed as froezen binaries. To the professional that might mean it will consume a bit more space on the drive but to the user it means he or she will get a working GNUmed that is easier on more reliably to install. For the developer it means GNUmed on MS Windows is made of less files and requires less magic to install. In case of updates this means there is only one file to replace (gnumed.exe) instead of a bunch of python (*.py) files.

For the developer there is a drawback. The GNUmed you will download now is frozen. If you want to hack on it you need to get the sources.

Hopefully that will lead to a better experience for the user.

Monday, March 15, 2010

GNUmed - clinical pearls

GNUmed will now warn you that you have prescribed a medication the patient is allergic to even once you have actually allowed that. Better be carefull.



Sunday, March 14, 2010

GNUmed 0.7 Release Candidate 1

Karsten has uploaded RC1. This is low beta quality. Please test
and report !

        http://www.gnumed.de/downloads/client/0.7/
        http://www.gnumed.de/downloads/server/v13/

Karsten

        0.7.X

- new: manage diagnostic orgs
- new: manage date of death per patient
- new: manage discontinuation of substance intake
- new: hook after_substance_intake_modified
- new: hook after_test_result_modified
- new: visual progress notes
- new: initial support for FreeDiams drug database frontend

- improved: login dialag:
        - hint about local DB on failure
        - do not show password ;-)
- improved: show allergies in substance intake edit area
- improved: warn on creating database users with empty passwords
- improved: default region/country for new-person creation
- improved: show lab name/contact details in measurement tooltip
- improved: always use new person creation rather than old
- improved: placeholders:
        - name::*::*
- improved: various typos
- improved: do not fail if unable to show part when adding documents
- improved: cleaner display of documents in tree
- improved: ARRIBA is now v2.0.4
- improved: using Git for SCM now

Friday, March 12, 2010

GNUmed has a webinterface - sort of

It took 10 hours, cherrypy and some good guessing but now it is there. Let me
introduce GNUmed's web interface.

I have repeated ad nauseum that GNUmed is so cool ( I mean well abstracted)
that there should not be any problem ripping out the wxpython interface and
replacing that by a web interface.

Because I suck at python and web frameworks it took ten hours to complete. I
hase used cherrypy and a stock GNUmed. It was not neccessary to add a single
line of code apart from a few lines for the html login page. Can you believe
that ?

GNUmed is so nicely seperated that I was able to reuse gmPG2, gmCLI and some
more middleware modules without changing any of them. I ripped out gmGuiMain
since this is mostly wxpython stuff, stole most of the code from gnumed.py and
gmAuthWidgets for the login stuff and put all this in gnumedweb.py.

What we have got now is a simple website that will ask for the backend
profile, the username and the password. It will the connect to a stock gnumed
database just as the the wxpython gui would. To prove that I did not make this
up it returns the database language for your login and shows it on a webpage.

Tell you what. If you want to try it install cherrypy for your operating
system, replace the original gnumed.py in the wxpython directory by the one I
have attached here and run the well know shell script gm-from-vcs.sh just as
you would for the wxpython gui. Open a webbrowser and go to 'localhost:8080'.
Put in the credentials and observe the output.

You need to have a version 13 (devel version) database. If you want to try it
with a v12 (stable ) database let me know and I will make a small change to
gnumed.py.

What's next ? This is a prototype only. It show that the existing GNUmed code
can be reused without rewriting it. One needs python skills and HTML and/or
some Javascript skills to hack up a nice user interface. Some Ajax won't hurt
either.



http://localhost:8080

Best regards,
Sebastian

Thursday, March 11, 2010

GNUmed on Mandriva 2010

GNUmed client and server run fine on Mandriva 2010. The client runs out of the box on Mandriva. If all is well the server part installs without a hitch and the command 'gm-boostrap_server' will happily create a GNUmed database. In some corner cases due to the interaction with PostgreSQL the bootstrap process may fail. If that happens you will need some time or someone with good GNU/Linux skills to correct this situation.

If you encounter a message like:
DataError: new encoding (UTF8) is incompatible with the encoding of the
template database (SQL_ASCII)
TIP:  Use the same encoding as in the template database, or use
template0 as template.
most likely your installation of PostgreSQL on Mandriva has a cluster with SQL-ASCII encoding. You can find out by running the following commands as user root on the command shell.
su postgres
psql -l
If the output shows SQL_ASCII for encoding you weil have to change a few things manually before the GNUmed server part can run porperly. If you are sure that you have not used PostgreSQL previously and have no data in it until now then and only then you can try to uninstall all Postgresql packages and reinstall them. Before you reinstall backup and remove the directory '/var/lib/pgsql/data'. After you have reinstalled everything and restarted PostgreSQL (e.g. /etc/init.d/postgresql start) issue the above command again and observe the output. If you now have UFT8 as encoding instead of SQL_ASCII you are good to go. If not or if you don't want to remove the SQL_ASCII cluster then you are in for some manual work on your system. In that case you need to initialize a second cluster in another directory.

Issue these commands as user root.
mkdir /var/lib/pgsql/data1
chown postgres /var/lib/pgsql/data1
As user postgres (via 'su postgres' ) issue this command.
/usr/bin/initdb --locale=de_DE.UTF-8 -D /var/lib/pgsql/data1
Now change into that directory.
cd /var/lib/pgsql/data1/
Edit the file postgresql.conf and set the line #port = 5432 to port = 5433. Make sure to strip away the # at the beginning of the line .Now you have to tell the bootstrap script that PostgreSQL is listening on port 5433 instead of 5432.Change into the directory
/usr/lib/gnumed-server/bootstrap
 and edit the file
bootstrap-latest.sh
Find the line #export GM_DB_PORT=5433 and remove the # to activate the line. To start the second cluster on port 5433 issue these commands as user postgres.
'pg_ctl -D /var/lib/pgsql/data1 start'
To stop PostgreSQL on port 5433 run this command as user postgres.
'pg_ctl -D /var/lib/pgsql/data1 stop'
-Now to finally bootstrap a GNUmed database run this command as user root.
gm-boostrap_server
This is tested and works. You can verify that the second server is running on
port 5433 by running this command as user postgres.
'psql -p 5433 -l'
What is left is a way to automatically cater for the above situation. I
recommend to extend the script 'postgresql 'in /etc/init.d' but this exercise
is left to the user.

Don't forget to edit your config file to tell the client that the server is on port 5433. One way to do this is to edit the file /etc/gnumed/gnumed-client.conf. Find the line port in the profile of your choice and replace 5432 by 5433. Let us know if it does not work out for you.

Sebastian

Tuesday, March 09, 2010

Visual progress notes in GNUmed 0.7

Looking at the latest code in GIT I saw that a new feature is about to appear in GNUmed. There will be a possibility to work with images as visual progress notes.

It supposedly works like that:
 - connect a camera to the PC
- press file
- select the photo you want
- an image manipulation application will be opened
- one can edit the picture
- one leaves the application
- image will be transferred into the GNUmed database
- to the right is a list of such notes




Monday, March 08, 2010

GNUmed - even smarter when local database is missing

It is not obvious to many first time users that despite its name the package gnumed-server does not create a local database. Instead it just copies all neccessary files to the disk. One still has to run 'gm-boostrap_server'.

To make it easier for users to know that they missed the most important step the error dialog tries to be much more helpful now.



GNUmed web interface

Hi all,

I am bringing this up every once in a while. There is no need to discuss the need for it again. I am simply interested in a proof of concept and collecting thoughts.

GNUmed has a wxpython based client. It is a wrapper around GTK on GNU/Linux. In the past I have wondered what it would take to hack a web interface for GNUmed.

There a far too many web toolkits to choose from. One of the ideas is to use a toolkit that will allow reuse of existing code as rewriting (e.g. the middleware) not feasible.

Toolkits that come to mind and have some userbase are Django, Turbogears and Pylons. All of them provide access to the PostgreSQL database and make use of python. However all of them are designed to talk to the database bypassing our middleware. Replicating the middleware makes no sense.

It is possible to reuse the midlleware we have. It can be done through XML-RPC. Mere chance has it I came across TinyERP Web on freshmeat. Digging a little deeper it looks like the solved the same problem. They have a default GTK-Client and now came up with a web-client based on Turbogears. They use XML-RPC. I am not sure if they use it to access what I would call the middleware. However if anyone wants to have a go at this here is their code to look at http://www.openerp.com/download/old/eTiny-1.0.1.1.tar.gz If you are going to attempt that I recommend to:

- create a webbased log-in dialog which resembles the fat client dialog.
- reuse GNUmed's python middleware for the connection
- glue it together by using XML-RPC to talk to the middleware
- implement a page that shows that you are actually connected to the GNUmed database

There is a project called 'medical'. It tries to implement an EMR on top of OpenERP which is the current version of TinyERP - the software the above webinterface is for.

http://medical.sourceforge.net/

Have fun,
Sebastian

Thursday, March 04, 2010

GNUmed Live media download statistics

Since I have started to provide Live media such as Live-CDs, VMware images at

www.sf.net/projects/gnumedlive

around 15 days ago there have been roughly 120 downloads. The VMware images have been downloaded just 11 times. Top download was the Debian based Live CD. I believe that is due to the fact that this download is featured on the page.

I have not received any feedback from people who have tried it out so either all worked well or noone could get it to work.



BTW. Don't miss your chance to crush the challenge of the week. Help GNUmed warn about bad medication during pregnancy.

Sebastian


Tuesday, March 02, 2010

Challenge of the week - make a difference to the pregnant woman / unborn baby

Hi all,

Remember my I want to know who is pregnant and takes ACE inhibitor call ?

I am proud to introduce the ... challenge of the week ...


You always wanted to start looking at GNUmed?

Now here is your chance. Solve the question of who is pregnant and takes ACE-inhibitor.


Hint 1) There are various ways for coders and regular users. I will give you a hint. Have a look at the SQL query plugin of GNUmed. One way is to design a query that looks up the ATC of a drug and searches health issues und open episodes for _('pregnancy*')

Hint 2) You can browse the schema either via pgadmin or have a look at http://wiki.gnumed.de/bin/view/Gnumed/DatabaseSchema

Hint 3) This is a team project. If you have trouble just ask :-)


All entries will receive an honorable mention at the Wiki frontpage for version 0.7.


Good luck,

Sebastian