Package Gnumed :: Package wxpython :: Package patient :: Module gmGP_Referrals
[frames] | no frames]

Source Code for Module Gnumed.wxpython.patient.gmGP_Referrals

  1  ############################################################################# 
  2  # This panel is the gui frontend to allow choice of person to 
  3  # refer to by name, company or category 
  4  # 
  5  # @copyright: author 
  6  # @license: GPL v2 or later (details at http://www.gnu.org) 
  7  ############################################################################ 
  8  # $Source: /home/ncq/Projekte/cvs2git/vcs-mirror/gnumed/gnumed/client/wxpython/patient/gmGP_Referrals.py,v $ 
  9  # $Id: gmGP_Referrals.py,v 1.14 2008-04-13 14:39:49 ncq Exp $ 
 10  __version__ = "$Revision: 1.14 $" 
 11  __author__ = "R.Terry, I.Haywood" 
 12   
 13  try: 
 14          import wxversion 
 15          import wx 
 16  except ImportError: 
 17          from wxPython import wx 
 18   
 19  from Gnumed.wxpython import gmGuiElement_HeadingCaptionPanel, gmGuiElement_DividerCaptionPanel, gmGuiElement_AlertCaptionPanel, gmEditArea, gmPlugin_Patient 
 20  from Gnumed.wxpython.gmPatientHolder import PatientHolder 
 21   
 22  ID_REFERRALDATE = wxNewId() 
 23   
 24  #============================================================== 
25 -class ReferralsPanel (wxPanel, PatientHolder):
26 - def __init__(self,parent, id):
27 PatientHolder.__init__(self) 28 29 wxPanel.__init__(self, parent, id,wxDefaultPosition,wxDefaultSize,wxRAISED_BORDER) 30 self.SetBackgroundColour(wxColor(222,222,222)) 31 # top heading 32 self.referralspanelheading = gmGuiElement_HeadingCaptionPanel.HeadingCaptionPanel(self,-1,_(" REFERRALS ")) 33 #---------------------------------- 34 # put date at top - allow backdating 35 # FIXME remove the fixed date below 36 # FIXME use gmDateTimeInput 37 # FIXME shouldn't this be part of the editarea proper ? 38 #---------------------------------- 39 szr_top = wxBoxSizer(wxHORIZONTAL) 40 self.txt_referraldate = wxTextCtrl(self,ID_REFERRALDATE,"12/06/2002",wxDefaultPosition,wxDefaultSize) 41 spacer_top = wxWindow(self, -1, wxDefaultPosition, wxDefaultSize, 0) 42 spacer_top.SetBackgroundColour(wxColor(222,222,222)) 43 szr_top.Add(spacer_top, 6, wxEXPAND) 44 szr_top.Add(self.txt_referraldate, 1, wxEXPAND|wxALL, 2) 45 szr_top.Add(10, 0, 0) 46 # create referrals specific editarea 47 self.editarea = gmEditArea.gmReferralEditArea(self, -1) 48 # add elements to the main background sizer 49 self.szr_main = wxBoxSizer(wxVERTICAL) 50 self.szr_main.Add(self.referralspanelheading, 0, wxEXPAND) 51 self.szr_main.Add(0, 5, 0) 52 self.szr_main.Add(szr_top, 0, wxEXPAND) 53 self.szr_main.Add(self.editarea, 10, wxEXPAND) 54 self.SetSizer(self.szr_main) 55 self.SetAutoLayout(True) 56 self.Show(True)
57 58 #==============================================================
59 -class gmGP_Referrals (gmPlugin_Patient.wxPatientPlugin):
60 """ 61 Plugin to encapsulate the referrals window 62 """ 63 __icons = { 64 """icon_outgoing_letter""": "x\xda]\xcd;\x0e\x830\x10\x04\xd0\x9eSXJ\xe1T+\\$r\x9dH.\xe3\x82f[\x84R\x05e\ 65 r\xff*\xbb\xb6\xf1\x87\x11B\xccc\x0c\xd7\xfd\xe7\xa6\xc5\xba\xbb\x91\xebf\ 66 \x9c\x9d\xd6\xc5\xc2l\xe6\xb1\xaf\xdb'5\x92v\xf1\xb3&u#\xfd\x85\xef;\x15\xd6\ 67 \x97\xc1\x87g\xf0\xa9G\xed\xf3\\\xbb\xc9!.\x0f\x1d\x12\x1d\xda\x90\xa8jE\xa2\ 68 \xa6m\t!\x9c\x96`\xddaX\x82\x13f-(\x96Q\x94\x0b\x02\xb1`\x04*\xb2*\xabq\x87\ 69 \x8c\x1c\x1e1-G\xcc6\x1eG\x8c\xf2Q\xb9\xf5?\xeas \x0fQ\xa4?:Rj{", 70 71 """icon_writing_pen""": 'x\xda\x8d\x901\x0b\xc3 \x10\x85\xf7\xfc\x8a\x83\x0e\x16\x02\x8ff\xa97+d\x8c\ 72 C\x96[C\xe8\xd4P\xfb\xff\xa7\x1a\xb5P/\x85\xf6!\xc2\xf7\xdd\xbbA\xcf\xdbs\ 73 \xe8f3\\)\x9dt\x99n\x99\rh%\xb7-\xeb=\x93$:Y\xb6\xder\xe6X\xf8\x92\x929\xec<\ 74 \xf2\xe8+S\xe2)>n\x19\xfa}\xe8\xd8y\xc7u\xd8\xe6?\t\xe0 \x051BK\x04@\x94\x14\ 75 \x049\xac#\xf4\x10%KQ\xc9Rle-\xb6\xb2\x16\xb5\xccE%\x01\xfa"?\xde\x8ew~\xfc\ 76 \x12^\x04\x14P\xa7' 77 } 78
79 - def name (self):
80 return 'Referrals'
81
82 - def MenuInfo (self):
83 return ('view', '&Referrals') #FIXME fix the ampersand to a logical place in relationship to other buttons
84
85 - def GetIconData(self, anIconID = None):
86 if anIconID == None: 87 return self.__icons[_("""icon_writing_pen""")] 88 else: 89 if self.__icons.has_key(anIconID): 90 return self.__icons[anIconID] 91 else: 92 return self.__icons[_("""icon_writing_pen""")]
93
94 - def GetWidget (self, parent):
95 return ReferralsPanel(parent, -1)
96 97 #============================================================== 98 if __name__ == "__main__": 99 app = wxPyWidgetTester(size = (600, 600)) 100 app.SetWidget(ReferralsPanel, -1) 101 app.MainLoop() 102 #============================================================== 103 # $Log: gmGP_Referrals.py,v $ 104 # Revision 1.14 2008-04-13 14:39:49 ncq 105 # - no more old style logging 106 # 107 # Revision 1.13 2005/09/26 18:01:53 ncq 108 # - use proper way to import wx26 vs wx2.4 109 # - note: THIS WILL BREAK RUNNING THE CLIENT IN SOME PLACES 110 # - time for fixup 111 # 112 # Revision 1.12 2004/07/18 20:30:54 ncq 113 # - wxPython.true/false -> Python.True/False as Python tells us to do 114 # 115 # Revision 1.11 2004/06/25 13:28:00 ncq 116 # - logically separate notebook and clinical window plugins completely 117 # 118 # Revision 1.10 2004/03/10 14:16:47 ncq 119 # - readability, comments 120 # 121 # Revision 1.9 2004/03/10 12:56:01 ihaywood 122 # fixed sudden loss of main.shadow 123 # more work on referrals, 124 # 125 # Revision 1.8 2004/03/09 07:34:51 ihaywood 126 # reactivating plugins 127 # 128 # Revision 1.7 2003/11/17 10:56:42 sjtan 129 # 130 # synced and commiting. 131 # 132 # Revision 1.2 2003/10/25 08:29:40 sjtan 133 # 134 # uses gmDispatcher to send new currentPatient objects to toplevel gmGP_ widgets. Proprosal to use 135 # yaml serializer to store editarea data in narrative text field of clin_root_item until 136 # clin_root_item schema stabilizes. 137 # 138 # Revision 1.1 2003/10/23 06:02:40 sjtan 139 # 140 # manual edit areas modelled after r.terry's specs. 141 # 142 # Revision 1.6 2003/02/02 13:34:28 ncq 143 # - cvs keyword metadata 144 # 145 # @change log: 146 # 01.08.2002 rterry initial implementation, untested 147