Package Gnumed :: Package wxpython :: Module gmAllergyWidgets
[frames] | no frames]

Source Code for Module Gnumed.wxpython.gmAllergyWidgets

  1  """GNUmed allergy related widgets.""" 
  2  ############################################################################ 
  3  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/wxpython/gmAllergyWidgets.py,v $ 
  4  # $Id: gmAllergyWidgets.py,v 1.35 2009/06/04 16:30:30 ncq Exp $ 
  5  __version__ = "$Revision: 1.35 $" 
  6  __author__  = "R.Terry <rterry@gnumed.net>, H.Herb <hherb@gnumed.net>, K.Hilbert <Karsten.Hilbert@gmx.net>" 
  7  __license__ = 'GPL (details at http://www.gnu.org)' 
  8   
  9  import sys, time, datetime as pyDT, logging 
 10   
 11   
 12  import wx 
 13   
 14   
 15  if __name__ == '__main__': 
 16          sys.path.insert(0, '../../') 
 17  from Gnumed.pycommon import gmDispatcher, gmI18N, gmDateTime, gmTools, gmMatchProvider 
 18  from Gnumed.wxpython import gmDateTimeInput, gmTerryGuiParts, gmRegetMixin, gmPatSearchWidgets 
 19  from Gnumed.business import gmPerson, gmAllergy 
 20  from Gnumed.wxGladeWidgets import wxgAllergyEditAreaPnl, wxgAllergyEditAreaDlg, wxgAllergyManagerDlg 
 21   
 22  _log = logging.getLogger('gm.ui') 
 23  _log.info(__version__) 
 24   
 25  #====================================================================== 
26 -class cAllergyEditAreaPnl(wxgAllergyEditAreaPnl.wxgAllergyEditAreaPnl):
27
28 - def __init__(self, *args, **kwargs):
29 wxgAllergyEditAreaPnl.wxgAllergyEditAreaPnl.__init__(self, *args, **kwargs) 30 31 try: 32 self.__allergy = kwargs['allergy'] 33 except KeyError: 34 self.__allergy = None 35 36 mp = gmMatchProvider.cMatchProvider_SQL2 ( 37 queries = [u""" 38 select substance, substance 39 from clin.allergy 40 where substance %(fragment_condition)s 41 42 union 43 44 select generics, generics 45 from clin.allergy 46 where generics %(fragment_condition)s 47 48 union 49 50 select allergene, allergene 51 from clin.allergy 52 where allergene %(fragment_condition)s 53 54 union 55 56 select atc_code, atc_code 57 from clin.allergy 58 where atc_code %(fragment_condition)s 59 """ 60 ] 61 ) 62 mp.setThresholds(2, 3, 5) 63 self._PRW_trigger.matcher = mp 64 65 mp = gmMatchProvider.cMatchProvider_SQL2 ( 66 queries = [u""" 67 select narrative, narrative 68 from clin.allergy 69 where narrative %(fragment_condition)s 70 """] 71 ) 72 mp.setThresholds(2, 3, 5) 73 self._PRW_reaction.matcher = mp 74 self._PRW_reaction.enable_default_spellchecker() 75 76 # self._RBTN_type_sensitivity.MoveAfterInTabOrder(self._RBTN_type_allergy) 77 # self._ChBOX_definite.MoveAfterInTabOrder(self._RBTN_type_sensitivity) 78 79 self.refresh()
80 #-------------------------------------------------------- 81 # external API 82 #--------------------------------------------------------
83 - def clear(self):
84 self.__allergy = None 85 return self.refresh()
86 #--------------------------------------------------------
87 - def refresh(self, allergy=None):
88 89 if allergy is not None: 90 self.__allergy = allergy 91 92 if self.__allergy is None: 93 ts = gmDateTime.cFuzzyTimestamp ( 94 timestamp = pyDT.datetime.now(tz=gmDateTime.gmCurrentLocalTimezone), 95 accuracy = gmDateTime.acc_days 96 ) 97 self._DPRW_date_noted.SetData(data = ts) 98 self._PRW_trigger.SetText() 99 self._TCTRL_brand_name.SetValue('') 100 self._TCTRL_generic.SetValue('') 101 self._ChBOX_generic_specific.SetValue(0) 102 self._TCTRL_atc_classes.SetValue('') 103 self._PRW_reaction.SetText() 104 self._RBTN_type_allergy.SetValue(1) 105 self._RBTN_type_sensitivity.SetValue(0) 106 self._ChBOX_definite.SetValue(1) 107 return True 108 109 if not isinstance(self.__allergy, gmAllergy.cAllergy): 110 raise ValueError('[%s].refresh(): expected gmAllergy.cAllergy instance, got [%s] instead' % (self.__class__.__name__, self.__allergy)) 111 112 ts = gmDateTime.cFuzzyTimestamp ( 113 timestamp = self.__allergy['date'], 114 accuracy = gmDateTime.acc_days 115 ) 116 self._DPRW_date_noted.SetData(data=ts) 117 self._PRW_trigger.SetText(value = self.__allergy['substance']) 118 self._TCTRL_brand_name.SetValue(self.__allergy['substance']) 119 self._TCTRL_generic.SetValue(gmTools.coalesce(self.__allergy['generics'], '')) 120 self._ChBOX_generic_specific.SetValue(self.__allergy['generic_specific']) 121 self._TCTRL_atc_classes.SetValue(gmTools.coalesce(self.__allergy['atc_code'], '')) 122 self._PRW_reaction.SetText(value = gmTools.coalesce(self.__allergy['reaction'], '')) 123 if self.__allergy['type'] == 'allergy': 124 self._RBTN_type_allergy.SetValue(1) 125 else: 126 self._RBTN_type_sensitivity.SetValue(1) 127 self._ChBOX_definite.SetValue(self.__allergy['definite'])
128 #--------------------------------------------------------
129 - def __is_valid_for_save(self):
130 131 if self._PRW_trigger.GetValue().strip() == '': 132 self._PRW_trigger.SetBackgroundColour('pink') 133 self._PRW_trigger.Refresh() 134 self._PRW_trigger.SetFocus() 135 return False 136 self._PRW_trigger.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)) 137 self._PRW_trigger.Refresh() 138 139 return True
140 #--------------------------------------------------------
141 - def save(self, can_create=True):
142 if not self.__is_valid_for_save(): 143 return False 144 145 if self.__allergy is None: 146 if not can_create: 147 gmDispatcher.send(signal='statustext', msg=_('Creating new allergy not allowed.')) 148 return False 149 150 pat = gmPerson.gmCurrentPatient() 151 emr = pat.get_emr() 152 153 if self._RBTN_type_allergy.GetValue(): 154 allg_type = 'allergy' 155 else: 156 allg_type = 'sensitivity' 157 self.__allergy = emr.add_allergy ( 158 substance = self._PRW_trigger.GetValue().strip(), 159 allg_type = allg_type 160 ) 161 162 # and update it with known data 163 self.__allergy['date'] = self._DPRW_date_noted.GetData().get_pydt() 164 self.__allergy['substance'] = self._PRW_trigger.GetValue().strip() 165 # FIXME: determine brandname/generic/etc from substance (trigger field) 166 self.__allergy['generic_specific'] = (True and self._ChBOX_generic_specific.GetValue()) 167 self.__allergy['reaction'] = self._PRW_reaction.GetValue().strip() 168 self.__allergy['definite'] = (True and self._ChBOX_definite.GetValue()) 169 if self._RBTN_type_allergy.GetValue(): 170 self.__allergy['pk_type'] = 'allergy' 171 else: 172 self.__allergy['pk_type'] = 'sensitivity' 173 174 self.__allergy.save_payload() 175 176 return True
177 #======================================================================
178 -class cAllergyEditAreaDlg(wxgAllergyEditAreaDlg.wxgAllergyEditAreaDlg):
179
180 - def __init__(self, *args, **kwargs):
181 182 try: 183 allergy = kwargs['allergy'] 184 del kwargs['allergy'] 185 except KeyError: 186 allergy = None 187 188 wxgAllergyEditAreaDlg.wxgAllergyEditAreaDlg.__init__(self, *args, **kwargs) 189 190 if allergy is None: 191 # self._BTN_save.SetLabel(_('&Save')) 192 self._BTN_clear.SetLabel(_('&Clear')) 193 else: 194 # self._BTN_save.SetLabel(_('Update')) 195 self._BTN_clear.SetLabel(_('&Restore')) 196 197 self._PNL_edit_area.refresh(allergy = allergy)
198 #--------------------------------------------------------
199 - def _on_save_button_pressed(self, evt):
200 if self._PNL_edit_area.save(): 201 if self.IsModal(): 202 self.EndModal(wx.ID_OK) 203 else: 204 self.Close()
205 #--------------------------------------------------------
206 - def _on_clear_button_pressed(self, evt):
207 self._PNL_edit_area.refresh()
208 #======================================================================
209 -class cAllergyManagerDlg(wxgAllergyManagerDlg.wxgAllergyManagerDlg):
210
211 - def __init__(self, *args, **kwargs):
212 213 wxgAllergyManagerDlg.wxgAllergyManagerDlg.__init__(self, *args, **kwargs) 214 215 self.Centre(direction = wx.BOTH) 216 217 self.__set_columns() 218 # MacOSX crashes on this with: 219 # exception type : wx._core.PyAssertionError 220 # exception value: C++ assertion "i" failed at /BUILD/wxPython-src-2.8.3.0/src/common/wincmn.cpp(2634) in DoMoveInTabOrder(): MoveBefore/AfterInTabOrder(): win is not a sibling 221 # while Win/Linux work just fine 222 #self._PNL_edit_area._ChBOX_definite.MoveAfterInTabOrder(self._BTN_save) 223 self.__refresh_state_ui() 224 self.__refresh_details_ui()
225 #-------------------------------------------------------- 226 # internal helpers 227 #--------------------------------------------------------
228 - def __set_columns(self):
229 self._LCTRL_allergies.set_columns (columns = [ 230 _('Type'), 231 _('Certainty'), 232 _('Trigger'), 233 _('Reaction') 234 ])
235 #--------------------------------------------------------
236 - def __refresh_state_ui(self):
237 238 pat = gmPerson.gmCurrentPatient() 239 emr = pat.get_emr() 240 state = emr.allergy_state 241 242 self._TXT_current_state.SetLabel(state.state_string) 243 244 if state['last_confirmed'] is None: 245 self._TXT_last_confirmed.SetLabel(_('<allergy state unasked>')) 246 else: 247 self._TXT_last_confirmed.SetLabel(state['last_confirmed'].strftime('%x %H:%M')) 248 249 if state['has_allergy'] is None: 250 self._RBTN_unknown.SetValue(True) 251 self._RBTN_none.SetValue(False) 252 self._RBTN_some.SetValue(False) 253 254 self._RBTN_unknown.Enable(True) 255 self._RBTN_none.Enable(True) 256 257 elif state['has_allergy'] == 0: 258 self._RBTN_unknown.SetValue(False) 259 self._RBTN_none.SetValue(True) 260 self._RBTN_some.SetValue(False) 261 262 self._RBTN_unknown.Enable(True) 263 self._RBTN_none.Enable(True) 264 265 elif state['has_allergy'] == 1: 266 self._RBTN_unknown.SetValue(False) 267 self._RBTN_none.SetValue(False) 268 self._RBTN_some.SetValue(True) 269 270 self._RBTN_unknown.Enable(True) 271 self._RBTN_none.Enable(False) 272 273 else: 274 self._RBTN_unknown.SetValue(True) 275 self._RBTN_none.SetValue(False) 276 self._RBTN_some.SetValue(False) 277 278 self._RBTN_unknown.Enable(True) 279 self._RBTN_none.Enable(True) 280 281 gmDispatcher.send(signal=u'statustext', msg=_('invalid allergy state [%s]') % state, beep=True) 282 283 if state['comment'] is not None: 284 self._TCTRL_state_comment.SetValue(state['comment'])
285 #--------------------------------------------------------
286 - def __refresh_details_ui(self):
287 288 pat = gmPerson.gmCurrentPatient() 289 emr = pat.get_emr() 290 allergies = emr.get_allergies() 291 no_of_allergies = len(allergies) 292 293 # display allergies 294 self._LCTRL_allergies.DeleteAllItems() 295 if no_of_allergies > 0: 296 emr.allergy_state = 1 297 298 for allergy in allergies: 299 row_idx = self._LCTRL_allergies.InsertStringItem(no_of_allergies, label = allergy['l10n_type']) 300 if allergy['definite']: 301 label = _('definite') 302 else: 303 label = u'' 304 self._LCTRL_allergies.SetStringItem(index = row_idx, col = 1, label = label) 305 self._LCTRL_allergies.SetStringItem(index = row_idx, col = 2, label = allergy['descriptor']) 306 self._LCTRL_allergies.SetStringItem(index = row_idx, col = 3, label = gmTools.coalesce(allergy['reaction'], u'')) 307 self._LCTRL_allergies.set_data(data=allergies) 308 309 self._LCTRL_allergies.Enable(True) 310 self._RBTN_some.SetValue(True) 311 self._RBTN_unknown.Enable(False) 312 self._RBTN_none.Enable(False) 313 else: 314 self._LCTRL_allergies.Enable(False) 315 self._RBTN_unknown.Enable(True) 316 self._RBTN_none.Enable(True) 317 318 self._LCTRL_allergies.set_column_widths (widths = [ 319 wx.LIST_AUTOSIZE, 320 wx.LIST_AUTOSIZE, 321 wx.LIST_AUTOSIZE, 322 wx.LIST_AUTOSIZE 323 ]) 324 325 self._PNL_edit_area.clear() 326 self._BTN_delete.Enable(False)
327 #-------------------------------------------------------- 328 # event handlers 329 #--------------------------------------------------------
330 - def _on_dismiss_button_pressed(self, evt):
331 if self.IsModal(): 332 self.EndModal(wx.ID_OK) 333 else: 334 self.Close()
335 #--------------------------------------------------------
336 - def _on_clear_button_pressed(self, evt):
337 self._LCTRL_allergies.deselect_selected_item() 338 self._PNL_edit_area.clear() 339 self._BTN_delete.Enable(False)
340 #--------------------------------------------------------
341 - def _on_delete_button_pressed(self, evt):
342 pat = gmPerson.gmCurrentPatient() 343 emr = pat.get_emr() 344 345 allergy = self._LCTRL_allergies.get_selected_item_data(only_one=True) 346 emr.delete_allergy(pk_allergy = allergy['pk_allergy']) 347 348 state = emr.allergy_state 349 state['last_confirmed'] = u'now' 350 state.save_payload() 351 352 self.__refresh_state_ui() 353 self.__refresh_details_ui()
354 #--------------------------------------------------------
355 - def _on_list_item_selected(self, evt):
356 allergy = self._LCTRL_allergies.get_selected_item_data(only_one=True) 357 self._PNL_edit_area.refresh(allergy=allergy) 358 self._BTN_delete.Enable(True)
359 #--------------------------------------------------------
360 - def _on_confirm_button_pressed(self, evt):
361 pat = gmPerson.gmCurrentPatient() 362 emr = pat.get_emr() 363 allergies = emr.get_allergies() 364 state = emr.allergy_state 365 366 cmt = self._TCTRL_state_comment.GetValue().strip() 367 368 if self._RBTN_unknown.GetValue(): 369 if len(allergies) > 0: 370 gmDispatcher.send(signal = u'statustext', msg = _('Cannot set allergy state to <unknown> because there are allergies stored for this patient.'), beep = True) 371 self._RBTN_some.SetValue(True) 372 state['has_allergy'] = 1 373 return False 374 else: 375 state['has_allergy'] = None 376 377 elif self._RBTN_none.GetValue(): 378 if len(allergies) > 0: 379 gmDispatcher.send(signal = u'statustext', msg = _('Cannot set allergy state to <None> because there are allergies stored for this patient.'), beep = True) 380 self._RBTN_some.SetValue(True) 381 state['has_allergy'] = 1 382 return False 383 else: 384 state['has_allergy'] = 0 385 386 elif self._RBTN_some.GetValue(): 387 if (len(allergies) == 0) and (cmt == u''): 388 gmDispatcher.send(signal = u'statustext', msg = _('Cannot set allergy state to <some> because there are neither allergies nor a comment available for this patient.'), beep = True) 389 return False 390 else: 391 state['has_allergy'] = 1 392 393 state['comment'] = cmt 394 state['last_confirmed'] = u'now' 395 396 state.save_payload() 397 self.__refresh_state_ui()
398 #--------------------------------------------------------
399 - def _on_save_details_button_pressed(self, evt):
400 401 if not self._PNL_edit_area.save(): 402 return False 403 404 pat = gmPerson.gmCurrentPatient() 405 emr = pat.get_emr() 406 state = emr.allergy_state 407 state['last_confirmed'] = u'now' 408 state.save_payload() 409 410 self.__refresh_state_ui() 411 self.__refresh_details_ui()
412 #======================================================================
413 -class cAllergyPanel(wx.Panel, gmRegetMixin.cRegetOnPaintMixin):
414 """Allergy details panel. 415 416 This panel will hold all the allergy details and 417 allow entry of those details via the editing area. 418 """ 419 #----------------------------------------------------
420 - def __init__(self, parent, id=-1):
421 wx.Panel.__init__(self, parent, id, wx.DefaultPosition, wx.DefaultSize, wx.RAISED_BORDER) 422 gmRegetMixin.cRegetOnPaintMixin.__init__(self) 423 self.__do_layout() 424 self.__pat = gmPerson.gmCurrentPatient() 425 self.__register_interests() 426 self.__reset_ui_content()
427 #----------------------------------------------------
428 - def __do_layout(self):
429 # -- top part -- 430 pnl_UpperCaption = gmTerryGuiParts.cHeadingCaption(self, -1, _("ALLERGIES")) 431 self.editarea = gmAllergyEditArea(self, -1) 432 433 # -- middle part -- 434 # divider headings below edit area 435 pnl_MiddleCaption = gmTerryGuiParts.cDividerCaption(self, -1, _("Allergy and Sensitivity - Summary")) 436 # self.sizer_divider_drug_generic = wx.BoxSizer(wxHORIZONTAL) 437 # self.sizer_divider_drug_generic.Add(pnl_MiddleCaption, 1, wxEXPAND) 438 self.LCTRL_allergies = wx.ListCtrl ( 439 parent = self, 440 id = ID_ALLERGY_LIST, 441 pos = wx.DefaultPosition, 442 size = wx.DefaultSize, 443 style = wx.LC_SINGLE_SEL | wx.LC_REPORT | wx.SUNKEN_BORDER | wx.LC_HRULES | wx.LC_VRULES | wx.VSCROLL 444 ) 445 self.LCTRL_allergies.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL, False, '')) 446 self.LCTRL_allergies.InsertColumn(0, _("Type")) 447 self.LCTRL_allergies.InsertColumn(1, _("Status")) 448 self.LCTRL_allergies.InsertColumn(2, _("ATC/Class")) 449 self.LCTRL_allergies.InsertColumn(3, _("Substance")) 450 self.LCTRL_allergies.InsertColumn(4, _("Generics")) 451 self.LCTRL_allergies.InsertColumn(5, _("Reaction")) 452 453 # -- bottom part -- 454 pnl_LowerCaption = gmTerryGuiParts.cDividerCaption(self, -1, _('Class notes')) 455 #add a richtext control or a wxTextCtrl multiline to display the class text information 456 #e.g. would contain say information re the penicillins 457 self.class_notes = wx.TextCtrl ( 458 self, 459 -1, 460 "A member of a new class of nonsteroidal anti-inflammatory agents (COX-2 selective NSAIDs) which have a mechanism of action that inhibits prostaglandin synthesis primarily by inhibition of cyclooxygenase 2 (COX-2). At therapeutic doses these have no effect on prostanoids synthesised by activation of COX-1 thereby not interfering with normal COX-1 related physiological processes in tissues, particularly the stomach, intestine and platelets.", 461 size = (200, 100), 462 style = wx.TE_MULTILINE | wx.TE_READONLY 463 ) 464 self.class_notes.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL, False, '')) 465 466 # -- add elements to main background sizer -- 467 self.mainsizer = wx.BoxSizer(wx.VERTICAL) 468 self.mainsizer.Add(pnl_UpperCaption, 0, wx.EXPAND) 469 self.mainsizer.Add(self.editarea, 6, wx.EXPAND) 470 # self.mainsizer.Add(self.sizer_divider_drug_generic,0,wxEXPAND) 471 self.mainsizer.Add(pnl_MiddleCaption, 0, wx.EXPAND) 472 self.mainsizer.Add(self.LCTRL_allergies, 5, wx.EXPAND) 473 self.mainsizer.Add(pnl_LowerCaption, 0, wx.EXPAND) 474 self.mainsizer.Add(self.class_notes, 4, wx.EXPAND) 475 476 self.SetAutoLayout(True) 477 self.SetSizer(self.mainsizer) 478 self.mainsizer.Fit(self)
479 #-----------------------------------------------
480 - def __register_interests(self):
481 wx.EVT_LIST_ITEM_ACTIVATED(self, ID_ALLERGY_LIST, self._on_allergy_activated) 482 483 # client internal signals 484 gmDispatcher.connect(signal = u'post_patient_selection', receiver=self._schedule_data_reget)
485 # gmDispatcher.connect(signal = u'vaccinations_updated', receiver=self._schedule_data_reget) 486 #-----------------------------------------------
487 - def __reset_ui_content(self):
488 self.editarea.set_data() 489 self.LCTRL_allergies.DeleteAllItems()
490 #-----------------------------------------------
491 - def _populate_with_data(self):
492 if not self.__pat.connected: 493 return False 494 495 self.LCTRL_allergies.DeleteAllItems() 496 497 emr = self.__pat.get_emr() 498 allergies = emr.get_allergies() 499 if allergies is None: 500 return False 501 for list_line in range(len(allergies)): 502 allg = allergies[list_line] 503 list_line = self.LCTRL_allergies.InsertStringItem(list_line, allg['l10n_type']) 504 # FIXME: check with Richard design specs 505 if allg['definite']: 506 self.LCTRL_allergies.SetStringItem(list_line, 1, _('definite')) 507 else: 508 self.LCTRL_allergies.SetStringItem(list_line, 1, _('likely')) 509 if allg['atc_code'] is not None: 510 self.LCTRL_allergies.SetStringItem(list_line, 2, allg['atc_code']) 511 self.LCTRL_allergies.SetStringItem(list_line, 3, allg['substance']) 512 if allg['generics'] is not None: 513 self.LCTRL_allergies.SetStringItem(list_line, 4, allg['generics']) 514 self.LCTRL_allergies.SetStringItem(list_line, 5, allg['reaction']) 515 self.LCTRL_allergies.SetItemData(list_line, allg['pk_allergy']) 516 for col in range(5): 517 self.LCTRL_allergies.SetColumnWidth(col, wx.LIST_AUTOSIZE) 518 # FIXME: resize event needed ? 519 return True
520 #-----------------------------------------------
521 - def _on_allergy_activated(self, evt):
522 pk_allg = evt.GetData() 523 emr = self.__pat.get_emr() 524 allgs = emr.get_allergies(ID_list=[pk_allg]) 525 self.editarea.set_data(allergy = allgs[0])
526 #====================================================================== 527 # main 528 #---------------------------------------------------------------------- 529 if __name__ == "__main__": 530 531 gmI18N.activate_locale() 532 gmI18N.install_domain(domain='gnumed') 533 534 #-----------------------------------------------
535 - def test_allergy_edit_area_dlg():
536 app = wx.PyWidgetTester(size = (600, 600)) 537 dlg = cAllergyEditAreaDlg(parent=app.frame, id=-1) 538 dlg.ShowModal() 539 # emr = pat.get_emr() 540 # allergy = emr.get_allergies()[0] 541 # dlg = cAllergyEditAreaDlg(parent=app.frame, id=-1, allergy=allergy) 542 # dlg.ShowModal() 543 return
544 #-----------------------------------------------
545 - def test_allergy_manager_dlg():
546 app = wx.PyWidgetTester(size = (800, 600)) 547 dlg = cAllergyManagerDlg(parent=app.frame, id=-1) 548 dlg.ShowModal() 549 return
550 #----------------------------------------------- 551 if len(sys.argv) > 1 and sys.argv[1] == 'test': 552 553 pat = gmPerson.ask_for_patient() 554 if pat is None: 555 sys.exit(0) 556 gmPatSearchWidgets.set_active_patient(pat) 557 558 #test_allergy_edit_area_dlg() 559 test_allergy_manager_dlg() 560 561 # app = wxPyWidgetTester(size = (600, 600)) 562 # app.SetWidget(cAllergyPanel, -1) 563 # app.MainLoop() 564 #====================================================================== 565 # $Log: gmAllergyWidgets.py,v $ 566 # Revision 1.35 2009/06/04 16:30:30 ncq 567 # - use set active patient from pat search widgets 568 # 569 # Revision 1.34 2008/10/22 12:12:31 ncq 570 # - rework allergy manager as per list 571 # 572 # Revision 1.33 2008/10/12 16:04:28 ncq 573 # - rework according to list discussion 574 # 575 # Revision 1.32 2008/07/07 13:43:16 ncq 576 # - current patient .connected 577 # 578 # Revision 1.31 2008/03/06 18:29:29 ncq 579 # - standard lib logging only 580 # 581 # Revision 1.30 2008/01/30 14:03:41 ncq 582 # - use signal names directly 583 # - switch to std lib logging 584 # 585 # Revision 1.29 2008/01/16 19:38:15 ncq 586 # - wxMAC doesn't like some Move*InTabOrder() 587 # 588 # Revision 1.28 2007/10/25 12:19:53 ncq 589 # - no more useless allergy update 590 # 591 # Revision 1.27 2007/09/10 18:35:27 ncq 592 # - help wxPython a bit with tab order 593 # - fix a faulty variable access 594 # - improve test suite 595 # 596 # Revision 1.26 2007/08/12 00:06:59 ncq 597 # - no more gmSignals.py 598 # 599 # Revision 1.25 2007/07/10 20:28:36 ncq 600 # - consolidate install_domain() args 601 # 602 # Revision 1.24 2007/04/02 18:39:52 ncq 603 # - gmFuzzyTimestamp -> gmDateTime 604 # 605 # Revision 1.23 2007/03/27 09:59:47 ncq 606 # - enable spell checker on allergy.reaction 607 # 608 # Revision 1.22 2007/03/26 16:49:50 ncq 609 # - "reaction" can be empty 610 # 611 # Revision 1.21 2007/03/22 11:04:15 ncq 612 # - activate prw match providers 613 # 614 # Revision 1.20 2007/03/21 08:14:01 ncq 615 # - improved allergy manager 616 # - cleanup 617 # 618 # Revision 1.19 2007/03/18 13:57:43 ncq 619 # - re-add lost 1.19 620 # 621 # Revision 1.19 2007/03/12 12:25:15 ncq 622 # - add allergy edit area panel/dialog 623 # - improved test suite 624 # 625 # Revision 1.18 2007/02/04 15:49:31 ncq 626 # - use SetText() on phrasewheel 627 # 628 # Revision 1.17 2006/10/25 07:46:44 ncq 629 # - Format() -> strftime() since datetime.datetime does not have .Format() 630 # 631 # Revision 1.16 2006/10/24 13:20:57 ncq 632 # - do not import gmPG 633 # 634 # Revision 1.15 2006/05/15 13:35:59 ncq 635 # - signal cleanup: 636 # - activating_patient -> pre_patient_selection 637 # - patient_selected -> post_patient_selection 638 # 639 # Revision 1.14 2006/05/04 09:49:20 ncq 640 # - get_clinical_record() -> get_emr() 641 # - adjust to changes in set_active_patient() 642 # - need explicit set_active_patient() after ask_for_patient() if wanted 643 # 644 # Revision 1.13 2006/01/03 12:12:03 ncq 645 # - make epydoc happy re _() 646 # 647 # Revision 1.12 2005/12/27 18:46:39 ncq 648 # - use gmI18N 649 # 650 # Revision 1.11 2005/09/28 21:27:30 ncq 651 # - a lot of wx2.6-ification 652 # 653 # Revision 1.10 2005/09/28 15:57:47 ncq 654 # - a whole bunch of wx.Foo -> wx.Foo 655 # 656 # Revision 1.9 2005/09/26 18:01:50 ncq 657 # - use proper way to import wx26 vs wx2.4 658 # - note: THIS WILL BREAK RUNNING THE CLIENT IN SOME PLACES 659 # - time for fixup 660 # 661 # Revision 1.8 2005/09/24 09:17:27 ncq 662 # - some wx2.6 compatibility fixes 663 # 664 # Revision 1.7 2005/03/20 17:49:11 ncq 665 # - default for id 666 # 667 # Revision 1.6 2005/01/31 10:37:26 ncq 668 # - gmPatient.py -> gmPerson.py 669 # 670 # Revision 1.5 2004/12/15 21:55:00 ncq 671 # - adapt to cleanly separated old/new style edit area 672 # 673 # Revision 1.4 2004/10/27 12:17:22 ncq 674 # - robustify should there not be an active patient 675 # 676 # Revision 1.3 2004/10/11 20:14:16 ncq 677 # - use RegetOnPaintMixin 678 # - attach to backend 679 # - cleanup, remove cruft 680 # 681 # Revision 1.2 2004/07/18 20:30:53 ncq 682 # - wxPython.true/false -> Python.True/False as Python tells us to do 683 # 684 # Revision 1.1 2004/07/17 21:16:38 ncq 685 # - cleanup/refactor allergy widgets: 686 # - Horst space plugin added 687 # - Richard space plugin separated out 688 # - plugin independant GUI code aggregated 689 # - allergies edit area factor out from generic edit area file 690 # 691 # 692