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

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

     1  # -*- coding: utf-8 -*-
     2  #======================================================================
     3  # GNUmed patient measurements plugin
     4  #
     5  # @copyright: author
     6  #======================================================================
     7  __author__ = "Karsten Hilbert"
     8  __license__ = 'GPL v2 or later (details at http://www.gnu.org)'
     9
    10  import logging
    11
    12
    13  from Gnumed.wxpython import gmPlugin
    14  from Gnumed.wxpython import gmMeasurementWidgets
    15  from Gnumed.pycommon import gmI18N
    16  from Gnumed.wxpython import gmAccessPermissionWidgets
    17
    18
    19  _log = logging.getLogger('gm.ui')
    20
    21  #======================================================================
    22 -class gmMeasurementsPlugin(gmPlugin.cNotebookPlugin):
    23          """Plugin to encapsulate patient measurements."""
    24
    25          tab_name = _('Measurements')
    26          required_minimum_role = 'full clinical access'
    27
    28          #-------------------------------------------------
    29          @gmAccessPermissionWidgets.verify_minimum_required_role (
    30                  required_minimum_role,
    31                  activity = _('loading plugin <%s>') % tab_name,
    32                  return_value_on_failure = False,
    33                  fail_silently = False
    34          )
    35 -        def register(self):
    36                  gmPlugin.cNotebookPlugin.register(self)
    37
    38          #-------------------------------------------------
    39 -        def name (self):
    40                  return gmMeasurementsPlugin.tab_name
    41
    42          #-------------------------------------------------
    43 -        def GetWidget (self, parent):
    44                  self._widget = gmMeasurementWidgets.cMeasurementsNb(parent, -1)
    45                  return self._widget
    46
    47          #-------------------------------------------------
    48 -        def MenuInfo (self):
    49                  return ('emr', _('&Measurements'))
    50
    51          #-------------------------------------------------
    52 -        def can_receive_focus(self):
    53                  if not self._verify_patient_avail():
    54                          return None
    55                  return 1
    56
    57  #======================================================================
    58  # main
    59  #----------------------------------------------------------------------
    60  if __name__ == "__main__":
    61          print("no test code")
    62