gnumed-devel
[Top][All Lists]
Advanced

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

Re: [Gnumed-devel] Maintaining patient demographics


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] Maintaining patient demographics
Date: Mon, 29 Aug 2011 22:12:12 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Aug 28, 2011 at 07:51:29PM -0700, Jim Busser wrote:

> It is possible in GNUmed to have a family as patients
> (sometimes an extended family) where three generations
> totalling several people all share the same telephone.
> 
> Does GNUmed normalize replicates of a communication
> channel,

No it does not.

> One option would be
> 
>       where dem.v_person_comms.url LIKE '%1%2%3%4%5%6%7%8%9%0'
> 
> however the above is very difficult to see clearly. Is
> there any postgres-supported expression which could evaluate
> a transform of (strip non-numerics from) a postgres column's
> values and allow them to be compared to
> 
>       '1234567890'
> 
> ??

I suppose this can be done with regexp_replace():

        http://www.postgresql.org/docs/9.0/static/functions-string.html

> I was unable to get past the following which only supplies numeric strings 
> *preserving*
> 
>       (
>       )
>       -
> 
>       select SUBSTRING(dem.v_person_comms.url, '[-0-9 \(\)]*')

Try something along the lines of

        where
                dem.v_person_comms.url = regexp_replace(....)

Karsten
-- 
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346



reply via email to

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