[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-devel] Future encounters
From: |
Karsten Hilbert |
Subject: |
Re: [Gnumed-devel] Future encounters |
Date: |
Sun, 13 Nov 2011 01:27:33 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Sun, Nov 13, 2011 at 12:04:41AM +0000, Jim Busser wrote:
> > def has_clinical_data(self):
> > cmd = u"""
> > select exists (
> > select 1 from clin.v_pat_items where pk_patient
> > = %(pat)s and pk_encounter = %(enc)s
> > union all
> > select 1 from blobs.v_doc_med where pk_patient
> > = %(pat)s and pk_encounter = %(enc)s
> > )"""
> > args = {
> > 'pat': self._payload[self._idx['pk_patient']],
> > 'enc': self.pk_obj
> > }
> > rows, idx = gmPG2.run_ro_queries (
> > queries = [{
> > 'cmd': cmd,
> > 'args': args
> > }]
> > )
> > return rows[0][0]
>
> Is that to say that non-empty requires something in a
> clin.clin_narrative row
That would suffice.
> (which is where I had imagined the
> row containing the text of 'Purpose' would be stored).
No, that's clin.encounter.reason_for_encounter.
Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346