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

Source Code for Module Gnumed.wxpython.gui.gmLabJournal

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