1
2 """This is a cardiac device interrogation management plugin """
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
27 """Plugin to encapsulate document tree."""
28
29 tab_name = _("Cardiac Devices")
30
33
37
39 return ('emr', _('Show &cardiac devices'))
40
42
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 if kwds['sort_mode'] == 'review':
52 self._widget._on_sort_by_review_selected(None)
53 except KeyError:
54 pass
55 return True
56
57
58
59 if __name__ == '__main__':
60
61
62 from Gnumed.business import gmPersonSearch
63 from Gnumed.wxpython import gmMeasurementWidgets,gmPatSearchWidgets
64
65 _log.info("starting Notebooked cardiac device input plugin...")
66
67
68 patient = gmPersonSearch.ask_for_patient()
69 if patient is None:
70 print "None patient. Exiting gracefully..."
71 sys.exit(0)
72 gmPatSearchWidgets.set_active_patient(patient=patient)
73
74
75 application = wx.wx.PyWidgetTester(size = (800,600))
76 multisash_notes = gmMeasurementWidgets.cCardiacDeviceMeasurementsPnl(application.frame, -1)
77
78 application.frame.Show(True)
79 application.MainLoop()
80
81
82 if patient is not None:
83 try:
84 patient.cleanup()
85 except Exception:
86 print "error cleaning up patient"
87
88 _log.info("closing Notebooked cardiac device input plugin...")
89
90