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

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

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