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

Source Code for Module Gnumed.wxpython.gui.gmNotebookedPatientEditionPlugin

  1  #====================================================================== 
  2  # GnuMed notebook based patient edition plugin 
  3  # ------------------------------------------------ 
  4  # 
  5  # this plugin displays a notebook container for patient edition 
  6  # current pages (0.1): identity, contacts, occupation 
  7  # 
  8  # @copyright: author 
  9  #====================================================================== 
 10  __version__ = "$Revision: 1.15 $" 
 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   
 19          # stdlib 
 20          import sys 
 21          sys.path.insert(0, '../../../') 
 22   
 23          from Gnumed.pycommon import gmI18N 
 24          gmI18N.activate_locale() 
 25          gmI18N.install_domain() 
 26   
 27  # GNUmed 
 28  from Gnumed.wxpython import gmPlugin, gmDemographicsWidgets 
 29   
 30   
 31  _log = logging.getLogger('gm.ui') 
 32  _log.info(__version__) 
 33  #====================================================================== 
34 -class gmNotebookedPatientEditionPlugin(gmPlugin.cNotebookPlugin):
35 """Plugin to encapsulate notebooked patient edition window.""" 36 37 tab_name = _('Demographics') 38
39 - def name (self):
41
42 - def GetWidget (self, parent):
43 self._widget = gmDemographicsWidgets.cNotebookedPatEditionPanel(parent, -1) 44 return self._widget
45
46 - def MenuInfo (self):
47 return ('patient', _('&Demographics'))
48
49 - def can_receive_focus(self):
50 # need patient 51 if not self._verify_patient_avail(): 52 return None 53 return 1
54 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 66 _log.info("starting Notebooked patient edition plugin...") 67 68 try: 69 # obtain patient 70 patient = gmPerson.ask_for_patient() 71 if patient is None: 72 print "None patient. Exiting gracefully..." 73 sys.exit(0) 74 gmPatSearchWidgets.set_active_patient(patient=patient) 75 76 # display standalone notebooked patient editor 77 application = wx.PyWidgetTester(size=(800,600)) 78 application.SetWidget(gmDemographicsWidgets.cNotebookedPatEditionPanel, -1) 79 80 application.frame.Show(True) 81 application.MainLoop() 82 83 # clean up 84 if patient is not None: 85 try: 86 patient.cleanup() 87 except: 88 print "error cleaning up patient" 89 except StandardError: 90 _log.exception("unhandled exception caught !") 91 # but re-raise them 92 raise 93 94 _log.info("closing Notebooked progress notes input plugin...") 95 96 #====================================================================== 97 # $Log: gmNotebookedPatientEditionPlugin.py,v $ 98 # Revision 1.15 2009/07/23 16:43:03 ncq 99 # - better name 100 # 101 # Revision 1.14 2009/06/29 15:13:25 ncq 102 # - improved placement in menu hierarchy 103 # - add active letters 104 # 105 # Revision 1.13 2009/06/20 12:48:08 ncq 106 # - rename to Demographics as per list 107 # 108 # Revision 1.12 2009/06/04 16:31:24 ncq 109 # - use set-active-patient from pat-search-widgets 110 # 111 # Revision 1.11 2008/03/06 18:32:31 ncq 112 # - standard lib logging only 113 # 114 # Revision 1.10 2008/01/27 21:21:59 ncq 115 # - no more gmCfg 116 # 117 # Revision 1.9 2008/01/22 12:26:24 ncq 118 # - better tab names 119 # 120 # Revision 1.8 2006/12/15 16:31:32 ncq 121 # - fix test suite 122 # 123 # Revision 1.7 2006/10/31 16:06:19 ncq 124 # - no more gmPG 125 # 126 # Revision 1.6 2006/10/25 07:23:30 ncq 127 # - no gmPG no more 128 # 129 # Revision 1.5 2006/05/04 09:49:20 ncq 130 # - get_clinical_record() -> get_emr() 131 # - adjust to changes in set_active_patient() 132 # - need explicit set_active_patient() after ask_for_patient() if wanted 133 # 134 # Revision 1.4 2005/10/03 13:49:21 sjtan 135 # using new wx. temporary debugging to stdout(easier to read). where is rfe ? 136 # 137 # Revision 1.3 2005/09/26 18:01:52 ncq 138 # - use proper way to import wx26 vs wx2.4 139 # - note: THIS WILL BREAK RUNNING THE CLIENT IN SOME PLACES 140 # - time for fixup 141 # 142 # Revision 1.2 2005/05/26 15:57:03 ncq 143 # - slightly better strings 144 # 145 # Revision 1.1 2005/05/25 22:52:47 cfmoro 146 # Added notebooked patient edition plugin 147 # 148