gnumed-update
[Top][All Lists]
Advanced

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

[Gnumed-update] GNUMed CVS report


From: ihaywood
Subject: [Gnumed-update] GNUMed CVS report
Date: Wed, 02 Jun 2004 00:10:29 -0400

Commit from ncq (2004-06-01 03:15 EDT)
---------------

- made cPerson into "private" class _cPersonMarker (as per the comment)
  such that never ever even the slighest confusion will arise whether to
  use that "class" or the cPerson in gmPatient.py

  gnumed  gnumed/client/business/gmOrganization.py  1.26


-----------------------------------------------
gnumed/gnumed/client/business/gmOrganization.py  (1.25 -> 1.26)
-----------------------------------------------

***************
*** 5,11 ****
  
  license: GPL"""
  #============================================================
! __version__ = "$Revision: 1.25 $"
  
  from Gnumed.pycommon import gmExceptions, gmLog,  gmI18N, gmBorg
  
--- 5,11 ----
  
  license: GPL"""
  #============================================================
! __version__ = "$Revision: 1.26 $"
  
  from Gnumed.pycommon import gmExceptions, gmLog,  gmI18N, gmBorg
  
***************
*** 300,306 ****
                return l2
  
  
! class cPerson:
        """marker class, for person type check"""
        pass
                        
--- 300,306 ----
                return l2
  
  
! class _cPersonMarker:
        """marker class, for person type check"""
        pass
                        
***************
*** 317,323 ****
                return cOrgDemographicAdapter()
        
        def isPersonOrg(self, org):
!               return cPerson in inspect.getmro(org.__class__) 
  
        def isPerson(self, org):
                return self.isPersonOrg(org)
--- 317,323 ----
                return cOrgDemographicAdapter()
        
        def isPersonOrg(self, org):
!               return _cPersonMarker in inspect.getmro(org.__class__) 
  
        def isPerson(self, org):
                return self.isPersonOrg(org)
***************
*** 898,904 ****
                        
  
        
! class cOrgDemographicAdapter(cOrg, cPerson):
        
        def __init__(self, parent = None, helper = cOrgHelperImpl3()):
                self._parent = parent
--- 898,904 ----
                        
  
        
! class cOrgDemographicAdapter(cOrg, _cPersonMarker):
        
        def __init__(self, parent = None, helper = cOrgHelperImpl3()):
                self._parent = parent
***************
*** 1890,1895 ****
--- 1890,1900 ----
                        clean_org_categories(adminlogin)
  #===========================================================
  # $Log: gmOrganization.py,v $
+ # Revision 1.26  2004/06/01 07:15:05  ncq
+ # - made cPerson into "private" class _cPersonMarker (as per the comment)
+ #   such that never ever even the slighest confusion will arise whether to
+ #   use that "class" or the cPerson in gmPatient.py
+ #
  # Revision 1.25  2004/05/31 14:24:19  sjtan
  #
  # intra-list cut and paste implemented. Not using wxClipboard ( could paste 
textified person


Commit from ncq (2004-06-01 03:18 EDT)
---------------

- simple Mac fix

  gnumed  gnumed/client/wxpython/gui/gmContacts.py  1.29


-----------------------------------------------
gnumed/gnumed/client/wxpython/gui/gmContacts.py  (1.28 -> 1.29)
-----------------------------------------------

***************
*** 8,14 ****
  #     implemented for gui presentation only
  ##############################################################################
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/wxpython/gui/gmContacts.py,v $
! __version__ = "$Revision: 1.28 $"
  __author__ = "Dr. Richard Terry, \
                        Sebastian Hilbert <address@hidden>"
  __license__ = "GPL"  # (details at http://www.gnu.org)
--- 8,14 ----
  #     implemented for gui presentation only
  ##############################################################################
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/wxpython/gui/gmContacts.py,v $
! __version__ = "$Revision: 1.29 $"
  __author__ = "Dr. Richard Terry, \
                        Sebastian Hilbert <address@hidden>"
  __license__ = "GPL"  # (details at http://www.gnu.org)
***************
*** 241,247 ****
          self.sizer_line9 = wxBoxSizer(wxHORIZONTAL)
          self.sizer_line10 = wxBoxSizer(wxHORIZONTAL)
          self.sizer_line11 = wxBoxSizer(wxHORIZONTAL)
!         self.sizer_line0.Add(0,10,1)
          #--------------------------------------
          #Heading at top of the left hand column
          #--------------------------------------
--- 241,247 ----
          self.sizer_line9 = wxBoxSizer(wxHORIZONTAL)
          self.sizer_line10 = wxBoxSizer(wxHORIZONTAL)
          self.sizer_line11 = wxBoxSizer(wxHORIZONTAL)
!         self.sizer_line0.Add((0,10),1)
          #--------------------------------------
          #Heading at top of the left hand column
          #--------------------------------------
***************
*** 931,936 ****
--- 931,939 ----
  
  #======================================================
  # $Log: gmContacts.py,v $
+ # Revision 1.29  2004/06/01 07:18:36  ncq
+ # - simple Mac fix
+ #
  # Revision 1.28  2004/05/31 14:24:19  sjtan
  #
  # intra-list cut and paste implemented. Not using wxClipboard ( could paste 
textified person


Commit from ncq (2004-06-01 03:50 EDT)
---------------

- error checking, optimizing, cleanup
- adaptation to ClinItem pending

  gnumed  gnumed/client/business/gmMedDoc.py  1.22


-----------------------------------------
gnumed/gnumed/client/business/gmMedDoc.py  (1.21 -> 1.22)
-----------------------------------------

***************
*** 36,43 ****
  """
  #============================================================
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/business/gmMedDoc.py,v $
! # $Id: gmMedDoc.py,v 1.21 2004/03/20 11:16:16 ncq Exp $
! __version__ = "$Revision: 1.21 $"
  __author__ = "Karsten Hilbert <address@hidden>"
  
  import sys, tempfile, os, shutil, os.path, types
--- 36,43 ----
  """
  #============================================================
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/business/gmMedDoc.py,v $
! # $Id: gmMedDoc.py,v 1.22 2004/06/01 07:50:01 ncq Exp $
! __version__ = "$Revision: 1.22 $"
  __author__ = "Karsten Hilbert <address@hidden>"
  
  import sys, tempfile, os, shutil, os.path, types
***************
*** 130,135 ****
--- 130,136 ----
                return rows
        #--------------------------------------------------------
        def get_doc_list(self, doc_type = None):
+               """return flat list of document IDs"""
                if doc_type is None:
                        cmd = "select id from doc_med where patient_id=%(ID)s"
                        args = {'ID': self.id_patient}
***************
*** 151,161 ****
                                        type=%(TYP)s
                                """
                        args = {'ID': self.id_patient, 'TYP': doc_type}
!               docs = gmPG.run_ro_query('blobs', cmd, None, args)
!               if docs is None:
                        _log.Log(gmLog.lErr, 'cannot load document list for 
patient [%s]' % self.id_patient)
                        return None
!               return docs
  #============================================================
  class gmMedObj:
        def __init__(self, aPKey):
--- 152,167 ----
                                        type=%(TYP)s
                                """
                        args = {'ID': self.id_patient, 'TYP': doc_type}
!               rows = gmPG.run_ro_query('blobs', cmd, None, args)
!               if rows is None:
                        _log.Log(gmLog.lErr, 'cannot load document list for 
patient [%s]' % self.id_patient)
                        return None
!               if len(rows) == 0:
!                       return []
!               doc_ids = []
!               for row in rows:
!                       doc_ids.append(row[0])
!               return doc_ids
  #============================================================
  class gmMedObj:
        def __init__(self, aPKey):
***************
*** 239,248 ****
                if self.__export (aFile, aChunkSize):
                        aFile.close ()
                        return fname
!               else:
!                       aFile.close ()
!                       return None
! 
        def export_to_string (self, aChunkSize = 0):
                """
                Returns the document as a Python string
--- 245,253 ----
                if self.__export (aFile, aChunkSize):
                        aFile.close ()
                        return fname
!               aFile.close ()
!               return None
!       #--------------------------------------------------------
        def export_to_string (self, aChunkSize = 0):
                """
                Returns the document as a Python string
***************
*** 253,263 ****
                        r = aFile.getvalue ()
                        aFile.close ()
                        return r
!               else:
!                       aFile.close ()
!                       return None
!       
! 
        def __export (self, aFile, aChunkSize = 0):
                """
                Internal helper, grabs data and writes it to
--- 258,266 ----
                        r = aFile.getvalue ()
                        aFile.close ()
                        return r
!               aFile.close ()
!               return None
!       #--------------------------------------------------------
        def __export (self, aFile, aChunkSize = 0):
                """
                Internal helper, grabs data and writes it to
***************
*** 607,612 ****
--- 610,619 ----
        return obj
  #============================================================
  # $Log: gmMedDoc.py,v $
+ # Revision 1.22  2004/06/01 07:50:01  ncq
+ # - error checking, optimizing, cleanup
+ # - adaptation to ClinItem pending
+ #
  # Revision 1.21  2004/03/20 11:16:16  ncq
  # - v_18n_doc_type is no more, use _(doc_type.name)
  #


Commit from ncq (2004-06-01 03:50 EDT)
---------------

- typo fix

  gnumed  gnumed/client/business/gmPatient.py  1.42


------------------------------------------
gnumed/gnumed/client/business/gmPatient.py  (1.41 -> 1.42)
------------------------------------------

***************
*** 8,15 ****
  """
  #============================================================
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/business/gmPatient.py,v $
! # $Id: gmPatient.py,v 1.41 2004/05/18 22:38:19 ncq Exp $
! __version__ = "$Revision: 1.41 $"
  __author__ = "K.Hilbert <address@hidden>"
  
  # access our modules
--- 8,15 ----
  """
  #============================================================
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/business/gmPatient.py,v $
! # $Id: gmPatient.py,v 1.42 2004/06/01 07:50:56 ncq Exp $
! __version__ = "$Revision: 1.42 $"
  __author__ = "K.Hilbert <address@hidden>"
  
  # access our modules
***************
*** 382,388 ****
  
                - either search term or search dict
                - search dict contains structured data that doesn't need to be 
parsed
!               - search_dict takes precedence of search_term
                """
                do_parsing = (search_dict is None)
                if not do_parsing:
--- 382,390 ----
  
                - either search term or search dict
                - search dict contains structured data that doesn't need to be 
parsed
!               - search_dict takes precedence over search_term
! 
!               - returns flat list of patient PKs
                """
                do_parsing = (search_dict is None)
                if not do_parsing:
***************
*** 908,913 ****
--- 910,918 ----
        gmPG.ConnectionPool().StopListeners()
  #============================================================
  # $Log: gmPatient.py,v $
+ # Revision 1.42  2004/06/01 07:50:56  ncq
+ # - typo fix
+ #
  # Revision 1.41  2004/05/18 22:38:19  ncq
  # - __patient -> _patient
  #


Commit from ncq (2004-06-01 03:55 EDT)
---------------

- use cDocumentFolder

  gnumed  gnumed/client/wxpython/gui/gmShowMedDocs.py  1.43


--------------------------------------------------
gnumed/gnumed/client/wxpython/gui/gmShowMedDocs.py  (1.42 -> 1.43)
--------------------------------------------------

***************
*** 11,17 ****
  For that it relies on proper mime type handling at the OS level.
  """
  # $Source: 
/cvsroot/gnumed/gnumed/gnumed/client/wxpython/gui/gmShowMedDocs.py,v $
! __version__ = "$Revision: 1.42 $"
  __author__ = "Karsten Hilbert <address@hidden>"
  #================================================================
  import os.path, sys, os, re
--- 11,17 ----
  For that it relies on proper mime type handling at the OS level.
  """
  # $Source: 
/cvsroot/gnumed/gnumed/gnumed/client/wxpython/gui/gmShowMedDocs.py,v $
! __version__ = "$Revision: 1.43 $"
  __author__ = "Karsten Hilbert <address@hidden>"
  #================================================================
  import os.path, sys, os, re
***************
*** 116,122 ****
          self.SetItemHasChildren(self.root, FALSE)
  
          # read documents from database
!         doc_ids = self.curr_pat['document id list']
          if doc_ids is None:
              name = self.curr_pat['demographic record'].get_names()
              gmGuiHelpers.gm_show_error(
--- 116,123 ----
          self.SetItemHasChildren(self.root, FALSE)
  
          # read documents from database
!         docs_folder = self.curr_pat.get_document_folder()
!         doc_ids = docs_folder.get_doc_list()
          if doc_ids is None:
              name = self.curr_pat['demographic record'].get_names()
              gmGuiHelpers.gm_show_error(
***************
*** 272,281 ****
              chunksize = 1 * 1024 * 1024
  
          # make sure metadata is there
!         tmp = obj.get_metadata
  
          # retrieve object
!         if not obj.export_to_file(aTempDir = exp_base, aChunkSize = 
chunksize):
              _log.Log(gmLog.lErr, "Cannot export object [%s] data from 
database !" % node_data['id'])
              gmGuiHelpers.gm_show_error(
                  aMessage = _('Cannot export document part from database to 
file.'),
--- 273,283 ----
              chunksize = 1 * 1024 * 1024
  
          # make sure metadata is there
!         tmp = obj.get_metadata()
  
          # retrieve object
!         fname = obj.export_to_file(aTempDir = exp_base, aChunkSize = 
chunksize)
!         if fname is None:
              _log.Log(gmLog.lErr, "Cannot export object [%s] data from 
database !" % node_data['id'])
              gmGuiHelpers.gm_show_error(
                  aMessage = _('Cannot export document part from database to 
file.'),
***************
*** 283,289 ****
              )
              return None
  
-         fname = obj['filename']
          (result, msg) = gmMimeLib.call_viewer_on_file(fname)
          if not result:
              gmGuiHelpers.gm_show_error(
--- 285,290 ----
***************
*** 623,628 ****
--- 624,632 ----
      pass
  #================================================================
  # $Log: gmShowMedDocs.py,v $
+ # Revision 1.43  2004/06/01 07:55:46  ncq
+ # - use cDocumentFolder
+ #
  # Revision 1.42  2004/04/16 00:36:23  ncq
  # - cleanup, constraints
  #


Commit from ncq (2004-06-01 03:58 EDT)
---------------

- improve comments

  gnumed  gnumed/server/sql/gmMeasurements.sql  1.26


-------------------------------------------
gnumed/gnumed/server/sql/gmMeasurements.sql  (1.25 -> 1.26)
-------------------------------------------

***************
*** 4,10 ****
  -- author: Christof Meigen <address@hidden>
  -- license: GPL
  -- $Source: /cvsroot/gnumed/gnumed/gnumed/server/sql/gmMeasurements.sql,v $
! -- $Revision: 1.25 $
  
  -- this belongs into the clinical service (historica)
  -- ===================================================================
--- 4,10 ----
  -- author: Christof Meigen <address@hidden>
  -- license: GPL
  -- $Source: /cvsroot/gnumed/gnumed/gnumed/server/sql/gmMeasurements.sql,v $
! -- $Revision: 1.26 $
  
  -- this belongs into the clinical service (historica)
  -- ===================================================================
***************
*** 185,191 ****
        'the results of a single measurement';
  -- FIXME: housekeeping sanity script:
  comment on column test_result.clin_when is
!       'the time when this result was actually obtained,
         if this is a lab result this should be between
         lab_request.clin_when and lab_request.results_reported_when';
  comment on column test_result.narrative is
--- 185,191 ----
        'the results of a single measurement';
  -- FIXME: housekeeping sanity script:
  comment on column test_result.clin_when is
!       'the time when this result was *actually* obtained,
         if this is a lab result this should be between
         lab_request.clin_when and lab_request.results_reported_when';
  comment on column test_result.narrative is
***************
*** 273,279 ****
                not null
                default true,
        unique (fk_test_org, request_id)
!       -- FIXME: there really should be a constraint like that
  --    unique (fk_patient, request_id)
  ) inherits (clin_root_item);
  
--- 273,279 ----
                not null
                default true,
        unique (fk_test_org, request_id)
!       -- FIXME: there really ought to be a constraint like this:
  --    unique (fk_patient, request_id)
  ) inherits (clin_root_item);
  
***************
*** 283,289 ****
  select i18n('final');
  
  comment on column lab_request.clin_when is
!       'when where the samples for this request taken';
  comment on column lab_request.request_id IS
        'ID this request had when sent to the lab
         LDT: 8310';
--- 283,290 ----
  select i18n('final');
  
  comment on column lab_request.clin_when is
!       'the time the sample for this request was taken
!        LDT: 8432:8433';
  comment on column lab_request.request_id IS
        'ID this request had when sent to the lab
         LDT: 8310';
***************
*** 352,361 ****
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename = '$RCSfile: 
gmMeasurements.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
gmMeasurements.sql,v $', '$Revision: 1.25 $');
  
  -- =============================================
  -- $Log: gmMeasurements.sql,v $
  -- Revision 1.25  2004/05/18 20:38:21  ncq
  -- - typo fix
  --
--- 353,365 ----
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename = '$RCSfile: 
gmMeasurements.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
gmMeasurements.sql,v $', '$Revision: 1.26 $');
  
  -- =============================================
  -- $Log: gmMeasurements.sql,v $
+ -- Revision 1.26  2004/06/01 07:58:13  ncq
+ -- - improve comments
+ --
  -- Revision 1.25  2004/05/18 20:38:21  ncq
  -- - typo fix
  --


Commit from ncq (2004-06-01 03:59 EDT)
---------------

- comments improved

  gnumed  gnumed/client/wxpython/gmGP_PatientPicture.py  1.9
  gnumed  gnumed/client/wxpython/gmGuiMain.py            1.146
  gnumed  gnumed/client/wxpython/gmMacro.py              1.12


----------------------------------------------------
gnumed/gnumed/client/wxpython/gmGP_PatientPicture.py  (1.8 -> 1.9)
----------------------------------------------------

***************
*** 2,9 ****
  #embryonic gmGP_PatientPicture.py
  ############################################################################
  # $Source: 
/cvsroot/gnumed/gnumed/gnumed/client/wxpython/gmGP_PatientPicture.py,v $
! # $Id: gmGP_PatientPicture.py,v 1.8 2004/05/28 08:57:08 shilbert Exp $
! __version__ = "$Revision: 1.8 $"
  __author__  = "R.Terry <address@hidden>,\
                           I.Haywood <address@hidden>,\
                           K.Hilbert <address@hidden>"
--- 2,9 ----
  #embryonic gmGP_PatientPicture.py
  ############################################################################
  # $Source: 
/cvsroot/gnumed/gnumed/gnumed/client/wxpython/gmGP_PatientPicture.py,v $
! # $Id: gmGP_PatientPicture.py,v 1.9 2004/06/01 07:59:55 ncq Exp $
! __version__ = "$Revision: 1.9 $"
  __author__  = "R.Terry <address@hidden>,\
                           I.Haywood <address@hidden>,\
                           K.Hilbert <address@hidden>"
***************
*** 60,66 ****
                        current_patient = kwds['ID']
                        docs = gmMedDoc.search_for_document (kwds['ID'], 
gmMedDoc.MUGSHOT)
                        # FIXME: "where date = max(select date from ... where 
l1.pat=l2.pat)" ...
!                       # FIXME: or rather use v_latest_mugshot
                        if docs: # get the latest in a series of photographs
                                latest_date = mxDT.DateTime (1)
                                latest_photo = None
--- 60,66 ----
                        current_patient = kwds['ID']
                        docs = gmMedDoc.search_for_document (kwds['ID'], 
gmMedDoc.MUGSHOT)
                        # FIXME: "where date = max(select date from ... where 
l1.pat=l2.pat)" ...
!                       # FIXME: or rather use v_latest_mugshot VO
                        if docs: # get the latest in a series of photographs
                                latest_date = mxDT.DateTime (1)
                                latest_photo = None
***************
*** 100,105 ****
--- 100,108 ----
        app.MainLoop()
  #====================================================
  # $Log: gmGP_PatientPicture.py,v $
+ # Revision 1.9  2004/06/01 07:59:55  ncq
+ # - comments improved
+ #
  # Revision 1.8  2004/05/28 08:57:08  shilbert
  # - bugfix for wxBitmapFromImage()
  #


------------------------------------------
gnumed/gnumed/client/wxpython/gmGuiMain.py  (1.145 -> 1.146)
------------------------------------------

***************
*** 19,26 ****
  """
  ############################################################################
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/wxpython/gmGuiMain.py,v $
! # $Id: gmGuiMain.py,v 1.145 2004/05/15 15:51:03 sjtan Exp $
! __version__ = "$Revision: 1.145 $"
  __author__  = "H. Herb <address@hidden>,\
                           K. Hilbert <address@hidden>,\
                           I. Haywood <address@hidden>"
--- 19,26 ----
  """
  ############################################################################
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/wxpython/gmGuiMain.py,v $
! # $Id: gmGuiMain.py,v 1.146 2004/06/01 07:59:55 ncq Exp $
! __version__ = "$Revision: 1.146 $"
  __author__  = "H. Herb <address@hidden>,\
                           K. Hilbert <address@hidden>,\
                           I. Haywood <address@hidden>"
***************
*** 361,367 ****
                # can we hand focus to new page ?
                if not new_page.can_receive_focus():
                        # we can only hope things will work out anyways
!                       _log.Log(gmLog.lWarn, "new page cannot receive focus 
but too late for veto (typically happens on Windows)")
                new_page.ReceiveFocus()
                # activate toolbar of new page
                self.top_panel.ShowBar(new_page.internal_name())
--- 361,367 ----
                # can we hand focus to new page ?
                if not new_page.can_receive_focus():
                        # we can only hope things will work out anyways
!                       _log.Log(gmLog.lWarn, "new page cannot receive focus 
but too late for veto (typically happens on Windows and Mac OSX)")
                new_page.ReceiveFocus()
                # activate toolbar of new page
                self.top_panel.ShowBar(new_page.internal_name())
***************
*** 767,772 ****
--- 767,775 ----
  
  #==================================================
  # $Log: gmGuiMain.py,v $
+ # Revision 1.146  2004/06/01 07:59:55  ncq
+ # - comments improved
+ #
  # Revision 1.145  2004/05/15 15:51:03  sjtan
  #
  # hoping to link this to organization widget.


----------------------------------------
gnumed/gnumed/client/wxpython/gmMacro.py  (1.11 -> 1.12)
----------------------------------------

***************
*** 6,12 ****
  
  #=====================================================================
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/wxpython/gmMacro.py,v $
! __version__ = "$Revision: 1.11 $"
  __author__ = "K.Hilbert <address@hidden>"
  
  import sys, time, random, types
--- 6,12 ----
  
  #=====================================================================
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/wxpython/gmMacro.py,v $
! __version__ = "$Revision: 1.12 $"
  __author__ = "K.Hilbert <address@hidden>"
  
  import sys, time, random, types
***************
*** 76,82 ****
                return 0
        #-----------------------------------------------------------------
        def version(self):
!               return "%s $Revision: 1.11 $" % self.__class__.__name__
        #-----------------------------------------------------------------
        def raise_gnumed(self, auth_cookie = None):
                """Raise ourselves to the top of the desktop."""
--- 76,82 ----
                return 0
        #-----------------------------------------------------------------
        def version(self):
!               return "%s $Revision: 1.12 $" % self.__class__.__name__
        #-----------------------------------------------------------------
        def raise_gnumed(self, auth_cookie = None):
                """Raise ourselves to the top of the desktop."""
***************
*** 130,136 ****
                # FIXME: let user select patient
                if len(pat_id) > 1:
                        return (0, _('several matching patients found for 
[%s]/%s') % (search_term, search_dict))
!               if not gmPatient.set_active_patient(pat_id[0][0]):
                        return (0, _('cannot activate patient [%s] (%s/%s)') % 
(pat_id[0], search_term, search_dict))
                pat.lock()
                self.__pat_lock_cookie = str(random.random())
--- 130,136 ----
                # FIXME: let user select patient
                if len(pat_id) > 1:
                        return (0, _('several matching patients found for 
[%s]/%s') % (search_term, search_dict))
!               if not gmPatient.set_active_patient(pat_id[0]):
                        return (0, _('cannot activate patient [%s] (%s/%s)') % 
(pat_id[0], search_term, search_dict))
                pat.lock()
                self.__pat_lock_cookie = str(random.random())
***************
*** 201,206 ****
--- 201,209 ----
        listener.tell_thread_to_stop()
  #=====================================================================
  # $Log: gmMacro.py,v $
+ # Revision 1.12  2004/06/01 07:59:55  ncq
+ # - comments improved
+ #
  # Revision 1.11  2004/03/20 19:48:07  ncq
  # - adapt to flat id list from get_patient_ids
  #


Commit from ncq (2004-06-01 04:20 EDT)
---------------

- limit in get_lab_results

  gnumed  gnumed/client/business/gmClinicalRecord.py  1.108
  gnumed  gnumed/client/business/gmEMRStructItems.py  1.10


-------------------------------------------------
gnumed/gnumed/client/business/gmClinicalRecord.py  (1.107 -> 1.108)
-------------------------------------------------

***************
*** 9,16 ****
  """
  #============================================================
  # $Source: 
/cvsroot/gnumed/gnumed/gnumed/client/business/gmClinicalRecord.py,v $
! # $Id: gmClinicalRecord.py,v 1.107 2004/05/30 20:51:34 ncq Exp $
! __version__ = "$Revision: 1.107 $"
  __author__ = "K.Hilbert <address@hidden>"
  __license__ = "GPL"
  
--- 9,16 ----
  """
  #============================================================
  # $Source: 
/cvsroot/gnumed/gnumed/gnumed/client/business/gmClinicalRecord.py,v $
! # $Id: gmClinicalRecord.py,v 1.108 2004/06/01 08:20:14 ncq Exp $
! __version__ = "$Revision: 1.108 $"
  __author__ = "K.Hilbert <address@hidden>"
  __license__ = "GPL"
  
***************
*** 1138,1144 ****
        #------------------------------------------------------------------
        # lab data API
        #------------------------------------------------------------------
!       def get_lab_results(self):
                try:
                        return self.__db_cache['lab results']
                except KeyError:
--- 1138,1145 ----
        #------------------------------------------------------------------
        # lab data API
        #------------------------------------------------------------------
!       def get_lab_results(self, limit=100):
!               lim = "limit %s" % limit
                try:
                        return self.__db_cache['lab results']
                except KeyError:
***************
*** 1147,1153 ****
                # get list of IDs
                # FIXME: date range, episode, encounter, issue, test filter
                # FIXME: hardcoded limit on # of test results
!               cmd = "select pk_result from v_results4lab_req where 
pk_patient=%s limit 500"
                rows = gmPG.run_ro_query('historica', cmd, None, 
self.id_patient)
                if rows is None:
                        return False
--- 1148,1154 ----
                # get list of IDs
                # FIXME: date range, episode, encounter, issue, test filter
                # FIXME: hardcoded limit on # of test results
!               cmd = "select pk_result from v_results4lab_req where 
pk_patient=%%s %s" % lim
                rows = gmPG.run_ro_query('historica', cmd, None, 
self.id_patient)
                if rows is None:
                        return False
***************
*** 1306,1311 ****
--- 1307,1315 ----
        gmPG.ConnectionPool().StopListeners()
  #============================================================
  # $Log: gmClinicalRecord.py,v $
+ # Revision 1.108  2004/06/01 08:20:14  ncq
+ # - limit in get_lab_results
+ #
  # Revision 1.107  2004/05/30 20:51:34  ncq
  # - verify provider in __init__, too
  #


-------------------------------------------------
gnumed/gnumed/client/business/gmEMRStructItems.py  (1.9 -> 1.10)
-------------------------------------------------

***************
*** 3,9 ****
  license: GPL
  """
  #============================================================
! __version__ = "$Revision: 1.9 $"
  __author__ = "Carlos Moro <address@hidden>"
  
  import types, sys
--- 3,9 ----
  license: GPL
  """
  #============================================================
! __version__ = "$Revision: 1.10 $"
  __author__ = "Carlos Moro <address@hidden>"
  
  import types, sys
***************
*** 253,259 ****
                        insert into clin_encounter (
                                fk_patient, fk_location, fk_provider, 
description, fk_type
                        ) values (
!                               %s, -1, %s, %s, coalesce((select id from 
encounter_type where description=%s), 0)
                        )"""
        queries.append((cmd, [fk_patient, fk_provider, description, enc_type]))
        cmd = "select currval('clin_encounter_id_seq')"
--- 253,259 ----
                        insert into clin_encounter (
                                fk_patient, fk_location, fk_provider, 
description, fk_type
                        ) values (
!                               %s, -1, %s, %s, coalesce((select pk from 
encounter_type where description=%s), 0)
                        )"""
        queries.append((cmd, [fk_patient, fk_provider, description, enc_type]))
        cmd = "select currval('clin_encounter_id_seq')"
***************
*** 306,311 ****
--- 306,314 ----
        print "updatable:", encounter.get_updatable_fields()
  #============================================================
  # $Log: gmEMRStructItems.py,v $
+ # Revision 1.10  2004/06/01 08:20:14  ncq
+ # - limit in get_lab_results
+ #
  # Revision 1.9  2004/05/30 20:10:31  ncq
  # - cleanup
  #


Commit from ncq (2004-06-01 04:21 EDT)
---------------

- default limit to all on get_lab_results()

  gnumed  gnumed/client/business/gmClinicalRecord.py  1.109


-------------------------------------------------
gnumed/gnumed/client/business/gmClinicalRecord.py  (1.108 -> 1.109)
-------------------------------------------------

***************
*** 9,16 ****
  """
  #============================================================
  # $Source: 
/cvsroot/gnumed/gnumed/gnumed/client/business/gmClinicalRecord.py,v $
! # $Id: gmClinicalRecord.py,v 1.108 2004/06/01 08:20:14 ncq Exp $
! __version__ = "$Revision: 1.108 $"
  __author__ = "K.Hilbert <address@hidden>"
  __license__ = "GPL"
  
--- 9,16 ----
  """
  #============================================================
  # $Source: 
/cvsroot/gnumed/gnumed/gnumed/client/business/gmClinicalRecord.py,v $
! # $Id: gmClinicalRecord.py,v 1.109 2004/06/01 08:21:56 ncq Exp $
! __version__ = "$Revision: 1.109 $"
  __author__ = "K.Hilbert <address@hidden>"
  __license__ = "GPL"
  
***************
*** 1138,1145 ****
        #------------------------------------------------------------------
        # lab data API
        #------------------------------------------------------------------
!       def get_lab_results(self, limit=100):
!               lim = "limit %s" % limit
                try:
                        return self.__db_cache['lab results']
                except KeyError:
--- 1138,1144 ----
        #------------------------------------------------------------------
        # lab data API
        #------------------------------------------------------------------
!       def get_lab_results(self, limit=None):
                try:
                        return self.__db_cache['lab results']
                except KeyError:
***************
*** 1147,1153 ****
                self.__db_cache['lab results'] = []
                # get list of IDs
                # FIXME: date range, episode, encounter, issue, test filter
!               # FIXME: hardcoded limit on # of test results
                cmd = "select pk_result from v_results4lab_req where 
pk_patient=%%s %s" % lim
                rows = gmPG.run_ro_query('historica', cmd, None, 
self.id_patient)
                if rows is None:
--- 1146,1155 ----
                self.__db_cache['lab results'] = []
                # get list of IDs
                # FIXME: date range, episode, encounter, issue, test filter
!               if limit is None:
!                       lim = ''
!               else:
!                       lim = "limit %s" % limit
                cmd = "select pk_result from v_results4lab_req where 
pk_patient=%%s %s" % lim
                rows = gmPG.run_ro_query('historica', cmd, None, 
self.id_patient)
                if rows is None:
***************
*** 1307,1312 ****
--- 1309,1317 ----
        gmPG.ConnectionPool().StopListeners()
  #============================================================
  # $Log: gmClinicalRecord.py,v $
+ # Revision 1.109  2004/06/01 08:21:56  ncq
+ # - default limit to all on get_lab_results()
+ #
  # Revision 1.108  2004/06/01 08:20:14  ncq
  # - limit in get_lab_results
  #


Commit from ncq (2004-06-01 04:43 EDT)
---------------

- fix grants re allergy_state
- include soap_cat in v_patient_items

  gnumed  gnumed/server/sql/gmClinicalViews.sql  1.70


--------------------------------------------
gnumed/gnumed/server/sql/gmClinicalViews.sql  (1.69 -> 1.70)
--------------------------------------------

***************
*** 5,11 ****
  -- license: GPL (details at http://gnu.org)
  
  -- $Source: /cvsroot/gnumed/gnumed/gnumed/server/sql/gmClinicalViews.sql,v $
! -- $Id: gmClinicalViews.sql,v 1.69 2004/05/30 20:58:13 ncq Exp $
  
  -- ===================================================================
  -- force terminate + exit(3) on errors if non-interactive
--- 5,11 ----
  -- license: GPL (details at http://gnu.org)
  
  -- $Source: /cvsroot/gnumed/gnumed/gnumed/server/sql/gmClinicalViews.sql,v $
! -- $Id: gmClinicalViews.sql,v 1.70 2004/06/01 08:43:21 ncq Exp $
  
  -- ===================================================================
  -- force terminate + exit(3) on errors if non-interactive
***************
*** 191,196 ****
--- 191,197 ----
        cri.id_encounter as id_encounter,
        cri.id_episode as id_episode,
        vpep.id_health_issue as id_health_issue,
+       cri.soap_cat as soap_cat,
        cri.narrative as narrative,
        pgc.relname as src_table
  from
***************
*** 624,629 ****
--- 625,631 ----
        clin_physical,
        _enum_allergy_type
        , allergy
+       , allergy_state
        , vaccination
        , vaccine
        , vacc_def
***************
*** 669,679 ****
        _enum_allergy_type,
        _enum_allergy_type_id_seq,
        allergy,
!       allergy_id_seq,
!       vaccination,
!       vaccination_id_seq,
!       vaccine,
!       vaccine_id_seq
        , vacc_def
        , vacc_def_id_seq
        , vacc_regime
--- 671,683 ----
        _enum_allergy_type,
        _enum_allergy_type_id_seq,
        allergy,
!       allergy_id_seq
!       , allergy_state
!       , allergy_state_id_seq
!       , vaccination
!       , vaccination_id_seq
!       , vaccine
!       , vaccine_id_seq
        , vacc_def
        , vacc_def_id_seq
        , vacc_regime
***************
*** 744,753 ****
  -- do simple schema revision tracking
  \unset ON_ERROR_STOP
  delete from gm_schema_revision where filename='$RCSfile: 
gmClinicalViews.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
gmClinicalViews.sql,v $', '$Revision: 1.69 $');
  
  -- =============================================
  -- $Log: gmClinicalViews.sql,v $
  -- Revision 1.69  2004/05/30 20:58:13  ncq
  -- - encounter_type.id -> encounter_type.pk
  --
--- 748,761 ----
  -- do simple schema revision tracking
  \unset ON_ERROR_STOP
  delete from gm_schema_revision where filename='$RCSfile: 
gmClinicalViews.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
gmClinicalViews.sql,v $', '$Revision: 1.70 $');
  
  -- =============================================
  -- $Log: gmClinicalViews.sql,v $
+ -- Revision 1.70  2004/06/01 08:43:21  ncq
+ -- - fix grants re allergy_state
+ -- - include soap_cat in v_patient_items
+ --
  -- Revision 1.69  2004/05/30 20:58:13  ncq
  -- - encounter_type.id -> encounter_type.pk
  --


Commit from ncq (2004-06-01 06:15 EDT)
---------------

- fk_patient, not id_patient in allergy_state

  gnumed  gnumed/server/sql/test-data/test_data-James_Kirk.sql  1.23


-----------------------------------------------------------
gnumed/gnumed/server/sql/test-data/test_data-James_Kirk.sql  (1.22 -> 1.23)
-----------------------------------------------------------

***************
*** 4,10 ****
  -- author: Karsten Hilbert <address@hidden>
  -- license: GPL
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/test_data-James_Kirk.sql,v $
! -- $Revision: 1.22 $
  -- =============================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
--- 4,10 ----
  -- author: Karsten Hilbert <address@hidden>
  -- license: GPL
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/test_data-James_Kirk.sql,v $
! -- $Revision: 1.23 $
  -- =============================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
***************
*** 334,340 ****
  );
  
  insert into allergy_state (
!       id_patient,
        has_allergy
  ) values (
        currval('identity_id_seq'),
--- 334,340 ----
  );
  
  insert into allergy_state (
!       fk_patient,
        has_allergy
  ) values (
        currval('identity_id_seq'),
***************
*** 421,430 ****
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename like '%James_Kirk%';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
test_data-James_Kirk.sql,v $', '$Revision: 1.22 $');
  
  -- =============================================
  -- $Log: test_data-James_Kirk.sql,v $
  -- Revision 1.22  2004/05/30 21:03:29  ncq
  -- - encounter_type.id -> encounter_type.pk
  --
--- 421,433 ----
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename like '%James_Kirk%';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
test_data-James_Kirk.sql,v $', '$Revision: 1.23 $');
  
  -- =============================================
  -- $Log: test_data-James_Kirk.sql,v $
+ -- Revision 1.23  2004/06/01 10:15:18  ncq
+ -- - fk_patient, not id_patient in allergy_state
+ --
  -- Revision 1.22  2004/05/30 21:03:29  ncq
  -- - encounter_type.id -> encounter_type.pk
  --


Commit from sjtan (2004-06-01 11:11 EDT)
-----------------


cut ctrl-x and paste ctrl-v, works through clipboard, so can paste name/address 
info onto
text editors (oowriter, kwrite tried out). Drag and drop doesn't work to 
outside apps.
List displays at last updated position after load_all_orgs() called. removed
old display data listing on list org display button press, because cutting and 
pasting
persons to these items loses  persons. Only saves top-level orgs if there is a 
valid
category value in category field.

  gnumed  gnumed/client/business/gmOrganization.py  1.27
  gnumed  gnumed/client/wxpython/gui/gmContacts.py  1.30


-----------------------------------------------
gnumed/gnumed/client/business/gmOrganization.py  (1.26 -> 1.27)
-----------------------------------------------

***************
*** 5,11 ****
  
  license: GPL"""
  #============================================================
! __version__ = "$Revision: 1.26 $"
  
  from Gnumed.pycommon import gmExceptions, gmLog,  gmI18N, gmBorg
  
--- 5,11 ----
  
  license: GPL"""
  #============================================================
! __version__ = "$Revision: 1.27 $"
  
  from Gnumed.pycommon import gmExceptions, gmLog,  gmI18N, gmBorg
  
***************
*** 167,172 ****
--- 167,179 ----
        def isPerson(self, org):
                return False
  
+       def setXMLClipboardFormat(self):
+               pass
+ 
+       def setLineSeparatedClipboardFormat(self):
+               pass
+               
+ 
  
  
  class cOrgHelperImpl1(gmBorg.cBorg, cOrgHelper):
***************
*** 175,180 ****
--- 182,231 ----
                gmBorg.cBorg.__init__(self)
                cOrgHelper.__init__(self)
                self._cache = {}
+               self.setLineSeparatedClipboardFormat()
+       
+ 
+       def setLineSeparatedClipboardFormat(self):
+               self._clipboardFormat = 
"%(name)s,\n%(address_str)s,\nphone:%(phone)s,\nfax:%(fax)s\nemail: 
%(email)s\nref:%(orgtype)s/%(id)d\n"
+       
+       def setXMLClipboardFormat(self):
+               self._clipboardFormat = """
+ <%(orgtype)s id='%(id)d'> 
+       <name>%(name)s</name>
+       <address>%(address_str)s</address>
+       <phone>%(phone)s</phone>
+       <fax>%(fax)s</fax>
+       <email>%(email)s</email>
+ </(orgtype)s>
+                       """
+ 
+       def getClipboardText(self, org):
+               
+               d = {   'name': org['name'],
+                       'address_str': self.getAddressStr(org),
+                       'phone' : org['phone'],
+                       'fax'   : org['fax'],
+                       'email' : org['email'],
+                       'id': org.getId()
+                       }
+               if self.isPerson(org):
+                       d['orgtype'] = 'person'
+                       
+               elif org.getParent() <> None:
+                       d['orgtype'] = 'org'
+                       d['name'] = ' '.join( [ org['name'], org['subtype'], 
',',org.getParent()['name'] ] )
+               else:
+                       d['orgtype'] = 'org'
+ 
+               # find a non-blank address
+               o = org
+               while o.getParent() <> None and  self.getAddressStr(o).strip() 
== '':
+                               d['address_str'] = 
self.getAddressStr(o.getParent() )
+                               o = o.getParent()       
+ 
+               str = self._clipboardFormat % d
+               
+               return str
  
        def cacheContains(self,id):
                return self._cache.has_key(id)
***************
*** 267,272 ****
--- 318,326 ----
                return cOrgImpl1()
  
                
+       def getAddressStr(self, org):
+               a = org.getAddress()
+               return  " ".join( [a.get('number','').strip(), 
a.get('street','').strip(), a.get('urb','').strip(), a.get('postcode','')])
  
  
  
***************
*** 955,961 ****
                }
                for k in d.keys():
                        d[k] = s[k]
!                       print 'data ', k, ' has been set to ', d[k]
                        
                
        
--- 1009,1017 ----
                }
                for k in d.keys():
                        d[k] = s[k]
!                       #<DEBUG>
!                       #print 'data ', k, ' has been set to ', d[k]
!                       #</DEBUG>
                        
                
        
***************
*** 972,984 ****
  
                        
                for k in s.keys():
!                       d = s[k]
  
        def getAddress(self):
                m = {}
                m.update(self._address)
                return m
  
        def __setitem__(self, k, v):
                d = self._data
                if d.has_key(k):
--- 1028,1045 ----
  
                        
                for k in s.keys():
!                       d[k] = s[k]
!               #<DEBUG>        
!               #print "self._address is now ", self._address
!               #</DEBUG>
  
        def getAddress(self):
                m = {}
                m.update(self._address)
                return m
  
+               
+ 
        def __setitem__(self, k, v):
                d = self._data
                if d.has_key(k):
***************
*** 1017,1026 ****
  
                address = r.getAddresses( addressTypes[workAddressType], 
firstonly=1)
                a = self._address
!               if not len(address):
                        return 
!               for k in ['number', 'street', 'urb', 'postcode']:
!                       a[k] = address[0].get(k, '')
                
  
        def save(self):
--- 1078,1100 ----
  
                address = r.getAddresses( addressTypes[workAddressType], 
firstonly=1)
                a = self._address
!               #<DEBUG>
!               print "got back address from demographic record", address
!               #</DEBUG>
!               if address is None:
                        return 
! 
!               fields = ['number', 'street', 'urb', 'postcode']
!               if type(address) is type([]) and len(address) >0:
!                       if type(address[0]) is type({}):
!                               address = address[0]
!                       elif type(address[0]) is type(''):
!                               a = dict ( [(k,v) for k,v in zip( fields, 
address) ] )
!                               return
! 
!               for k in fields:
!                       if  type(address) is type({}):
!                               a[k] = address.get(k, '')
                
  
        def save(self):
***************
*** 1890,1895 ****
--- 1964,1978 ----
                        clean_org_categories(adminlogin)
  #===========================================================
  # $Log: gmOrganization.py,v $
+ # Revision 1.27  2004/06/01 15:11:56  sjtan
+ #
+ # cut ctrl-x and paste ctrl-v, works through clipboard, so can paste 
name/address info onto
+ # text editors (oowriter, kwrite tried out). Drag and drop doesn't work to 
outside apps.
+ # List displays at last updated position after load_all_orgs() called. removed
+ # old display data listing on list org display button press, because cutting 
and pasting
+ # persons to these items loses  persons. Only saves top-level orgs if there 
is a valid
+ # category value in category field.
+ #
  # Revision 1.26  2004/06/01 07:15:05  ncq
  # - made cPerson into "private" class _cPersonMarker (as per the comment)
  #   such that never ever even the slighest confusion will arise whether to


-----------------------------------------------
gnumed/gnumed/client/wxpython/gui/gmContacts.py  (1.29 -> 1.30)
-----------------------------------------------

***************
*** 8,20 ****
  #     implemented for gui presentation only
  ##############################################################################
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/wxpython/gui/gmContacts.py,v $
! __version__ = "$Revision: 1.29 $"
  __author__ = "Dr. Richard Terry, \
                        Sebastian Hilbert <address@hidden>"
  __license__ = "GPL"  # (details at http://www.gnu.org)
  from Gnumed.pycommon import gmLog
  from wxPython.wx import *
  import wx
  from Gnumed.wxpython import gmPlugin, images_contacts_toolbar16_16
  from Gnumed.wxpython.gmPhraseWheel import cPhraseWheel
  from Gnumed.business import gmDemographicRecord
--- 8,22 ----
  #     implemented for gui presentation only
  ##############################################################################
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/wxpython/gui/gmContacts.py,v $
! __version__ = "$Revision: 1.30 $"
  __author__ = "Dr. Richard Terry, \
                        Sebastian Hilbert <address@hidden>"
  __license__ = "GPL"  # (details at http://www.gnu.org)
  from Gnumed.pycommon import gmLog
  from wxPython.wx import *
  import wx
+ 
+ 
  from Gnumed.wxpython import gmPlugin, images_contacts_toolbar16_16
  from Gnumed.wxpython.gmPhraseWheel import cPhraseWheel
  from Gnumed.business import gmDemographicRecord
***************
*** 402,418 ****
--- 404,441 ----
                self._isPersonIndex = {}
                self._tmpPerson = {}
                self._currentPerson = None
+               self._cutPerson = None
  
                self._connectCutPaste()
                
                self._lastSelected = None # for internal cut and paste
  
+               self._lastItemIndex = 0
+               
+               self._connectDrag()
+               
+ 
        def getLastSelected(self):
                return self._lastSelected
  
        def setLastSelected(self, obj):
                self._lastSelected = obj
  
+ 
+       def _connectDrag(self):
+               EVT_LIST_BEGIN_DRAG(self.list_organisations, 
self.list_organisations.GetId(), self._doDrag)
+       
+       def _doDrag(self, event):
+               dragSource = wxDropSource(self)
+               text = self._getClipDragTextDataObject()
+               if text:
+                       dragSource.SetData(text)
+                       
+                       result = dragSource.DoDragDrop(True)
+                       if result == wxDragCopy: print "drag copy action"
+                       elif result == wxDragMove: print "drag move action"
+               
+ 
        def _connectCutPaste(self):
                EVT_KEY_DOWN(self.list_organisations, self._checkForCutPaste)
  
***************
*** 425,430 ****
--- 448,454 ----
                        if c == 88 : # ascii('x')
                                print "cut"
                                self._cutPerson = self.getLastSelected()
+                               self._doCopyToClipboard() # experiment with 
wxClipboard
                        elif c == 86: # ascii('v')
                                print "paste"
                                self.doPaste()
***************
*** 438,451 ****
                        self.getCurrent().linkPerson(p.getDemographicRecord())
                        p.setParent(self.getCurrent())
  
                        self._cutPerson = None
                        self.setLastSelected(None)
  
-                       self.load_all_orgs()
- 
  
!                               
!                               
  
                def _connect_list(self):
          """allow list selection to update the org edit area"""
--- 462,494 ----
                        self.getCurrent().linkPerson(p.getDemographicRecord())
                        p.setParent(self.getCurrent())
  
+                       self.load_all_orgs()
+ 
                        self._cutPerson = None
                        self.setLastSelected(None)
  
  
!       def _doCopyToClipboard(self):
!               
!               board = wxTheClipboard
!               if not board.Open():
!                       print "unable to get ownership of clipboard yet."
!                       return False
!               text = self._getClipDragTextDataObject()
!               if text:
!                       board.SetData(text )
!               board.Close()
! 
!       def _getClipDragTextDataObject(self):   
!               p = self.getLastSelected()
!               if p is None:
!                       p = self.getCurrent()
!                       if p is None:
!                               #<DEBUG>
!                               print "No current org or person to copy to 
clipboard"
!                               #</DEBUG>
!                               return None             
!               return wxTextDataObject( p.getHelper().getClipboardText(p) )
  
                def _connect_list(self):
          """allow list selection to update the org edit area"""
***************
*** 467,475 ****
                  f = self.input_fields
          vals = [ f[n].GetValue() for n in ['street', 'urb', 'postcode'] ]
          # split the street value into 2 parts, number and street. ? Have a 
separate number field instead.
!         vals = [ vals[0].split(' ')[0] , ' '.join( vals[0].split(' ')[1:] ) ] 
+ vals[1:] + [None,None]
          # [None, None] is state and country at the moment
!         return vals
  
                def get_org_values(self):
          """returns a dictionary of the widget controls contents"""
--- 510,518 ----
                  f = self.input_fields
          vals = [ f[n].GetValue() for n in ['street', 'urb', 'postcode'] ]
          # split the street value into 2 parts, number and street. ? Have a 
separate number field instead.
!         addr = [ vals[0].split(' ')[0] , ' '.join( vals[0].split(' ')[1:] ) ] 
+ vals[1:] + [None,None]
          # [None, None] is state and country at the moment
!         return addr 
  
                def get_org_values(self):
          """returns a dictionary of the widget controls contents"""
***************
*** 487,492 ****
--- 530,536 ----
                        return
                x = self.list_organisations.GetItemCount()
                self._insert_org_data( x, key, data)
+               
                if showPersons:
                        m = org.getPersonMap(reload=False)
                        # create _isPersonIndex, which maps a row index to
***************
*** 551,562 ****
                  return None, None 
  
  
-         a = org.getAddress()
          o = org.get()
  
-         address_str = " ".join( [a.get('number','').strip(), 
a.get('street','').strip(), a.get('urb','').strip(), a.get('postcode','')])
          
          phone_fax = '/fax '.join([ o.get('phone', '') , o.get('fax', '')]  )
  
          # display for person
          if org.getHelper().isPerson(org):
--- 595,605 ----
                  return None, None 
  
  
          o = org.get()
  
          
          phone_fax = '/fax '.join([ o.get('phone', '') , o.get('fax', '')]  )
+         address_str = org.getHelper().getAddressStr(org)
  
          # display for person
          if org.getHelper().isPerson(org):
***************
*** 567,577 ****
                return key, [o['name'], '', address_str,  o['category'], 
phone_fax]
  
          # display  branch, department , division
!         return key, ["", ' '.join([o.get('name',''), o.get('subtype','')]), 
address_str, o.get('email',''), phone_fax]
                         
  
        
-       
                def _insert_org_data(self, n, key, data):         
          self.list_organisations.InsertStringItem(n, data[0])
          self.list_organisations.SetStringItem(n, 1, data[1])
--- 610,619 ----
                return key, [o['name'], '', address_str,  o['category'], 
phone_fax]
  
          # display  branch, department , division
!         return key, ["", ' '.join([o.get('name',''), 
o.get('subtype','')]),address_str, o.get('email',''), phone_fax]
                         
  
        
                def _insert_org_data(self, n, key, data):         
          self.list_organisations.InsertStringItem(n, data[0])
          self.list_organisations.SetStringItem(n, 1, data[1])
***************
*** 580,585 ****
--- 622,628 ----
          self.list_organisations.SetStringItem(n, 4, data[4])
          self.list_organisations.SetItemData(n, key)
  
+ 
                def _update_org_data( self, n, key, data):
          l = self.list_organisations
          for i in xrange(0, 4):
***************
*** 590,597 ****
                def load_all_orgs(self):
          """clears the list control, displays the example data, and then 
          the real data, from _helper.findAllOrganizations() """
          self.list_organisations.DeleteAllItems()
!         self._insert_example_data()
          if self._isPersonIndex <> {}:
                  self._tmpPerson = {}
                  for person  in self._isPersonIndex.values():
--- 633,641 ----
                def load_all_orgs(self):
          """clears the list control, displays the example data, and then 
          the real data, from _helper.findAllOrganizations() """
+         #pos = self.list_organisations.GetScrollPos(wxVERTICAL)
          self.list_organisations.DeleteAllItems()
!         #self._insert_example_data()   , removing this as it is confusing
          if self._isPersonIndex <> {}:
                  self._tmpPerson = {}
                  for person  in self._isPersonIndex.values():
***************
*** 601,606 ****
--- 645,683 ----
          orgs = self.getOrgHelper().findAllOrganizations()
          for org in orgs:
                  self.add_org(org)
+               
+         #self.list_organisations.SetScrollPos(wxVERTICAL, pos)
+         #self.list_organisations.Refresh()
+         self._ensureCurrentVisible()
+         
+       def _ensureCurrentVisible(self):
+         l = self.list_organisations
+         person = self._currentPerson or self._cutPerson
+         print "person ", person, "self._cutPerson", self._cutPerson
+ 
+         if person:
+                 key = person.getId()
+                 for i, p in self._isPersonIndex.items():
+                         if p.getId() == person.getId():
+                                 break
+         elif self.getCurrent() is None:
+                         return
+         else:
+               
+               c = l.GetItemCount()
+               key = self.getCurrent().getId()
+               i , nexti = 0, -1
+               while  nexti <> i and (i < l.GetItemCount()  or 
self._isPersonIndex.has_key(i)):
+                       i = nexti
+                       nexti = l.FindItemData(i, key)
+                       
+                       #print i
+ 
+         for j in xrange(0, 2):          
+                 if i + 1 < l.GetItemCount():
+                         i += 1
+ 
+         l.EnsureVisible(i)
         
                def _insert_example_data(self):
          items = organisationsdata.items()
***************
*** 773,783 ****
--- 850,864 ----
                o = self.get_org_values()
                a = self.get_address_values()
                org.set(*[],**o)
+               #<DEBUG>
+               print "setting address with ", a
+               #</DEBUG>
                org.setAddress(*a)
                
                isNew = org.getId() is None
                org.save()
                self.load_all_orgs()
+ 
                #if isNew:
                #       self.add_org(org)
                #else:
***************
*** 931,936 ****
--- 1012,1026 ----
  
  #======================================================
  # $Log: gmContacts.py,v $
+ # Revision 1.30  2004/06/01 15:11:59  sjtan
+ #
+ # cut ctrl-x and paste ctrl-v, works through clipboard, so can paste 
name/address info onto
+ # text editors (oowriter, kwrite tried out). Drag and drop doesn't work to 
outside apps.
+ # List displays at last updated position after load_all_orgs() called. removed
+ # old display data listing on list org display button press, because cutting 
and pasting
+ # persons to these items loses  persons. Only saves top-level orgs if there 
is a valid
+ # category value in category field.
+ #
  # Revision 1.29  2004/06/01 07:18:36  ncq
  # - simple Mac fix
  #


Commit from ncq (2004-06-01 19:42 EDT)
---------------

- improve error message from failed notify dispatch attempt

  gnumed  gnumed/client/pycommon/gmBackendListener.py  1.3


--------------------------------------------------
gnumed/gnumed/client/pycommon/gmBackendListener.py  (1.2 -> 1.3)
--------------------------------------------------

***************
*** 8,14 ****
  """
  #=====================================================================
  # $Source: 
/cvsroot/gnumed/gnumed/gnumed/client/pycommon/gmBackendListener.py,v $
! __version__ = "$Revision: 1.2 $"
  __author__ = "H. Herb <address@hidden>, K.Hilbert <address@hidden>"
  
  import sys, time, threading, select
--- 8,14 ----
  """
  #=====================================================================
  # $Source: 
/cvsroot/gnumed/gnumed/gnumed/client/pycommon/gmBackendListener.py,v $
! __version__ = "$Revision: 1.3 $"
  __author__ = "H. Herb <address@hidden>, K.Hilbert <address@hidden>"
  
  import sys, time, threading, select
***************
*** 176,182 ****
                                                try:
                                                        
gmDispatcher.send(signal = note.relname, sender = self._service, 
sending_backend_pid = note.be_pid)
                                                except:
!                                                       print "problem passing 
on notification to intra-client dispatcher"
                                        if self._quit_lock.acquire(0):
                                                break
                                        time.sleep(0.25)
--- 176,182 ----
                                                try:
                                                        
gmDispatcher.send(signal = note.relname, sender = self._service, 
sending_backend_pid = note.be_pid)
                                                except:
!                                                       print "problem routing 
notification [%s] from [%s] to intra-client dispatcher" % (note.relname, 
note.be_pid)
                                        if self._quit_lock.acquire(0):
                                                break
                                        time.sleep(0.25)
***************
*** 279,284 ****
--- 279,287 ----
        listener.unregister_callback('patient_changed', OnPatientModified)
  #=====================================================================
  # $Log: gmBackendListener.py,v $
+ # Revision 1.3  2004/06/01 23:42:53  ncq
+ # - improve error message from failed notify dispatch attempt
+ #
  # Revision 1.2  2004/04/21 14:27:15  ihaywood
  # bug preventing backendlistener working on local socket connections
  #


Commit from ncq (2004-06-01 19:51 EDT)
---------------

- id_episode/pk_encounter

  gnumed  gnumed/client/business/gmClinicalRecord.py  1.110


-------------------------------------------------
gnumed/gnumed/client/business/gmClinicalRecord.py  (1.109 -> 1.110)
-------------------------------------------------

***************
*** 9,16 ****
  """
  #============================================================
  # $Source: 
/cvsroot/gnumed/gnumed/gnumed/client/business/gmClinicalRecord.py,v $
! # $Id: gmClinicalRecord.py,v 1.109 2004/06/01 08:21:56 ncq Exp $
! __version__ = "$Revision: 1.109 $"
  __author__ = "K.Hilbert <address@hidden>"
  __license__ = "GPL"
  
--- 9,16 ----
  """
  #============================================================
  # $Source: 
/cvsroot/gnumed/gnumed/gnumed/client/business/gmClinicalRecord.py,v $
! # $Id: gmClinicalRecord.py,v 1.110 2004/06/01 23:51:33 ncq Exp $
! __version__ = "$Revision: 1.110 $"
  __author__ = "K.Hilbert <address@hidden>"
  __license__ = "GPL"
  
***************
*** 238,244 ****
                        _log.Log(gmLog.lInfo, 'will not create empty clinical 
note')
                        return 1
                cmd = "insert into clin_note(id_encounter, id_episode, 
narrative) values (%s, %s, %s)"
!               return gmPG.run_commit('historica', [(cmd, 
[self.__encounter['id'], self.__episode['id'], note])])
        #--------------------------------------------------------
        # __getitem__ handling
        #--------------------------------------------------------
--- 238,244 ----
                        _log.Log(gmLog.lInfo, 'will not create empty clinical 
note')
                        return 1
                cmd = "insert into clin_note(id_encounter, id_episode, 
narrative) values (%s, %s, %s)"
!               return gmPG.run_commit('historica', [(cmd, 
[self.__encounter['pk_encounter'], self.__episode['id_episode'], note])])
        #--------------------------------------------------------
        # __getitem__ handling
        #--------------------------------------------------------
***************
*** 301,307 ****
                episodes = self.get_episodes()
                episode_map = {}
                for episode in episodes:
!                       episode_map[episode['id_episode']] = episode['episode']
                emr_data = {}
                # get item data from all source tables
                for src_table in items_by_table.keys():
--- 301,307 ----
                episodes = self.get_episodes()
                episode_map = {}
                for episode in episodes:
!                       episode_map[episode['id_episode']] = 
episode['description']
                emr_data = {}
                # get item data from all source tables
                for src_table in items_by_table.keys():
***************
*** 468,474 ****
                episodes = self.get_episodes()
                episode_map = {}
                for episode in episodes:
!                       episode_map[episode['id_episode']] = episode['episode']
                emr_data = {}
                # get item data from all source tables
                curs = self._ro_conn_clin.cursor()
--- 468,474 ----
                episodes = self.get_episodes()
                episode_map = {}
                for episode in episodes:
!                       episode_map[episode['id_episode']] = 
episode['description']
                emr_data = {}
                # get item data from all source tables
                curs = self._ro_conn_clin.cursor()
***************
*** 584,592 ****
        #--------------------------------------------------------
        def add_allergy(self, substance=None, allg_type=None, 
encounter_id=None, episode_id=None):
                if encounter_id is None:
!                       encounter_id = self.__encounter['id']
                if episode_id is None:
!                       episode_id = self.__episode['id']
                status, data = gmAllergy.create_allergy(
                        substance=substance,
                        allg_type=allg_type,
--- 584,592 ----
        #--------------------------------------------------------
        def add_allergy(self, substance=None, allg_type=None, 
encounter_id=None, episode_id=None):
                if encounter_id is None:
!                       encounter_id = self.__encounter['pk_encounter']
                if episode_id is None:
!                       episode_id = self.__episode['id_episode']
                status, data = gmAllergy.create_allergy(
                        substance=substance,
                        allg_type=allg_type,
***************
*** 650,656 ****
                        id_health_issue = self.health_issue['ID']
                # already there ?
                for episode in self.__db_cache['episodes']:
!                       if episode['episode'] == episode_name:
                                if episode['id_health_issue'] == 
id_health_issue:
                                        return episode
                                else:
--- 650,656 ----
                        id_health_issue = self.health_issue['ID']
                # already there ?
                for episode in self.__db_cache['episodes']:
!                       if episode['description'] == episode_name:
                                if episode['id_health_issue'] == 
id_health_issue:
                                        return episode
                                else:
***************
*** 752,758 ****
                        _log.Log(gmLog.lErr, 'cannot activate episode [%s], 
cannot get episode list' % ep_name)
                        return False
                for episode in self.__db_cache['episodes']:
!                       if episode['episode'] == ep_name:
                                episode.set_active()
                                return True
                _log.Log(gmLog.lErr, 'cannot activate episode [%s], not found 
in list' % ep_name)
--- 752,758 ----
                        _log.Log(gmLog.lErr, 'cannot activate episode [%s], 
cannot get episode list' % ep_name)
                        return False
                for episode in self.__db_cache['episodes']:
!                       if episode['description'] == ep_name:
                                episode.set_active()
                                return True
                _log.Log(gmLog.lErr, 'cannot activate episode [%s], not found 
in list' % ep_name)
***************
*** 982,989 ****
                """Creates a new vaccination entry in backend."""
                return gmVaccination.create_vaccination(
                        patient_id = self.id_patient,
!                       episode_id = self.__episode['id'],
!                       encounter_id = self.__encounter['id'],
                        vaccine = vaccine
                )
        #------------------------------------------------------------------
--- 982,989 ----
                """Creates a new vaccination entry in backend."""
                return gmVaccination.create_vaccination(
                        patient_id = self.id_patient,
!                       episode_id = self.__episode['id_episode'],
!                       encounter_id = self.__encounter['pk_encounter'],
                        vaccine = vaccine
                )
        #------------------------------------------------------------------
***************
*** 1173,1181 ****
        #------------------------------------------------------------------
        def add_lab_request(self, lab=None, req_id=None, encounter_id=None, 
episode_id=None):
                if encounter_id is None:
!                       encounter_id = self.__encounter['id']
                if episode_id is None:
!                       episode_id = self.__episode['id']
                status, data = gmPathLab.create_lab_request(
                        lab=lab,
                        req_id=req_id,
--- 1173,1181 ----
        #------------------------------------------------------------------
        def add_lab_request(self, lab=None, req_id=None, encounter_id=None, 
episode_id=None):
                if encounter_id is None:
!                       encounter_id = self.__encounter['pk_encounter']
                if episode_id is None:
!                       episode_id = self.__episode['id_episode']
                status, data = gmPathLab.create_lab_request(
                        lab=lab,
                        req_id=req_id,
***************
*** 1207,1213 ****
        %s, %s, %s, %s, %s, %s
  )
  """
!               gmPG.run_query (rw_curs, cmd, 1, self.__encounter['id'], 
self.__episode['id'], allergy["substance"], allergy["reaction"], 
allergy["definite"])
                rw_curs.close()
                rw_conn.commit()
                rw_conn.close()
--- 1207,1213 ----
        %s, %s, %s, %s, %s, %s
  )
  """
!               gmPG.run_query (rw_curs, cmd, 1, 
self.__encounter['pk_encounter'], self.__episode['id_episode'], 
allergy["substance"], allergy["reaction"], allergy["definite"])
                rw_curs.close()
                rw_conn.commit()
                rw_conn.close()
***************
*** 1233,1239 ****
                %s, %s, %s, %s
                )
                """
!               return gmPG.run_commit (cursor, [(cmd, [self.__encounter['id'], 
self.__episode['id'], text, form_id])])
  
  #============================================================
  # convenience functions
--- 1233,1239 ----
                %s, %s, %s, %s
                )
                """
!               return gmPG.run_commit (cursor, [(cmd, 
[self.__encounter['pk_encounter'], self.__episode['id_episode'], text, 
form_id])])
  
  #============================================================
  # convenience functions
***************
*** 1309,1314 ****
--- 1309,1317 ----
        gmPG.ConnectionPool().StopListeners()
  #============================================================
  # $Log: gmClinicalRecord.py,v $
+ # Revision 1.110  2004/06/01 23:51:33  ncq
+ # - id_episode/pk_encounter
+ #
  # Revision 1.109  2004/06/01 08:21:56  ncq
  # - default limit to all on get_lab_results()
  #


Commit from ncq (2004-06-01 19:53 EDT)
---------------

- v_pat_episodes.episode -> *.description

  gnumed  gnumed/client/business/gmEMRStructItems.py  1.11


-------------------------------------------------
gnumed/gnumed/client/business/gmEMRStructItems.py  (1.10 -> 1.11)
-------------------------------------------------

***************
*** 3,9 ****
  license: GPL
  """
  #============================================================
! __version__ = "$Revision: 1.10 $"
  __author__ = "Carlos Moro <address@hidden>"
  
  import types, sys
--- 3,9 ----
  license: GPL
  """
  #============================================================
! __version__ = "$Revision: 1.11 $"
  __author__ = "Carlos Moro <address@hidden>"
  
  import types, sys
***************
*** 64,70 ****
                        where id=%(id)s"""
                ]
        _updatable_fields = [
!               'episode',
                'id_health_issue'
        ]
        #--------------------------------------------------------
--- 64,70 ----
                        where id=%(id)s"""
                ]
        _updatable_fields = [
!               'description',
                'id_health_issue'
        ]
        #--------------------------------------------------------
***************
*** 306,311 ****
--- 306,314 ----
        print "updatable:", encounter.get_updatable_fields()
  #============================================================
  # $Log: gmEMRStructItems.py,v $
+ # Revision 1.11  2004/06/01 23:53:56  ncq
+ # - v_pat_episodes.episode -> *.description
+ #
  # Revision 1.10  2004/06/01 08:20:14  ncq
  # - limit in get_lab_results
  #


Commit from ncq (2004-06-01 19:56 EDT)
---------------

- improved error handling in several places

  gnumed  gnumed/client/business/gmPathLab.py  1.29


------------------------------------------
gnumed/gnumed/client/business/gmPathLab.py  (1.28 -> 1.29)
------------------------------------------

***************
*** 4,11 ****
  """
  #============================================================
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/business/gmPathLab.py,v $
! # $Id: gmPathLab.py,v 1.28 2004/05/30 20:12:33 ncq Exp $
! __version__ = "$Revision: 1.28 $"
  __author__ = "K.Hilbert <address@hidden>"
  
  import types, sys
--- 4,11 ----
  """
  #============================================================
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/business/gmPathLab.py,v $
! # $Id: gmPathLab.py,v 1.29 2004/06/01 23:56:39 ncq Exp $
! __version__ = "$Revision: 1.29 $"
  __author__ = "K.Hilbert <address@hidden>"
  
  import types, sys
***************
*** 191,196 ****
--- 191,202 ----
                                        and
                                vbp.i_id=vpi.id_patient"""
                pat = gmPG.run_ro_query('historica', cmd, None, 
self._payload[self._idx['pk_item']])
+               if pat is None:
+                       _log.Log(gmLog.lErr, 'cannot get patient for lab 
request [%s]' % self._payload[self._idx['pk_item']])
+                       return None
+               if len(pat) == 0:
+                       _log.Log(gmLog.lErr, 'no patient associated with lab 
request [%s]' % self._payload[self._idx['pk_item']])
+                       return None
                return pat[0]
  #============================================================
  class cTestType(gmClinItem.cClinItem):
***************
*** 294,300 ****
                # yes but ambigous
                if name != db_lname:
                        _log.Log(gmLog.lErr, 'test type found for [%s:%s] but 
long name mismatch: expected [%s], in DB [%s]' % (lab, code, name, db_lname))
!                       me = '$RCSfile: gmPathLab.py,v $ $Revision: 1.28 $'
                        to = 'user'
                        prob = _('The test type already exists but the long 
name is different. '
                                        'The test facility may have changed the 
descriptive name of this test.')
--- 300,306 ----
                # yes but ambigous
                if name != db_lname:
                        _log.Log(gmLog.lErr, 'test type found for [%s:%s] but 
long name mismatch: expected [%s], in DB [%s]' % (lab, code, name, db_lname))
!                       me = '$RCSfile: gmPathLab.py,v $ $Revision: 1.29 $'
                        to = 'user'
                        prob = _('The test type already exists but the long 
name is different. '
                                        'The test facility may have changed the 
descriptive name of this test.')
***************
*** 371,380 ****
        # found
        if req is not None:
                db_pat = req.get_patient()
                # yes but ambigous
                if pat_id != db_pat[0]:
                        _log.Log(gmLog.lErr, 'lab request found for [%s:%s] but 
patient mismatch: expected [%s], in DB [%s]' % (lab, req_id, pat_id, db_pat))
!                       me = '$RCSfile: gmPathLab.py,v $ $Revision: 1.28 $'
                        to = 'user'
                        prob = _('The lab request already exists but belongs to 
a different patient.')
                        sol = _('Verify which patient this lab request really 
belongs to.')
--- 377,389 ----
        # found
        if req is not None:
                db_pat = req.get_patient()
+               if db_pat is None:
+                       _log.Log(gmLog.lErr, 'cannot cross-check patient on lab 
request')
+                       return (None, '')
                # yes but ambigous
                if pat_id != db_pat[0]:
                        _log.Log(gmLog.lErr, 'lab request found for [%s:%s] but 
patient mismatch: expected [%s], in DB [%s]' % (lab, req_id, pat_id, db_pat))
!                       me = '$RCSfile: gmPathLab.py,v $ $Revision: 1.29 $'
                        to = 'user'
                        prob = _('The lab request already exists but belongs to 
a different patient.')
                        sol = _('Verify which patient this lab request really 
belongs to.')
***************
*** 610,615 ****
--- 619,627 ----
        gmPG.ConnectionPool().StopListeners()
  #============================================================
  # $Log: gmPathLab.py,v $
+ # Revision 1.29  2004/06/01 23:56:39  ncq
+ # - improved error handling in several places
+ #
  # Revision 1.28  2004/05/30 20:12:33  ncq
  # - make create_lab_result() handle request objects, not request_id
  #


Commit from ncq (2004-06-01 19:58 EDT)
---------------

- debugged dob handling in _make_queries_generic

  gnumed  gnumed/client/business/gmPatient.py  1.43


------------------------------------------
gnumed/gnumed/client/business/gmPatient.py  (1.42 -> 1.43)
------------------------------------------

***************
*** 8,15 ****
  """
  #============================================================
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/business/gmPatient.py,v $
! # $Id: gmPatient.py,v 1.42 2004/06/01 07:50:56 ncq Exp $
! __version__ = "$Revision: 1.42 $"
  __author__ = "K.Hilbert <address@hidden>"
  
  # access our modules
--- 8,15 ----
  """
  #============================================================
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/business/gmPatient.py,v $
! # $Id: gmPatient.py,v 1.43 2004/06/01 23:58:01 ncq Exp $
! __version__ = "$Revision: 1.43 $"
  __author__ = "K.Hilbert <address@hidden>"
  
  # access our modules
***************
*** 364,369 ****
--- 364,370 ----
                                except KeyError:
                                        self.__generate_queries = 
self.__query_generators['default']
                # make a cursor
+ #             self.conn = gmPG.ConnectionPool().GetConnection('personalia', 
extra_verbose=gmPyCompat.True)
                self.conn = gmPG.ConnectionPool().GetConnection('personalia')
                self.curs = self.conn.cursor()
        #--------------------------------------------------------
***************
*** 910,915 ****
--- 911,919 ----
        gmPG.ConnectionPool().StopListeners()
  #============================================================
  # $Log: gmPatient.py,v $
+ # Revision 1.43  2004/06/01 23:58:01  ncq
+ # - debugged dob handling in _make_queries_generic
+ #
  # Revision 1.42  2004/06/01 07:50:56  ncq
  # - typo fix
  #


Commit from ncq (2004-06-01 19:59 EDT)
---------------

- use emr.get_active_*()

  gnumed  gnumed/client/business/gmReferral.py  1.2


-------------------------------------------
gnumed/gnumed/client/business/gmReferral.py  (1.1 -> 1.2)
-------------------------------------------

***************
*** 82,88 ****
      pool = gmPG.ConnectionPool ()
      conn = pool.GetConnection ('historica', readonly = 0)
      curs = conn.cursor ()
!     form_id = form.store (patient_clinical.encounter['id'], 
patient_clinical.episode['id'], params, curs)
      if form_id:
          if patient_clinical.store_referral (curs, text, form_id):
              curs.close ()
--- 82,88 ----
      pool = gmPG.ConnectionPool ()
      conn = pool.GetConnection ('historica', readonly = 0)
      curs = conn.cursor ()
!     form_id = form.store 
(patient_clinical.get_active_encounter()['pk_encounter'], 
patient_clinical.get_active_episode()['id_episode'], params, curs)
      if form_id:
          if patient_clinical.store_referral (curs, text, form_id):
              curs.close ()


Commit from ncq (2004-06-01 20:00 EDT)
---------------

- make work on Mac AND 2.4.1 Linux wxWidgets
- correctly handle episode VOs

  gnumed  gnumed/client/wxpython/gmTopPanel.py  1.42


-------------------------------------------
gnumed/gnumed/client/wxpython/gmTopPanel.py  (1.41 -> 1.42)
-------------------------------------------

***************
*** 2,8 ****
  # GPL
  
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/wxpython/gmTopPanel.py,v $
! __version__ = "$Revision: 1.41 $"
  __author__  = "R.Terry <address@hidden>, I.Haywood <address@hidden>, 
K.Hilbert <address@hidden>"
  #===========================================================
  import sys, os.path, cPickle, zlib, string
--- 2,8 ----
  # GPL
  
  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/wxpython/gmTopPanel.py,v $
! __version__ = "$Revision: 1.42 $"
  __author__  = "R.Terry <address@hidden>, I.Haywood <address@hidden>, 
K.Hilbert <address@hidden>"
  #===========================================================
  import sys, os.path, cPickle, zlib, string
***************
*** 145,151 ****
  
                # - stack them atop each other
                self.szr_stacked_rows = wxBoxSizer(wxVERTICAL)
!               self.szr_stacked_rows.Add((1, 3), 0, wxEXPAND)  # ??? (IMHO: 
space is at too much of a premium for such padding)
                self.szr_stacked_rows.Add(self.szr_top_row, 1, wxEXPAND)
                self.szr_stacked_rows.Add(self.szr_bottom_row, 1, wxEXPAND | 
wxALL, 2)
  
--- 145,156 ----
  
                # - stack them atop each other
                self.szr_stacked_rows = wxBoxSizer(wxVERTICAL)
!               # FIXME: deuglify
!               # ??? (IMHO: space is at too much of a premium for such padding)
!               if wxPlatform == '__WXMAC__':
!                       self.szr_stacked_rows.Add((1, 3), 0, wxEXPAND)
!               else:
!                       self.szr_stacked_rows.Add(1, 3, 0, wxEXPAND)
                self.szr_stacked_rows.Add(self.szr_top_row, 1, wxEXPAND)
                self.szr_stacked_rows.Add(self.szr_bottom_row, 1, wxEXPAND | 
wxALL, 2)
  
***************
*** 233,240 ****
                        return None
                episodes = epr.get_episodes()
                for episode in episodes:
!                       self.combo_episodes.Append(episode['episode'], 
str(episode['id_episode']))
!               
self.combo_episodes.SetValue(epr.get_active_episode()['episode'])
        #-------------------------------------------------------
        def __on_display_demographics(self, evt):
                print "display patient demographic window now"
--- 238,245 ----
                        return None
                episodes = epr.get_episodes()
                for episode in episodes:
!                       self.combo_episodes.Append(episode['description'], 
str(episode['id_episode']))
!               
self.combo_episodes.SetValue(epr.get_active_episode()['description'])
        #-------------------------------------------------------
        def __on_display_demographics(self, evt):
                print "display patient demographic window now"
***************
*** 344,349 ****
--- 349,358 ----
        app.MainLoop()
  #===========================================================
  # $Log: gmTopPanel.py,v $
+ # Revision 1.42  2004/06/02 00:00:47  ncq
+ # - make work on Mac AND 2.4.1 Linux wxWidgets
+ # - correctly handle episode VOs
+ #
  # Revision 1.41  2004/05/30 09:03:46  shilbert
  # - one more little fix regarding get_active_episode()
  #


Commit from ncq (2004-06-01 20:02 EDT)
---------------

- cleanup, indentation fixes

  gnumed  gnumed/client/wxpython/gui/gmLabJournal.py  1.24


-------------------------------------------------
gnumed/gnumed/client/wxpython/gui/gmLabJournal.py  (1.23 -> 1.24)
-------------------------------------------------

***************
*** 2,8 ****
  """
  #============================================================================
  # $Source: 
/cvsroot/gnumed/gnumed/gnumed/client/wxpython/gui/gmLabJournal.py,v $
! __version__ = "$Revision: 1.23 $"
  __author__ = "Sebastian Hilbert <address@hidden>"
  
  # system
--- 2,8 ----
  """
  #============================================================================
  # $Source: 
/cvsroot/gnumed/gnumed/gnumed/client/wxpython/gui/gmLabJournal.py,v $
! __version__ = "$Revision: 1.24 $"
  __author__ = "Sebastian Hilbert <address@hidden>"
  
  # system
***************
*** 47,75 ****
  
  #====================================
  class MyCustomRenderer(wxPyGridCellRenderer):
!     def __init__(self):
!         wxPyGridCellRenderer.__init__(self)
  
!     def Draw(self, grid, attr, dc, rect, row, col, isSelected):
!         dc.SetBackgroundMode(wxSOLID)
!         dc.SetBrush(wxBrush(wxBLACK, wxSOLID))
!         dc.SetPen(wxTRANSPARENT_PEN)
!         dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height)
! 
!         dc.SetBackgroundMode(wxTRANSPARENT)
!         dc.SetFont(attr.GetFont())
! 
!         text = grid.GetCellValue(row, col)
!         colors = [wxRED, wxWHITE, wxCYAN]
!         x = rect.x + 1
!         y = rect.y + 1
!         for ch in text:
!             dc.SetTextForeground(random.choice(colors))
!             dc.DrawText(ch, x, y)
!             w, h = dc.GetTextExtent(ch)
!             x = x + w
!             if x > rect.right - 5:
!                 break
  
  #=======================================
  class cLabReviewGrid(wxGrid):
--- 47,74 ----
  
  #====================================
  class MyCustomRenderer(wxPyGridCellRenderer):
!       def __init__(self):
!               wxPyGridCellRenderer.__init__(self)
  
!       def Draw(self, grid, attr, dc, rect, row, col, isSelected):
!               dc.SetBackgroundMode(wxSOLID)
!               dc.SetBrush(wxBrush(wxBLACK, wxSOLID))
!               dc.SetPen(wxTRANSPARENT_PEN)
!               dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height)
!               dc.SetBackgroundMode(wxTRANSPARENT)
!               dc.SetFont(attr.GetFont())
! 
!               text = grid.GetCellValue(row, col)
!               colors = [wxRED, wxWHITE, wxCYAN]
!               x = rect.x + 1
!               y = rect.y + 1
!               for ch in text:
!                       dc.SetTextForeground(random.choice(colors))
!                       dc.DrawText(ch, x, y)
!                       w, h = dc.GetTextExtent(ch)
!                       x = x + w
!                       if x > rect.right - 5:
!                               break
  
  #=======================================
  class cLabReviewGrid(wxGrid):
***************
*** 273,279 ****
                
self.DataGrid.SetDefaultCellAlignment(wxALIGN_LEFT,wxALIGN_CENTRE)
                renderer = apply(MyCustomRenderer, ())
                self.DataGrid.SetDefaultRenderer(renderer)
!               
                # There is a bug in wxGTK for this method...
                self.DataGrid.AutoSizeColumns(True)
                self.DataGrid.AutoSizeRows(True)
--- 272,278 ----
                
self.DataGrid.SetDefaultCellAlignment(wxALIGN_LEFT,wxALIGN_CENTRE)
                renderer = apply(MyCustomRenderer, ())
                self.DataGrid.SetDefaultRenderer(renderer)
! 
                # There is a bug in wxGTK for this method...
                self.DataGrid.AutoSizeColumns(True)
                self.DataGrid.AutoSizeRows(True)
***************
*** 406,419 ****
                # populate grid
                for item_idx in range(len(data)):
                        result = data[item_idx]
!                       
                        # -- chose boolean renderer for first and second column
                        renderer = apply(wxGridCellBoolRenderer, ())
                        self.DataGrid.SetCellRenderer(item_idx, 0 , renderer)
                        self.DataGrid.SetCellRenderer(item_idx, 1 , renderer)
                        self.DataGrid.SetReadOnly(item_idx, 0, 1)
                        self.DataGrid.SetReadOnly(item_idx, 1, 1)
!                       
                        # -- put reviewed status checkbox in first column
                        self.DataGrid.SetCellValue(item_idx, 0, '1')
                        # -- put relevant status checkbox in second column
--- 405,418 ----
                # populate grid
                for item_idx in range(len(data)):
                        result = data[item_idx]
! 
                        # -- chose boolean renderer for first and second column
                        renderer = apply(wxGridCellBoolRenderer, ())
                        self.DataGrid.SetCellRenderer(item_idx, 0 , renderer)
                        self.DataGrid.SetCellRenderer(item_idx, 1 , renderer)
                        self.DataGrid.SetReadOnly(item_idx, 0, 1)
                        self.DataGrid.SetReadOnly(item_idx, 1, 1)
! 
                        # -- put reviewed status checkbox in first column
                        self.DataGrid.SetCellValue(item_idx, 0, '1')
                        # -- put relevant status checkbox in second column
***************
*** 429,435 ****
                                
self.DataGrid.SetCellTextColour(item_idx,8,wxRED)
                                # abnormal status from lab
                                info = '(%s)' % result['abnormal']
-                               
                                # technically abnormal -> defaults to relevant 
= true
                                self.DataGrid.SetCellValue(item_idx, 1, '1')
                        else:
--- 428,433 ----
***************
*** 459,465 ****
                                self.DataGrid.SetCellValue(item_idx, 8, 
result['note_provider'])
                        # we need to track the request to be able to identify 
the request later
                        self.dict_req_unreviewed[item_idx] = result
!                       
                # we show 50 items at once , notify user if there are more
                if more_avail:
                        gmGuiHelpers.gm_beep_statustext(_('More unreviewed 
results available. Review some to see more.'))
--- 457,463 ----
                                self.DataGrid.SetCellValue(item_idx, 8, 
result['note_provider'])
                        # we need to track the request to be able to identify 
the request later
                        self.dict_req_unreviewed[item_idx] = result
! 
                # we show 50 items at once , notify user if there are more
                if more_avail:
                        gmGuiHelpers.gm_beep_statustext(_('More unreviewed 
results available. Review some to see more.'))
***************
*** 533,539 ****
        def on_select_all(self, event):
                for item_idx in range(self.DataGrid.GetNumberRows()):
                        self.DataGrid.SetCellValue(item_idx,0,'1')
-       
        #------------------------------------------------
        def on_mark_reviewed(self, event):
                # look for checkmark
--- 531,536 ----
***************
*** 707,712 ****
--- 704,712 ----
        pass
  #================================================================
  # $Log: gmLabJournal.py,v $
+ # Revision 1.24  2004/06/02 00:02:32  ncq
+ # - cleanup, indentation fixes
+ #
  # Revision 1.23  2004/05/30 21:19:01  shilbert
  # - completely redone review panel
  #


Commit from ncq (2004-06-01 20:04 EDT)
---------------

- soap_cat defaults

  gnumed  gnumed/server/sql/gmMeasurements.sql  1.27


-------------------------------------------
gnumed/gnumed/server/sql/gmMeasurements.sql  (1.26 -> 1.27)
-------------------------------------------

***************
*** 4,10 ****
  -- author: Christof Meigen <address@hidden>
  -- license: GPL
  -- $Source: /cvsroot/gnumed/gnumed/gnumed/server/sql/gmMeasurements.sql,v $
! -- $Revision: 1.26 $
  
  -- this belongs into the clinical service (historica)
  -- ===================================================================
--- 4,10 ----
  -- author: Christof Meigen <address@hidden>
  -- license: GPL
  -- $Source: /cvsroot/gnumed/gnumed/gnumed/server/sql/gmMeasurements.sql,v $
! -- $Revision: 1.27 $
  
  -- this belongs into the clinical service (historica)
  -- ===================================================================
***************
*** 181,186 ****
--- 181,188 ----
  select add_table_for_audit('test_result');
  select add_x_db_fk_def('test_result', 'val_unit', 'reference', 'unit', 
'name_short');
  
+ alter table test_result alter column soap_cat set default 'o';
+ 
  COMMENT ON TABLE test_result is
        'the results of a single measurement';
  -- FIXME: housekeeping sanity script:
***************
*** 282,287 ****
--- 284,291 ----
  select i18n('partial');
  select i18n('final');
  
+ alter table lab_request alter column soap_cat set default 'p';
+ 
  comment on column lab_request.clin_when is
        'the time the sample for this request was taken
         LDT: 8432:8433';
***************
*** 353,362 ****
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename = '$RCSfile: 
gmMeasurements.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
gmMeasurements.sql,v $', '$Revision: 1.26 $');
  
  -- =============================================
  -- $Log: gmMeasurements.sql,v $
  -- Revision 1.26  2004/06/01 07:58:13  ncq
  -- - improve comments
  --
--- 357,369 ----
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename = '$RCSfile: 
gmMeasurements.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
gmMeasurements.sql,v $', '$Revision: 1.27 $');
  
  -- =============================================
  -- $Log: gmMeasurements.sql,v $
+ -- Revision 1.27  2004/06/02 00:04:50  ncq
+ -- - soap_cat defaults
+ --
  -- Revision 1.26  2004/06/01 07:58:13  ncq
  -- - improve comments
  --


Commit from ncq (2004-06-01 20:06 EDT)
---------------

- vpep.episode now vpep.description

  gnumed  gnumed/server/sql/gmClinicalViews.sql  1.71


--------------------------------------------
gnumed/gnumed/server/sql/gmClinicalViews.sql  (1.70 -> 1.71)
--------------------------------------------

***************
*** 5,11 ****
  -- license: GPL (details at http://gnu.org)
  
  -- $Source: /cvsroot/gnumed/gnumed/gnumed/server/sql/gmClinicalViews.sql,v $
! -- $Id: gmClinicalViews.sql,v 1.70 2004/06/01 08:43:21 ncq Exp $
  
  -- ===================================================================
  -- force terminate + exit(3) on errors if non-interactive
--- 5,11 ----
  -- license: GPL (details at http://gnu.org)
  
  -- $Source: /cvsroot/gnumed/gnumed/gnumed/server/sql/gmClinicalViews.sql,v $
! -- $Id: gmClinicalViews.sql,v 1.71 2004/06/02 00:05:51 ncq Exp $
  
  -- ===================================================================
  -- force terminate + exit(3) on errors if non-interactive
***************
*** 127,133 ****
  select
        chi.id_patient as id_patient,
        cep.id as id_episode,
!       cep.description as episode,
        chi.id as id_health_issue,
        chi.description as health_issue
  from
--- 127,133 ----
  select
        chi.id_patient as id_patient,
        cep.id as id_episode,
!       cep.description as description,
        chi.id as id_health_issue,
        chi.description as health_issue
  from
***************
*** 748,757 ****
  -- do simple schema revision tracking
  \unset ON_ERROR_STOP
  delete from gm_schema_revision where filename='$RCSfile: 
gmClinicalViews.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
gmClinicalViews.sql,v $', '$Revision: 1.70 $');
  
  -- =============================================
  -- $Log: gmClinicalViews.sql,v $
  -- Revision 1.70  2004/06/01 08:43:21  ncq
  -- - fix grants re allergy_state
  -- - include soap_cat in v_patient_items
--- 748,760 ----
  -- do simple schema revision tracking
  \unset ON_ERROR_STOP
  delete from gm_schema_revision where filename='$RCSfile: 
gmClinicalViews.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
gmClinicalViews.sql,v $', '$Revision: 1.71 $');
  
  -- =============================================
  -- $Log: gmClinicalViews.sql,v $
+ -- Revision 1.71  2004/06/02 00:05:51  ncq
+ -- - vpep.episode now vpep.description
+ --
  -- Revision 1.70  2004/06/01 08:43:21  ncq
  -- - fix grants re allergy_state
  -- - include soap_cat in v_patient_items


Commit from ncq (2004-06-01 20:08 EDT)
---------------

- tailor to Laborata Testwoman

  gnumed  gnumed/test-area/khilbert/ldt-anonymizer/anonymize-ldt.py       1.2
+ gnumed  gnumed/test-area/khilbert/ldt-anonymizer/make-anon-lab_reqs.py  1.1


----------------------------------------------------------------
gnumed/gnumed/test-area/khilbert/ldt-anonymizer/anonymize-ldt.py  (1.1 -> 1.2)
----------------------------------------------------------------

***************
*** 8,15 ****
  """
  #===============================================================
  # $Source: 
/cvsroot/gnumed/gnumed/gnumed/test-area/khilbert/ldt-anonymizer/anonymize-ldt.py,v
 $
! # $Id: anonymize-ldt.py,v 1.1 2004/05/13 19:44:41 ncq Exp $
! __version__ = "$Revision: 1.1 $"
  __author__ = "Karsten Hilbert <address@hidden>"
  __license__ = "GPL, details at http://www.gnu.org";
  
--- 8,15 ----
  """
  #===============================================================
  # $Source: 
/cvsroot/gnumed/gnumed/gnumed/test-area/khilbert/ldt-anonymizer/anonymize-ldt.py,v
 $
! # $Id: anonymize-ldt.py,v 1.2 2004/06/02 00:08:13 ncq Exp $
! __version__ = "$Revision: 1.2 $"
  __author__ = "Karsten Hilbert <address@hidden>"
  __license__ = "GPL, details at http://www.gnu.org";
  
***************
*** 32,39 ****
        '8310': 'anon: %s',
        '8311': 'anon: lab internal sample ID',
        '8405': 'anon: arbitrary patient info',
!       '3101': 'anon: last name',
!       '3102': 'anon: first name',
        # Geschlecht: 0 = unbekannt
        '8407': '0'
  }
--- 32,40 ----
        '8310': 'anon: %s',
        '8311': 'anon: lab internal sample ID',
        '8405': 'anon: arbitrary patient info',
!       '3101': 'Testwoman',
!       '3102': 'Laborata',
!       '3103': '22031931',
        # Geschlecht: 0 = unbekannt
        '8407': '0'
  }
***************
*** 44,63 ****
  infilename = sys.argv[1]
  outfilename = "%s.anon.txt" % infilename
  print "anonymizing [%s] into [%s]" % (infilename, outfilename)
- 
  outfile = open(outfilename, "wb+")
  
  random.jumpahead(int(time.strftime('%S%M%H')))
  
  for line in fileinput.input(infilename):
!       line_type = line[3:7]
!       line_data = line[7:-2]
        if line_type in map_sensitive_fields.keys():
-               anon_data = map_sensitive_fields[line_type]
                if line_type == '8310':
                        anon_data = map_sensitive_fields[line_type] % 
random.randrange(sys.maxint)
                        # if you don't want random sample IDs uncomment this 
line:
                        #anon_data = map_sensitive_fields[line_type] % "sample 
ID"
                print "anonymisiere Feld [%s]: [%s] -> [%s]" % (line_type, 
line_data, anon_data)
                len_int = len(anon_data) + 5
                new_line = "%03d%s%s\r\n" % (len_int, line_type, anon_data)
--- 45,71 ----
  infilename = sys.argv[1]
  outfilename = "%s.anon.txt" % infilename
  print "anonymizing [%s] into [%s]" % (infilename, outfilename)
  outfile = open(outfilename, "wb+")
  
  random.jumpahead(int(time.strftime('%S%M%H')))
+ gender = 0
  
  for line in fileinput.input(infilename):
!       tmp = line.replace('\r','')
!       tmp = tmp.replace('\n','')
!       line_type = tmp[3:7]
!       line_data = tmp[7:]
        if line_type in map_sensitive_fields.keys():
                if line_type == '8310':
                        anon_data = map_sensitive_fields[line_type] % 
random.randrange(sys.maxint)
                        # if you don't want random sample IDs uncomment this 
line:
                        #anon_data = map_sensitive_fields[line_type] % "sample 
ID"
+               elif line_type == '8407':
+                       tmp = divmod(gender, 7)
+                       gender += 1
+                       anon_data = str(tmp[1])
+               else:
+                       anon_data = map_sensitive_fields[line_type]
                print "anonymisiere Feld [%s]: [%s] -> [%s]" % (line_type, 
line_data, anon_data)
                len_int = len(anon_data) + 5
                new_line = "%03d%s%s\r\n" % (len_int, line_type, anon_data)
***************
*** 71,76 ****
--- 79,87 ----
  
  #===============================================================
  # $Log: anonymize-ldt.py,v $
+ # Revision 1.2  2004/06/02 00:08:13  ncq
+ # - tailor to Laborata Testwoman
+ #
  # Revision 1.1  2004/05/13 19:44:41  ncq
  # - first version
  #


---------------------------------------------------------------------
gnumed/gnumed/test-area/khilbert/ldt-anonymizer/make-anon-lab_reqs.py  (1.1)
---------------------------------------------------------------------

***************
*** 0 ****
--- 1,102 ----
+ # -*- coding: latin-1 -*-
+ """GnuMed LDT anonymizer.
+ 
+ This script anonymizes German pathology result
+ files in LDT format.
+ 
+ copyright: authors
+ """
+ #===============================================================
+ # $Source: 
/cvsroot/gnumed/gnumed/gnumed/test-area/khilbert/ldt-anonymizer/make-anon-lab_reqs.py,v
 $
+ # $Id: make-anon-lab_reqs.py,v 1.1 2004/06/02 00:08:16 ncq Exp $
+ __version__ = "$Revision: 1.1 $"
+ __author__ = "Karsten Hilbert <address@hidden>"
+ __license__ = "GPL, details at http://www.gnu.org";
+ 
+ import fileinput, sys, random, time
+ 
+ from Gnumed.pycommon import gmPG, gmLoginInfo, gmLog
+ from Gnumed.business import gmPathLab, gmPatient
+ 
+ from Gnumed.pycommon.gmPyCompat import *
+ 
+ _log = gmLog.gmDefLog
+ _log.SetAllLogLevels(gmLog.lData)
+ 
+ def usage():
+       print """use like this:"
+ $> python make-anon-lab_reqs <ldt-datei>"
+ 
+ This will generate lab requests for all sample IDs found
+ in <ldt-datei>. All requests will belong to Laborata
+ Testwoman.
+ """
+       sys.exit()      
+ 
+ print "accessing patient data Laborata Testwoman"
+ # set encoding
+ gmPG.set_default_client_encoding('latin1')
+ # setup login defs
+ auth_data = gmLoginInfo.LoginInfo(
+       user = 'any-doc',
+       passwd = 'any-doc',
+       host = '',
+       port = 5432,
+       database = 'gnumed'
+ )
+ backend = gmPG.ConnectionPool(login = auth_data)
+ 
+ pat_data = {
+       'lastnames': 'Testwoman',
+       'firstnames': 'Laborata',
+       'gender': 'f'
+ }
+ searcher = gmPatient.cPatientSearcher_SQL()
+ pat_ids = searcher.get_patient_ids(search_dict = pat_data)
+ 
+ if len(pat_ids) == 0:
+       print "cannot find Laborata Testwoman"
+       sys.exit()
+ if len(pat_ids) > 1:
+       print "more than one patient for Laborata Testwoman"
+       sys.exit()
+ 
+ patid = pat_ids[0]
+ print "Laborata Testwoman has ID [%s]" % patid
+ pat = gmPatient.gmCurrentPatient(aPKey=patid)
+ emr = pat.get_clinical_record()
+ enc_id = emr.get_active_encounter()['pk_encounter']
+ print "encounter", enc_id
+ epi_id = emr.get_active_episode()['id_episode']
+ print "episode", epi_id
+ 
+ infilename = sys.argv[1]
+ print "generating request IDs from LDT file [%s]" % infilename
+ 
+ for line in fileinput.input(infilename):
+       tmp = line.replace('\r','')
+       tmp = tmp.replace('\n','')
+       line_type = tmp[3:7]
+       line_data = tmp[7:]
+       if line_type == '8310':
+               _log.Log(gmLog.lInfo, "creating lab request for ID [%s]" % 
line_data)
+               status, data = gmPathLab.create_lab_request(
+                       lab = 'your own practice',
+                       req_id = line_data,
+                       pat_id = patid,
+                       encounter_id = enc_id,
+                       episode_id = epi_id
+               )
+               if status is False:
+                       print "ERROR:", data
+               elif status is None:
+                       print "ERROR: check lab journal"
+ 
+ print "done"
+ backend.StopListeners()
+ 
+ #===============================================================
+ # $Log: make-anon-lab_reqs.py,v $
+ # Revision 1.1  2004/06/02 00:08:16  ncq
+ # - tailor to Laborata Testwoman
+ #


Commit from ncq (2004-06-01 20:14 EDT)
---------------

- add time zone setting

  gnumed  gnumed/server/sql/test-data/gmDemographics-Person-test_data.sql  1.4
  gnumed  gnumed/server/sql/test-data/test_data-Christine_Chapel.sql       1.5
  gnumed  gnumed/server/sql/test-data/test_data-James_Kirk.sql             1.24
  gnumed  gnumed/server/sql/test-data/test_data-Julian_Bashir.sql          1.5
  gnumed  gnumed/server/sql/test-data/test_data-Leonard_McCoy.sql          1.9
  gnumed  gnumed/server/sql/test-data/test_data-Spock.sql                  1.3
  gnumed  gnumed/server/sql/test-data/test_data-USS_Enterprise.sql         1.7
  gnumed  gnumed/server/sql/test-data/test_data-lab_regression.sql         1.3


----------------------------------------------------------------------
gnumed/gnumed/server/sql/test-data/gmDemographics-Person-test_data.sql  (1.3 -> 
1.4)
----------------------------------------------------------------------

***************
*** 4,15 ****
  -- identity related test data
  -- ===================================================================
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/gmDemographics-Person-test_data.sql,v
 $
! -- $Id: gmDemographics-Person-test_data.sql,v 1.3 2004/01/08 22:58:28 ncq Exp 
$
  -- ===================================================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
  
  -- ==========================================================
  -- insert some example people
  insert into v_basic_person (firstnames, lastnames, dob, cob, gender) values 
('Ian', 'Haywood', '1977-12-19', 'UK', 'm');
  insert into v_basic_person (firstnames, lastnames, dob, cob, gender) values 
('Cilla', 'Raby', '1979-3-1', 'AU', 'f');
--- 4,17 ----
  -- identity related test data
  -- ===================================================================
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/gmDemographics-Person-test_data.sql,v
 $
! -- $Id: gmDemographics-Person-test_data.sql,v 1.4 2004/06/02 00:14:45 ncq Exp 
$
  -- ===================================================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
  
  -- ==========================================================
+ set time zone '+2:00';
+ 
  -- insert some example people
  insert into v_basic_person (firstnames, lastnames, dob, cob, gender) values 
('Ian', 'Haywood', '1977-12-19', 'UK', 'm');
  insert into v_basic_person (firstnames, lastnames, dob, cob, gender) values 
('Cilla', 'Raby', '1979-3-1', 'AU', 'f');
***************
*** 22,31 ****
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename = '$RCSfile: 
gmDemographics-Person-test_data.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
gmDemographics-Person-test_data.sql,v $', '$Revision: 1.3 $');
  
  -- =============================================
  -- $Log: gmDemographics-Person-test_data.sql,v $
  -- Revision 1.3  2004/01/08 22:58:28  ncq
  -- - delete from gm_schema_revision
  --
--- 24,36 ----
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename = '$RCSfile: 
gmDemographics-Person-test_data.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
gmDemographics-Person-test_data.sql,v $', '$Revision: 1.4 $');
  
  -- =============================================
  -- $Log: gmDemographics-Person-test_data.sql,v $
+ -- Revision 1.4  2004/06/02 00:14:45  ncq
+ -- - add time zone setting
+ --
  -- Revision 1.3  2004/01/08 22:58:28  ncq
  -- - delete from gm_schema_revision
  --


-----------------------------------------------------------------
gnumed/gnumed/server/sql/test-data/test_data-Christine_Chapel.sql  (1.4 -> 1.5)
-----------------------------------------------------------------

***************
*** 4,15 ****
  -- author: Karsten Hilbert <address@hidden>
  -- license: GPL
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/test_data-Christine_Chapel.sql,v
 $
! -- $Revision: 1.4 $
  -- =============================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
  
  -- =============================================
  insert into identity (gender, dob, cob, title)
  values ('f', '1932-2-23', 'US', 'Dr.RN');
  
--- 4,17 ----
  -- author: Karsten Hilbert <address@hidden>
  -- license: GPL
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/test_data-Christine_Chapel.sql,v
 $
! -- $Revision: 1.5 $
  -- =============================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
  
  -- =============================================
+ set time zone '+2:00';
+ 
  insert into identity (gender, dob, cob, title)
  values ('f', '1932-2-23', 'US', 'Dr.RN');
  
***************
*** 28,37 ****
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename like '$RCSfile: 
test_data-Christine_Chapel.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
test_data-Christine_Chapel.sql,v $', '$Revision: 1.4 $');
  
  -- =============================================
  -- $Log: test_data-Christine_Chapel.sql,v $
  -- Revision 1.4  2004/01/18 21:59:06  ncq
  -- - no clinical data hence no mention in xln_identity
  --
--- 30,42 ----
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename like '$RCSfile: 
test_data-Christine_Chapel.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
test_data-Christine_Chapel.sql,v $', '$Revision: 1.5 $');
  
  -- =============================================
  -- $Log: test_data-Christine_Chapel.sql,v $
+ -- Revision 1.5  2004/06/02 00:14:46  ncq
+ -- - add time zone setting
+ --
  -- Revision 1.4  2004/01/18 21:59:06  ncq
  -- - no clinical data hence no mention in xln_identity
  --


-----------------------------------------------------------
gnumed/gnumed/server/sql/test-data/test_data-James_Kirk.sql  (1.23 -> 1.24)
-----------------------------------------------------------

***************
*** 4,15 ****
  -- author: Karsten Hilbert <address@hidden>
  -- license: GPL
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/test_data-James_Kirk.sql,v $
! -- $Revision: 1.23 $
  -- =============================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
  
  -- =============================================
  -- identity
  -- name
  delete from names where
--- 4,17 ----
  -- author: Karsten Hilbert <address@hidden>
  -- license: GPL
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/test_data-James_Kirk.sql,v $
! -- $Revision: 1.24 $
  -- =============================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
  
  -- =============================================
+ set time zone '+2:00';
+ 
  -- identity
  -- name
  delete from names where
***************
*** 421,430 ****
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename like '%James_Kirk%';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
test_data-James_Kirk.sql,v $', '$Revision: 1.23 $');
  
  -- =============================================
  -- $Log: test_data-James_Kirk.sql,v $
  -- Revision 1.23  2004/06/01 10:15:18  ncq
  -- - fk_patient, not id_patient in allergy_state
  --
--- 423,435 ----
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename like '%James_Kirk%';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
test_data-James_Kirk.sql,v $', '$Revision: 1.24 $');
  
  -- =============================================
  -- $Log: test_data-James_Kirk.sql,v $
+ -- Revision 1.24  2004/06/02 00:14:46  ncq
+ -- - add time zone setting
+ --
  -- Revision 1.23  2004/06/01 10:15:18  ncq
  -- - fk_patient, not id_patient in allergy_state
  --


--------------------------------------------------------------
gnumed/gnumed/server/sql/test-data/test_data-Julian_Bashir.sql  (1.4 -> 1.5)
--------------------------------------------------------------

***************
*** 4,15 ****
  -- author: Karsten Hilbert <address@hidden>
  -- license: GPL
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/test_data-Julian_Bashir.sql,v
 $
! -- $Revision: 1.4 $
  -- =============================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
  
  -- =============================================
  insert into identity (gender, dob, cob, title)
  values ('m', '1965-11-21', 'SD', 'Dr.');
  
--- 4,17 ----
  -- author: Karsten Hilbert <address@hidden>
  -- license: GPL
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/test_data-Julian_Bashir.sql,v
 $
! -- $Revision: 1.5 $
  -- =============================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
  
  -- =============================================
+ set time zone '+2:00';
+ 
  insert into identity (gender, dob, cob, title)
  values ('m', '1965-11-21', 'SD', 'Dr.');
  
***************
*** 28,37 ****
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename like '$RCSfile: 
test_data-Julian_Bashir.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
test_data-Julian_Bashir.sql,v $', '$Revision: 1.4 $');
  
  -- =============================================
  -- $Log: test_data-Julian_Bashir.sql,v $
  -- Revision 1.4  2004/01/18 21:59:06  ncq
  -- - no clinical data hence no mention in xln_identity
  --
--- 30,42 ----
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename like '$RCSfile: 
test_data-Julian_Bashir.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
test_data-Julian_Bashir.sql,v $', '$Revision: 1.5 $');
  
  -- =============================================
  -- $Log: test_data-Julian_Bashir.sql,v $
+ -- Revision 1.5  2004/06/02 00:14:47  ncq
+ -- - add time zone setting
+ --
  -- Revision 1.4  2004/01/18 21:59:06  ncq
  -- - no clinical data hence no mention in xln_identity
  --


--------------------------------------------------------------
gnumed/gnumed/server/sql/test-data/test_data-Leonard_McCoy.sql  (1.8 -> 1.9)
--------------------------------------------------------------

***************
*** 4,15 ****
  -- author: Karsten Hilbert <address@hidden>
  -- license: GPL
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/test_data-Leonard_McCoy.sql,v
 $
! -- $Revision: 1.8 $
  -- =============================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
  
  -- =============================================
  insert into identity (gender, dob, cob, title)
  values ('m', '1920-1-20', 'US', 'Dr.');
  
--- 4,17 ----
  -- author: Karsten Hilbert <address@hidden>
  -- license: GPL
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/test_data-Leonard_McCoy.sql,v
 $
! -- $Revision: 1.9 $
  -- =============================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
  
  -- =============================================
+ set time zone '+2:00';
+ 
  insert into identity (gender, dob, cob, title)
  values ('m', '1920-1-20', 'US', 'Dr.');
  
***************
*** 31,40 ****
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename like '$RCSfile: 
test_data-Leonard_McCoy.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
test_data-Leonard_McCoy.sql,v $', '$Revision: 1.8 $');
  
  -- =============================================
  -- $Log: test_data-Leonard_McCoy.sql,v $
  -- Revision 1.8  2004/03/18 10:59:24  ncq
  -- - xlnk_id
  --
--- 33,45 ----
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename like '$RCSfile: 
test_data-Leonard_McCoy.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
test_data-Leonard_McCoy.sql,v $', '$Revision: 1.9 $');
  
  -- =============================================
  -- $Log: test_data-Leonard_McCoy.sql,v $
+ -- Revision 1.9  2004/06/02 00:14:47  ncq
+ -- - add time zone setting
+ --
  -- Revision 1.8  2004/03/18 10:59:24  ncq
  -- - xlnk_id
  --


------------------------------------------------------
gnumed/gnumed/server/sql/test-data/test_data-Spock.sql  (1.2 -> 1.3)
------------------------------------------------------

***************
*** 5,16 ****
  -- author: Karsten Hilbert <address@hidden>
  -- license: GPL
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/test_data-Spock.sql,v $
! -- $Revision: 1.2 $
  -- =============================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
  
  -- =============================================
  insert into identity (gender, dob, cob, title)
  values ('m', '1931-03-26', 'US', 'Capt.');
  
--- 5,18 ----
  -- author: Karsten Hilbert <address@hidden>
  -- license: GPL
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/test_data-Spock.sql,v $
! -- $Revision: 1.3 $
  -- =============================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
  
  -- =============================================
+ set time zone '+2:00';
+ 
  insert into identity (gender, dob, cob, title)
  values ('m', '1931-03-26', 'US', 'Capt.');
  
***************
*** 32,41 ****
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename like '$RCSfile: 
test_data-Spock.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
test_data-Spock.sql,v $', '$Revision: 1.2 $');
  
  -- =============================================
  -- $Log: test_data-Spock.sql,v $
  -- Revision 1.2  2004/03/18 10:58:57  ncq
  -- - xlnk_id
  --
--- 34,46 ----
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename like '$RCSfile: 
test_data-Spock.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
test_data-Spock.sql,v $', '$Revision: 1.3 $');
  
  -- =============================================
  -- $Log: test_data-Spock.sql,v $
+ -- Revision 1.3  2004/06/02 00:14:47  ncq
+ -- - add time zone setting
+ --
  -- Revision 1.2  2004/03/18 10:58:57  ncq
  -- - xlnk_id
  --


---------------------------------------------------------------
gnumed/gnumed/server/sql/test-data/test_data-USS_Enterprise.sql  (1.6 -> 1.7)
---------------------------------------------------------------

***************
*** 4,15 ****
  -- author: Karsten Hilbert <address@hidden>
  -- license: GPL
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/test_data-USS_Enterprise.sql,v
 $
! -- $Revision: 1.6 $
  -- =============================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
  
  -- =============================================
  -- pathology lab
  insert into test_org
        (fk_org, fk_adm_contact, fk_med_contact, internal_name, comment)
--- 4,17 ----
  -- author: Karsten Hilbert <address@hidden>
  -- license: GPL
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/test_data-USS_Enterprise.sql,v
 $
! -- $Revision: 1.7 $
  -- =============================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
  
  -- =============================================
+ set time zone '+2:00';
+ 
  -- pathology lab
  insert into test_org
        (fk_org, fk_adm_contact, fk_med_contact, internal_name, comment)
***************
*** 97,106 ****
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename like '$RCSfile: 
test_data-USS_Enterprise.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
test_data-USS_Enterprise.sql,v $', '$Revision: 1.6 $');
  
  -- =============================================
  -- $Log: test_data-USS_Enterprise.sql,v $
  -- Revision 1.6  2004/05/06 23:32:44  ncq
  -- - internal_name now local_name
  -- - technically_abnormal now text
--- 99,111 ----
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename like '$RCSfile: 
test_data-USS_Enterprise.sql,v $';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
test_data-USS_Enterprise.sql,v $', '$Revision: 1.7 $');
  
  -- =============================================
  -- $Log: test_data-USS_Enterprise.sql,v $
+ -- Revision 1.7  2004/06/02 00:14:47  ncq
+ -- - add time zone setting
+ --
  -- Revision 1.6  2004/05/06 23:32:44  ncq
  -- - internal_name now local_name
  -- - technically_abnormal now text


---------------------------------------------------------------
gnumed/gnumed/server/sql/test-data/test_data-lab_regression.sql  (1.2 -> 1.3)
---------------------------------------------------------------

***************
*** 4,15 ****
  -- author: Karsten Hilbert <address@hidden>
  -- license: GPL
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/test_data-lab_regression.sql,v
 $
! -- $Revision: 1.2 $
  -- =============================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
  
  -- =============================================
  -- identity
  -- name
  delete from names where
--- 4,17 ----
  -- author: Karsten Hilbert <address@hidden>
  -- license: GPL
  -- $Source: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/test_data-lab_regression.sql,v
 $
! -- $Revision: 1.3 $
  -- =============================================
  -- force terminate + exit(3) on errors if non-interactive
  \set ON_ERROR_STOP 1
  
  -- =============================================
+ set time zone '+2:00';
+ 
  -- identity
  -- name
  delete from names where
***************
*** 90,99 ****
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename like '%James_Kirk%';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
test_data-lab_regression.sql,v $', '$Revision: 1.2 $');
  
  -- =============================================
  -- $Log: test_data-lab_regression.sql,v $
  -- Revision 1.2  2004/05/30 21:03:29  ncq
  -- - encounter_type.id -> encounter_type.pk
  --
--- 92,104 ----
  -- =============================================
  -- do simple schema revision tracking
  delete from gm_schema_revision where filename like '%James_Kirk%';
! INSERT INTO gm_schema_revision (filename, version) VALUES('$RCSfile: 
test_data-lab_regression.sql,v $', '$Revision: 1.3 $');
  
  -- =============================================
  -- $Log: test_data-lab_regression.sql,v $
+ -- Revision 1.3  2004/06/02 00:14:47  ncq
+ -- - add time zone setting
+ --
  -- Revision 1.2  2004/05/30 21:03:29  ncq
  -- - encounter_type.id -> encounter_type.pk
  --




reply via email to

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