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.gmDateTimeInput import cFuzzyTimestampInput
17 from Gnumed.wxpython.gmEMRStructWidgets import cEncounterTypePhraseWheel
18 from Gnumed.wxpython.gmCodingWidgets import cGenericCodesPhraseWheel
19 from Gnumed.wxpython import gmListWidgets
20
21
22 kwds["style"] = wx.NO_BORDER|wx.TAB_TRAVERSAL
23 wx.Panel.__init__(self, *args, **kwds)
24 self._splitter_main = wx.SplitterWindow(self, -1, style=wx.SP_3D|wx.SP_BORDER|wx.SP_PERMIT_UNSPLIT)
25 self.__splitter_main_right_pnl = wx.Panel(self._splitter_main, -1, style=wx.NO_BORDER|wx.TAB_TRAVERSAL)
26 self._NB_soap_editors = cSoapNoteInputNotebook(self.__splitter_main_right_pnl, -1, style=0)
27 self.__splitter_main_left_pnl = wx.Panel(self._splitter_main, -1, style=wx.NO_BORDER)
28 self._splitter_left = wx.SplitterWindow(self.__splitter_main_left_pnl, -1, style=wx.SP_3D|wx.SP_BORDER|wx.SP_PERMIT_UNSPLIT)
29 self.__splitter_left_bottom_pnl = wx.Panel(self._splitter_left, -1, style=wx.NO_BORDER)
30 self.__splitter_left_top_pnl = wx.Panel(self._splitter_left, -1, style=wx.NO_BORDER)
31 self._SZR_recent_notes_staticbox = wx.StaticBox(self.__splitter_left_bottom_pnl, -1, _("Most recent notes on above problem"))
32 self.__szr_right_staticbox = wx.StaticBox(self.__splitter_main_right_pnl, -1, _("New notelets in current encounter"))
33 self._SZR_problem_list_staticbox = wx.StaticBox(self.__splitter_left_top_pnl, -1, _("Active problems"))
34 self._CHBOX_show_closed_episodes = wx.CheckBox(self.__splitter_left_top_pnl, -1, _("Closed episodes"))
35 self._CHBOX_irrelevant_issues = wx.CheckBox(self.__splitter_left_top_pnl, -1, _("Non-relevant issues"))
36 self._LCTRL_active_problems = gmListWidgets.cReportListCtrl(self.__splitter_left_top_pnl, -1, style=wx.LC_REPORT|wx.NO_BORDER)
37 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)
38 self._PRW_encounter_type = cEncounterTypePhraseWheel(self.__splitter_main_right_pnl, -1, "", style=wx.NO_BORDER)
39 self._PRW_encounter_start = cFuzzyTimestampInput(self.__splitter_main_right_pnl, -1, "", style=wx.NO_BORDER)
40 self._PRW_encounter_end = cFuzzyTimestampInput(self.__splitter_main_right_pnl, -1, "", style=wx.NO_BORDER)
41 self._TCTRL_rfe = wx.TextCtrl(self.__splitter_main_right_pnl, -1, "", style=wx.NO_BORDER)
42 self._PRW_rfe_codes = cGenericCodesPhraseWheel(self.__splitter_main_right_pnl, -1, "", style=wx.NO_BORDER)
43 self._TCTRL_aoe = wx.TextCtrl(self.__splitter_main_right_pnl, -1, "", style=wx.NO_BORDER)
44 self._PRW_aoe_codes = cGenericCodesPhraseWheel(self.__splitter_main_right_pnl, -1, "", style=wx.NO_BORDER)
45 self.notebook_1_pane_1 = wx.Panel(self._NB_soap_editors, -1)
46 self._BTN_new_editor = wx.Button(self.__splitter_main_right_pnl, -1, _("&New"), style=wx.BU_EXACTFIT)
47 self._BTN_clear_editor = wx.Button(self.__splitter_main_right_pnl, -1, _("&Clear"), style=wx.BU_EXACTFIT)
48 self._BTN_discard_editor = wx.Button(self.__splitter_main_right_pnl, -1, _("&Discard"), style=wx.BU_EXACTFIT)
49 self._BTN_save_note = wx.Button(self.__splitter_main_right_pnl, -1, _("&Save"), style=wx.BU_EXACTFIT)
50 self._BTN_save_note_under = wx.Button(self.__splitter_main_right_pnl, -1, _("Save &under"), style=wx.BU_EXACTFIT)
51 self._BTN_image = wx.Button(self.__splitter_main_right_pnl, -1, _("&Image"), style=wx.BU_EXACTFIT)
52 self._BTN_new_encounter = wx.Button(self.__splitter_main_right_pnl, -1, _("New"), style=wx.BU_EXACTFIT)
53 self._BTN_save_encounter = wx.Button(self.__splitter_main_right_pnl, -1, _("Save"), style=wx.BU_EXACTFIT)
54 self._BTN_save_all = wx.Button(self.__splitter_main_right_pnl, -1, _("Save &all"), style=wx.BU_EXACTFIT)
55
56 self.__set_properties()
57 self.__do_layout()
58
59 self.Bind(wx.EVT_CHECKBOX, self._on_show_closed_episodes_checked, self._CHBOX_show_closed_episodes)
60 self.Bind(wx.EVT_CHECKBOX, self._on_irrelevant_issues_checked, self._CHBOX_irrelevant_issues)
61 self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_problem_selected, self._LCTRL_active_problems)
62 self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self._on_problem_activated, self._LCTRL_active_problems)
63 self.Bind(wx.EVT_LIST_ITEM_FOCUSED, self._on_problem_focused, self._LCTRL_active_problems)
64 self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self._on_problem_rclick, self._LCTRL_active_problems)
65 self.Bind(wx.EVT_BUTTON, self._on_new_editor_button_pressed, self._BTN_new_editor)
66 self.Bind(wx.EVT_BUTTON, self._on_clear_editor_button_pressed, self._BTN_clear_editor)
67 self.Bind(wx.EVT_BUTTON, self._on_discard_editor_button_pressed, self._BTN_discard_editor)
68 self.Bind(wx.EVT_BUTTON, self._on_save_note_button_pressed, self._BTN_save_note)
69 self.Bind(wx.EVT_BUTTON, self._on_save_note_under_button_pressed, self._BTN_save_note_under)
70 self.Bind(wx.EVT_BUTTON, self._on_image_button_pressed, self._BTN_image)
71 self.Bind(wx.EVT_BUTTON, self._on_new_encounter_button_pressed, self._BTN_new_encounter)
72 self.Bind(wx.EVT_BUTTON, self._on_save_encounter_button_pressed, self._BTN_save_encounter)
73 self.Bind(wx.EVT_BUTTON, self._on_save_all_button_pressed, self._BTN_save_all)
74
75
77
78 self._CHBOX_show_closed_episodes.SetToolTipString(_("Show closed episodes as pseudo-problems ?"))
79 self._CHBOX_irrelevant_issues.SetToolTipString(_("Show issues marked clinically NOT relevant."))
80 self._LCTRL_active_problems.SetToolTipString(_("This shows the list of active problems, They include open episodes as well as active health issues."))
81 self._TCTRL_recent_notes.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE))
82 self._PRW_encounter_type.SetToolTipString(_("Select the type of encounter."))
83 self._PRW_encounter_start.SetToolTipString(_("Date and time when the current (!) encounter started."))
84 self._PRW_encounter_end.SetToolTipString(_("Date and time when the current (!) encounter ends."))
85 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)."))
86 self._PRW_rfe_codes.SetToolTipString(_("Enter codes relevant to this Reason for Encounter."))
87 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."))
88 self._PRW_aoe_codes.SetToolTipString(_("Enter codes relevant to this Outcome of Encounter."))
89 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."))
90 self._BTN_clear_editor.SetToolTipString(_("Clear the editor for the displayed progress note."))
91 self._BTN_discard_editor.SetToolTipString(_("Discard the editor for the displayed progress note."))
92 self._BTN_save_note.SetToolTipString(_("Save the currently displayed progress note under the current encounter."))
93 self._BTN_save_note_under.SetToolTipString(_("Save the currently displayed note into an encounter selected from a list of encounters."))
94 self._BTN_image.SetToolTipString(_("Add a visual progress note for this episode."))
95 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."))
96 self._BTN_save_encounter.SetToolTipString(_("Save the encounter details."))
97 self._BTN_save_all.SetToolTipString(_("Save encounter details and all progress notes."))
98
99
101
102 __szr_main = wx.BoxSizer(wx.HORIZONTAL)
103 __szr_right = wx.StaticBoxSizer(self.__szr_right_staticbox, wx.VERTICAL)
104 __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
105 __gszr_encounter_details = wx.FlexGridSizer(3, 2, 2, 5)
106 __szr_aoe = wx.BoxSizer(wx.HORIZONTAL)
107 __szr_rfe_details = wx.BoxSizer(wx.HORIZONTAL)
108 __szr_encounter_details = wx.BoxSizer(wx.HORIZONTAL)
109 __szr_left = wx.BoxSizer(wx.HORIZONTAL)
110 _SZR_recent_notes = wx.StaticBoxSizer(self._SZR_recent_notes_staticbox, wx.VERTICAL)
111 _SZR_problem_list = wx.StaticBoxSizer(self._SZR_problem_list_staticbox, wx.VERTICAL)
112 __szr_problem_filter = wx.BoxSizer(wx.HORIZONTAL)
113 __lbl_problem_filter = wx.StaticText(self.__splitter_left_top_pnl, -1, _("Include:"))
114 __szr_problem_filter.Add(__lbl_problem_filter, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 10)
115 __szr_problem_filter.Add(self._CHBOX_show_closed_episodes, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
116 __szr_problem_filter.Add(self._CHBOX_irrelevant_issues, 0, wx.ALIGN_CENTER_VERTICAL, 0)
117 __szr_problem_filter.Add((20, 20), 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
118 _SZR_problem_list.Add(__szr_problem_filter, 0, wx.EXPAND, 0)
119 _SZR_problem_list.Add(self._LCTRL_active_problems, 1, wx.EXPAND, 0)
120 self.__splitter_left_top_pnl.SetSizer(_SZR_problem_list)
121 _SZR_recent_notes.Add(self._TCTRL_recent_notes, 1, wx.EXPAND, 0)
122 self.__splitter_left_bottom_pnl.SetSizer(_SZR_recent_notes)
123 self._splitter_left.SplitHorizontally(self.__splitter_left_top_pnl, self.__splitter_left_bottom_pnl)
124 __szr_left.Add(self._splitter_left, 1, wx.EXPAND, 0)
125 self.__splitter_main_left_pnl.SetSizer(__szr_left)
126 __lbl_encounter_details = wx.StaticText(self.__splitter_main_right_pnl, -1, _("Encounter"))
127 __gszr_encounter_details.Add(__lbl_encounter_details, 0, wx.ALIGN_CENTER_VERTICAL, 0)
128 __szr_encounter_details.Add(self._PRW_encounter_type, 1, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 10)
129 __szr_encounter_details.Add(self._PRW_encounter_start, 1, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
130 __lbl_until = wx.StaticText(self.__splitter_main_right_pnl, -1, _("until"))
131 __szr_encounter_details.Add(__lbl_until, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
132 __szr_encounter_details.Add(self._PRW_encounter_end, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
133 __gszr_encounter_details.Add(__szr_encounter_details, 1, wx.EXPAND, 0)
134 __lbl_rfe = wx.StaticText(self.__splitter_main_right_pnl, -1, _("Purpose"))
135 __gszr_encounter_details.Add(__lbl_rfe, 0, wx.ALIGN_CENTER_VERTICAL, 0)
136 __szr_rfe_details.Add(self._TCTRL_rfe, 2, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
137 __lbl_rfe_codes = wx.StaticText(self.__splitter_main_right_pnl, -1, _("Codes:"))
138 __szr_rfe_details.Add(__lbl_rfe_codes, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
139 __szr_rfe_details.Add(self._PRW_rfe_codes, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
140 __gszr_encounter_details.Add(__szr_rfe_details, 1, wx.EXPAND, 0)
141 __lbl_aoe = wx.StaticText(self.__splitter_main_right_pnl, -1, _("Summary"))
142 __gszr_encounter_details.Add(__lbl_aoe, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
143 __szr_aoe.Add(self._TCTRL_aoe, 2, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
144 __lbl_aoe_codes = wx.StaticText(self.__splitter_main_right_pnl, -1, _("Codes:"))
145 __szr_aoe.Add(__lbl_aoe_codes, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
146 __szr_aoe.Add(self._PRW_aoe_codes, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
147 __gszr_encounter_details.Add(__szr_aoe, 0, wx.EXPAND, 3)
148 __gszr_encounter_details.AddGrowableCol(1)
149 __szr_right.Add(__gszr_encounter_details, 0, wx.RIGHT|wx.TOP|wx.BOTTOM|wx.EXPAND, 3)
150 self._NB_soap_editors.AddPage(self.notebook_1_pane_1, _("tab1"))
151 __szr_right.Add(self._NB_soap_editors, 4, wx.EXPAND, 3)
152 __lbl_editor = wx.StaticText(self.__splitter_main_right_pnl, -1, _("Notelet:"))
153 __szr_buttons.Add(__lbl_editor, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
154 __szr_buttons.Add(self._BTN_new_editor, 0, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 3)
155 __szr_buttons.Add(self._BTN_clear_editor, 0, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 3)
156 __szr_buttons.Add(self._BTN_discard_editor, 0, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 3)
157 __szr_buttons.Add(self._BTN_save_note, 0, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 3)
158 __szr_buttons.Add(self._BTN_save_note_under, 0, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 3)
159 __szr_buttons.Add(self._BTN_image, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
160 __szr_buttons.Add((1, 1), 1, wx.EXPAND, 0)
161 __lbl_encounter = wx.StaticText(self.__splitter_main_right_pnl, -1, _("Encounter:"))
162 __szr_buttons.Add(__lbl_encounter, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
163 __szr_buttons.Add(self._BTN_new_encounter, 0, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 3)
164 __szr_buttons.Add(self._BTN_save_encounter, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 3)
165 __szr_buttons.Add((1, 1), 1, wx.EXPAND, 0)
166 __szr_buttons.Add(self._BTN_save_all, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
167 __szr_right.Add(__szr_buttons, 0, wx.RIGHT|wx.TOP|wx.EXPAND, 3)
168 self.__splitter_main_right_pnl.SetSizer(__szr_right)
169 self._splitter_main.SplitVertically(self.__splitter_main_left_pnl, self.__splitter_main_right_pnl)
170 __szr_main.Add(self._splitter_main, 1, wx.EXPAND, 0)
171 self.SetSizer(__szr_main)
172 __szr_main.Fit(self)
173
174
176 print "Event handler `_on_save_all_button_pressed' not implemented!"
177 event.Skip()
178
180 print "Event handler `_on_save_encounter_button_pressed' not implemented!"
181 event.Skip()
182
184 print "Event handler `_on_save_note_button_pressed' not implemented!"
185 event.Skip()
186
188 print "Event handler `_on_new_editor_button_pressed' not implemented!"
189 event.Skip()
190
192 print "Event handler `_on_clear_editor_button_pressed' not implemented!"
193 event.Skip()
194
196 print "Event handler `_on_discard_editor_button_pressed' not implemented!"
197 event.Skip()
198
200 print "Event handler `_on_problem_activated' not implemented"
201 event.Skip()
202
204 print "Event handler `_on_new_encounter_button_pressed' not implemented"
205 event.Skip()
206
208 print "Event handler `_on_problem_selected' not implemented"
209 event.Skip()
210
212 print "Event handler `_on_problem_focused' not implemented"
213 event.Skip()
214
216 print "Event handler `_on_show_closed_episodes_checked' not implemented"
217 event.Skip()
218
220 print "Event handler `_on_irrelevant_issues_checked' not implemented"
221 event.Skip()
222
224 print "Event handler `_on_image_button_pressed' not implemented"
225 event.Skip()
226
228 print "Event handler `_on_save_note_under_button_pressed' not implemented"
229 event.Skip()
230
232 print "Event handler `_on_problem_rclick' not implemented"
233 event.Skip()
234
235
236