[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-devel] Waiting time display question
From: |
Karsten Hilbert |
Subject: |
Re: [Gnumed-devel] Waiting time display question |
Date: |
Wed, 27 Jun 2012 14:56:49 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Jun 25, 2012 at 03:34:38PM +0000, Jim Busser wrote:
> 1) how to refresh it, because -- if a client is kept
> running for more than a day -- the stats become wrong. The
> obvious options are to refresh with each new patient
> activation or, if that would be excessive (slowing down
> GNUmed unnecessarily) what about a "Refresh" button at right
> (rightmost)?
Well, currently GNUmed refreshes on any change to
- the active patient
- the waiting list table itself
as witnessed in this snippet:
#--------------------------------------------------------
def __register_events(self):
gmDispatcher.connect(signal = u'waiting_list_generic_mod_db',
receiver = self._on_waiting_list_modified)
gmDispatcher.connect(signal = u'post_patient_selection',
receiver = self._on_post_patient_selection)
#--------------------------------------------------------
Oh, wait, the _on_post_patient_selection only does some of it:
#--------------------------------------------------------
def _on_post_patient_selection(self, *args, **kwargs):
wx.CallAfter(self._check_RFE)
#--------------------------------------------------------
#--------------------------------------------------------
def _check_RFE(self):
"""
This gets called when a patient has been activated, but
only when the waiting list is actually in use (that is,
the plugin is loaded)
"""
pat = gmPerson.gmCurrentPatient()
enc = pat.emr.active_encounter
if gmTools.coalesce(enc['reason_for_encounter'], u'').strip()
!= u'':
return
entries = pat.waiting_list_entries
if len(entries) == 0:
if self.__last_patient is None:
return
if self.__last_patient != pat.ID:
return
rfe = self.__last_comment
else:
entry = entries[0]
if gmTools.coalesce(entry['comment'], u'').strip() ==
u'':
return
rfe = entry['comment'].strip()
enc['reason_for_encounter'] = rfe
enc.save()
self.__last_patient = None
#--------------------------------------------------------
Since passing of time does not evoke a signal from the
database the waiting list would not get updated unless
modified.
I'll add refreshing when patients are changed.
Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346