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

Source Code for Module Gnumed.wxpython.gui.gmCardiacDevicePlugin

  1  """ 
  2  This is a cardiac device interrogation management plugin  
  3  """ 
  4  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/wxpython/gui/gmCardiacDevicePlugin.py,v $ 
  5  __version__ = "$Revision: 1.9 $" 
  6  __author__ = "Karsten Hilbert <Karsten.Hilbert@gmx.net>" 
  7  #================================================================ 
  8  import os.path, sys, logging 
  9   
 10   
 11  import wx 
 12   
 13   
 14  from Gnumed.wxpython import gmPlugin, gmDeviceWidgets 
 15   
 16  if __name__ == '__main__': 
 17          # stdlib 
 18          import sys 
 19          sys.path.insert(0, '../../../') 
 20   
 21          from Gnumed.pycommon import gmI18N 
 22          gmI18N.activate_locale() 
 23          gmI18N.install_domain() 
 24   
 25   
 26   
 27  _log = logging.getLogger('gm.ui') 
 28  _log.info(__version__) 
 29  #================================================================ 
30 -class gmCardiacDevicePlugin(gmPlugin.cNotebookPlugin):
31 """Plugin to encapsulate document tree.""" 32 33 tab_name = _("Cardiac Devices") 34
35 - def name (self):
37 #--------------------------------------------------------
38 - def GetWidget (self, parent):
39 self._widget = gmDeviceWidgets.cCardiacDevicePluginPnl(parent, -1) 40 return self._widget
41 #--------------------------------------------------------
42 - def MenuInfo (self):
43 return ('emr', _('Show &cardiac devices'))
44 #--------------------------------------------------------
45 - def can_receive_focus(self):
46 # need patient 47 if not self._verify_patient_avail(): 48 return None 49 return 1
50 #--------------------------------------------------------
51 - def _on_raise_by_signal(self, **kwds):
52 if not gmPlugin.cNotebookPlugin._on_raise_by_signal(self, **kwds): 53 return False 54 try: 55 if kwds['sort_mode'] == 'review': 56 self._widget._on_sort_by_review_selected(None) 57 except KeyError: 58 pass 59 return True
60 #================================================================ 61 # MAIN 62 #---------------------------------------------------------------- 63 if __name__ == '__main__': 64 65 # GNUmed 66 from Gnumed.business import gmPerson 67 from Gnumed.wxpython import gmMeasurementWidgets,gmPatSearchWidgets 68 69 _log.info("starting Notebooked cardiac device input plugin...") 70 71 try: 72 # obtain patient 73 patient = gmPerson.ask_for_patient() 74 if patient is None: 75 print "None patient. Exiting gracefully..." 76 sys.exit(0) 77 gmPatSearchWidgets.set_active_patient(patient=patient) 78 79 # display standalone multisash progress notes input 80 application = wx.wx.PyWidgetTester(size = (800,600)) 81 multisash_notes = gmMeasurementWidgets.cCardiacDeviceMeasurementsPnl(application.frame, -1) 82 83 application.frame.Show(True) 84 application.MainLoop() 85 86 # clean up 87 if patient is not None: 88 try: 89 patient.cleanup() 90 except: 91 print "error cleaning up patient" 92 except StandardError: 93 _log.exception("unhandled exception caught !") 94 # but re-raise them 95 raise 96 97 _log.info("closing Notebooked cardiac device input plugin...") 98 #================================================================ 99 # $Log: gmCardiacDevicePlugin.py,v $ 100 # Revision 1.9 2009/08/08 21:12:17 ncq 101 # - protect against missing keyword argument 102 # 103 # Revision 1.8 2009/07/02 12:14:25 shilbert 104 # - added missing import 105 # 106 # Revision 1.7 2009/06/29 15:13:25 ncq 107 # - improved placement in menu hierarchy 108 # - add active letters 109 # 110 # Revision 1.6 2009/06/04 16:31:24 ncq 111 # - use set-active-patient from pat-search-widgets 112 # 113 # Revision 1.5 2009/04/16 12:51:17 ncq 114 # - cleanup 115 # 116 # Revision 1.4 2009/04/14 18:37:39 shilbert 117 # - description updated 118 # 119 # Revision 1.3 2009/04/13 15:34:55 shilbert 120 # - renamed class cCardiacDeviceMeasurmentPnl to cCardiacDevicePluginPnl 121 # 122 # Revision 1.2 2009/04/12 20:22:12 shilbert 123 # - make it run in pywidgettester 124 # 125 # Revision 1.1 2009/04/09 11:37:37 shilbert 126 # - first iteration of cardiac device management plugin 127