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.7 $" 
 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 ('emr', _('&Notes'))
48 #return None 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 gmPerson 65 from Gnumed.wxpython import gmSOAPWidgets 66 67 _log.info("starting Notebooked progress notes input plugin...") 68 69 try: 70 # obtain patient 71 patient = gmPerson.ask_for_patient() 72 if patient is None: 73 print "None patient. Exiting gracefully..." 74 sys.exit(0) 75 gmPatSearchWidgets.set_active_patient(patient=patient) 76 77 # display standalone multisash progress notes input 78 application = wx.wx.PyWidgetTester(size = (800,600)) 79 multisash_notes = gmSOAPWidgets.cNotebookedProgressNoteInputPanel(application.frame, -1) 80 81 application.frame.Show(True) 82 application.MainLoop() 83 84 # clean up 85 if patient is not None: 86 try: 87 patient.cleanup() 88 except: 89 print "error cleaning up patient" 90 except StandardError: 91 _log.exception("unhandled exception caught !") 92 # but re-raise them 93 raise 94 95 _log.info("closing Notebooked progress notes input plugin...") 96 #====================================================================== 97 # $Log: gmSoapPlugin.py,v $ 98 # Revision 1.7 2010/02/07 15:20:39 ncq 99 # - show this in EMR menu now 100 # 101 # Revision 1.6 2009/08/03 20:51:18 ncq 102 # - don't put it into the menu specifically 103 # 104 # Revision 1.5 2009/06/29 15:13:25 ncq 105 # - improved placement in menu hierarchy 106 # - add active letters 107 # 108 # Revision 1.4 2009/06/04 16:31:24 ncq 109 # - use set-active-patient from pat-search-widgets 110 # 111 # Revision 1.3 2009/04/12 20:12:23 shilbert 112 # - import of gmSOAPWidgets was missing in standalone mode 113 # 114 # Revision 1.2 2009/01/06 18:21:55 ncq 115 # - better tab name 116 # 117 # Revision 1.1 2008/11/20 20:30:49 ncq 118 # - new plugin 119 # 120 # 121