[Top][All Lists]

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

Re: [Gnumed-devel] Comments on 0.2

From: Karsten Hilbert
Subject: Re: [Gnumed-devel] Comments on 0.2
Date: Sat, 24 Jun 2006 20:03:06 +0200
User-agent: Mutt/1.5.11+cvs20060403

On Sat, Jun 24, 2006 at 07:17:45PM +1000, Ian Haywood wrote:

> >         kwargs['patient_id'] = self.check_encounter_sanity 
> > (kwargs['episode_id'], kwargs['encounter_id'])  # if an error, exception 
> > goes straight to be caller, we don't need to handle
> This could be folded into cBusinessClass too.
No it cannot. But it can be folded into the cClinicalItem
subclass of cBusinessObject since it is generic to all
*clinical* item objects (clin_root_item children, that is).

I assume you want to use cBusinessObject for demographics
etc as well ?

> >         if type(allg_type) != types.IntType:
> >             kwargs['allg_type'] = gmPG.run_ro_query ('select id from 
> > clin._enum_allergy_type where value=%s', kwargs['allg_type'])[0][0]
> An INSERT rule could catch this.

> CASE WHEN allg_type ~ '[0-9]+' THEN allg_type::integer ELSE (select id from 
> clin._enum_allergy_type where value=allg_type) END
How do you handle the error case ? You'll have a hard time
finding out exactly what went wrong from the error
information PG gives you. Did the user type in a bogus
allergy type ? Did the programmer screw up (such as an
off-by-one error) ? Also I am not sure whether PG rules
allow this sort of dynamic runtime datatype fiddling.

GPG key ID E4071346 @
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

reply via email to

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