1
2
3
4
5 import wx
6
7
8
9
10
11
14
15 from Gnumed.wxpython.gmNarrativeWidgets import cSoapNoteInputNotebook
16 from Gnumed.wxpython.gmNarrativeWidgets import cVisualSoapPnl
17 from Gnumed.wxpython.gmDateTimeInput import cFuzzyTimestampInput
18 from Gnumed.wxpython.gmEMRStructWidgets import cEncounterTypePhraseWheel
19 from Gnumed.wxpython.gmCodingWidgets import cGenericCodesPhraseWheel
20 from Gnumed.wxpython import gmListWidgets
21
22
23 kwds["style"] = wx.NO_BORDER|wx.TAB_TRAVERSAL
24 wx.Panel.__init__(self, *args, **kwds)
25 self._splitter_main = wx.SplitterWindow(self, -1, style=wx.SP_3D|wx.SP_BORDER|wx.SP_PERMIT_UNSPLIT)
26 self.__splitter_main_right_pnl = wx.Panel(self._splitter_main, -1, style=wx.NO_BORDER|wx.TAB_TRAVERSAL)
27 self._splitter_right = wx.SplitterWindow(self.__splitter_main_right_pnl, -1, style=wx.SP_3D|wx.SP_BORDER|wx.SP_PERMIT_UNSPLIT)
28 self.__splitter_right_bottom_pnl = wx.Panel(self._splitter_right, -1, style=wx.NO_BORDER|wx.TAB_TRAVERSAL)
29 self.__splitter_right_top_pnl = wx.Panel(self._splitter_right, -1, style=wx.NO_BORDER|wx.TAB_TRAVERSAL)
30 self._NB_soap_editors = cSoapNoteInputNotebook(self.__splitter_right_top_pnl, -1, style=0)
31 self.__splitter_main_left_pnl = wx.Panel(self._splitter_main, -1, style=wx.NO_BORDER)
32 self._splitter_left = wx.SplitterWindow(self.__splitter_main_left_pnl, -1, style=wx.SP_3D|wx.SP_BORDER|wx.SP_PERMIT_UNSPLIT)
33 self.__splitter_left_bottom_pnl = wx.Panel(self._splitter_left, -1, style=wx.NO_BORDER)
34 self.__splitter_left_top_pnl = wx.Panel(self._splitter_left, -1, style=wx.NO_BORDER)
35 self._SZR_recent_notes_staticbox = wx.StaticBox(self.__splitter_left_bottom_pnl, -1, _("Most recent notes on above problem"))
36 self.__szr_top_right_staticbox = wx.StaticBox(self.__splitter_right_top_pnl, -1, _("New notelets in current encounter"))
37 self.__szr_bottom_right_staticbox = wx.StaticBox(self.__splitter_right_bottom_pnl, -1, _("Tips and hints"))
38 self._SZR_problem_list_staticbox = wx.StaticBox(self.__splitter_left_top_pnl, -1, _("Active problems"))
39 self._CHBOX_show_closed_episodes = wx.CheckBox(self.__splitter_left_top_pnl, -1, _("Closed episodes"))
40 self._CHBOX_irrelevant_issues = wx.CheckBox(self.__splitter_left_top_pnl, -1, _("Non-relevant issues"))
41 self._LCTRL_active_problems = gmListWidgets.cReportListCtrl(self.__splitter_left_top_pnl, -1, style=wx.LC_REPORT|wx.NO_BORDER)
42 self._TCTRL_recent_notes = wx.TextCtrl(self.__splitter_left_bottom_pnl, -1, _("In this area GNUmed will place the notes of the\nprevious encounter as well as notes by other\nstaff for the current encounter.\n\nNote that this may change depending on which\nactive problem is selected in the editor below."), style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_WORDWRAP|wx.NO_BORDER)
43 self._PRW_encounter_type = cEncounterTypePhraseWheel(self.__splitter_right_top_pnl, -1, "", style=wx.NO_BORDER)
44 self._PRW_encounter_start = cFuzzyTimestampInput(self.__splitter_right_top_pnl, -1, "", style=wx.NO_BORDER)
45 self._PRW_encounter_end = cFuzzyTimestampInput(self.__splitter_right_top_pnl, -1, "", style=wx.NO_BORDER)
46 self._TCTRL_rfe = wx.TextCtrl(self.__splitter_right_top_pnl, -1, "", style=wx.NO_BORDER)
47 self._PRW_rfe_codes = cGenericCodesPhraseWheel(self.__splitter_right_top_pnl, -1, "", style=wx.NO_BORDER)
48 self.notebook_1_pane_1 = wx.Panel(self._NB_soap_editors, -1)
49 self._TCTRL_aoe = wx.TextCtrl(self.__splitter_right_top_pnl, -1, "", style=wx.NO_BORDER)
50 self._PRW_aoe_codes = cGenericCodesPhraseWheel(self.__splitter_right_top_pnl, -1, "", style=wx.NO_BORDER)
51 self._BTN_new_editor = wx.Button(self.__splitter_right_top_pnl, -1, _("&New"), style=wx.BU_EXACTFIT)
52 self._BTN_clear_editor = wx.Button(self.__splitter_right_top_pnl, -1, _("&Clear"), style=wx.BU_EXACTFIT)
53 self._BTN_discard_editor = wx.Button(self.__splitter_right_top_pnl, -1, _("&Discard"), style=wx.BU_EXACTFIT)
54 self._BTN_save_note = wx.Button(self.__splitter_right_top_pnl, -1, _("&Save"), style=wx.BU_EXACTFIT)
55 self._BTN_save_note_under = wx.Button(self.__splitter_right_top_pnl, -1, _("Save &under"), style=wx.BU_EXACTFIT)
56 self._BTN_image = wx.Button(self.__splitter_right_top_pnl, -1, _("&Image"), style=wx.BU_EXACTFIT)
57 self._BTN_new_encounter = wx.Button(self.__splitter_right_top_pnl, -1, _("New"), style=wx.BU_EXACTFIT)
58 self._BTN_save_encounter = wx.Button(self.__splitter_right_top_pnl, -1, _("Save"), style=wx.BU_EXACTFIT)
59 self._BTN_save_all = wx.Button(self.__splitter_right_top_pnl, -1, _("Save &all"), style=wx.BU_EXACTFIT)
60 self._lbl_hints = wx.StaticText(self.__splitter_right_bottom_pnl, -1, _("In this area GNUmed will place hints and tips\nrelated to the current progress note and patient.\n\nThose hints will be derived from a variety of\nsources such as classifications (ICD, ...), expert\nsystems (EGADDS), online resources (Google\nand friends), drug databases, etc.\n\nEventually, those hints will be active in that you\ncan click on them and be taken to the relevant\ninformation/an appropriate action be performed."))
61
62 self.__set_properties()
63 self.__do_layout()
64
65 self.Bind(wx.EVT_CHECKBOX, self._on_show_closed_episodes_checked, self._CHBOX_show_closed_episodes)
66 self.Bind(wx.EVT_CHECKBOX, self._on_irrelevant_issues_checked, self._CHBOX_irrelevant_issues)
67 self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_problem_selected, self._LCTRL_active_problems)
68 self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self._on_problem_activated, self._LCTRL_active_problems)
69 self.Bind(wx.EVT_LIST_ITEM_FOCUSED, self._on_problem_focused, self._LCTRL_active_problems)
70 self.Bind(wx.EVT_BUTTON, self._on_new_editor_button_pressed, self._BTN_new_editor)
71 self.Bind(wx.EVT_BUTTON, self._on_clear_editor_button_pressed, self._BTN_clear_editor)
72 self.Bind(wx.EVT_BUTTON, self._on_discard_editor_button_pressed, self._BTN_discard_editor)
73 self.Bind(wx.EVT_BUTTON, self._on_save_note_button_pressed, self._BTN_save_note)
74 self.Bind(wx.EVT_BUTTON, self._on_save_note_under_button_pressed, self._BTN_save_note_under)
75 self.Bind(wx.EVT_BUTTON, self._on_image_button_pressed, self._BTN_image)
76 self.Bind(wx.EVT_BUTTON, self._on_new_encounter_button_pressed, self._BTN_new_encounter)
77 self.Bind(wx.EVT_BUTTON, self._on_save_encounter_button_pressed, self._BTN_save_encounter)
78 self.Bind(wx.EVT_BUTTON, self._on_save_all_button_pressed, self._BTN_save_all)
79
80
82
83 self._CHBOX_show_closed_episodes.SetToolTipString(_("Show closed episodes as pseudo-problems ?"))
84 self._CHBOX_irrelevant_issues.SetToolTipString(_("Show issues marked clinically NOT relevant."))
85 self._LCTRL_active_problems.SetToolTipString(_("This shows the list of active problems, They include open episodes as well as active health issues."))
86 self._TCTRL_recent_notes.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE))
87 self._PRW_encounter_type.SetToolTipString(_("Select the type of encounter."))
88 self._PRW_encounter_start.SetToolTipString(_("Date and time when the current (!) encounter started."))
89 self._PRW_encounter_end.SetToolTipString(_("Date and time when the current (!) encounter ends."))
90 self._TCTRL_rfe.SetToolTipString(_("This documents why the encounter takes place.\n\nIt may be due to a patient request or it may be prompted by other reasons. Often initially collected at the front desk and put into a waiting list comment. May turn out to just be a proxy request for why the patient really is here.\n\nAlso known as the Reason For Encounter/Visit (RFE)."))
91 self._PRW_rfe_codes.SetToolTipString(_("Enter codes relevant to this Reason for Encounter."))
92 self._TCTRL_aoe.SetToolTipString(_("This summarizes the outcome/assessment of the consultation from the doctors point of view. Note that this summary spans all the problems discussed during this encounter."))
93 self._PRW_aoe_codes.SetToolTipString(_("Enter codes relevant to this Outcome of Encounter."))
94 self._BTN_new_editor.SetToolTipString(_("Open a new progress note editor.\n\nThere is a configuration item on whether to allow several new-episode editors at once."))
95 self._BTN_clear_editor.SetToolTipString(_("Clear the editor for the displayed progress note."))
96 self._BTN_discard_editor.SetToolTipString(_("Discard the editor for the displayed progress note."))
97 self._BTN_save_note.SetToolTipString(_("Save the currently displayed progress note under the current encounter."))
98 self._BTN_save_note_under.SetToolTipString(_("Save the currently displayed note into an encounter selected from a list of encounters."))
99 self._BTN_image.SetToolTipString(_("Add a visual progress note for this episode."))
100 self._BTN_new_encounter.SetToolTipString(_("Start a new encounter. If there are any changes to the current encounter you will be asked whether to save them."))
101 self._BTN_save_encounter.SetToolTipString(_("Save the encounter details."))
102 self._BTN_save_all.SetToolTipString(_("Save encounter details and all progress notes."))
103
104
106
107 __szr_main = wx.BoxSizer(wx.HORIZONTAL)
108 __szr_right = wx.BoxSizer(wx.VERTICAL)
109 __szr_bottom_right = wx.StaticBoxSizer(self.__szr_bottom_right_staticbox, wx.VERTICAL)
110 __szr_top_right = wx.StaticBoxSizer(self.__szr_top_right_staticbox, wx.VERTICAL)
111 __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
112 __szr_aoe = wx.BoxSizer(wx.HORIZONTAL)
113 __gszr_encounter_details = wx.FlexGridSizer(2, 2, 2, 5)
114 __szr_rfe_details = wx.BoxSizer(wx.HORIZONTAL)
115 __szr_encounter_details = wx.BoxSizer(wx.HORIZONTAL)
116 __szr_left = wx.BoxSizer(wx.HORIZONTAL)
117 _SZR_recent_notes = wx.StaticBoxSizer(self._SZR_recent_notes_staticbox, wx.VERTICAL)
118 _SZR_problem_list = wx.StaticBoxSizer(self._SZR_problem_list_staticbox, wx.VERTICAL)
119 __szr_problem_filter = wx.BoxSizer(wx.HORIZONTAL)
120 __lbl_problem_filter = wx.StaticText(self.__splitter_left_top_pnl, -1, _("Include:"))
121 __szr_problem_filter.Add(__lbl_problem_filter, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 10)
122 __szr_problem_filter.Add(self._CHBOX_show_closed_episodes, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
123 __szr_problem_filter.Add(self._CHBOX_irrelevant_issues, 0, wx.ALIGN_CENTER_VERTICAL, 0)
124 __szr_problem_filter.Add((20, 20), 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
125 _SZR_problem_list.Add(__szr_problem_filter, 0, wx.EXPAND, 0)
126 _SZR_problem_list.Add(self._LCTRL_active_problems, 1, wx.EXPAND, 0)
127 self.__splitter_left_top_pnl.SetSizer(_SZR_problem_list)
128 _SZR_recent_notes.Add(self._TCTRL_recent_notes, 1, wx.EXPAND, 0)
129 self.__splitter_left_bottom_pnl.SetSizer(_SZR_recent_notes)
130 self._splitter_left.SplitHorizontally(self.__splitter_left_top_pnl, self.__splitter_left_bottom_pnl)
131 __szr_left.Add(self._splitter_left, 1, wx.EXPAND, 0)
132 self.__splitter_main_left_pnl.SetSizer(__szr_left)
133 __lbl_encounter_details = wx.StaticText(self.__splitter_right_top_pnl, -1, _("Encounter"))
134 __gszr_encounter_details.Add(__lbl_encounter_details, 0, wx.ALIGN_CENTER_VERTICAL, 0)
135 __szr_encounter_details.Add(self._PRW_encounter_type, 1, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 10)
136 __szr_encounter_details.Add(self._PRW_encounter_start, 1, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
137 __lbl_until = wx.StaticText(self.__splitter_right_top_pnl, -1, _("until"))
138 __szr_encounter_details.Add(__lbl_until, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
139 __szr_encounter_details.Add(self._PRW_encounter_end, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
140 __gszr_encounter_details.Add(__szr_encounter_details, 1, wx.EXPAND, 0)
141 __lbl_rfe = wx.StaticText(self.__splitter_right_top_pnl, -1, _("Purpose ..."))
142 __gszr_encounter_details.Add(__lbl_rfe, 0, wx.ALIGN_CENTER_VERTICAL, 0)
143 __szr_rfe_details.Add(self._TCTRL_rfe, 2, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
144 __lbl_rfe_codes = wx.StaticText(self.__splitter_right_top_pnl, -1, _("Codes:"))
145 __szr_rfe_details.Add(__lbl_rfe_codes, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
146 __szr_rfe_details.Add(self._PRW_rfe_codes, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
147 __gszr_encounter_details.Add(__szr_rfe_details, 1, wx.EXPAND, 0)
148 __gszr_encounter_details.AddGrowableCol(1)
149 __szr_top_right.Add(__gszr_encounter_details, 0, wx.RIGHT|wx.TOP|wx.EXPAND, 3)
150 self._NB_soap_editors.AddPage(self.notebook_1_pane_1, _("tab1"))
151 __szr_top_right.Add(self._NB_soap_editors, 4, wx.EXPAND, 3)
152 __lbl_aoe = wx.StaticText(self.__splitter_right_top_pnl, -1, _("... summary"))
153 __szr_aoe.Add(__lbl_aoe, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
154 __szr_aoe.Add(self._TCTRL_aoe, 2, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
155 __lbl_aoe_codes = wx.StaticText(self.__splitter_right_top_pnl, -1, _("Codes:"))
156 __szr_aoe.Add(__lbl_aoe_codes, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
157 __szr_aoe.Add(self._PRW_aoe_codes, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
158 __szr_top_right.Add(__szr_aoe, 0, wx.RIGHT|wx.TOP|wx.EXPAND, 3)
159 __lbl_editor = wx.StaticText(self.__splitter_right_top_pnl, -1, _("Notelet:"))
160 __szr_buttons.Add(__lbl_editor, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
161 __szr_buttons.Add(self._BTN_new_editor, 0, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 3)
162 __szr_buttons.Add(self._BTN_clear_editor, 0, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 3)
163 __szr_buttons.Add(self._BTN_discard_editor, 0, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 3)
164 __szr_buttons.Add(self._BTN_save_note, 0, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 3)
165 __szr_buttons.Add(self._BTN_save_note_under, 0, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 3)
166 __szr_buttons.Add(self._BTN_image, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
167 __szr_buttons.Add((1, 1), 1, wx.EXPAND, 0)
168 __lbl_encounter = wx.StaticText(self.__splitter_right_top_pnl, -1, _("Encounter:"))
169 __szr_buttons.Add(__lbl_encounter, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
170 __szr_buttons.Add(self._BTN_new_encounter, 0, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 3)
171 __szr_buttons.Add(self._BTN_save_encounter, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 3)
172 __szr_buttons.Add((1, 1), 1, wx.EXPAND, 0)
173 __szr_buttons.Add(self._BTN_save_all, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
174 __szr_top_right.Add(__szr_buttons, 0, wx.RIGHT|wx.TOP|wx.EXPAND, 3)
175 self.__splitter_right_top_pnl.SetSizer(__szr_top_right)
176 __szr_bottom_right.Add(self._lbl_hints, 0, wx.EXPAND, 0)
177 self.__splitter_right_bottom_pnl.SetSizer(__szr_bottom_right)
178 self._splitter_right.SplitHorizontally(self.__splitter_right_top_pnl, self.__splitter_right_bottom_pnl)
179 __szr_right.Add(self._splitter_right, 1, wx.EXPAND, 0)
180 self.__splitter_main_right_pnl.SetSizer(__szr_right)
181 self._splitter_main.SplitVertically(self.__splitter_main_left_pnl, self.__splitter_main_right_pnl)
182 __szr_main.Add(self._splitter_main, 1, wx.EXPAND, 0)
183 self.SetSizer(__szr_main)
184 __szr_main.Fit(self)
185
186
188 print "Event handler `_on_save_all_button_pressed' not implemented!"
189 event.Skip()
190
192 print "Event handler `_on_save_encounter_button_pressed' not implemented!"
193 event.Skip()
194
196 print "Event handler `_on_save_note_button_pressed' not implemented!"
197 event.Skip()
198
200 print "Event handler `_on_new_editor_button_pressed' not implemented!"
201 event.Skip()
202
204 print "Event handler `_on_clear_editor_button_pressed' not implemented!"
205 event.Skip()
206
208 print "Event handler `_on_discard_editor_button_pressed' not implemented!"
209 event.Skip()
210
212 print "Event handler `_on_problem_activated' not implemented"
213 event.Skip()
214
216 print "Event handler `_on_new_encounter_button_pressed' not implemented"
217 event.Skip()
218
220 print "Event handler `_on_problem_selected' not implemented"
221 event.Skip()
222
224 print "Event handler `_on_problem_focused' not implemented"
225 event.Skip()
226
228 print "Event handler `_on_show_closed_episodes_checked' not implemented"
229 event.Skip()
230
232 print "Event handler `_on_irrelevant_issues_checked' not implemented"
233 event.Skip()
234
236 print "Event handler `_on_image_button_pressed' not implemented"
237 event.Skip()
238
240 print "Event handler `_on_save_note_under_button_pressed' not implemented"
241 event.Skip()
242
243
244