1 """ This is the EMR Timeline plugin."""
2
3 __author__ = "karsten.hilbert@gmx.net"
4 __license__ = "GPL v2 or later"
5
6
7 import logging
8
9
10 import wx
11
12
13 from Gnumed.wxpython import gmPlugin, gmEMRTimelineWidgets
14
15
16 _log = logging.getLogger('gm.ui')
17
19 tab_name = _("EMR Timeline")
20
23
27
29 return ('emr', _('Show &Timeline'))
30
32 if not self._verify_patient_avail():
33 return None
34 return 1
35
37 if not gmPlugin.cNotebookPlugin._on_raise_by_signal(self, **kwds):
38 return False
39 try:
40 pass
41 except KeyError:
42 pass
43 return True
44
45
46
47 if __name__ == '__main__':
48
49
50 import sys
51 sys.path.insert(0, '../../../')
52
53 from Gnumed.pycommon import gmI18N
54 gmI18N.activate_locale()
55 gmI18N.install_domain()
56
57
58 from Gnumed.business import gmPersonSearch
59 from Gnumed.wxpython import gmPatSearchWidgets
60
61 _log.info("starting template plugin...")
62
63 try:
64
65 patient = gmPersonSearch.ask_for_patient()
66 if patient is None:
67 print "None patient. Exiting gracefully..."
68 sys.exit(0)
69 gmPatSearchWidgets.set_active_patient(patient=patient)
70
71
72 application = wx.wx.PyWidgetTester(size = (800,600))
73 widgets = gmExamplePluginWidgets.cExamplePluginPnl(application.frame, -1)
74
75 application.frame.Show(True)
76 application.MainLoop()
77
78
79 if patient is not None:
80 try:
81 patient.cleanup()
82 except:
83 print "error cleaning up patient"
84 except StandardError:
85 _log.exception("unhandled exception caught !")
86
87 raise
88
89 _log.info("closing example plugin...")
90