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

Source Code for Module Gnumed.wxpython.gui.gmNotebookedProgressNoteInputPlugin

 1  #====================================================================== 
 2  # GnuMed notebook based progress note input plugin 
 3  # ------------------------------------------------ 
 4  # 
 5  # this plugin displays the list of patient problems 
 6  # together whith a notebook container for progress notes 
 7  # 
 8  # @copyright: author 
 9  #====================================================================== 
10  __version__ = "$Revision: 1.18 $" 
11  __author__ = "Carlos Moro, Karsten Hilbert" 
12  __license__ = 'GPL (details at http://www.gnu.org)' 
13   
14  import logging 
15   
16   
17  if __name__ == '__main__': 
18          # stdlib 
19          import sys 
20          sys.path.insert(0, '../../../') 
21   
22          from Gnumed.pycommon import gmI18N 
23          gmI18N.activate_locale() 
24          gmI18N.install_domain() 
25   
26  # GNUmed 
27  from Gnumed.wxpython import gmPlugin, gmSOAPWidgets 
28   
29   
30  _log = logging.getLogger('gm.ui') 
31  _log.info(__version__) 
32   
33  #====================================================================== 
34 -class gmNotebookedProgressNoteInputPlugin(gmPlugin.cNotebookPlugin):
35 """Plugin to encapsulate notebook based progress note input window.""" 36 37 tab_name = _('Progress notes') 38
39 - def name (self):
41
42 - def GetWidget (self, parent):
43 self._widget = gmSOAPWidgets.cNotebookedProgressNoteInputPanel(parent, -1) 44 return self._widget
45
46 - def MenuInfo (self):
47 return None
48 #return ('emr', _('&Progress notes editor')) 49
50 - def can_receive_focus(self):
51 # need patient 52 if not self._verify_patient_avail(): 53 return None 54 return True
55 #====================================================================== 56 # main 57 #---------------------------------------------------------------------- 58 if __name__ == "__main__": 59 60 # 3rd party 61 import wx 62 63 # GNUmed 64 from Gnumed.business import gmPersonSearch 65 66 _log.info("starting Notebooked progress notes input plugin...") 67 68 try: 69 # obtain patient 70 patient = gmPersonSearch.ask_for_patient() 71 if patient is None: 72 print "None patient. Exiting gracefully..." 73 sys.exit(0) 74 gmPatSearchWidgets.set_active_patient(patient=patient) 75 76 # display standalone multisash progress notes input 77 application = wx.wx.PyWidgetTester(size=(800,600)) 78 multisash_notes = gmSOAPWidgets.cNotebookedProgressNoteInputPanel(application.frame, -1) 79 80 application.frame.Show(True) 81 application.MainLoop() 82 83 # clean up 84 if patient is not None: 85 try: 86 patient.cleanup() 87 except: 88 print "error cleaning up patient" 89 except StandardError: 90 _log.exception("unhandled exception caught !") 91 # but re-raise them 92 raise 93 94 _log.info("closing Notebooked progress notes input plugin...") 95 #====================================================================== 96