Gnumed.wxpython.gui.gmNotebookedProgressNoteInputPlugin

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

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

      1  # -*- coding: utf-8 -*-
      2  #======================================================================
      3  # GNUmed notebook based progress note input plugin
      4  # ------------------------------------------------
      5  #
      6  # this plugin displays the list of patient problems
      7  # together whith a notebook container for progress notes
      8  #
      9  # @copyright: author
     10  #======================================================================
     11  __version__ = "$Revision: 1.18 $"
     12  __author__ = "Carlos Moro, Karsten Hilbert"
     13  __license__ = 'GPL v2 or later (details at http://www.gnu.org)'
     14
     15  import logging
     16
     17
     18  if __name__ == '__main__':
     19          # stdlib
     20          import sys
     21          sys.path.insert(0, '../../../')
     22
     23          from Gnumed.pycommon import gmI18N
     24          gmI18N.activate_locale()
     25          gmI18N.install_domain()
     26
     27  # GNUmed
     28  from Gnumed.wxpython import gmPlugin, gmSOAPWidgets
     29  from Gnumed.wxpython import gmAccessPermissionWidgets
     30
     31
     32  _log = logging.getLogger('gm.ui')
     33  _log.info(__version__)
     34
     35  #======================================================================
     36 -class gmNotebookedProgressNoteInputPlugin(gmPlugin.cNotebookPlugin):
     37          """Plugin to encapsulate notebook based progress note input window."""
     38
     39          tab_name = _('Progress notes')
     40          required_minimum_role = 'full clinical access'
     41
     42          @gmAccessPermissionWidgets.verify_minimum_required_role (
     43                  required_minimum_role,
     44                  activity = _('loading plugin <%s>') % tab_name,
     45                  return_value_on_failure = False,
     46                  fail_silently = False
     47          )
     48 -        def register(self):
     49                  gmPlugin.cNotebookPlugin.register(self)
     50          #-------------------------------------------------
     51 -        def name (self):
     52                  return gmNotebookedProgressNoteInputPlugin.tab_name
     53
     54 -        def GetWidget (self, parent):
     55                  self._widget = gmSOAPWidgets.cNotebookedProgressNoteInputPanel(parent, -1)
     56                  return self._widget
     57
     58 -        def MenuInfo (self):
     59                  return None
     60                  #return ('emr', _('&Progress notes editor'))
     61
     62 -        def can_receive_focus(self):
     63                  # need patient
     64                  if not self._verify_patient_avail():
     65                          return None
     66                  return True
     67  #======================================================================
     68  # main
     69  #----------------------------------------------------------------------
     70  if __name__ == "__main__":
     71
     72          # 3rd party
     73          import wx
     74
     75          # GNUmed
     76          from Gnumed.business import gmPersonSearch
     77
     78          _log.info("starting Notebooked progress notes input plugin...")
     79
     80          # obtain patient
     81          patient = gmPersonSearch.ask_for_patient()
     82          if patient is None:
     83                  print "None patient. Exiting gracefully..."
     84                  sys.exit(0)
     85          gmPatSearchWidgets.set_active_patient(patient=patient)
     86
     87          # display standalone multisash progress notes input
     88          application = wx.wx.PyWidgetTester(size=(800,600))
     89          multisash_notes = gmSOAPWidgets.cNotebookedProgressNoteInputPanel(application.frame, -1)
     90
     91          application.frame.Show(True)
     92          application.MainLoop()
     93
     94          # clean up
     95          if patient is not None:
     96                  try:
     97                          patient.cleanup()
     98                  except Exception:
     99                          print "error cleaning up patient"
    100
    101          _log.info("closing Notebooked progress notes input plugin...")
    102  #======================================================================
    103