1
2
3
4
5
6
7
8
9
10 __version__ = "$Revision: 1.7 $"
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 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, gmNarrativeWidgets
28 from Gnumed.wxpython import gmAccessPermissionWidgets
29
30
31 _log = logging.getLogger('gm.ui')
32 _log.info(__version__)
36 """Plugin to encapsulate notebook based progress note input window."""
37
38 tab_name = _('Notes')
39 required_minimum_role = 'doctor'
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
50
53
57
59 return ('emr', _('&Notes'))
60
61
63
64 if not self._verify_patient_avail():
65 return None
66 return True
67
68
69
70 if __name__ == "__main__":
71
72
73 import wx
74
75
76 from Gnumed.business import gmPersonSearch
77 from Gnumed.wxpython import gmSOAPWidgets
78
79 _log.info("starting Notebooked progress notes input plugin...")
80
81 try:
82
83 patient = gmPersonSearch.ask_for_patient()
84 if patient is None:
85 print "None patient. Exiting gracefully..."
86 sys.exit(0)
87 gmPatSearchWidgets.set_active_patient(patient=patient)
88
89
90 application = wx.wx.PyWidgetTester(size = (800,600))
91 multisash_notes = gmSOAPWidgets.cNotebookedProgressNoteInputPanel(application.frame, -1)
92
93 application.frame.Show(True)
94 application.MainLoop()
95
96
97 if patient is not None:
98 try:
99 patient.cleanup()
100 except:
101 print "error cleaning up patient"
102 except StandardError:
103 _log.exception("unhandled exception caught !")
104
105 raise
106
107 _log.info("closing Notebooked progress notes input plugin...")
108
109