1
2 __doc__ = """ This is the EMR Timeline plugin."""
3
4
5 __author__ = "karsten.hilbert@gmx.net"
6 __license__ = "GPL v2 or later"
7
8 import logging
9
10
11 import wx
12
13
14 from Gnumed.wxpython import gmPlugin, gmEMRTimelineWidgets
15 from Gnumed.wxpython import gmAccessPermissionWidgets
19
20 tab_name = _("EMR Timeline")
21 required_minimum_role = 'full clinical access'
22
23 @gmAccessPermissionWidgets.verify_minimum_required_role (
24 required_minimum_role,
25 activity = _('loading plugin <%s>') % tab_name,
26 return_value_on_failure = False,
27 fail_silently = False
28 )
31
34
38
40 return ('emr', _('EMR &Timeline'))
41
43 if not self._verify_patient_avail():
44 return None
45 return 1
46
48 if not gmPlugin.cNotebookPlugin._on_raise_by_signal(self, **kwds):
49 return False
50 try:
51 pass
52 except KeyError:
53 pass
54 return True
55
56
57
58 if __name__ == '__main__':
59
60
61 import sys
62 sys.path.insert(0, '../../../')
63
64 from Gnumed.pycommon import gmI18N
65 gmI18N.activate_locale()
66 gmI18N.install_domain()
67
68
69 from Gnumed.business import gmPersonSearch
70 from Gnumed.wxpython import gmPatSearchWidgets
71
72 _log.info("starting template plugin...")
73
74
75 patient = gmPersonSearch.ask_for_patient()
76 if patient is None:
77 print("None patient. Exiting gracefully...")
78 sys.exit(0)
79 gmPatSearchWidgets.set_active_patient(patient=patient)
80
81
82 application = wx.wx.PyWidgetTester(size = (800,600))
83 widgets = gmExamplePluginWidgets.cExamplePluginPnl(application.frame, -1)
84
85 application.frame.Show(True)
86 application.MainLoop()
87
88
89 if patient is not None:
90 try:
91 patient.cleanup()
92 except Exception:
93 print("error cleaning up patient")
94
95 _log.info("closing example plugin...")
96