[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-devel] freshly-created patients do not populate the 'recent
From: |
Busser, Jim |
Subject: |
Re: [Gnumed-devel] freshly-created patients do not populate the 'recent searches' dropdown |
Date: |
Fri, 2 Dec 2011 09:14:48 +0000 |
On 2011-12-01, at 6:42 AM, Karsten Hilbert wrote:
> On Thu, Dec 01, 2011 at 12:04:46AM +0000, Jim Busser wrote:
>
>> However, is there a way to include such patients in the
>> dropdown, so that it becomes a list of recently-activated
>> patients (thus including patients recently accessed via
>> inbox item) ?
>
> There is nearly always a way.
Pending the way …
>> Otherwise it maybe needs to be achieved as a separate function or Report
>> stored query
>
> The latter feels logical to me, although likely not really
> particularly user friendly.
a few queries for consideration for I decided to forgo DISTINCT ON because that
precluded ORDER BY unless I would build a more complex query
-- encounters recently created or modified (by current user)
select to_char(c_e.modified_when,'yyyy.mm.dd hh:mm') modified, d_n.lastnames ||
', ' || d_n.firstnames person_encountered, c_e.fk_patient pk_patient,
c_e.assessment_of_encounter aoe
from clin.encounter c_e
inner join dem.names d_n
on c_e.fk_patient = d_n.id_identity
where c_e.modified_by = "current_user"()
order by modified_when desc ;
-- encounters recently created or modified (by any user)
select to_char(c_e.modified_when,'yyyy.mm.dd hh:mm') modified, c_e.modified_by
by_user, d_n.lastnames || ', ' || d_n.firstnames person_encountered,
c_e.fk_patient pk_patient, c_e.assessment_of_encounter aoe
from clin.encounter c_e
inner join dem.names d_n
on c_e.fk_patient = d_n.id_identity
order by modified_when desc ;
-- Jim