1 """This is a cardiac device interrogation management plugin """
2 __version__ = "$Revision: 1.9 $"
3 __author__ = "Karsten Hilbert <Karsten.Hilbert@gmx.net>"
4
5 import os.path, sys, logging
6
7
8 import wx
9
10
11 from Gnumed.wxpython import gmPlugin, gmDeviceWidgets
12
13 if __name__ == '__main__':
14
15 import sys
16 sys.path.insert(0, '../../../')
17
18 from Gnumed.pycommon import gmI18N
19 gmI18N.activate_locale()
20 gmI18N.install_domain()
21
22
23
24 _log = logging.getLogger('gm.ui')
25 _log.info(__version__)
26
28 """Plugin to encapsulate document tree."""
29
30 tab_name = _("Cardiac Devices")
31
34
38
40 return ('emr', _('Show &cardiac devices'))
41
43
44 if not self._verify_patient_avail():
45 return None
46 return 1
47
49 if not gmPlugin.cNotebookPlugin._on_raise_by_signal(self, **kwds):
50 return False
51 try:
52 if kwds['sort_mode'] == 'review':
53 self._widget._on_sort_by_review_selected(None)
54 except KeyError:
55 pass
56 return True
57
58
59
60 if __name__ == '__main__':
61
62
63 from Gnumed.business import gmPersonSearch
64 from Gnumed.wxpython import gmMeasurementWidgets,gmPatSearchWidgets
65
66 _log.info("starting Notebooked cardiac device input plugin...")
67
68 try:
69
70 patient = gmPersonSearch.ask_for_patient()
71 if patient is None:
72 print "None patient. Exiting gracefully..."
73 sys.exit(0)
74 gmPatSearchWidgets.set_active_patient(patient=patient)
75
76
77 application = wx.wx.PyWidgetTester(size = (800,600))
78 multisash_notes = gmMeasurementWidgets.cCardiacDeviceMeasurementsPnl(application.frame, -1)
79
80 application.frame.Show(True)
81 application.MainLoop()
82
83
84 if patient is not None:
85 try:
86 patient.cleanup()
87 except:
88 print "error cleaning up patient"
89 except StandardError:
90 _log.exception("unhandled exception caught !")
91
92 raise
93
94 _log.info("closing Notebooked cardiac device input plugin...")
95
96