[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-bugs] <bug>: <user did not comment on bug report>
From: |
Karsten Hilbert |
Subject: |
Re: [Gnumed-bugs] <bug>: <user did not comment on bug report> |
Date: |
Tue, 3 May 2011 20:29:53 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hello Oliver,
thanks for your report !
> client version: 0.8.6
You are missing two bug fix releases and a major release
with several bug fix release in itself. However, none seems
related to your problem.
Let's dissect it:
You are running 0.8.6 ...
> 2011-05-02 21:24:45 INFO gm.launcher
> (/usr/share/gnumed/Gnumed/gnumed.py::log_startup_info() #201): GNUmed client
> version [0.8.6] on branch [0.8]
... on Ubuntu ...
> 2011-05-02 21:24:45 INFO gm.launcher
> (/usr/share/gnumed/Gnumed/gnumed.py::log_startup_info() #206): {'RELEASE':
> '11.04', 'CODENAME': 'natty', 'ID': 'Ubuntu', 'DESCRIPTION': 'Ubuntu 11.04'}
... against a local database:
> 2011-05-02 21:25:57 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmAuthWidgets.py::GetLoginInfo() #633):
> backend profile "GNUmed database on this machine" selected
> 2011-05-02 21:25:57 DEBUG gm.ui
> (/usr/share/gnumed/Gnumed/wxpython/gmAuthWidgets.py::GetLoginInfo() #640):
> details: <any-doc> on gnumed_v14@:5432 (UTF8, public)
(IOW you must have set up the database locally - which is fine).
Now, your message inbox shows that there are unreviewed
documents for Rainer Hänel (ID 49):
> 2011-05-02 21:27:47 DEBUG gm.logging
> (/usr/share/gnumed/Gnumed/pycommon/gmLog2.py::log_stack_trace() #172):
> msg = [cInboxMessage:None]: [u'category: >>clinical<<', u'comment:
> >>unreviewed documents for patient [H\xe4nel, Rainer]<<', 'pk_type: >>2<<',
> 'importance: >>0<<', 'received_when: >>2011-05-02 21:27:44.073831+02:00<<',
> 'pk_patient: >>49<<', u'pk_context: NULL', 'is_virtual: >>True<<',
> u'l10n_type: >>review docs<<', u'l10n_category: >>clinical<<', u'data: NULL',
> u'pk_message_inbox: NULL', u'provider: >>LMcC<<', 'pk_staff: >>1<<', u'type:
> >>review docs<<', 'pk_category: >>1<<']
Note that this message does not really exist as a row
in the message inbox table. It is constructed on the fly
whenever the message inbox *view* is read. This means
that at the time the displayed inbox messages were last
read this patient MUST HAVE existed.
However, when activating that patient, GNUmed does not find him anymore:
> IntegrityError: insert or update on table "encounter" violates foreign key
> constraint "encounter_fk_patient_fkey"
> DETAIL: Key (fk_patient)=(49) is not present in table "identity".
This means that the patient 49 (Rainer Hänel) must *now* be
gone (now means "sometime after the inbox messages were last
read").
This scenario can ONLY happen when you
- open a GNUmed client
- let the client rest with the inbox shown which includes the message about
patient 49
- delete the patient 49 from elsewhere (psql, command line, pgadmin3, ...)
- then try to activate the message about patient 49 in the GNUmed client
In that case GNUmed will not have read the inbox again,
still thinking patient 49 exists. The only other case I can
think of is connection problems between the client and the
server just when trying to activate the patient 49. But
since both client and server are running on the same machine
this is quite unlikely.
If you *can* provoke this problem any other way I would like
to know the exact steps so I can reproduce and fix it.
For the time being I have removed (!) a check whether the
patient in question exists before trying to activate it
(because that check was incomplete and a subsequent check
already covered the case).
The proper fix, however, is to listen for changes to the
demographics table and reload messages when there are any.
Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346