Trees | Indices | Help |
|
---|
|
1 #====================================================================== 2 # GnuMed patient EMR browser plugin 3 # ---------------------------------------------- 4 # 5 # this plugin holds patient EMR tree 6 # 7 # @copyright: author 8 #====================================================================== 9 __version__ = "$Revision: 1.18 $" 10 __author__ = "Carlos Moro" 11 __license__ = 'GPL (details at http://www.gnu.org)' 12 13 import logging 14 15 16 from Gnumed.wxpython import gmPlugin, gmEMRBrowser 17 from Gnumed.pycommon import gmI18N 18 19 _log = logging.getLogger('gm.ui') 20 _log.info(__version__) 21 22 #======================================================================24 """Plugin to encapsulate patient EMR browser window.""" 25 26 tab_name = _('EMR tree') 27 30 #-------------------------------------------------47 #====================================================================== 48 # main 49 #---------------------------------------------------------------------- 50 if __name__ == "__main__": 51 52 import sys 53 54 import wx 55 56 from Gnumed.exporters import gmPatientExporter 57 from Gnumed.business import gmPerson 58 59 _log.info("starting emr browser plugin...") 60 61 try: 62 # obtain patient 63 patient = gmPerson.ask_for_patient() 64 if patient is None: 65 print "None patient. Exiting gracefully..." 66 sys.exit(0) 67 gmPatSearchWidgets.set_active_patient(patient=patient) 68 69 # display standalone browser 70 application = wx.wxPyWidgetTester(size=(800,600)) 71 emr_browser = gmEMRBrowser.cEMRBrowserPanel(application.frame, -1) 72 emr_browser.refresh_tree() 73 74 application.frame.Show(True) 75 application.MainLoop() 76 77 # clean up 78 if patient is not None: 79 try: 80 patient.cleanup() 81 except: 82 print "error cleaning up patient" 83 except StandardError: 84 _log.exception("unhandled exception caught !") 85 # but re-raise them 86 raise 87 88 _log.info("closing emr browser plugin...") 89 90 #====================================================================== 91 # $Log: gmEMRBrowserPlugin.py,v $ 92 # Revision 1.18 2009/06/29 15:13:25 ncq 93 # - improved placement in menu hierarchy 94 # - add active letters 95 # 96 # Revision 1.17 2009/06/04 16:31:24 ncq 97 # - use set-active-patient from pat-search-widgets 98 # 99 # Revision 1.16 2008/03/06 18:32:30 ncq 100 # - standard lib logging only 101 # 102 # Revision 1.15 2008/01/27 21:21:59 ncq 103 # - no more gmCfg 104 # 105 # Revision 1.14 2007/10/12 07:28:24 ncq 106 # - lots of import related cleanup 107 # 108 # Revision 1.13 2006/10/31 16:06:19 ncq 109 # - no more gmPG 110 # 111 # Revision 1.12 2006/10/25 07:23:30 ncq 112 # - no gmPG no more 113 # 114 # Revision 1.11 2006/05/28 16:18:52 ncq 115 # - use new splitter plugin class 116 # 117 # Revision 1.10 2006/05/04 09:49:20 ncq 118 # - get_clinical_record() -> get_emr() 119 # - adjust to changes in set_active_patient() 120 # - need explicit set_active_patient() after ask_for_patient() if wanted 121 # 122 # Revision 1.9 2005/12/27 19:05:36 ncq 123 # - use gmI18N 124 # 125 # Revision 1.8 2005/09/28 21:38:11 ncq 126 # - more 2.6-ification 127 # 128 # Revision 1.7 2005/09/26 18:01:52 ncq 129 # - use proper way to import wx26 vs wx2.4 130 # - note: THIS WILL BREAK RUNNING THE CLIENT IN SOME PLACES 131 # - time for fixup 132 # 133 # Revision 1.6 2005/06/07 20:56:56 ncq 134 # - take advantage of improved EMR menu 135 # 136 # Revision 1.5 2005/03/29 07:33:47 ncq 137 # - fix naming 138 # 139 # Revision 1.4 2005/03/11 22:53:37 ncq 140 # - ask_for_patient() is now in gmPerson 141 # 142 # Revision 1.3 2004/10/31 00:35:40 cfmoro 143 # Fixed some method names. Added sys import. Refesh browser at startup in standalone mode 144 # 145 # Revision 1.2 2004/09/25 13:12:15 ncq 146 # - switch to from wxPython import wx 147 # 148 # Revision 1.1 2004/09/06 18:59:18 ncq 149 # - Carlos wrote a plugin wrapper for us 150 # 15132 self._widget = gmEMRBrowser.cSplittedEMRTreeBrowserPnl(parent, -1) 33 # self._widget = gmEMRBrowser.cEMRBrowserPanel(parent, -1) 34 # self._widget = gmEMRBrowser.cScrolledEMRTreePnl(parent, -1) 35 # from Gnumed.wxpython import gmMedDocWidgets 36 # self._widget = gmMedDocWidgets.cSelectablySortedDocTreePnl(parent, -1) 37 return self._widget38 #-------------------------------------------------40 return ('emr_show', _('EMR &tree'))41 #-------------------------------------------------
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Feb 4 04:01:35 2010 | http://epydoc.sourceforge.net |