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