private void buttonReject_Click(object sender, EventArgs e)
        {
            Notice notObj = new Notice();

            Patient patObj    = new Patient(storeKeys.loginUserName);
            string  patientID = patObj.getID();

            DoctorClass docObj   = new DoctorClass(notificationListView.SelectedItems[0].Text);
            string      doctorID = docObj.getID();

            //create a method to permit doctor in notice class
            notObj.permitOrDeny("R" + "" + patientID + "" + doctorID);
            MessageBox.Show("You have denied access to your medical records. ");
        }
Esempio n. 2
0
        public ArrayList getDoctorMedicalPermitRequest()
        {
            Patient patObj = new Patient(storeKeys.loginUserName);


            //connection
            string          myConnection = connectionCLass;
            MySqlConnection myConn       = new MySqlConnection(myConnection);

            //query
            string query = "SELECT * FROM wzb_notice WHERE Send_to = @patID AND (Type_is = 'MP' ) And (Response = '-1' )";


            //list to store medicalRequest
            ArrayList medicalRequestList = new ArrayList();

            try
            {
                MySqlCommand cmd = new MySqlCommand(query, myConn);
                cmd.Parameters.AddWithValue("@patID", patObj.getID());
                Console.WriteLine(patObj.getID());
                MySqlDataReader myReader;
                myConn.Open();
                myReader = cmd.ExecuteReader();
                while (myReader.Read())
                {
                    string docID   = myReader["Received_from"].ToString();
                    string message = myReader["Message"].ToString();

                    DoctorClass docObj     = new DoctorClass(docID);
                    string      doctorName = docObj.getName();

                    //build a string to add to to listview
                    medicalRequestList.Add(doctorName);
                    medicalRequestList.Add(message);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            finally
            {
                myConn.Close();
            }

            return(medicalRequestList);
        }
Esempio n. 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            //create arraylist to store legin credentials
            ArrayList userLoginList = new ArrayList();
            //patient_view object
            Patient_View dps = new Patient_View();

            //get textbox fields
            string userName = textBoxUserName.Text;
            string password = textBoxPassword.Text;

            //add textbox values to list, after validating the credentials
            userLoginList = Notice.validateUserInfo(userName, password);
            //Console.WriteLine("count" + userLoginList.Count);

            //if empty, meaning no validated credentials, incorrect login
            if (userLoginList.Count != 0)
            {
                //class objects
                DoctorClass docObj     = new DoctorClass();
                Patient     patObj     = new Patient();
                Notice      thisNotice = (Notice)(userLoginList[0]);
                signedUserName = thisNotice.getUserName();

                //send userName to DoctorClass and Patient in order to store other information used in later queries
                patObj.setUserName(signedUserName);
                docObj.setUserName(signedUserName);

                //retrieve the password and name of the user stored in notice class
                signedPassword = thisNotice.getPassword();
                signedName     = thisNotice.getName();             //added this to pass to both views in order to update who is logged in - will

                storeKeys.loggedInfo = userName;

                //open patient_view, where credentials will be checked
                //will either continue with patient_view, or will open doctor_view
                dps.validateLabel(signedPassword[0], signedName);

                //hide login window
                this.Hide();
            }
            else
            {
                MessageBox.Show("Username or Password is incorrect, please try again!");
            }
        }
Esempio n. 4
0
        private void UserControl2_Load(object sender, EventArgs e)
        {
            Patient patObj = new Patient(storeKeys.loggedInfo);

            textBoxFullName.Text = patObj.getName();

            DoctorClass docObj = new DoctorClass();


            //when appointment page opens it loads the doctors under dr dropdownlist
            List <string> newList = new List <string>();

            newList = docObj.getDoctor();
            //Console.WriteLine("classDoctor2.getDoctor()" + classDoctor2.getDoctor());
            comboBoxDoctor.DataSource    = new BindingSource(newList, null);
            comboBoxDoctor.DropDownStyle = ComboBoxStyle.DropDownList;
            comboBoxDoctor.Enabled       = true;
        }
        private void buttonMakeAppointment_Click(object sender, EventArgs e)
        {
            //create objects for patient class using login username
            Patient patObj = new Patient(storeKeys.loggedInfo);

            DoctorClass docObj = new DoctorClass(comboBoxDoctor.SelectedItem.ToString());

            foreach (Control c in groupBox1.Controls.Cast <Control>().OrderBy(c => c.TabIndex))
            {
                if (string.IsNullOrWhiteSpace(c.Text))
                {
                    MessageBox.Show(string.Format("Empty field {0} ", c.Name.Substring(7)));
                    c.Focus();
                    return;
                }
            }

            //check if appoinment is open or not
            Notice notObj = new Notice();
            int    isOpen = notObj.checkAvailability(dateTimePicker1.Text, comboBoxAvailableHours.SelectedItem.ToString());

            if (isOpen == 1)
            {
                MessageBox.Show("That time is unavailable!");
                return;
            }

            MessageBox.Show("You have successfully made an appointment with " + comboBoxDoctor.SelectedItem.ToString() + ".");

            List <string> appoint = new List <string>();

            appoint.Add(docObj.getID());                                 //doctor ID
            appoint.Add(patObj.getID());                                 // patient id
            appoint.Add(patObj.getName());                               //patient full name
            appoint.Add(comboBoxAvailableHours.SelectedItem.ToString()); //selected appointment time
            appoint.Add(dateTimePicker1.Text);                           //selected appointment date
            appoint.Add(textBoxReason.Text);                             //discription for doctor from patient about the appointment
            patObj.requestDoctorAppointment(appoint);
        }
Esempio n. 6
0
        private void buttonSubmitRefillRequest_Click(object sender, EventArgs e)
        {
            //create objects of different classes
            Notice notObj = new Notice();

            DoctorClass docObj = new DoctorClass(comboBoxDoctor.SelectedItem.ToString());

            Patient patObj = new Patient(storeKeys.loggedInfo);

            textBoxFullName.Text = patObj.getName();



            //check if field is empty
            foreach (Control c in groupBox1.Controls.Cast <Control>().OrderBy(c => c.TabIndex))
            {
                if (string.IsNullOrWhiteSpace(c.Text))
                {
                    MessageBox.Show(string.Format("Empty field {0} ", c.Name.Substring(7)));
                    c.Focus();
                    return;
                }
            }


            //creates a list of data inputed from patient when they request a refill permit - Bereket
            List <string> requestRefillPermitList = new List <string>();

            requestRefillPermitList.Add("RD");                                                                               //type
            requestRefillPermitList.Add(docObj.getID());                                                                     //send t0
            requestRefillPermitList.Add(patObj.getID());                                                                     //received from
            requestRefillPermitList.Add(patObj.getName() + " | " + textBoxMedicationName.Text + " | " + textBoxReason.Text); //message + additional

            //calls a method from patient class to send a doctor phone call request - Bereket
            notObj.SendMessage(requestRefillPermitList);

            MessageBox.Show("You have successfully sent your medicine refill request!");
        }
        private void buttonMakePhoneCallRequest_Click(object sender, EventArgs e)
        {
            //creating an object for patient class using login info
            Patient patObj = new Patient(storeKeys.loggedInfo);

            textBoxFullName.Text = patObj.getName();

            //creating an object for doctor class using doctor name
            DoctorClass docObj = new DoctorClass(comboBoxDoctor.SelectedItem.ToString());


            foreach (Control c in groupBox1.Controls.Cast <Control>().OrderBy(c => c.TabIndex))
            {
                if (string.IsNullOrWhiteSpace(c.Text))
                {
                    MessageBox.Show(string.Format("Empty field {0} ", c.Name.Substring(7)));
                    c.Focus();
                    return;
                }
            }


            //creates a list of inputs from patient when they request an immediate phone call. - Bereket
            List <string> requestDoctorCallList = new List <string>();

            requestDoctorCallList.Add("PD");
            requestDoctorCallList.Add(docObj.getID());
            requestDoctorCallList.Add(patObj.getID());
            requestDoctorCallList.Add(textBoxFullName.Text + " | " + textBoxMobile.Text + " | " + textBoxReason.Text);

            //calls a method from patient class to send a doctor phone call request - Bereket
            //*****Right now i have it where it a method is patient class is called and that methods calls a sendMessage() method in notice class - Bereket
            //You can change it if you want to
            patObj.requestDoctorCall(requestDoctorCallList);
            MessageBox.Show("You have successfully send your request for an immediate phone call.");
        }
Esempio n. 8
0
        //method used to getNotices to display all notices to a doctor
        public List <string> getNotices()
        {
            //objects and variables used
            //username is only used to get id
            //id is used in query
            DoctorClass docObj  = new DoctorClass();
            Patient     patObj  = new Patient();
            string      docUser = docObj.getUserName();
            string      docID   = docObj.calculateID(docUser);


            //connection
            string          myConnection = connectionCLass;
            MySqlConnection myConn       = new MySqlConnection(myConnection);

            //query
            //in the case of a doctor's notices
            string query = "SET FOREIGN_KEY_CHECKS=0; SELECT * FROM wzb_notice WHERE Send_to = @docID " +
                           "AND (Type_is = 'RD' OR Type_is = 'AD' OR Type_is = 'PD' OR Type_is = 'DD');SET FOREIGN_KEY_CHECKS=1";
            MySqlCommand cmd = new MySqlCommand(query, myConn);

            cmd.Parameters.AddWithValue("@docID", docID);
            MySqlDataReader myReader;

            //list to store notices
            List <string> noticeList = new List <string>();

            try
            {
                myConn.Open();
                myReader = cmd.ExecuteReader();
                while (myReader.Read())
                {
                    //store values
                    ID   = myReader["ID"].ToString();
                    type = myReader["Type_is"].ToString();

                    //check type and convert to string
                    //----------
                    // Group
                    //----------

                    // Doctor
                    //----------
                    // Set Appt ------------------------ A
                    // Grant/Reject Refills ------------ R

                    // Patient
                    //----------
                    // Request Phone Call -------------- P
                    // Doctor Asks for Medical Permis -- M

                    //----------
                    // Individual
                    //----------
                    // Pharmacy Recevies Refill Req ---- E
                    // Pharmacy Receives New Presc ----- N
                    // When Medicine is Ready ---------- W
                    // Doctor DIscuss with Pharmacy ---- D
                    if (type == "R")
                    {
                        type = "Refill Request";
                    }
                    else if (type == "P")
                    {
                        type = "Phone Call Request";
                    }
                    else
                    {
                        type = "Appointment Request";
                    }

                    to   = myReader["Send_to"].ToString();
                    from = myReader["Received_from"].ToString();

                    from = patObj.getPatientName(from);

                    message = myReader["Message"].ToString();

                    //build a string to add to to listview
                    noticeList.Add("Notice ID: " + ID + "  |  " + type + "  |  From: " + from + "  |  Message: " + message);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            finally
            {
                myConn.Close();
            }

            //return the list of string objects
            return(noticeList);
        }
Esempio n. 9
0
        public ArrayList getPatientNotices()
        {
            //objects and variables used
            //id is used in query


            Patient patObj  = new Patient(storeKeys.loginUserName);
            string  patID   = patObj.getID();         //patient ID
            string  patName = patObj.getName();       //patient Name
            string  status  = "";


            //connection
            string          myConnection = connectionCLass;
            MySqlConnection myConn       = new MySqlConnection(myConnection);

            //query
            //in the case of a patient's notices
            string query = "SELECT * FROM wzb_notice WHERE (Received_from = @patID) AND (Type_is = 'RD' or Type_is = 'RP' OR Type_is = 'AD' OR Type_is = 'AP' OR Type_is = 'PD' OR Type_is = 'EP')" +
                           "OR Type_is = 'NP' OR Type_is = 'WP'";
            MySqlCommand cmd = new MySqlCommand(query, myConn);

            cmd.Parameters.AddWithValue("@patID", patID);
            MySqlDataReader myReader;

            //list to store notices
            ArrayList noticeList = new ArrayList();

            try
            {
                myConn.Open();
                myReader = cmd.ExecuteReader();
                while (myReader.Read())
                {
                    //store values
                    ID   = myReader["ID"].ToString();
                    type = myReader["Type_is"].ToString();
                    string respond = myReader["Response"].ToString();
                    message = myReader["Message"].ToString();

                    //doctor Name
                    DoctorClass docObj  = new DoctorClass(myReader["Received_from"].ToString());
                    string      docName = docObj.getName();

                    Notice notObj = new Notice();
                    if (respond != "")
                    {
                        status = notObj.checkResponse(type, respond, message);
                        noticeList.Add(status);
                    }


                    //check type and convert to string
                    //----------
                    // Group
                    //----------

                    // Doctor
                    //----------
                    // Set Appt ------------------------ A ---appointment made
                    // Grant/Reject Refills ------------ R ---Refill granted/rejected/in process
                    // Doctor request for medical records M --medical record request

                    // Patient
                    //----------
                    // Request Phone Call -------------- P ---Phone call request accepted

                    //----------
                    // Individual
                    //----------
                    // Pharmacy Recevies Refill Req ---- E ---Refill pharmacy request received
                    // Pharmacy Receives New Presc ----- N ---Prescription pharmacy request received
                    // When Medicine is Ready ---------- W ---Medicine is ready
                    // Doctor DIscuss with Pharmacy ---- D



                    //build a string to add to to listview
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            finally
            {
                myConn.Close();
            }

            return(noticeList);
        }