Gnumed.wxpython.patient.gmDemographics

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

# Source Code for Module Gnumed.wxpython.patient.gmDemographics

      1  #############################################################################
      2  # gmDemographics
      3  # ----------------------------------
      4  #
      5  # This panel will hold all the patients details
      6  #
      7  # If you don't like it - change this code see @TODO!
      8  #
      9  # @copyright: authorcd
     10  # @license: GPL v2 or later (details at http://www.gnu.org)
     11  # @dependencies: wxPython (>= version 2.3.1)
     12  # @change log:
     13  #           10.06.2002 rterry initial implementation, untested
     14  #           30.07.2002 rterry images put in file
     15  # @TODO:
     16  ############################################################################
     17  # $Source: /home/ncq/Projekte/cvs2git/vcs-mirror/gnumed/gnumed/client/wxpython/patient/gmDemographics.py,v $
     18  # $Id: gmDemographics.py,v 1.40 2008-04-13 14:39:49 ncq Exp $
     19  __version__ = "$Revision: 1.40 $"
     20  __author__ = "R.Terry, SJ Tan"
     21
     22
     23  try:
     24          import wxversion
     25          import wx
     26  except ImportError:
     27          from wxPython import wx
     28
     29  from mx import DateTime
     30
     31  from Gnumed.pycommon import gmGuiBroker, gmDispatcher
     32
     33  import gmPlugin
     34  import gmSQLListControl
     35  from string import *
     36  #import gmGP_PatientPicture
     37
     38  ID_PATIENT = wxNewId()
     39  ID_PATIENTSLIST = wxNewId()
     40  ID_ALL_MENU  = wxNewId()
     41  ID_ADDRESSLIST = wxNewId()
     42  ID_NAMESLIST = wxNewId()
     43  ID_CURRENTADDRESS = wxNewId()
     44  gmSECTION_PATIENT = 5
     45  ID_COMBOTITLE = wxNewId()
     46  ID_COMBOSEX = wxNewId()
     47  ID_COMBOMARITALSTATUS = wxNewId()
     48  ID_COMBONOKRELATIONSHIP = wxNewId()
     49  ID_TXTSURNAME = wxNewId()
     50  ID_TXTFIRSTNAME = wxNewId()
     51  ID_TXTSALUTATION = wxNewId()
     52  ID_TXTSTREET = wxNewId()
     53  ID_TXTSUBURB = wxNewId()
     54  ID_TXTSTATE = wxNewId()
     55  ID_TXTPOSTCODE = wxNewId()
     56  ID_TXTBIRTHDATE = wxNewId()
     57  ID_TXTCOUNTRYOFBIRTH = wxNewId()
     58  ID_TXTOCCUPATION = wxNewId()
     59  ID_TXTNOKADDRESS = wxNewId()
     60  ID_TXTHOMEPHONE = wxNewId()
     61  ID_TXTWORKPHONE = wxNewId()
     62  ID_TXTFAX = wxNewId()
     63  ID_TXTEMAIL = wxNewId()
     64  ID_TXTINTERNET = wxNewId()
     65  ID_TXTMOBILE = wxNewId()
     66  ID_TXTMEMO = wxNewId()
     67  ID_LISTADDRESSES = wxNewId()
     68  ID_BUTTONBROWSENOK = wxNewId()
     69  ID_BUTTONPHOTOAQUIRE = wxNewId()
     70  ID_BUTTONPHOTOEXPORT = wxNewId()
     71  ID_BUTTONPHOTOIMPORT = wxNewId()
     72  ID_CHKBOXRESIDENCE = wxNewId()
     73  ID_CHKBOXPOSTAL = wxNewId()
     74  ID_CHKBOXPREFERREDALIAS = wxNewId()
     75  ID_BUTTONFINDPATIENT = wxNewId()
     76  ID_TXTPATIENTFIND = wxNewId()
     77  ID_TXTPATIENTAGE = wxNewId()
     78  ID_TXTPATIENTALLERGIES  = wxNewId()
     79
     80  #------------------------------------
     81  #Dummy data to simulate allergy items
     82  #------------------------------------
     83  aliasdata = {
     84  1 : ("Peter Patient"),
     85  2 : ("Bruce Dag"),
     86  }
     87  namelistdata = [
     88          'Smith Adan 129 Box Hill Road BOX HILL etc....',
     89          'Smith Jean 52 WhereEver Street CANBERRA etc.....',
     90          'Smith Michael 99 Longbeach Rd MANLYVALE  etc........'
     91  ]
     92
     93  addressdata = ['129 Afred Street WARNERS BAY 2280', '99 Wolfe Street NEWCASTLE 2301']
     94
     95  #--------------------------------------------------
     96  #Class which shows a blue bold label left justified
     97  #--------------------------------------------------
     98 -class BlueLabel(wxStaticText):
     99 -        def __init__(self, parent, id, prompt):
    100                  wxStaticText.__init__(self,parent, id,prompt,wxDefaultPosition,wxDefaultSize,wxALIGN_LEFT)
    101                  self.SetFont(wxFont(12,wxSWISS,wxNORMAL,wxBOLD,False,''))
    102                  self.SetForegroundColour(wxColour(0,0,131))
    103  #------------------------------------------------------------
    104  #text control class to be later replaced by the gmPhraseWheel
    105  #------------------------------------------------------------
    106 -class TextBox_RedBold(wxTextCtrl):
    107 -        def __init__ (self, parent, id): #, wxDefaultPostion, wxDefaultSize):
    108                  wxTextCtrl.__init__(self,parent,id,"",wxDefaultPosition, wxDefaultSize,wxSIMPLE_BORDER)
    109                  self.SetForegroundColour(wxColor(255,0,0))
    110                  self.SetFont(wxFont(12,wxSWISS,wxNORMAL, wxBOLD,False,''))
    111 -class TextBox_BlackNormal(wxTextCtrl):
    112 -        def __init__ (self, parent, id): #, wxDefaultPostion, wxDefaultSize):
    113                  wxTextCtrl.__init__(self,parent,id,"",wxDefaultPosition, wxDefaultSize,wxSIMPLE_BORDER)
    114                  self.SetForegroundColour(wxColor(0,0,0))
    115                  self.SetFont(wxFont(12,wxSWISS,wxNORMAL, wxBOLD,False,''))
    116  #------------------------------------------------------------
    117 -class PatientsPanel(wxPanel, gmDataPanelMixin.DataPanelMixin):
    118 -        def __init__(self, parent, plugin, id=wxNewId ()):
    119                  wxPanel.__init__(self, parent, id ,wxDefaultPosition,wxDefaultSize,wxRAISED_BORDER|wxTAB_TRAVERSAL)
    120                  gmDataPanelMixin.DataPanelMixin.__init__(self)
    121                  self.gb = gmGuiBroker.GuiBroker ()
    122                  self.mwm = self.gb['clinical.manager']
    123                  self.plugin = plugin
    124                  # controls on the top toolbar are available via plugin.foo
    125                  self.addresslist = wxListBox(self,ID_NAMESLIST,wxDefaultPosition,wxDefaultSize,addressdata,wxLB_SINGLE)
    126                  self.addresslist.SetFont(wxFont(12,wxSWISS, wxNORMAL, wxNORMAL, False, '')) #first list with patient names
    127                  self.addresslist.SetForegroundColour(wxColor(180,182,180))
    128                  # code to link up SQLListControl
    129                  self.patientslist = gmSQLListControl.SQLListControl (self, ID_PATIENTSLIST, hideid=True, style= wxLC_REPORT|wxLC_NO_HEADER|wxSUNKEN_BORDER)
    130                  self.patientslist.SetFont(wxFont(12,wxSWISS, wxNORMAL, wxNORMAL, False, '')) #first list with patient names
    131                  EVT_LIST_ITEM_SELECTED (self.patientslist, ID_PATIENTSLIST, self.OnPatient)
    132                  self.lbl_surname = BlueLabel(self,-1,"Surname")
    133                  self.lbl_firstname = BlueLabel(self,-1,"Firstname")
    134                  self.lbl_preferredname = BlueLabel(self,-1,"Salutation")
    135                  self.lbl_title = BlueLabel(self,-1,"Title")
    136                  self.lbl_sex = BlueLabel(self,-1,"Sex ")
    137                  self.lbl_street = BlueLabel(self,-1,"Street")
    138                  self.lbl_suburb = BlueLabel(self,-1,"Suburb")
    139                  self.lbl_zip = BlueLabel(self,-1,"Postcode")
    140                  self.lbl_address_s = BlueLabel(self,-1,"Address(s)")
    141                  self.lbl_birthdate = BlueLabel(self,-1,"Birthdate")
    142                  self.lbl_maritalstatus = BlueLabel(self,-1,"  Marital Status")
    143                  self.lbl_occupation = BlueLabel(self,-1,"Occupation")
    144                  self.lbl_birthplace = BlueLabel(self,-1,"Born In")
    145                  self.lbl_nextofkin = BlueLabel(self,-1,"")
    146                  self.lbl_addressNOK = BlueLabel(self,-1,"Next of Kin")
    147                  self.lbl_relationship = BlueLabel(self,-1,"  Relationship  ")
    148                  self.lbl_homephone = BlueLabel(self,-1,"Home Phone")
    149                  self.lbl_workphone = BlueLabel(self,-1,"Work Phone")
    150                  self.lbl_fax = BlueLabel(self,-1,"Fax")
    151                  self.lbl_mobile = BlueLabel(self,-1,"Mobile")
    152                  self.lbl_email = BlueLabel(self,-1,"Email")
    153                  self.lbl_web = BlueLabel(self,-1,"Web")
    154                  self.lbl_mobile = BlueLabel(self,-1,"Mobile")
    155                  self.lbl_line6gap = BlueLabel(self,-1,"")
    156                  self.titlelist = ['Mr', 'Mrs', 'Miss', 'Mst', 'Ms', 'Dr', 'Prof']
    157                  self.combo_relationship = wxComboBox(self, 500, "", wxDefaultPosition,wxDefaultSize, ['Father','Mother'], wxCB_DROPDOWN)
    158                  self.txt_surname = TextBox_RedBold(self,-1)
    159                  self.combo_title = wxComboBox(self, 500, "", wxDefaultPosition,wxDefaultSize,self.titlelist, wxCB_DROPDOWN)
    160                  self.txt_firstname = TextBox_RedBold(self,-1)
    161                  self.combo_sex = wxComboBox(self, 500, "", wxDefaultPosition,wxDefaultSize, ['M','F'], wxCB_DROPDOWN)
    162                  self.cb_preferredname = wxCheckBox(self, -1, _("Preferred Name"), wxDefaultPosition,wxDefaultSize, wxNO_BORDER)
    163                  self.txt_preferred = TextBox_RedBold(self,-1)
    164                  self.txt_address = wxTextCtrl(self, 30, "",
    165                                                wxDefaultPosition,wxDefaultSize, style=wxTE_MULTILINE|wxNO_3D|wxSIMPLE_BORDER)
    166                  self.txt_address.SetInsertionPoint(0)
    167                  self.txt_address.SetFont(wxFont(12,wxSWISS, wxNORMAL, wxNORMAL, False, ''))
    168                  self.txt_suburb = TextBox_BlackNormal(self,-1)
    169                  self.txt_zip = TextBox_BlackNormal(self,-1)
    170                  self.txt_birthdate = TextBox_BlackNormal(self,-1)
    171                  self.combo_maritalstatus = wxComboBox(self, 500, "", wxDefaultPosition,wxDefaultSize,
    172                                                        ['single','married'], wxCB_DROPDOWN)
    173                  self.txt_occupation = TextBox_BlackNormal(self,-1)
    174                  self.txt_countryofbirth = TextBox_BlackNormal(self,-1)
    175                  self.btn_browseNOK = wxButton(self,-1,"Browse NOK") #browse database to pick next of Kin
    176                  self.txt_nameNOK = wxTextCtrl(self, 30,
    177                                                "Peter Smith \n"
    178                                                "22 Lakes Way \n"
    179                                                "Valentine 2280",
    180                                                wxDefaultPosition,wxDefaultSize, style=wxTE_MULTILINE|wxNO_3D|wxSIMPLE_BORDER)
    181                  self.txt_nameNOK.SetInsertionPoint(0)
    182                  self.txt_nameNOK.SetFont(wxFont(12,wxSWISS, wxNORMAL, wxNORMAL, False, ''))
    183                  self.txt_homephone = TextBox_BlackNormal(self,-1)
    184                  self.txt_workphone = TextBox_BlackNormal(self,-1)
    185                  self.txt_fax = TextBox_BlackNormal(self,-1)
    186
    187                  self.txt_email = TextBox_BlackNormal(self,-1)
    188                  self.txt_web = TextBox_BlackNormal(self,-1)
    189                  self.txt_mobile = TextBox_BlackNormal(self,-1)
    190                  #----------------------
    191                  #create the check boxes
    192                  #----------------------
    193                  self.cb_addressresidence = wxCheckBox(self, -1, " Residence ", wxDefaultPosition,wxDefaultSize, wxNO_BORDER)
    194                  self.cb_addresspostal = wxCheckBox(self, -1, " Postal ", wxDefaultPosition,wxDefaultSize, wxNO_BORDER)
    195                  #--------------------
    196                  # create the buttons
    197                  #--------------------
    198                  self.btn_photo_import= wxButton(self,-1,"Import")
    199                  self.btn_photo_export = wxButton(self,-1,"Export")
    200                  self.btn_photo_aquire = wxButton(self,-1,"Acquire")
    201                  #-------------------------------------------------------
    202                  #Add the each line of controls to a horizontal box sizer
    203                  #-------------------------------------------------------
    204                  self.sizer_line0_left = wxBoxSizer(wxHORIZONTAL)
    205                  #line one:surname, title
    206                  self.sizer_line1_left = wxBoxSizer(wxHORIZONTAL)
    207                  self.sizer_line1_left.Add(self.lbl_surname,3, wxGROW|wxALIGN_CENTER_VERTICAL,5)
    208                  self.sizer_line1_left.Add(self.txt_surname,7,wxEXPAND)
    209                  self.sizer_line1_left.Add(0,0,1)
    210                  self.sizer_line1_left.Add(self.lbl_title,2,wxALIGN_CENTER_VERTICAL, 5)
    211                  self.sizer_line1_left.Add(self.combo_title,4,wxEXPAND)
    212                  #line two:firstname, sex
    213                  self.sizer_line2_left = wxBoxSizer(wxHORIZONTAL)
    214                  self.sizer_line2_left.Add(self.lbl_firstname,3,wxGROW|wxALIGN_CENTER_VERTICAL,5)
    215                  self.sizer_line2_left.Add(self.txt_firstname,7,wxEXPAND)
    216                  self.sizer_line2_left.Add(0,0,1)
    217                  self.sizer_line2_left.Add(self.lbl_sex,2,wxGROW|wxALIGN_CENTER_VERTICAL,5)
    218                  self.sizer_line2_left.Add(self.combo_sex,4,wxEXPAND)
    219                  #line three:preferred salutation
    220                  self.sizer_line3_left = wxBoxSizer(wxHORIZONTAL)
    221                  self.sizer_line3_left.Add(self.lbl_preferredname,3,wxGROW|wxALIGN_CENTER_VERTICAL,5)
    222                  self.sizer_line3_left.Add(self.txt_preferred,7,wxEXPAND)
    223                  self.sizer_line3_left.Add(1,0,7)
    224                  #line four: preferred alias
    225                  self.sizer_line4_left = wxBoxSizer(wxHORIZONTAL)
    226                  self.sizer_line4_left.Add(1,0,3)
    227                  self.sizer_line4_left.Add(self.cb_preferredname,7,wxEXPAND)
    228                  self.sizer_line4_left.Add(1,0,7)
    229                  #line6 on this left side is blank
    230                  self.sizer_line6_left = wxBoxSizer(wxHORIZONTAL)
    231                  self.sizer_line6_left.Add(self.lbl_line6gap,1,wxEXPAND)
    232                  #----------------
    233                  #3:street details
    234                  #a) the label
    235                  sizer_lblstreet = wxBoxSizer(wxVERTICAL)
    236                  sizer_lblstreet.Add(self.lbl_street,1, wxEXPAND)
    237                  #--------------------
    238                  #3:street details
    239                  #b) multiline textbox
    240                  #-------------------
    241                  self.sizer_line7_left = wxBoxSizer(wxHORIZONTAL)
    242                  self.sizer_line7_left.Add(0,0,1)
    243                  #------------------------------
    244                  #3:street details
    245                  #c) residence or postal address
    246                  #------------------------------
    247                  sizer_respostal = wxBoxSizer(wxVERTICAL)
    248                  sizer_respostal.Add(self.cb_addressresidence,1,wxEXPAND)
    249                  sizer_respostal.Add(self.cb_addresspostal,1,wxEXPAND)
    250                  #sizer_respostal.Add(1,0,1)
    251                  self.sizer_line7_left = wxBoxSizer(wxHORIZONTAL)
    252                  self.sizer_line7_left.Add(sizer_lblstreet,3,wxALIGN_CENTER_VERTICAL,5)
    253                  self.sizer_line7_left.Add(self.txt_address,7,wxEXPAND)
    254                  self.sizer_line7_left.Add(0,0,1)
    255                  self.sizer_line7_left.Add(sizer_respostal,6,wxEXPAND)
    256                  #--------------------------
    257                  # create the suburb details
    258                  #--------------------------
    259                  self.sizer_line8_left = wxBoxSizer(wxHORIZONTAL)
    260                  self.sizer_line8_left.Add(self.lbl_suburb,3,wxALIGN_CENTER_VERTICAL,5)
    261                  self.sizer_line8_left.Add(self.txt_suburb,7,wxEXPAND)
    262                  self.sizer_line8_left.Add(0,0,1)
    263                  self.sizer_line8_left.Add(self.lbl_zip,3,wxALIGN_CENTER_VERTICAL,5)
    264                  self.sizer_line8_left.Add(self.txt_zip,3,wxEXPAND)
    265                  #--------------------------------
    266                  # create the multiple address box
    267                  #--------------------------------
    268                  self.sizer_line9_left = wxBoxSizer(wxHORIZONTAL)
    269                  self.sizer_line9_left.Add(self.lbl_address_s,3,wxALIGN_CENTER_VERTICAL,5)
    270                  self.sizer_line9_left.Add(self.addresslist,14,wxEXPAND)
    271                  #-------------------------------------------------------------------------
    272                  #now add all the left hand line sizers to the one left hand vertical sizer
    273                  #-------------------------------------------------------------------------
    274                  self.leftside = wxBoxSizer(wxVERTICAL)
    275                  self.leftside.Add(self.sizer_line1_left,0,wxEXPAND|wxALL,1)
    276                  self.leftside.Add(self.sizer_line2_left,0,wxEXPAND|wxALL,1)
    277                  self.leftside.Add(self.sizer_line3_left,0,wxEXPAND|wxALL,1)
    278                  self.leftside.Add(self.sizer_line4_left,0,wxEXPAND|wxALL,1)
    279                  self.leftside.Add(self.sizer_line6_left,0,wxEXPAND|wxALL,1)
    280                  self.leftside.Add(self.sizer_line7_left,0,wxEXPAND|wxALL,1)
    281                  self.leftside.Add(self.sizer_line8_left,0,wxEXPAND|wxALL,1)
    282                  self.leftside.Add(self.sizer_line9_left,0,wxEXPAND|wxALL,1)
    283                  #---------------------------------------------------
    284                  #now add textboxes etc to the right hand line sizers
    285                  #---------------------------------------------------
    286                  self.sizer_line0_right = wxBoxSizer(wxHORIZONTAL)
    287                  self.sizer_line1_right = wxBoxSizer(wxHORIZONTAL)
    288                  self.sizer_line2_right = wxBoxSizer(wxHORIZONTAL)
    289                  self.sizer_line3_right = wxBoxSizer(wxHORIZONTAL)
    290                  self.sizer_line4_right = wxBoxSizer(wxHORIZONTAL)
    291                  self.sizer_line5_right = wxBoxSizer(wxHORIZONTAL)
    292                  self.sizer_line6_right = wxBoxSizer(wxHORIZONTAL)
    293                  self.sizer_line7_right = wxBoxSizer(wxHORIZONTAL)
    294                  self.sizer_line8_right = wxBoxSizer(wxHORIZONTAL)
    295                  self.sizer_line9_right = wxBoxSizer(wxHORIZONTAL)
    296                  self.sizer_line10_right = wxBoxSizer(wxHORIZONTAL)
    297                  self.sizer_line11_right = wxBoxSizer(wxHORIZONTAL)
    298                  #line1 _ birthdate, maritial status
    299                  self.sizer_line1_right.Add(self.lbl_birthdate,2,wxALIGN_CENTER_VERTICAL,0)
    300                  self.sizer_line1_right.Add(self.txt_birthdate,2,wxALIGN_LEFT)
    301                  self.sizer_line1_right.Add(self.lbl_maritalstatus,2,wxALIGN_CENTRE,0)
    302                  self.sizer_line1_right.Add(self.combo_maritalstatus, 2, wxALIGN_CENTER_VERTICAL,0)
    303                  #line2 - occupation (use word wheel later in place of text box)
    304                  self.sizer_line2_right.Add(self.lbl_occupation,2,wxALIGN_CENTER_VERTICAL,0)
    305                  self.sizer_line2_right.Add(self.txt_occupation,6,wxEXPAND)
    306                  #line3 - country of birth (use word wheel later)
    307                  self.sizer_line3_right.Add(self.lbl_birthplace,2,wxALIGN_CENTER_VERTICAL,0)
    308                  self.sizer_line3_right.Add(self.txt_countryofbirth,6,wxEXPAND)
    309                  #line 4 - next of kin + browse for next of kin
    310                  self.sizer_line4_right.Add(self.lbl_nextofkin, 2,wxALIGN_CENTER_VERTICAL,0)
    311                  self.sizer_line4_right.Add(self.btn_browseNOK,2, wxALIGN_CENTER_VERTICAL)
    312                  #self.sizer_line4_right.Add(0,0,1)
    313                  self.sizer_line4_right.Add(self.lbl_relationship,2, wxALIGN_CENTER_VERTICAL,0)
    314                  self.sizer_line4_right.Add(self.combo_relationship,2,wxEXPAND)
    315                  #name of next of kin
    316                  self.sizer_gap_vertical =wxBoxSizer(wxVERTICAL)
    317                  self.sizer_gap_vertical.Add(1,47,1)
    318                  self.sizer_line5_right.Add(self.lbl_addressNOK,2,wxEXPAND)
    319                  self.sizer_line5_right.Add(self.txt_nameNOK, 6,wxEXPAND)
    320                  self.sizer_line5_right.AddSizer(self.sizer_gap_vertical)
    321                  #----------------------------------------------------------------------------
    322                  # Contact numbers are on their own separate vertical sizer as the photo sits
    323                  # next to this
    324                  #----------------------------------------------------------------------------
    325                  self.sizer_contacts = wxBoxSizer(wxVERTICAL)
    326                  self.sizer_line6_right.Add(self.lbl_homephone, 3,wxALIGN_CENTRE,0)
    327                  self.sizer_line6_right.Add(self.txt_homephone, 5,wxEXPAND)
    328                  self.sizer_line6_right.Add(0,0,1)
    329                  self.sizer_contacts.Add(self.sizer_line6_right,0,wxEXPAND)
    330                  self.sizer_line7_right.Add(self.lbl_workphone,3,wxALIGN_CENTRE,0)
    331                  self.sizer_line7_right.Add(self.txt_workphone, 5,wxEXPAND)
    332                  self.sizer_line7_right.Add(0,0,1)
    333                  self.sizer_contacts.Add(self.sizer_line7_right,0,wxEXPAND)
    334                  self.sizer_line8_right.Add(self.lbl_fax,3,wxALIGN_CENTRE,0)
    335                  self.sizer_line8_right.Add(self.txt_fax, 5,wxEXPAND)
    336                  self.sizer_line8_right.Add(0,0,1)
    337                  self.sizer_contacts.Add(self.sizer_line8_right,0,wxEXPAND)
    338                  self.sizer_line9_right.Add(self.lbl_email,3,wxALIGN_CENTRE,0)
    339                  self.sizer_line9_right.Add(self.txt_email, 5,wxEXPAND)
    340                  self.sizer_line9_right.Add(0,0,1)
    341                  self.sizer_contacts.Add(self.sizer_line9_right,0,wxEXPAND)
    342                  self.sizer_line10_right.Add(self.lbl_web,3,wxALIGN_CENTRE,0)
    343                  self.sizer_line10_right.Add(self.txt_web, 5,wxEXPAND)
    344                  self.sizer_line10_right.Add(0,0,1)
    345                  self.sizer_contacts.Add(self.sizer_line10_right,0,wxEXPAND)
    346                  self.sizer_line11_right.Add(self.lbl_mobile,3,wxALIGN_CENTRE,0)
    347                  self.sizer_line11_right.Add(self.txt_mobile, 5,wxEXPAND)
    348                  self.sizer_line11_right.Add(0,0,1)
    349                  self.sizer_contacts.Add(self.sizer_line11_right,0,wxEXPAND)
    350                  self.sizer_photo = wxBoxSizer(wxVERTICAL)
    351  #               self.patientpicture = gmGP_PatientPicture.cPatientPicture(self, -1)
    352                  self.sizer_photo.Add(self.patientpicture,3,wxALIGN_CENTER_HORIZONTAL,0)
    353                  self.sizer_photo.Add(self.btn_photo_aquire,1,wxALIGN_CENTER_HORIZONTAL,0)
    354                  self.sizer_photo.Add(self.btn_photo_export,1,wxALIGN_CENTER_HORIZONTAL,0)
    355                  self.sizer_photo.Add(self.btn_photo_import,1,wxALIGN_CENTER_HORIZONTAL,0)
    356                  self.sizer_contactsandphoto  = wxBoxSizer(wxHORIZONTAL)
    357                  self.sizer_contactsandphoto.AddSizer(self.sizer_contacts,6,wxALIGN_CENTER_VERTICAL,0)
    358                  self.sizer_contactsandphoto.AddSizer(self.sizer_photo,2,wxALIGN_CENTER_VERTICAL,0)
    359                  self.rightside = wxBoxSizer(wxVERTICAL)
    360                  self.rightside.Add(self.sizer_line1_right,0,wxEXPAND|wxALL,1)
    361                  self.rightside.Add(self.sizer_line2_right,0,wxEXPAND|wxALL,1)
    362                  self.rightside.Add(self.sizer_line3_right,0,wxEXPAND|wxALL,1)
    363                  self.rightside.Add(self.sizer_line4_right,0,wxEXPAND|wxALL,1)
    364                  self.rightside.Add(self.sizer_line5_right,0,wxEXPAND|wxALL,1)
    365                  self.rightside.Add(self.sizer_contactsandphoto,0,wxEXPAND|wxALL,1)
    366                  self.mainsizer = wxBoxSizer(wxVERTICAL)
    367                  self.topsizer = wxBoxSizer(wxHORIZONTAL)
    368                  self.sizerunder = wxBoxSizer(wxHORIZONTAL)
    369                  self.sizerunder.AddSizer(self.leftside,10,wxEXPAND|wxALL,5)
    370                  self.sizerunder.Add(1,0,1)
    371                  self.sizerunder.AddSizer(self.rightside,10,wxEXPAND|wxALL,5)
    372                  self.mainsizer.Add(self.patientslist,3,wxEXPAND)
    373                  self.mainsizer.Add(self.sizerunder,0,wxEXPAND|wxALL,10)
    374                  self.SetSizer(self.mainsizer)
    375                  self.SetAutoLayout(True)
    376                  self.Show(False)
    377
    378
    379 -        def OnPatient (self, event):
    380                  pat_id = event.GetData ()
    381                  index = event.GetIndex ()
    382                  gmLog.gmDefLog.Log (gmLog.lInfo, "selected patient ID %s" % pat_id)
    383                  pat_title = self.patientslist.GetItem (index, 0).GetText ()
    384                  pat_fname = self.patientslist.GetItem (index, 1).GetText ()
    385                  pat_lname = self.patientslist.GetItem (index, 2).GetText ()
    386                  pat_dob = self.patientslist.GetItem (index, 3).GetText ()
    387                  # load the demographic text controls
    388                  # send a signal to other objects
    389                  kwds = {'title':pat_title, 'firstnames':pat_fname, 'lastnames':pat_lname, 'dob':pat_dob, 'ID':pat_id}
    390                  gmDispatcher.send ('post_patient_selection', sender='Terry Patient Selector', kwds=kwds )
    391
    392 -        def FindPatient (self, name):
    393                  self.patientslist.SetQueryStr (gmPatientNameQuery.MakeQuery (name), service='personalia')
    394                  self.patientslist.RunQuery ()
    395
    396  #============================================================
    397  #class gmDemographics(gmPlugin.wxBasePlugin):
    398  #       """A plugin for searching the patient database by name.
    399  #
    400  #       Required the gmPatientWindowPlugin to be loaded.
    401  #       CANNOT BE UNLOADED
    402  #       """
    403  #       def name (self):
    404  #               return 'Patient Search'
    405  #       #--------------------------------------------------------
    406  #       def register (self):
    407  #               # first, set up the widgets on the top line of the toolbar
    408  #               top_panel = self.gb['main.top_panel']
    409  #
    410  #               # and register ourselves as a widget
    411  #               self.gb['modules.patient'][self.__class__.__name__] = self              # split/renamed 'horstspace.notebook.%s'
    412  #               self.mwm = self.gb['clinical.manager']
    413  #               self.widget = PatientsPanel (self.mwm, self)
    414  #               self.mwm.RegisterWholeScreen(self.__class__.__name__, self.widget)
    415  #               self.RegisterInterests()
    416  #       #--------------------------------------------------------
    417  #       def OnTool (self, event):
    418  #               pass
    419  #               self.mwm.Display (self.__class__.__name__)
    420  #               print "OnTool"
    421  #               self.gb['modules.gui']['Patient'].Raise()               # split/renamed 'horstspace.notebook.%s'
    422  #
    423  #       def RegisterInterests(self):
    424  #               pass
    425  #               gmDispatcher.connect(self.OnSelected, gmSignals.post_patient_selection())
    426  #
    427  #       def OnSelected (self, **kwargs):
    428  #               pass
    429  #----------------------------------------------------------------------
    430  if __name__ == "__main__":
    431          import gmGuiBroker
    432          app = wxPyWidgetTester(size = (800, 600))
    433          app.SetWidget(PatientsPanel, -1)
    434          app.MainLoop()
    435  #----------------------------------------------------------------------
    436