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

Source Code for Module Gnumed.wxpython.gui.gmEMRJournalPlugin

  1  #====================================================================== 
  2  # GnuMed patient EMR Journal plugin 
  3  # ---------------------------------------------- 
  4  # 
  5  # @copyright: author 
  6  #====================================================================== 
  7  __version__ = "$Revision: 1.14 $" 
  8  __author__ = "Karsten Hilbert" 
  9  __license__ = 'GPL (details at http://www.gnu.org)' 
 10   
 11  import logging 
 12   
 13   
 14  from Gnumed.wxpython import gmPlugin, gmEMRBrowser 
 15  from Gnumed.pycommon import gmI18N 
 16   
 17  _log = logging.getLogger('gm.ui') 
 18  _log.info(__version__) 
 19   
 20  #====================================================================== 
21 -class gmEMRJournalPlugin(gmPlugin.cNotebookPlugin):
22 """Plugin to encapsulate patient EMR Journal window.""" 23 24 tab_name = _('EMR journal') 25
26 - def name (self):
28
29 - def GetWidget (self, parent):
30 self._widget = gmEMRBrowser.cEMRJournalPanel(parent, -1) 31 return self._widget
32
33 - def MenuInfo (self):
34 return ('emr_show', _('Chronological &journal'))
35
36 - def can_receive_focus(self):
37 # need patient 38 if not self._verify_patient_avail(): 39 return None 40 return 1
41 42 #====================================================================== 43 # main 44 #---------------------------------------------------------------------- 45 if __name__ == "__main__": 46 47 import sys 48 49 import wx 50 51 from Gnumed.exporters import gmPatientExporter 52 from Gnumed.business import gmPerson 53 54 _log.info("starting emr journal plugin...") 55 56 try: 57 # obtain patient 58 patient = gmPerson.ask_for_patient() 59 if patient is None: 60 print "None patient. Exiting gracefully..." 61 sys.exit(0) 62 gmPatSearchWidgets.set_active_patient(patient=patient) 63 64 # display standalone browser 65 application = wx.wxPyWidgetTester(size=(800,600)) 66 emr_journal = gmEMRBrowser.cEMRJournalPanel(application.frame, -1) 67 emr_journal.refresh_journal() 68 69 application.frame.Show(True) 70 application.MainLoop() 71 72 # clean up 73 if patient is not None: 74 try: 75 patient.cleanup() 76 except: 77 print "error cleaning up patient" 78 except StandardError: 79 _log.exception("unhandled exception caught !") 80 # but re-raise them 81 raise 82 83 _log.info("closing emr journal plugin...") 84 85 #====================================================================== 86 # $Log: gmEMRJournalPlugin.py,v $ 87 # Revision 1.14 2009/06/29 15:13:25 ncq 88 # - improved placement in menu hierarchy 89 # - add active letters 90 # 91 # Revision 1.13 2009/06/04 16:31:24 ncq 92 # - use set-active-patient from pat-search-widgets 93 # 94 # Revision 1.12 2008/03/06 18:32:30 ncq 95 # - standard lib logging only 96 # 97 # Revision 1.11 2008/01/27 21:21:59 ncq 98 # - no more gmCfg 99 # 100 # Revision 1.10 2007/10/21 20:25:43 ncq 101 # - fix syntax error 102 # 103 # Revision 1.9 2007/10/12 07:28:24 ncq 104 # - lots of import related cleanup 105 # 106 # Revision 1.8 2006/10/31 16:06:19 ncq 107 # - no more gmPG 108 # 109 # Revision 1.7 2006/10/25 07:23:30 ncq 110 # - no gmPG no more 111 # 112 # Revision 1.6 2006/05/04 09:49:20 ncq 113 # - get_clinical_record() -> get_emr() 114 # - adjust to changes in set_active_patient() 115 # - need explicit set_active_patient() after ask_for_patient() if wanted 116 # 117 # Revision 1.5 2005/12/27 19:05:36 ncq 118 # - use gmI18N 119 # 120 # Revision 1.4 2005/10/03 13:59:59 sjtan 121 # indentation errors 122 # 123 # Revision 1.3 2005/09/26 18:01:52 ncq 124 # - use proper way to import wx26 vs wx2.4 125 # - note: THIS WILL BREAK RUNNING THE CLIENT IN SOME PLACES 126 # - time for fixup 127 # 128 # Revision 1.2 2005/06/07 20:56:56 ncq 129 # - take advantage of improved EMR menu 130 # 131 # Revision 1.1 2005/04/12 16:26:33 ncq 132 # - added Journal style EMR display plugin 133 # 134