1
2
3
4
5
6 import wx
7
8
9 import gettext
10
11
12
13
14
15
18
19 kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX | wx.RESIZE_BORDER
20 wx.Dialog.__init__(self, *args, **kwds)
21 from Gnumed.wxpython.gmEMRStructWidgets import cEpisodeSelectionPhraseWheel
22 self._PhWheel_episode = cEpisodeSelectionPhraseWheel(self, wx.ID_ANY, style=wx.NO_BORDER)
23 from Gnumed.wxpython.gmDocumentWidgets import cDocumentTypeSelectionPhraseWheel
24 self._PhWheel_doc_type = cDocumentTypeSelectionPhraseWheel(self, wx.ID_ANY, style=wx.NO_BORDER)
25 from Gnumed.wxpython.gmOrganizationWidgets import cOrgUnitPhraseWheel
26 self._PRW_org = cOrgUnitPhraseWheel(self, wx.ID_ANY, "")
27 self._RBTN_org_is_source = wx.RadioButton(self, wx.ID_ANY, _("Source"))
28 self._RBTN_org_is_receiver = wx.RadioButton(self, wx.ID_ANY, _("Receiver"))
29 from Gnumed.wxpython.gmHospitalStayWidgets import cHospitalStayPhraseWheel
30 self._PRW_hospital_stay = cHospitalStayPhraseWheel(self, wx.ID_ANY, "")
31 from Gnumed.wxpython.gmDocumentWidgets import cDocumentCommentPhraseWheel
32 self._PRW_doc_comment = cDocumentCommentPhraseWheel(self, wx.ID_ANY, "")
33 from Gnumed.wxpython.gmDateTimeInput import cFuzzyTimestampInput
34 self._PhWheel_doc_date = cFuzzyTimestampInput(self, wx.ID_ANY, style=wx.NO_BORDER)
35 self._TCTRL_reference = wx.TextCtrl(self, wx.ID_ANY, "")
36 self._TCTRL_filename = wx.TextCtrl(self, wx.ID_ANY, "")
37 self._SPINCTRL_seq_idx = wx.SpinCtrl(self, wx.ID_ANY, "", min=0, max=10000, style=wx.SP_ARROW_KEYS | wx.SP_WRAP | wx.TE_AUTO_URL | wx.TE_NOHIDESEL)
38 self._LCTRL_existing_reviews = wx.ListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_ALIGN_LEFT | wx.LC_HRULES | wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.LC_VRULES)
39 self._TCTRL_responsible = wx.TextCtrl(self, wx.ID_ANY, _("(you are/are not the primary reviewer)"), style=wx.TE_READONLY)
40 self._ChBOX_review = wx.CheckBox(self, wx.ID_ANY, _("review document"))
41 self._ChBOX_abnormal = wx.CheckBox(self, wx.ID_ANY, _("technically abnormal"))
42 self._ChBOX_responsible = wx.CheckBox(self, wx.ID_ANY, _("take over responsibility"))
43 self._ChBOX_relevant = wx.CheckBox(self, wx.ID_ANY, _("clinically relevant"))
44 self._ChBOX_sign_all_pages = wx.CheckBox(self, wx.ID_ANY, _("sign all pages"))
45 self._BTN_save = wx.Button(self, wx.ID_OK, _("Save"))
46 self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, _("Cancel"))
47
48 self.__set_properties()
49 self.__do_layout()
50
51 self.Bind(wx.EVT_CHECKBOX, self._on_reviewed_box_checked, self._ChBOX_review)
52 self.Bind(wx.EVT_BUTTON, self._on_save_button_pressed, id=wx.ID_OK)
53
54
56
57 self.SetTitle(_("Edit document properties"))
58 self._PhWheel_episode.SetToolTip(_("Shows the episode associated with this document. Select another one or type in a new episode name to associate a different one."))
59 self._PRW_org.SetToolTip(_("The organizational unit this document originates from."))
60 self._RBTN_org_is_source.SetToolTip(_("Select if the organization is the source (sender) of the document."))
61 self._RBTN_org_is_source.SetValue(1)
62 self._RBTN_org_is_receiver.SetToolTip(_("Select if the organization is the target (receiver) of the document.\n\nMostly when the document was sent from this praxis."))
63 self._PRW_hospital_stay.SetToolTip(_("Select the hospital stay associated with this document."))
64 self._PhWheel_doc_date.SetToolTip(_("Enter the date of creation of the document."))
65 self._TCTRL_reference.SetToolTip(_("Enter the ID by which this document is referenced externally."))
66 self._TCTRL_filename.SetToolTip(_("An example file name for this document type.\n\nMainly used to derive a file name extension during export for operating systems which need that to guesstimate the viewer."))
67 self._SPINCTRL_seq_idx.SetToolTip(_("The sequence index or page number. If invoked from a document instead of a page always applies to the first page."))
68 self._LCTRL_existing_reviews.SetToolTip(_("Lists previous reviews for this document part.\n\nThe first line (marked with an icon) will show your previous review if there is one.\nThe second line (marked with a blue bar) will display the review of the responsible provider if there is such a review.\n\n You can edit your review below."))
69 self._LCTRL_existing_reviews.Enable(False)
70 self._TCTRL_responsible.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
71 self._ChBOX_review.SetToolTip(_("Check this if you want to edit your review."))
72 self._ChBOX_abnormal.SetToolTip(_("Does this document inform on a state of the patient's health that is technically abnormal ?"))
73 self._ChBOX_abnormal.Enable(False)
74 self._ChBOX_responsible.SetToolTip(_("Check this if you intend to take over responsibility for this document and not just review it."))
75 self._ChBOX_responsible.Enable(False)
76 self._ChBOX_relevant.SetToolTip(_("Is this document clinically relevant."))
77 self._ChBOX_relevant.Enable(False)
78 self._ChBOX_sign_all_pages.SetToolTip(_("Apply review to entire document rather than just this part or page."))
79 self._ChBOX_sign_all_pages.Enable(False)
80 self._ChBOX_sign_all_pages.SetValue(1)
81 self._BTN_save.SetToolTip(_("Save your review."))
82 self._BTN_cancel.SetToolTip(_("Cancel this review."))
83 self._BTN_cancel.SetFocus()
84 self._BTN_cancel.SetDefault()
85
86
88
89 __szr_main = wx.BoxSizer(wx.VERTICAL)
90 __szr_bottom = wx.BoxSizer(wx.HORIZONTAL)
91 __szr_box_review = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Your review")), wx.VERTICAL)
92 __szr_grid_review = wx.FlexGridSizer(3, 2, 0, 0)
93 __szr_reviews = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Reviews by others")), wx.HORIZONTAL)
94 __szr_grid_properties = wx.FlexGridSizer(9, 2, 2, 3)
95 __szr_org_details = wx.BoxSizer(wx.HORIZONTAL)
96 __lbl_episode_picker = wx.StaticText(self, wx.ID_ANY, _("Episode"))
97 __lbl_episode_picker.SetForegroundColour(wx.Colour(255, 0, 0))
98 __szr_grid_properties.Add(__lbl_episode_picker, 0, wx.ALIGN_CENTER_VERTICAL, 0)
99 __szr_grid_properties.Add(self._PhWheel_episode, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
100 __lbl_type = wx.StaticText(self, wx.ID_ANY, _("Type"))
101 __lbl_type.SetForegroundColour(wx.Colour(255, 0, 0))
102 __szr_grid_properties.Add(__lbl_type, 0, wx.ALIGN_CENTER_VERTICAL, 0)
103 __szr_grid_properties.Add(self._PhWheel_doc_type, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
104 __lbl_org = wx.StaticText(self, wx.ID_ANY, _("Source"))
105 __szr_grid_properties.Add(__lbl_org, 0, wx.ALIGN_CENTER_VERTICAL, 0)
106 __szr_org_details.Add(self._PRW_org, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
107 __lbl_org_arrow = wx.StaticText(self, wx.ID_ANY, _(u"\u2794"))
108 __szr_org_details.Add(__lbl_org_arrow, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, 5)
109 __szr_org_details.Add(self._RBTN_org_is_source, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 3)
110 __szr_org_details.Add(self._RBTN_org_is_receiver, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 3)
111 __szr_grid_properties.Add(__szr_org_details, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
112 __lbl_stay = wx.StaticText(self, wx.ID_ANY, _("Hospital Stay"))
113 __szr_grid_properties.Add(__lbl_stay, 0, wx.ALIGN_CENTER_VERTICAL, 0)
114 __szr_grid_properties.Add(self._PRW_hospital_stay, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
115 __lbl_comment = wx.StaticText(self, wx.ID_ANY, _("Comment"))
116 __szr_grid_properties.Add(__lbl_comment, 0, wx.ALIGN_CENTER_VERTICAL, 0)
117 __szr_grid_properties.Add(self._PRW_doc_comment, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
118 __lbl_doc_date = wx.StaticText(self, wx.ID_ANY, _("Date"))
119 __lbl_doc_date.SetForegroundColour(wx.Colour(255, 0, 0))
120 __szr_grid_properties.Add(__lbl_doc_date, 0, wx.ALIGN_CENTER_VERTICAL, 0)
121 __szr_grid_properties.Add(self._PhWheel_doc_date, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
122 __lbl_reference = wx.StaticText(self, wx.ID_ANY, _("Reference"))
123 __szr_grid_properties.Add(__lbl_reference, 0, wx.ALIGN_CENTER_VERTICAL, 0)
124 __szr_grid_properties.Add(self._TCTRL_reference, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
125 __lbl_filename = wx.StaticText(self, wx.ID_ANY, _("Filename"))
126 __lbl_filename.SetToolTip(_("The original filename (if any). Only editable if invoked from a single part of the document."))
127 __szr_grid_properties.Add(__lbl_filename, 0, wx.ALIGN_CENTER_VERTICAL, 0)
128 __szr_grid_properties.Add(self._TCTRL_filename, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
129 __lbl_seq_idx = wx.StaticText(self, wx.ID_ANY, _("Seq #"))
130 __lbl_seq_idx.SetToolTip(_("The sequence index or page number. If invoked from a document instead of a page always applies to the first page."))
131 __szr_grid_properties.Add(__lbl_seq_idx, 0, wx.ALIGN_CENTER_VERTICAL, 0)
132 __szr_grid_properties.Add(self._SPINCTRL_seq_idx, 1, wx.ALIGN_CENTER_VERTICAL, 0)
133 __szr_grid_properties.AddGrowableCol(1)
134 __szr_main.Add(__szr_grid_properties, 1, wx.EXPAND, 5)
135 __szr_reviews.Add(self._LCTRL_existing_reviews, 1, wx.EXPAND, 0)
136 __szr_main.Add(__szr_reviews, 1, wx.EXPAND, 0)
137 __szr_box_review.Add(self._TCTRL_responsible, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND, 0)
138 __szr_grid_review.Add(self._ChBOX_review, 0, 0, 0)
139 __szr_grid_review.Add((5, 5), 1, wx.EXPAND, 0)
140 __szr_grid_review.Add(self._ChBOX_abnormal, 0, wx.LEFT, 10)
141 __szr_grid_review.Add(self._ChBOX_responsible, 0, wx.LEFT, 10)
142 __szr_grid_review.Add(self._ChBOX_relevant, 0, wx.LEFT, 10)
143 __szr_grid_review.Add(self._ChBOX_sign_all_pages, 0, wx.LEFT, 10)
144 __szr_box_review.Add(__szr_grid_review, 1, wx.EXPAND, 0)
145 __szr_main.Add(__szr_box_review, 1, wx.EXPAND, 0)
146 __szr_bottom.Add(self._BTN_save, 0, 0, 0)
147 __szr_bottom.Add(self._BTN_cancel, 0, 0, 0)
148 __szr_main.Add(__szr_bottom, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
149 self.SetSizer(__szr_main)
150 __szr_main.Fit(self)
151 self.Layout()
152 self.Centre()
153
154
156 print("Event handler '_on_reviewed_box_checked' not implemented!")
157 event.Skip()
158
160 print("Event handler '_on_save_button_pressed' not implemented!")
161 event.Skip()
162
163
164