Package Gnumed :: Package wxpython :: Package gui :: Module gmPatientOverviewPlugin |
[frames] | no frames]

# Source Code for Module Gnumed.wxpython.gui.gmPatientOverviewPlugin

     1  #======================================================================
     2  # GNUmed patient overview plugin
     3  # ------------------------------
     4  #
     5  # @copyright: author
     6  #======================================================================
     7  __author__ = "Carlos Moro, Karsten Hilbert"
     8  __license__ = 'GPL v2 or later (details at http://www.gnu.org)'
     9
    10  import logging
    11
    12
    13  if __name__ == '__main__':
    14          # stdlib
    15          import sys
    16          sys.path.insert(0, '../../../')
    17
    18          from Gnumed.pycommon import gmI18N
    19          gmI18N.activate_locale()
    20          gmI18N.install_domain()
    21
    22  # GNUmed
    23  from Gnumed.wxpython import gmPlugin, gmPatOverviewWidgets
    24
    25
    26  _log = logging.getLogger('gm.ui')
    27  #======================================================================
    28 -class gmPatientOverviewPlugin(gmPlugin.cNotebookPlugin):
    29
    30          tab_name = _('Overview')
    31
    32 -        def name (self):
    33                  return gmPatientOverviewPlugin.tab_name
    34
    35 -        def GetWidget (self, parent):
    36                  self._widget = gmPatOverviewWidgets.cPatientOverviewPnl(parent, -1)
    37                  return self._widget
    38
    39 -        def MenuInfo (self):
    40                  return ('emr', _('&Overview'))
    41
    42 -        def can_receive_focus(self):
    43                  # need patient
    44                  if not self._verify_patient_avail():
    45                          return None
    46                  return True
    47  #======================================================================
    48  # main
    49  #----------------------------------------------------------------------
    50  if __name__ == "__main__":
    51
    52          # 3rd party
    53          import wx
    54
    55          # GNUmed
    56          from Gnumed.business import gmPersonSearch
    57          from Gnumed.wxpython import gmSOAPWidgets
    58
    59          _log.info("starting Notebooked progress notes input plugin...")
    60
    61          try:
    62                  # obtain patient
    63                  patient = gmPersonSearch.ask_for_patient()
    64                  if patient is None:
    65                          print "None patient. Exiting gracefully..."
    66                          sys.exit(0)
    67                  gmPatSearchWidgets.set_active_patient(patient=patient)
    68
    69                  # display standalone multisash progress notes input
    70                  application = wx.wx.PyWidgetTester(size = (800,600))
    71                  multisash_notes = gmSOAPWidgets.cNotebookedProgressNoteInputPanel(application.frame, -1)
    72
    73                  application.frame.Show(True)
    74                  application.MainLoop()
    75
    76                  # clean up
    77                  if patient is not None:
    78                          try:
    79                                  patient.cleanup()
    80                          except:
    81                                  print "error cleaning up patient"
    82          except StandardError:
    83                  _log.exception("unhandled exception caught !")
    84                  # but re-raise them
    85                  raise
    86
    87          _log.info("closing Notebooked progress notes input plugin...")
    88  #======================================================================
    89