1
2
3
4
5
6
7
8
9
10
11 __version__ = "$Revision: 1.7 $"
12 __author__ = "Carlos Moro, Karsten Hilbert"
13 __license__ = 'GPL v2 or later (details at http://www.gnu.org)'
14
15 import logging
16
17
18 if __name__ == '__main__':
19
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
28 from Gnumed.wxpython import gmPlugin, gmNarrativeWidgets
29 from Gnumed.wxpython import gmAccessPermissionWidgets
30
31
32 _log = logging.getLogger('gm.ui')
33 _log.info(__version__)
37 """Plugin to encapsulate notebook based progress note input window."""
38
39 tab_name = _('Notes')
40 required_minimum_role = 'full clinical access'
41
42 @gmAccessPermissionWidgets.verify_minimum_required_role (
43 required_minimum_role,
44 activity = _('loading plugin <%s>') % tab_name,
45 return_value_on_failure = False,
46 fail_silently = False
47 )
50
51
54
58
60 return ('emr', _('&Notes'))
61
62
64
65 if not self._verify_patient_avail():
66 return None
67 return True
68
69
70
71 if __name__ == "__main__":
72
73
74 import wx
75
76
77 from Gnumed.business import gmPersonSearch
78 from Gnumed.wxpython import gmSOAPWidgets
79
80 _log.info("starting Notebooked progress notes input plugin...")
81
82 try:
83
84 patient = gmPersonSearch.ask_for_patient()
85 if patient is None:
86 print("None patient. Exiting gracefully...")
87 sys.exit(0)
88 gmPatSearchWidgets.set_active_patient(patient=patient)
89
90
91 application = wx.wx.PyWidgetTester(size = (800,600))
92 multisash_notes = gmSOAPWidgets.cNotebookedProgressNoteInputPanel(application.frame, -1)
93
94 application.frame.Show(True)
95 application.MainLoop()
96
97
98 if patient is not None:
99 try:
100 patient.cleanup()
101 except:
102 print("error cleaning up patient")
103 except Exception:
104 _log.exception("unhandled exception caught !")
105
106 raise
107
108 _log.info("closing Notebooked progress notes input plugin...")
109
110