Exemple #1
0
    def get_data_search(self, table, item):

        if item.text() == "":
            item.setStyleSheet("QLineEdit{ "
                               "border:none;"
                               "border-radius:5;"
                               "background-color:#af2b44;}"
                               "QLineEdit:focus {"
                               "border:none;"
                               "border-radius:5;"
                               "background-color:white;}")
            return
        item.setStyleSheet("QLineEdit{ "
                           "border:none;"
                           "border-radius:5;"
                           "background-color:white;}")

        hospital.execute(
            "select date_appointment,time_appointment,Doctor_UserCode,Username,Patient_UserCode "
            "from appointment, user where appointment.Doctor_UserCode = user.User_Code and User_Code=%s",
            (item.text(), ))
        filters = hospital.fetchall()
        for i in range(table.rowCount() - 1):
            table.removeRow(i)
        print(table.rowCount())

        for i in range(len(filters)):
            table.insertRow(i)

        for i in range(len(filters)):
            for j in range(4):
                text = QTableWidgetItem(str(filters[i][j]))
                table.setItem(i, j, text)
        print("successful")
Exemple #2
0
    def get_data_search(self, table, item):

        if item.text() == "":
            item.setStyleSheet("QLineEdit{ "
                               "border:none;"
                               "border-radius:5;"
                               "background-color:#af2b44;}"
                               "QLineEdit:focus {"
                               "border:none;"
                               "border-radius:5;"
                               "background-color:white;}")
            return
        item.setStyleSheet("QLine Edit{ "
                           "border:none;"
                           "border-radius:5;"
                           "background-color:white;}")

        hospital.execute(
            "select DrugName,ExpirationDate,Price from drug where ExpirationDate > %s order by ExpirationDate asc",
            (item.text(), ))
        filters = hospital.fetchall()

        for i in range(table.rowCount() - 1):
            table.removeRow(i)
            print(table.rowCount())
Exemple #3
0
    def get_data(self, table):
        hospital.execute("select DrugName,ExpirationDate,Price from drug")
        drugs = hospital.fetchall()
        for i in range(len(drugs)):
            table.insertRow(i)

        for i in range(len(drugs)):
            for j in range(3):
                text = QTableWidgetItem(str(drugs[i][j]))
                table.setItem(i, j, text)
        table.insertRow(table.rowCount())
Exemple #4
0
    def get_data(self, table):
        hospital.execute(
            "select date_appointment,time_appointment,Doctor_UserCode,Username,Patient_UserCode "
            "from appointment, user where appointment.Doctor_UserCode = user.User_Code"
        )
        appointments = hospital.fetchall()
        for i in range(len(appointments)):
            table.insertRow(i)

        for i in range(len(appointments)):
            for j in range(4):
                text = QTableWidgetItem(str(appointments[i][j]))
                table.setItem(i, j, text)
Exemple #5
0
    def get_data(self, table):
        hospital.execute(
            "select user.User_Code,Username,Phone_Number,`E-Mail` from user,"
            "user_role where user.User_Code = user_role.user_Code "
            "and user_role.role_ID = 3 and user.isVerified=0;")
        doctors = hospital.fetchall()
        for i in range(len(doctors)):
            table.insertRow(i)

        for i in range(len(doctors)):
            for j in range(4):
                print(i)
                text = QTableWidgetItem(str(doctors[i][j]))
                table.setItem(i, j, text)
Exemple #6
0
    def get_drugs(self, username):
        hospital.execute(
            "select drug.Drug_ID,DrugName "
            "from drug, has_drug, given, prescription where given.Patient_UserCode =%s "
            "and given.PrescriptionID = prescription.PrescriptionID "
            "and prescription.DrugFlag = true "
            "and ExamineFlag = false "
            "and has_drug.Drug_ID = drug.Drug_ID "
            "and has_drug.Prescription_ID = given.PrescriptionID",
            (username, ))

        drugs = hospital.fetchall()
        drug_string = ""

        for i in range(len(drugs)):
            drug_string = drug_string + str(i +
                                            1) + ":" + drugs[i][1] + "(" + str(
                                                drugs[i][0]) + ")" + "\n"

        return drug_string
Exemple #7
0
 def get_date(self, table, username):
     hospital.execute(
         "select date_appointment,time_appointment,Patient_UserCode,Username "
         "from appointment, user where "
         "appointment.Patient_UserCode = user.User_Code and Doctor_UserCode=%s",
         (username, ))
     appointments = hospital.fetchall()
     for i in range(len(appointments)):
         table.insertRow(i)
     for i in range(len(appointments)):
         for j in range(4):
             if j == 2:
                 button = QPushButton(str(appointments[i][2]))
                 button.setStyleSheet(
                     "QPushButton{"
                     "background-color: rgba(255, 255, 255, 50);"
                     "color:rgb(0,0,0)}")
                 table.setCellWidget(i, 2, button)
                 button.clicked.connect(
                     lambda: self.show_patient_drog_history(appointments[i][
                         2]))
                 continue
             text = QTableWidgetItem(str(appointments[i][j]))
             table.setItem(i, j, text)