1
2
3
4
5
6
7
8
9
10 __author__ = "Carlos Moro, Karsten Hilbert"
11 __license__ = 'GPL v2 or later (details at http://www.gnu.org)'
12
13 import logging
14
15
16 if __name__ == '__main__':
17
18
19 import sys
20 sys.path.insert(0, '../../../')
21
22 from Gnumed.pycommon import gmI18N
23 gmI18N.activate_locale()
24 gmI18N.install_domain()
25
26
27 from Gnumed.wxpython import gmPlugin, gmDemographicsWidgets
28 from Gnumed.wxpython import gmAccessPermissionWidgets
29
30
31 _log = logging.getLogger('gm.ui')
34 """Plugin to encapsulate notebooked patient edition window."""
35
36 tab_name = _('Demographics')
37 required_minimum_role = 'non-clinical access'
38
39 @gmAccessPermissionWidgets.verify_minimum_required_role (
40 required_minimum_role,
41 activity = _('loading plugin <%s>') % tab_name,
42 return_value_on_failure = False,
43 fail_silently = False
44 )
47
50
54
56 return ('patient', _('&Demographics'))
57
59
60 if not self._verify_patient_avail():
61 return None
62 return 1
63
64
65
66
67 if __name__ == "__main__":
68
69
70 import wx
71
72
73 from Gnumed.business import gmPersonSearch
74
75 _log.info("starting Notebooked patient edition plugin...")
76
77 try:
78
79 patient = gmPersonSearch.ask_for_patient()
80 if patient is None:
81 print "None patient. Exiting gracefully..."
82 sys.exit(0)
83 gmPatSearchWidgets.set_active_patient(patient=patient)
84
85
86 application = wx.PyWidgetTester(size=(800,600))
87 application.SetWidget(gmDemographicsWidgets.cNotebookedPatEditionPanel, -1)
88
89 application.frame.Show(True)
90 application.MainLoop()
91
92
93 if patient is not None:
94 try:
95 patient.cleanup()
96 except:
97 print "error cleaning up patient"
98 except StandardError:
99 _log.exception("unhandled exception caught !")
100
101 raise
102
103 _log.info("closing Notebooked progress notes input plugin...")
104
105
106