gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] re: clin_medication, most recent


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] re: clin_medication, most recent
Date: Sun, 17 Oct 2004 18:21:30 +0200
User-agent: Mutt/1.3.22.1i

> Not sure if it's because clin_when isn't cast to timestamp with time zone
> as well?
> Is this why this keeps failing?
I think you are right. I casted clin_when to ::date for the
constraint check. Please see if it works...

Note that you still need to be explicit about the time zone
valid for your connection such that casting to date works
correctly with respect to daylight savings time etc.

> Should clin when also be cast to timestamp with time zone?
You mean last_prescribed ...  No, the other way round. We
can't cast last_prescribed to timestamp with time zone since
we don't have enough data for that.

> 21-Oct-2004 15:19:27 
> org.gnumed.testweb1.persist.scripted.gnumed.medication.MedicationSaveScriptV01
>  ensurePrescribedAfterStarted
> INFO:  clin when and last_prescribed are
>     Thu Oct 21 15:18:48 EST 2004
> and
>     Thu Oct 21 15:18:50 EST 2004
It almost worked as is even ! You just got the current time
in the "wrong" order in your client code hence it differed by
2 seconds. Casting clin_when to date alleviates that problem
(except for the corner case of before/after midnight !).

(BTW, are you sure your log entry doesn't have the %s's reversed ?)

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346




reply via email to

[Prev in Thread] Current Thread [Next in Thread]