| Home | Trees | Indices | Help |
|
|---|
|
|
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 v2 or later (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 from Gnumed.wxpython import gmAccessPermissionWidgets
30
31
32 _log = logging.getLogger('gm.ui')
33 _log.info(__version__)
34 #======================================================================
35 -class gmNotebookedPatientEditionPlugin(gmPlugin.cNotebookPlugin):
36 """Plugin to encapsulate notebooked patient edition window."""
37
38 tab_name = _('Demographics')
39 required_minimum_role = 'staff'
40
41 @gmAccessPermissionWidgets.verify_minimum_required_role (
42 required_minimum_role,
43 activity = _('loading plugin <%s>') % tab_name,
44 return_value_on_failure = False,
45 fail_silently = False
46 )
49 #-------------------------------------------------
52
54 self._widget = gmDemographicsWidgets.cNotebookedPatEditionPanel(parent, -1)
55 return self._widget
56
58 return ('patient', _('&Demographics'))
59
65
66 #======================================================================
67 # main
68 #----------------------------------------------------------------------
69 if __name__ == "__main__":
70
71 # 3rd party
72 import wx
73
74 # GNUmed
75 from Gnumed.business import gmPersonSearch
76
77 _log.info("starting Notebooked patient edition plugin...")
78
79 try:
80 # obtain patient
81 patient = gmPersonSearch.ask_for_patient()
82 if patient is None:
83 print "None patient. Exiting gracefully..."
84 sys.exit(0)
85 gmPatSearchWidgets.set_active_patient(patient=patient)
86
87 # display standalone notebooked patient editor
88 application = wx.PyWidgetTester(size=(800,600))
89 application.SetWidget(gmDemographicsWidgets.cNotebookedPatEditionPanel, -1)
90
91 application.frame.Show(True)
92 application.MainLoop()
93
94 # clean up
95 if patient is not None:
96 try:
97 patient.cleanup()
98 except:
99 print "error cleaning up patient"
100 except StandardError:
101 _log.exception("unhandled exception caught !")
102 # but re-raise them
103 raise
104
105 _log.info("closing Notebooked progress notes input plugin...")
106
107 #======================================================================
108
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Fri Jul 12 03:57:03 2013 | http://epydoc.sourceforge.net |