[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-bugs] GNUmed does not allow same-day substance discontinuati
From: |
Karsten Hilbert |
Subject: |
Re: [Gnumed-bugs] GNUmed does not allow same-day substance discontinuations |
Date: |
Thu, 11 Jul 2013 19:21:48 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Jul 11, 2013 at 04:55:45PM +0000, Jim Busser wrote:
> > Citing from the CHANGELOG:
> >
> > 1.3.2
> >
> > FIX: exception on substance-discontinued in the future [thanks
> > S.Hilbert]
>
> what caused you to decide to look in the above changelog?
> Was it the result of your checking back across the
> changelogs, to visually identify (or to identify on the
> basis of the word 'substance' whatever was the most recent
> manipulation of substance-related code? Or is it because you
> had a relatively clear recollection of having then done some
> patching of discontinuation-related code?
The latter.
> > The corresponding patch:
> > ...
> > @@ -1493,17 +1493,21 @@ class
> > cSubstanceIntakeEAPnl(wxgCurrentMedicationEAPnl.wxgCurrentMedicationEAPnl,
> > else:
> > self._PRW_duration.display_as_valid(True)
> >
> > ...
> > The code thus reads:
> >
> > # end must be "< now()" AND "> start" if at all
> > end = self._DP_discontinued.GetData()
> > if end is not None:
> > # not in the future:
> > if end > gmDateTime.pydt_now_here():
> > self._DP_discontinued.display_as_valid(False)
> > validity = False
> > else:
> > # and not before it started
> > if start > end:
> > self._DP_started.display_as_valid(False)
> > self._DP_discontinued.display_as_valid(False)
> > validity = False
> > else:
> > self._DP_started.display_as_valid(True)
> > self._DP_discontinued.display_as_valid(True)
> >
> > So, this really should work. Going checking... OK, I can
> > reproduce it. So let's instrument the code a bit... GNUmed
> > seems to think that end is > than now(). Ah, there's the
> > rub. The started PRW is pre-filled with now()
>
> In the code, what is it that you have chosen or designated the expressions
> (abbreviations)
>
> PRW
> and
> DP
>
> to represent?
PRhrasewheel
DatePicker
Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346