|
From: | Busser, Jim |
Subject: | Re: [Gnumed-bugs] a query problem when bootstrapping bundle [v18-v19-dynamic] |
Date: | Sun, 17 Nov 2013 20:53:38 +0000 |
On 2013-11-17, at 11:47 AM, "Busser, Jim" <address@hidden> wrote:
On closer examination I had misjudged the purpose of the problem query from the log which was
insert into
dem.org_unit (fk_org, description)
select (select pk from dem.org where dem.org.description = c_hs.narrative), 'unit of ' || c_hs.narrative from clin.hospital_stay c_hs where not exists ( select 1 from dem.org_unit where dem.org_unit.description = 'unit of ' || c_hs.narrative and fk_org = (select pk from dem.org where dem.org.description = c_hs.narrative) ) which on my v18 yields ?column? | ?column?
----------+------------------------------------------
| unit of Enterprise Healthcare Unit
| unit of VGH
| unit of Vancouver General - Med Day Care
| unit of Vancouver General - Med Day Care
| unit of Vancouver General Hospital
| unit of Vanc
(6 rows)
I now suspect this query was trying to ensure that every org which was not yet characterized by one or more units becomes, at minimum, a unit of itself but If that is the case, why is it constrained to organizations which had been referenced from hospital
stays, and why is it populating the org unit description from
'unit of ' || c_hs.narrative
when clin.hospital_stay.narrative is 'a comment on the hospital stay' ?
It would seem to me that the description of an org unit as a 'unit of' something should be acquired from
'unit of ' || dem.org.narrative
no?
-- Jim
|
[Prev in Thread] | Current Thread | [Next in Thread] |