[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-bugs] Trouble to search last name with apostrophe (single qu
From: |
Karsten Hilbert |
Subject: |
Re: [Gnumed-bugs] Trouble to search last name with apostrophe (single quote) |
Date: |
Thu, 1 Dec 2011 12:05:25 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Dec 01, 2011 at 11:43:45AM +0100, Karsten Hilbert wrote:
> > I have a patient whose name is like
> >
> > O'Kelly, Michael
>
> One *can* search for "Kelly" (omitting the O') but I admit
> one must know that (well, the tooltips says so: "fragments
> of first- and/or lastname", but ...).
>
> As for why it doesn't find O'Kelly in the first place -
...
> The fixed query is this:
>
> select distinct on (pk_identity)
> *
> from (
> select
> vbp.*,
> 'kompletter Name'::text as match_type
> from
> dem.v_basic_person vbp,
> dem.names n
> where
> vbp.pk_identity = n.id_identity
> and
> lower(coalesce(vbp.title, '') || vbp.firstnames ||
> vbp.lastnames) ~* lower('O''Kelly')
> order by
> lastnames,
> firstnames,
> dob
> ) as ordered_list
> ;
>
> Will fix for the next 1.1 release.
Done.
Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346