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