//Accepts the appointment and sends notice that the appointment was accepted
        private void acceptButton_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = new DialogResult();

            dialogResult = new ConfirmationPopup("Are you sure you want to accept this appointment request?", "").ShowDialog();
            if (dialogResult == DialogResult.OK)
            {
                selectedAppointment.updateStatus("Accepted");

                // Send notice to patient that their appointment was accepted
                String message = Doctor.retrieveDoctorName(User.Id) + " has accepted your appointment request.";
                Notice.sendNotice(Int32.Parse(selectedAppointment.PatientID), message, Notice.SEND_APPOINTMENT_REQUEST_ACCEPT_NOTICE_TYPE);

                populateListView();
                viewAppointmentsPanel.Show();
                appointmentDetailPanel.Hide();
            }
        }
Esempio n. 2
0
        //after confirmation, create new appointment
        private void selectAppointmentButton_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = new ConfirmationPopup("Are you sure you want to request this appointment?",
                                                              "Appointment with " + selectedDoctor.Name + " at " + listBox1.SelectedItem + " on " + dateLabel.Text).ShowDialog();

            if (dialogResult == DialogResult.OK)
            {
                //Create new appointment
                DateTime date = Convert.ToDateTime(dateLabel.Text);
                DateTime time = Convert.ToDateTime(listBox1.SelectedItem);
                date = date.AddHours(time.Hour);
                date = date.AddMinutes(time.Minute);
                Appointment.createAppointment(selectedDoctor.Id, User.Id, date.ToString("yyyy-MM-dd HH:mm:ss"), "New");

                //Display confirmation
                new AlertDialog("The appointment was requested.").ShowDialog();
            }
        }
        //Sends a record request denied notice to the doctor
        private void denyButton_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = new DialogResult();

            dialogResult = new ConfirmationPopup("Are you sure you want to deny this record request?", "").ShowDialog();
            if (dialogResult == DialogResult.OK)
            {
                //deny the record request
                String message    = Patient.retrievePatientByID(User.Id).Name + " has denied your request to view their medical records.";
                int    receiverID = Notice.retrievedDoctorSenderID(selectedNotice.Id);
                Notice.sendNotice(receiverID, message, Notice.SEND_RECORD_REQUEST_REJECT_NOTICE_TYPE);

                //after denying a request, return to notifications
                Notice.retrieveNotices();
                populateList();
                noticeDetailPanel.Hide();
                notificationListPanel.Show();
            }
        }
        //Sends a record request accepted notice to the doctor and grants the doctor access to the patient's records
        private void acceptButton_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = new DialogResult();

            dialogResult = new ConfirmationPopup("Are you sure you want to accept this record request?", "").ShowDialog();
            if (dialogResult == DialogResult.OK)
            {
                //accept the record request
                int    doctorID = Notice.retrievedDoctorSenderID(selectedNotice.Id);
                String message  = Patient.retrievePatientByID(User.Id).Name + " has accepted your request to view their medical records.";
                Notice.sendNotice(doctorID, message, Notice.SEND_RECORD_REQUEST_ACCEPT_NOTICE_TYPE);
                Doctor.grantRecordAccess(doctorID, User.Id);

                //after accepting a request, return to notifications
                Notice.retrieveNotices();
                populateList();
                noticeDetailPanel.Hide();
                notificationListPanel.Show();
            }
        }