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.
Sure.
> 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.
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
_______________________________________________
Gnumed-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnumed-devel