-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddPatientEntryWarning.py
103 lines (91 loc) · 4.11 KB
/
addPatientEntryWarning.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'addPatientEntryWarning.ui'
#
# Created by: PyQt5 UI code generator 5.13.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Warning(object):
def setupUi(self, Warning):
Warning.setObjectName("Warning")
Warning.resize(454, 148)
self.Window=Warning
self.buttonBox = QtWidgets.QDialogButtonBox(Warning)
self.buttonBox.setGeometry(QtCore.QRect(-300, 100, 621, 32))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.label = QtWidgets.QLabel(Warning)
self.label.setGeometry(QtCore.QRect(20, 40, 421, 60))
font = QtGui.QFont()
font.setFamily("Calibri")
font.setPointSize(12)
self.label.setFont(font)
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setObjectName("label")
self.criteria=None
self.retranslateUi(Warning)
self.buttonBox.accepted.connect(self.accepted)
self.buttonBox.rejected.connect(self.canceled)
QtCore.QMetaObject.connectSlotsByName(Warning)
def retranslateUi(self, Warning):
_translate = QtCore.QCoreApplication.translate
Warning.setWindowTitle(_translate("Alert", "Dialog"))
self.label.setText(_translate("Warning", "TextLabel"))
def changeText(self,criteria):
self.criteria=criteria
if criteria=="name":
self.label.setText("Please enter a valid name of the patient.")
elif criteria=="gender":
self.label.setText("Please indicate gender identity of the patient.")
elif criteria=="phone":
self.label.setText("Please enter a valid phone number.")
elif criteria=="saveSuccess":
self.label.setText("Save Success!")
elif criteria=="noPatientSelected":
self.label.setText("There is no patient selected. \nPlease retry after selecting a patient.")
elif criteria=="noRecord":
self.label.setText("There is no record loaded. \nThere is no record to delete.")
elif criteria=="deleted":
self.label.setText("Successfully Deleted")
elif criteria=="noEntry":
self.label.setText("There is no entry given. Please enter all fields.")
elif criteria=="noRecordAddBill":
self.label.setText("Please save before you add the bill")
def changeText1(self,criteria,mother):
if criteria=="delete":
self.criteria=criteria
self.label.setText("Once you delete, the profile cannot be restored. \nContinue?")
elif criteria=="askWhetherToSave1" or criteria=="askWhetherToSave2":
self.label.setText("Would you like to save current service record?")
self.criteria=criteria
elif criteria=="askDelete":
self.label.setText("Once you delete, the record cannot be restored. \nContinue?")
self.criteria=criteria
elif criteria=="initialize":
self.label.setText("Once you initialize, the entire database, including patient, record, \nand finance data will be deleted. Continue?")
self.criteria=criteria
self.mother=mother
def canceled(self):
self.Window.close()
def accepted(self):
if self.criteria=="delete":
self.mother.delete()
elif self.criteria=="askWhetherToSave1":
self.mother.saveRecordNoAlert()
self.mother.openServiceRecord()
elif self.criteria=="askWhetherToSave2":
self.mother.returnHome()
elif self.criteria=="askDelete":
self.mother.deleteRecord()
elif self.criteria=="initialize":
self.mother.initialize()
self.Window.close()
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Warning = QtWidgets.QDialog()
ui = Ui_Warning()
ui.setupUi(Warning)
Warning.show()
sys.exit(app.exec_())