gnumed-devel
[Top][All Lists]
Advanced

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

Re: [Gnumed-devel] Kirk is a tobacco user


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] Kirk is a tobacco user
Date: Tue, 1 Dec 2009 22:24:59 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

On Tue, Dec 01, 2009 at 12:54:20PM -0800, Jim Busser wrote:

> Comparing the last 2 screenshots, we can see that you
> changed the tobacco-associated problem from none to CVI risk
> protection.
>
> OTOH there is nothing showing that accounts for how you
> edited the tobacco-smoking values to make the item
> "inactive".

Why sure ?

Duration was set from infinity to 30 years. Smoking having
been started in 1970 this means he stopped in 2000 ;-)

> Maybe the item would originally have been "long term"

yes

> (even though not approved-of) and would you afterward
> unchecked this box, making the tobacco-smoking "inactive"?

yes + adding the duration of 30 years (that he did smoke)

> I am also not clear on how the edit field value of
> "duration" relates to what is displayed in the grid view
> under Duration:
>
> - if no value is entered, displays a calculated value
>       now() - started ??

No, if no value is entered no value will be displayed unless
is_long_term is True in which case the grid shows the
infinity symbol.

Again, activity status is calculated like this:

        case
                when csi.clin_when is null then false
                -- from here on csi.clin_when cannot be null
                when (csi.clin_when > current_timestamp) is true then false
                -- from here on csi.clin_when must be < current_timestamp and 
not null
                when is_long_term is true then true
                -- from here on csi.is_long_term must be false or null
                when (csi.clin_when + csi.duration > current_timestamp) is true 
then true
                when (csi.clin_when + csi.duration < current_timestamp) is true 
then false
                -- from here on csi.duration must be null
                else null
        end::boolean
                as is_currently_active,

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]