gnumed-devel
[Top][All Lists]
Advanced

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

[Gnumed-devel] postgres boolean checks, and (e.g) diagnoses


From: J Busser
Subject: [Gnumed-devel] postgres boolean checks, and (e.g) diagnoses
Date: Sat, 18 Sep 2004 10:27:25 -0700

Just making sure I am interpreting the constraints correctly for example in clin_diag

the schema specifies:

clin_diag_is_active CHECK (((is_chronic = false) OR ((is_chronic = true) AND (is_active = true))))

Does a "check" function as a validity test that is applied only when the boolean is attempted to be set as "true" or does it test the validity of both true and false values?

In this example
- if the diagnosis is *not* chronic, then both is_active is permitted to be either true or false? - in order to be is_active, the diagnosis must also be chronic? This is confusing because the diagnosis defaults to is_active but NOT is_chronic, also IMHO during the first episode of any problem (say pneumonia) it remains active until it is resolved, there may be a requirement to check that a post-pneumonia chest x-ray has returned to normal but it is not a chronic condition.

BTW I am still thinking about the recent questions about health issues etc




reply via email to

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