Home | Trees | Indices | Help |
|
---|
|
1 """ This is the EMR Timeline plugin.""" 2 3 __author__ = "karsten.hilbert@gmx.net" 4 __license__ = "GPL v2 or later" 5 6 #================================================================ 7 import logging 8 9 10 import wx 11 12 13 from Gnumed.wxpython import gmPlugin, gmEMRTimelineWidgets 14 from Gnumed.wxpython import gmAccessPermissionWidgets 15 16 17 _log = logging.getLogger('gm.ui')18 #================================================================ 19 -class gmEMRTimelinePlugin(gmPlugin.cNotebookPlugin):20 tab_name = _("EMR Timeline") 21 required_minimum_role = 'doctor' 22 23 @gmAccessPermissionWidgets.verify_minimum_required_role ( 24 required_minimum_role, 25 activity = _('loading plugin <%s>') % tab_name, 26 return_value_on_failure = False, 27 fail_silently = False 28 ) 31 #------------------------------------------------- 34 #-------------------------------------------------------- 38 #--------------------------------------------------------55 #================================================================ 56 # MAIN 57 #---------------------------------------------------------------- 58 if __name__ == '__main__': 59 60 # stdlib 61 import sys 62 sys.path.insert(0, '../../../') 63 64 from Gnumed.pycommon import gmI18N 65 gmI18N.activate_locale() 66 gmI18N.install_domain() 67 68 # GNUmed 69 from Gnumed.business import gmPersonSearch 70 from Gnumed.wxpython import gmPatSearchWidgets 71 72 _log.info("starting template plugin...") 73 74 try: 75 # obtain patient 76 patient = gmPersonSearch.ask_for_patient() 77 if patient is None: 78 print "None patient. Exiting gracefully..." 79 sys.exit(0) 80 gmPatSearchWidgets.set_active_patient(patient=patient) 81 82 # display the plugin standalone 83 application = wx.wx.PyWidgetTester(size = (800,600)) 84 widgets = gmExamplePluginWidgets.cExamplePluginPnl(application.frame, -1) 85 86 application.frame.Show(True) 87 application.MainLoop() 88 89 # clean up 90 if patient is not None: 91 try: 92 patient.cleanup() 93 except: 94 print "error cleaning up patient" 95 except StandardError: 96 _log.exception("unhandled exception caught !") 97 # but re-raise them 98 raise 99 100 _log.info("closing example plugin...") 10140 return ('emr', _('Show &Timeline'))41 #-------------------------------------------------------- 46 #--------------------------------------------------------48 if not gmPlugin.cNotebookPlugin._on_raise_by_signal(self, **kwds): 49 return False 50 try: 51 pass 52 except KeyError: 53 pass 54 return True
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Aug 3 03:56:37 2013 | http://epydoc.sourceforge.net |