Package Gnumed :: Package wxGladeWidgets :: Module wxgScanIdxPnl |
[frames] | no frames]

# Source Code for Module Gnumed.wxGladeWidgets.wxgScanIdxPnl

      1  # -*- coding: UTF-8 -*-
      2  #
      3  # generated by wxGlade
      4  #
      5
      6  import wx
      7
      8  # begin wxGlade: dependencies
      9  import gettext
     10  # end wxGlade
     11
     12  # begin wxGlade: extracode
     13  # end wxGlade
     14
     15
     16 -class wxgScanIdxPnl(wx.Panel):
     17 -        def __init__(self, *args, **kwds):
     18                  # begin wxGlade: wxgScanIdxPnl.__init__
     19                  kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
     20                  wx.Panel.__init__(self, *args, **kwds)
     21                  from Gnumed.wxpython.gmDocumentWidgets import cDocumentTypeSelectionPhraseWheel
     22                  from Gnumed.wxpython.gmDocumentWidgets import cDocumentCommentPhraseWheel
     23                  from Gnumed.wxpython.gmListWidgets import cReportListCtrl
     24                  from Gnumed.wxpython.gmPhraseWheel import cPhraseWheel
     25                  from Gnumed.wxpython import gmDateTimeInput
     26                  from Gnumed.wxpython import gmEMRStructWidgets
     27                  from Gnumed.wxpython import gmOrganizationWidgets
     28                  self.__btn_scan = wx.Button(self, wx.ID_ANY, _("&Scan page(s)"))
     29                  self.__btn_load = wx.Button(self, wx.ID_ANY, _("Pick &file(s)"))
     30                  self.__btn_clipboard = wx.Button(self, wx.ID_ANY, _("&Clipboard"))
     31                  self._PhWheel_doc_type = cDocumentTypeSelectionPhraseWheel(self, wx.ID_ANY)
     32                  self._PhWheel_doc_date = gmDateTimeInput.cFuzzyTimestampInput(self, wx.ID_ANY)
     33                  self._PhWheel_episode = gmEMRStructWidgets.cEpisodeSelectionPhraseWheel(self, wx.ID_ANY)
     34                  self._PhWheel_source = gmOrganizationWidgets.cOrgUnitPhraseWheel(self, wx.ID_ANY)
     35                  self._RBTN_org_is_source = wx.RadioButton(self, wx.ID_ANY, _("Source"))
     36                  self._RBTN_org_is_receiver = wx.RadioButton(self, wx.ID_ANY, _("Receiver"))
     37                  self._PRW_doc_comment = cDocumentCommentPhraseWheel(self, wx.ID_ANY, "")
     38                  self.__lbl_reviewer = wx.StaticText(self, wx.ID_ANY, _("Intended reviewer:"))
     39                  self._PhWheel_reviewer = cPhraseWheel(self, wx.ID_ANY)
     40                  self._ChBOX_reviewed = wx.CheckBox(self, wx.ID_ANY, _("&review and sign"))
     41                  self._ChBOX_abnormal = wx.CheckBox(self, wx.ID_ANY, _("&technically abnormal"))
     42                  self._ChBOX_relevant = wx.CheckBox(self, wx.ID_ANY, _("&clinically relevant"))
     43                  self._TBOX_description = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_CHARWRAP | wx.TE_MULTILINE | wx.TE_WORDWRAP)
     44                  self._LCTRL_doc_pages = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT)
     45                  self.__btn_show_page = wx.Button(self, wx.ID_ANY, _("Show"))
     46                  self.__btn_del_page = wx.Button(self, wx.ID_ANY, _("Remove part"))
     47                  self.__btn_save = wx.Button(self, wx.ID_ANY, _("Save"))
     48                  self.__btn_discard = wx.Button(self, wx.ID_ANY, _("Discard"))
     49                  self._TCTRL_metadata = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_WORDWRAP)
     50
     51                  self.__set_properties()
     52                  self.__do_layout()
     53
     54                  self.Bind(wx.EVT_BUTTON, self._scan_btn_pressed, self.__btn_scan)
     55                  self.Bind(wx.EVT_BUTTON, self._load_btn_pressed, self.__btn_load)
     56                  self.Bind(wx.EVT_BUTTON, self._clipboard_btn_pressed, self.__btn_clipboard)
     57                  self.Bind(wx.EVT_CHECKBOX, self._reviewed_box_checked, self._ChBOX_reviewed)
     58                  self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_part_selected, self._LCTRL_doc_pages)
     59                  self.Bind(wx.EVT_BUTTON, self._show_btn_pressed, self.__btn_show_page)
     60                  self.Bind(wx.EVT_BUTTON, self._del_btn_pressed, self.__btn_del_page)
     61                  self.Bind(wx.EVT_BUTTON, self._save_btn_pressed, self.__btn_save)
     62                  self.Bind(wx.EVT_BUTTON, self._startover_btn_pressed, self.__btn_discard)
     63                  # end wxGlade
     64
     65 -        def __set_properties(self):
     66                  # begin wxGlade: wxgScanIdxPnl.__set_properties
     67                  self.__btn_scan.SetToolTip(_("Acquire a page from an image source (scanner, camera). This may bring up an intermediate dialog. It uses Sane (Linux) or TWAIN (Windows)."))
     68                  self.__btn_scan.SetFocus()
     69                  self.__btn_scan.SetDefault()
     70                  self.__btn_load.SetToolTip(_("Add a file from the filesystem as a new part. Shows a file selector dialog."))
     71                  self.__btn_clipboard.SetToolTip(_("Load the topmost item from the clipboard."))
     72                  self._PhWheel_doc_type.SetToolTip(_("Required: The type of this document."))
     73                  self._PhWheel_doc_date.SetToolTip(_("The date when the medical information described in the document was produced. This is free text so you can add approximate dates, too, such as 3/2004 where appropriate."))
     74                  self._PhWheel_episode.SetToolTip(_("Required: The primary episode this document is to be listed under."))
     75                  self._PhWheel_source.SetToolTip(_("Optional: The organization (unit) this document originates from (sender) or is intended for (receiver)."))
     76                  self._RBTN_org_is_source.SetToolTip(_("Select if the organization is the source of the document (the default)."))
     77                  self._RBTN_org_is_source.SetValue(1)
     78                  self._RBTN_org_is_receiver.SetToolTip(_("Select if the organization is the receiver of the document.\n\nIn most cases this means that the document was created in this praxis and sent to the organization."))
     79                  self._PRW_doc_comment.SetToolTip(_("Optional: A short comment identifying the document. Good comments give an idea of the content and source of the document."))
     80                  self.__lbl_reviewer.SetForegroundColour(wx.Colour(255, 0, 0))
     81                  self._PhWheel_reviewer.SetToolTip(_("Required: Enter the provider who will be notified about the new document so it can be reviewed. In most cases this is the primary doctor of the patient."))
     82                  self._ChBOX_reviewed.SetToolTip(_("Check this to mark the document as reviewed upon import. If checked you can (and must) decide on \"technically abnormal\" and \"clinically relevant\", too. The default can be set by an option."))
     83                  self._ChBOX_abnormal.SetToolTip(_("Whether this document report technically abormal results."))
     84                  self._ChBOX_abnormal.Enable(False)
     85                  self._ChBOX_relevant.SetToolTip(_("Whether this document reports clinically relevant results. Note that both normal and abnormal resuslts can be relevant."))
     86                  self._ChBOX_relevant.Enable(False)
     87                  self._TBOX_description.SetToolTip(_("Optional: A free-text document description."))
     88                  self._LCTRL_doc_pages.SetToolTip(_("This field lists the parts belonging to the current document."))
     89                  self.__btn_show_page.SetToolTip(_("View the part selected in the above list."))
     90                  self.__btn_del_page.SetToolTip(_("Remove the part selected in the above list. Will ask before physical deletion from disk."))
     91                  self.__btn_save.SetToolTip(_("Save finished document."))
     92                  self.__btn_discard.SetToolTip(_("Start over (discards current data)."))
     93                  self._TCTRL_metadata.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
     94                  self._TCTRL_metadata.SetFont(wx.Font(8, wx.MODERN, wx.NORMAL, wx.NORMAL, 0, ""))
     95                  # end wxGlade
     96
     97 -        def __do_layout(self):
     98                  # begin wxGlade: wxgScanIdxPnl.__do_layout
     99                  __szr_main = wx.BoxSizer(wx.HORIZONTAL)
    100                  __szr_left = wx.BoxSizer(wx.VERTICAL)
    101                  __szr_bottom_third = wx.BoxSizer(wx.HORIZONTAL)
    102                  __szr_middle_left = wx.BoxSizer(wx.HORIZONTAL)
    103                  __szr_parts_list = wx.BoxSizer(wx.VERTICAL)
    104                  __szr_page_actions = wx.BoxSizer(wx.HORIZONTAL)
    105                  __szr_top_left = wx.BoxSizer(wx.HORIZONTAL)
    106                  __szr_top_middle = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Document Properties")), wx.VERTICAL)
    107                  __szr_org_details = wx.BoxSizer(wx.HORIZONTAL)
    108                  __szr_top_left_btns = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Part Sources")), wx.VERTICAL)
    109                  __szr_top_left_btns.Add(self.__btn_scan, 0, wx.BOTTOM | wx.EXPAND, 2)
    110                  __szr_top_left_btns.Add(self.__btn_load, 0, wx.BOTTOM | wx.EXPAND, 2)
    111                  __szr_top_left_btns.Add(self.__btn_clipboard, 0, wx.BOTTOM | wx.EXPAND, 2)
    112                  __szr_top_left.Add(__szr_top_left_btns, 0, wx.EXPAND | wx.LEFT, 5)
    113                  __lbl_doc_type = wx.StaticText(self, wx.ID_ANY, _("Document type:"))
    114                  __lbl_doc_type.SetForegroundColour(wx.Colour(255, 0, 0))
    115                  __szr_top_middle.Add(__lbl_doc_type, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.TOP, 3)
    116                  __szr_top_middle.Add(self._PhWheel_doc_type, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.LEFT, 3)
    117                  __lbl_doc_date = wx.StaticText(self, wx.ID_ANY, _("Date document created:"))
    118                  __szr_top_middle.Add(__lbl_doc_date, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.TOP, 3)
    119                  __szr_top_middle.Add(self._PhWheel_doc_date, 0, wx.EXPAND | wx.LEFT, 3)
    120                  __lbl_doc_episode = wx.StaticText(self, wx.ID_ANY, _("Associate to episode:"))
    121                  __lbl_doc_episode.SetForegroundColour(wx.Colour(255, 0, 0))
    122                  __szr_top_middle.Add(__lbl_doc_episode, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.TOP, 3)
    123                  __szr_top_middle.Add(self._PhWheel_episode, 0, wx.EXPAND | wx.LEFT, 3)
    124                  __lbl_doc_source = wx.StaticText(self, wx.ID_ANY, _("Organization:"))
    125                  __szr_top_middle.Add(__lbl_doc_source, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.TOP, 3)
    126                  __szr_org_details.Add(self._PhWheel_source, 1, wx.EXPAND | wx.LEFT, 3)
    127                  __lbl_org_arrow = wx.StaticText(self, wx.ID_ANY, _(u"\u2794"))
    128                  __szr_org_details.Add(__lbl_org_arrow, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, 5)
    129                  __szr_org_details.Add(self._RBTN_org_is_source, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
    130                  __szr_org_details.Add(self._RBTN_org_is_receiver, 0, wx.ALIGN_CENTER_VERTICAL, 3)
    131                  __szr_top_middle.Add(__szr_org_details, 0, wx.EXPAND, 0)
    132                  __lbl_doc_comment = wx.StaticText(self, wx.ID_ANY, _("Comment / Identification:"))
    133                  __szr_top_middle.Add(__lbl_doc_comment, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.TOP, 3)
    134                  __szr_top_middle.Add(self._PRW_doc_comment, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.LEFT, 3)
    135                  __szr_top_middle.Add(self.__lbl_reviewer, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.TOP, 3)
    136                  __szr_top_middle.Add(self._PhWheel_reviewer, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.LEFT, 3)
    137                  __szr_top_middle.Add(self._ChBOX_reviewed, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.TOP, 3)
    138                  __szr_top_middle.Add(self._ChBOX_abnormal, 0, wx.LEFT, 9)
    139                  __szr_top_middle.Add(self._ChBOX_relevant, 0, wx.LEFT, 9)
    140                  __szr_top_left.Add(__szr_top_middle, 1, wx.EXPAND | wx.LEFT, 5)
    141                  __szr_left.Add(__szr_top_left, 0, wx.BOTTOM | wx.EXPAND, 5)
    142                  __szr_middle_left.Add(self._TBOX_description, 2, wx.EXPAND, 5)
    143                  __szr_parts_list.Add(self._LCTRL_doc_pages, 1, wx.EXPAND | wx.LEFT, 3)
    144                  __szr_page_actions.Add(self.__btn_show_page, 0, wx.RIGHT, 5)
    145                  __szr_page_actions.Add(self.__btn_del_page, 0, 0, 0)
    146                  __szr_parts_list.Add(__szr_page_actions, 0, wx.EXPAND | wx.TOP, 4)
    147                  __szr_middle_left.Add(__szr_parts_list, 3, wx.EXPAND | wx.LEFT, 5)
    148                  __szr_left.Add(__szr_middle_left, 1, wx.BOTTOM | wx.EXPAND, 5)
    149                  __szr_bottom_third.Add(self.__btn_save, 0, wx.EXPAND, 0)
    150                  __szr_bottom_third.Add(self.__btn_discard, 0, wx.EXPAND, 0)
    151                  __szr_left.Add(__szr_bottom_third, 0, wx.EXPAND, 5)
    152                  __szr_main.Add(__szr_left, 3, wx.EXPAND, 0)
    153                  __szr_main.Add(self._TCTRL_metadata, 2, wx.EXPAND | wx.LEFT, 5)
    154                  self.SetSizer(__szr_main)
    155                  __szr_main.Fit(self)
    156                  self.Layout()
    157                  # end wxGlade
    158
    159 -        def _scan_btn_pressed(self, event):  # wxGlade: wxgScanIdxPnl.<event_handler>
    160                  print("Event handler '_scan_btn_pressed' not implemented!")
    161                  event.Skip()
    162
    163 -        def _load_btn_pressed(self, event):  # wxGlade: wxgScanIdxPnl.<event_handler>
    164                  print("Event handler '_load_btn_pressed' not implemented!")
    165                  event.Skip()
    166
    167 -        def _clipboard_btn_pressed(self, event):  # wxGlade: wxgScanIdxPnl.<event_handler>
    168                  print("Event handler '_clipboard_btn_pressed' not implemented!")
    169                  event.Skip()
    170
    171 -        def _reviewed_box_checked(self, event):  # wxGlade: wxgScanIdxPnl.<event_handler>
    172                  print("Event handler '_reviewed_box_checked' not implemented!")
    173                  event.Skip()
    174
    175 -        def _on_part_selected(self, event):  # wxGlade: wxgScanIdxPnl.<event_handler>
    176                  print("Event handler '_on_part_selected' not implemented!")
    177                  event.Skip()
    178
    179 -        def _show_btn_pressed(self, event):  # wxGlade: wxgScanIdxPnl.<event_handler>
    180                  print("Event handler '_show_btn_pressed' not implemented!")
    181                  event.Skip()
    182
    183 -        def _del_btn_pressed(self, event):  # wxGlade: wxgScanIdxPnl.<event_handler>
    184                  print("Event handler '_del_btn_pressed' not implemented!")
    185                  event.Skip()
    186
    187 -        def _save_btn_pressed(self, event):  # wxGlade: wxgScanIdxPnl.<event_handler>
    188                  print("Event handler '_save_btn_pressed' not implemented!")
    189                  event.Skip()
    190
    191 -        def _startover_btn_pressed(self, event):  # wxGlade: wxgScanIdxPnl.<event_handler>
    192                  print("Event handler '_startover_btn_pressed' not implemented!")
    193                  event.Skip()
    194
    195  # end of class wxgScanIdxPnl
    196