1
2
3
4
5
6
7 __version__ = "$Revision: 1.15 $"
8 __author__ = "Karsten Hilbert"
9 __license__ = 'GPL v2 or later (details at http://www.gnu.org)'
10
11 import logging
12
13
14 from Gnumed.wxpython import gmPlugin, gmEMRBrowser
15 from Gnumed.pycommon import gmI18N
16
17 _log = logging.getLogger('gm.ui')
18 _log.info(__version__)
19
20
22 """Plugin to encapsulate patient EMR Journal window."""
23
24 tab_name = _('EMR journal')
25
28
32
34
35 return ('emr', _('Chronological &journal'))
36
38
39 if not self._verify_patient_avail():
40 return None
41 return 1
42
43
44
45
46 if __name__ == "__main__":
47
48 import sys
49
50 import wx
51
52 from Gnumed.exporters import gmPatientExporter
53 from Gnumed.business import gmPersonSearch
54
55 _log.info("starting emr journal plugin...")
56
57 try:
58
59 patient = gmPersonSearch.ask_for_patient()
60 if patient is None:
61 print "None patient. Exiting gracefully..."
62 sys.exit(0)
63 gmPatSearchWidgets.set_active_patient(patient=patient)
64
65
66 application = wx.wxPyWidgetTester(size=(800,600))
67 emr_journal = gmEMRBrowser.cEMRJournalPanel(application.frame, -1)
68 emr_journal.refresh_journal()
69
70 application.frame.Show(True)
71 application.MainLoop()
72
73
74 if patient is not None:
75 try:
76 patient.cleanup()
77 except:
78 print "error cleaning up patient"
79 except StandardError:
80 _log.exception("unhandled exception caught !")
81
82 raise
83
84 _log.info("closing emr journal plugin...")
85
86
87