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

Source Code for Module Gnumed.wxpython.gui.gmSoapPlugin

  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.6 $" 
 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, gmNarrativeWidgets 
 28   
 29   
 30  _log = logging.getLogger('gm.ui') 
 31  _log.info(__version__) 
 32   
 33  #====================================================================== 
34 -class gmSoapPlugin(gmPlugin.cNotebookPlugin):
35 """Plugin to encapsulate notebook based progress note input window.""" 36 37 tab_name = _('Notes') 38
39 - def name (self):
41
42 - def GetWidget (self, parent):
43 self._widget = gmNarrativeWidgets.cSoapPluginPnl(parent, -1) 44 return self._widget
45
46 - def MenuInfo (self):
47 return None
48
49 - def can_receive_focus(self):
50 # need patient 51 if not self._verify_patient_avail(): 52 return None 53 return True
54 #====================================================================== 55 # main 56 #---------------------------------------------------------------------- 57 if __name__ == "__main__": 58 59 # 3rd party 60 import wx 61 62 # GNUmed 63 from Gnumed.business import gmPerson 64 from Gnumed.wxpython import gmSOAPWidgets 65 66 _log.info("starting Notebooked progress notes input plugin...") 67 68 try: 69 # obtain patient 70 patient = gmPerson.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 # $Log: gmSoapPlugin.py,v $ 97 # Revision 1.6 2009/08/03 20:51:18 ncq 98 # - don't put it into the menu specifically 99 # 100 # Revision 1.5 2009/06/29 15:13:25 ncq 101 # - improved placement in menu hierarchy 102 # - add active letters 103 # 104 # Revision 1.4 2009/06/04 16:31:24 ncq 105 # - use set-active-patient from pat-search-widgets 106 # 107 # Revision 1.3 2009/04/12 20:12:23 shilbert 108 # - import of gmSOAPWidgets was missing in standalone mode 109 # 110 # Revision 1.2 2009/01/06 18:21:55 ncq 111 # - better tab name 112 # 113 # Revision 1.1 2008/11/20 20:30:49 ncq 114 # - new plugin 115 # 116 # 117