gnumed-devel
[Top][All Lists]
Advanced

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

[Gnumed-devel] Re: Gnumed-devel Digest, Vol 6, Issue 4


From: Sam Bowen
Subject: [Gnumed-devel] Re: Gnumed-devel Digest, Vol 6, Issue 4
Date: Fri, 02 May 2003 17:11:14 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830

address@hidden wrote:

Send Gnumed-devel mailing list submissions to
        address@hidden

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.gnu.org/mailman/listinfo/gnumed-devel
or, via email, send a message with subject or body 'help' to
        address@hidden

You can reach the person managing the list at
        address@hidden

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Gnumed-devel digest..."


Today's Topics:

  1. need SQL help (Karsten Hilbert)


----------------------------------------------------------------------

Date: Fri, 2 May 2003 17:03:10 +0200
From: Karsten Hilbert <address@hidden>
To: GNUmed list <address@hidden>
Subject: [Gnumed-devel] need SQL help
Message-ID: <address@hidden>
Content-Type: text/plain; charset=us-ascii
MIME-Version: 1.0
Precedence: list
Message: 1

Horst, Ian, others,

I am trying to set up a view that displays the allergies per
patient. Problem being that in the allergy table the
id_comment is a foreign key into clin_narrative which can be
NULL if no comment is recorded. I can't figure out how to
select the rows I need !

select a.substance, cn.value
   from
        allergy a, clin_narrative cn
   where
        a.id_comment=cn.id;

This does not work because a.id_comment can be NULL.

select a.substance, cn.value
   from
        allergy a, clin_narrative cn
   where
        a.id_comment in (cn.id, NULL);

does not work either although it seems intuitive.

Any suggestions ?

For the full SQL definitions see server/sql/gmclinical.sql and
gmClinicalViews.sql.

Karsten
Dear Karsten:

I have been reading along with the development notes for a while. In my practice, allergy information is critical and collected on the first visit in all patients. Would it be practical to have a default value of 'none' in the allergy table so that id_comment is not null?

Sam Bowen, MD
Internal Medicine
North Carolina, USA






reply via email to

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