Package Gnumed :: Package wxpython :: Package gui :: Module gmLabJournal |
[frames] | no frames]

# Source Code for Module Gnumed.wxpython.gui.gmLabJournal

     1  """This plugin lets you manage laboratory requests
     2   - add requests
     3   - keep track of pending requests
     4   - see import errors
     5   - review newly imported lab results
     6  """
     7  #============================================================================
     8  # $Source: /home/ncq/Projekte/cvs2git/vcs-mirror/gnumed/gnumed/client/wxpython/gui/gmLabJournal.py,v $
     9  # $Id: gmLabJournal.py,v 1.40 2008-03-06 18:32:31 ncq Exp $
    10  __version__ = "$Revision: 1.40 $"
    11  __author__ = "Sebastian Hilbert <Sebastian.Hilbert@gmx.net>"
    12
    13  import wx
    14
    15  from Gnumed.pycommon import gmI18N
    16  from Gnumed.wxpython import gmLabWidgets, gmPlugin
    17
    18  _log = gmLog.gmDefLog
    19  _log.Log(gmLog.lInfo, __version__)
    20
    21  #============================================================
    22 -class cPluginPanel(wx.Panel):
    23 -        def __init__(self, parent, id):
    24                  # set up widgets
    25                  wx.Panel.__init__(self, parent, id, wxDefaultPosition, wxDefaultSize)
    26
    27                  # make lab notebook
    28                  self.nb = gmLabWidgets.cLabJournalNB(self, -1)
    29
    30                  # just one vertical sizer
    31                  sizer = wx.BoxSizer(wx.VERTICAL)
    32                  szr_nb = wx.NotebookSizer( self.nb )
    33
    34                  sizer.Add(szr_nb, 1, wxEXPAND, 0)
    35                  self.SetAutoLayout(1)
    36                  self.SetSizer(sizer)
    37                  sizer.Fit(self)
    38                  self.Layout()
    39
    40  #------------------------------------------------------------
    41 -class gmLabJournal(gmPlugin.cNotebookPluginOld):
    42          tab_name = _("lab journal")
    43
    44 -        def name (self):
    45                  return gmLabJournal.tab_name
    46
    47 -        def GetWidget (self, parent):
    48                  self._widget = cPluginPanel(parent, -1)
    49                  return self._widget
    50
    51 -        def MenuInfo (self):
    52                  return ('tools', _('Show &lab journal'))
    53
    54 -        def populate_with_data(self):
    55                  # no use reloading if invisible
    56                  if self.gb['main.notebook.raised_plugin'] != self.__class__.__name__:
    57                          return 1
    58                  if self._widget.nb.update() is None:
    59                          _log.Log(gmLog.lErr, "cannot update lab journal with data")
    60                          return None
    61                  return 1
    62
    63 -        def can_receive_focus(self):
    64                  # need patient
    65                  if not self._verify_patient_avail():
    66                          return None
    67                  return 1
    68  #================================================================
    69  # MAIN
    70  #----------------------------------------------------------------
    71  if __name__ == '__main__':
    72          print "do not run standalone like this"
    73  #================================================================
    74