Ejemplo n.º 1
0
        public FormDoctorAppointment(BusinessLayer.AppointmentInformation app, BusinessLayer.PatientInformation pat)
        {
            InitializeComponent();
            //Set window title.
            this.Text = "Appointment - " + pat.FirstName + " " + pat.LastName;
            //Set active appointment and patient.
            activeAppointment = app;
            activePatient     = pat;

            //Set patient name and lastname
            textBoxFirstName.Text = activePatient.FirstName;
            textBoxLastName.Text  = activePatient.LastName;

            //Get new description if there was a change
            activeAppointment           = BusinessLayer.DoctorFacade.GetActAppInfo(app);
            richTextBoxDescription.Text = activeAppointment.Description;
            richTextBoxDiagnosis.Text   = activeAppointment.Diagnosis;

            if (activeAppointment.Status == "BEG")
            {
                buttonBeginAppointment.Text = "Continue appointment";
            }
            else if (activeAppointment.Status == "COMP")
            {
                buttonBeginAppointment.Enabled = false;
            }
        }
Ejemplo n.º 2
0
 private void searchForPatients()
 {
     //Get search criteria.
     BusinessLayer.PatientInformation patientSearchCriteria = new BusinessLayer.PatientInformation();
     patientSearchCriteria.FirstName = textBoxFirstName.Text;
     patientSearchCriteria.LastName  = textBoxLastName.Text;
     patientSearchCriteria.PESEL     = textBoxPESEL.Text;
     //Search and display.
     dataGridViewPatients.Columns.Clear();
     dataGridViewPatients.DataSource       = BusinessLayer.ReceptionistFacade.GetPatients(patientSearchCriteria);
     dataGridViewPatients.Columns[0].Width = 72;
     dataGridViewPatients.Columns[1].Width = 124;
     dataGridViewPatients.Columns[2].Width = 124;
     dataGridViewPatients.Columns[3].Width = 124;
     //Reorder columns.
     dataGridViewPatients.Columns[1].DisplayIndex = 0;
     dataGridViewPatients.Columns[2].DisplayIndex = 1;
     dataGridViewPatients.Columns[3].DisplayIndex = 2;
     dataGridViewPatients.Columns[0].DisplayIndex = 3;
     //Select first patient if not empty.
     if (dataGridViewPatients.Rows.Count > 0)
     {
         dataGridViewPatients.CurrentCell = dataGridViewPatients[0, 0];
     }
     //Search for appointments.
     searchForAppointments();
 }
 public FormReceptionistEditPatient(BusinessLayer.PatientInformation patientInformation)
 {
     InitializeComponent();
     //Set window title.
     this.Text = "Edit Patient";
     editedPatientInformation = patientInformation;
     textBoxFirstName.Text    = patientInformation.FirstName;
     textBoxLastName.Text     = patientInformation.LastName;
     textBoxPESEL.Text        = patientInformation.PESEL;
 }
Ejemplo n.º 4
0
        public FormDoctorHistory(BusinessLayer.AppointmentInformation actApp, BusinessLayer.PatientInformation actPat, BusinessLayer.DoctorInformation actDoc)
        {
            InitializeComponent();
            //Set window title.
            this.Text         = "Patient History - " + actPat.FirstName + " " + actPat.LastName;
            activeAppointment = actApp;
            activeDoctor      = actDoc;
            activePatient     = actPat;

            textBoxFirstName.Text = actPat.FirstName;
            textBoxLastName.Text  = actPat.LastName;

            searchForAppointments();
        }
 public FormReceptionistCancelAppointment(BusinessLayer.PatientInformation patient, BusinessLayer.ReceptionistFacade.ReceptionistAppointment appointment)
 {
     InitializeComponent();
     //Set window title.
     this.Text           = "Cancel Appointment";
     canceledAppointment = appointment;
     //Fill patient textboxes.
     textBoxFirstName.Text = patient.FirstName;
     textBoxLastName.Text  = patient.LastName;
     textBoxPESEL.Text     = patient.PESEL;
     //Fill appointment textboxes.
     textBoxDoctor.Text      = appointment.DoctorFirstName + " " + appointment.DoctorLastName;
     textBoxDateAndTime.Text = appointment.Date.ToString();
 }
Ejemplo n.º 6
0
 public FormDoctorManageExaminations(BusinessLayer.AppointmentInformation actApp, BusinessLayer.PatientInformation actPat, BusinessLayer.DoctorInformation actDoc)
 {
     InitializeComponent();
     //Set window title.
     this.Text             = "Examinations - " + actPat.FirstName + " " + actPat.LastName;
     activeAppointment     = actApp;
     activeDoctor          = actDoc;
     activePatient         = actPat;
     textBoxFirstName.Text = activePatient.FirstName;
     textBoxLastName.Text  = activePatient.LastName;
     //Initial search.
     searchForPhysExams();
     searchForLabExams();
 }
 public FormReceptionistNewAppointment(BusinessLayer.PatientInformation patientInfo, BusinessLayer.ReceptionistInformation receptionistInfo)
 {
     InitializeComponent();
     //Set window title.
     this.Text               = "New Appointment";
     patientInformation      = patientInfo;
     receptionistInformation = receptionistInfo;
     //Create table of tuples: <radio buttons, corresponding time>.
     timeButtons = new List <Tuple <RadioButton, TimeSpan> >()
     {
         Tuple.Create(radioButton0, new TimeSpan(6, 0, 0)),
         Tuple.Create(radioButton1, new TimeSpan(6, 30, 0)),
         Tuple.Create(radioButton2, new TimeSpan(7, 0, 0)),
         Tuple.Create(radioButton3, new TimeSpan(7, 30, 0)),
         Tuple.Create(radioButton4, new TimeSpan(8, 0, 0)),
         Tuple.Create(radioButton5, new TimeSpan(8, 30, 0)),
         Tuple.Create(radioButton6, new TimeSpan(9, 0, 0)),
         Tuple.Create(radioButton7, new TimeSpan(9, 30, 0)),
         Tuple.Create(radioButton8, new TimeSpan(10, 0, 0)),
         Tuple.Create(radioButton9, new TimeSpan(10, 30, 0)),
         Tuple.Create(radioButton10, new TimeSpan(11, 0, 0)),
         Tuple.Create(radioButton11, new TimeSpan(11, 30, 0)),
         Tuple.Create(radioButton12, new TimeSpan(12, 0, 0)),
         Tuple.Create(radioButton13, new TimeSpan(12, 30, 0)),
         Tuple.Create(radioButton14, new TimeSpan(13, 0, 0)),
         Tuple.Create(radioButton15, new TimeSpan(13, 30, 0)),
         Tuple.Create(radioButton16, new TimeSpan(14, 0, 0)),
         Tuple.Create(radioButton17, new TimeSpan(14, 30, 0)),
         Tuple.Create(radioButton18, new TimeSpan(15, 0, 0)),
         Tuple.Create(radioButton19, new TimeSpan(15, 30, 0)),
         Tuple.Create(radioButton20, new TimeSpan(16, 0, 0)),
         Tuple.Create(radioButton21, new TimeSpan(16, 30, 0)),
         Tuple.Create(radioButton22, new TimeSpan(17, 0, 0)),
         Tuple.Create(radioButton23, new TimeSpan(17, 30, 0)),
         Tuple.Create(radioButton24, new TimeSpan(18, 0, 0)),
         Tuple.Create(radioButton25, new TimeSpan(18, 30, 0)),
         Tuple.Create(radioButton26, new TimeSpan(19, 0, 0)),
         Tuple.Create(radioButton27, new TimeSpan(19, 30, 0))
     };
     //Initial search for doctors.
     searchForDoctors();
     //Fill patient textboxes.
     textBoxFirstName.Text = patientInformation.FirstName;
     textBoxLastName.Text  = patientInformation.LastName;
     textBoxPESEL.Text     = patientInformation.PESEL;
     //Initialize date picker with today's date.
     dateTimePickerAppointmentDate.Value   = DateTime.Now.Date;
     dateTimePickerAppointmentDate.MinDate = DateTime.Now.Date;
 }
Ejemplo n.º 8
0
 private void buttonCancelAppointment_Click(object sender, EventArgs e)
 {
     //Check if any appointment is selected.
     if (dataGridViewAppointments.SelectedCells.Count > 0)
     {
         //Get patient information.
         BusinessLayer.PatientInformation patientInfo = new BusinessLayer.PatientInformation();
         patientInfo.PatientID = (int)(dataGridViewPatients.Rows[dataGridViewPatients.CurrentCell.RowIndex].Cells[0].Value);
         patientInfo.FirstName = (string)(dataGridViewPatients.Rows[dataGridViewPatients.CurrentCell.RowIndex].Cells[1].Value);
         patientInfo.LastName  = (string)(dataGridViewPatients.Rows[dataGridViewPatients.CurrentCell.RowIndex].Cells[2].Value);
         patientInfo.PESEL     = (string)(dataGridViewPatients.Rows[dataGridViewPatients.CurrentCell.RowIndex].Cells[3].Value);
         //Get appointment information.
         var appointmentInfo = new BusinessLayer.ReceptionistFacade.ReceptionistAppointment();
         appointmentInfo.AppointmentID   = (int)(dataGridViewAppointments.Rows[dataGridViewAppointments.CurrentCell.RowIndex].Cells[4].Value);
         appointmentInfo.Date            = (DateTime)(dataGridViewAppointments.Rows[dataGridViewAppointments.CurrentCell.RowIndex].Cells[0].Value);
         appointmentInfo.Status          = (string)(dataGridViewAppointments.Rows[dataGridViewAppointments.CurrentCell.RowIndex].Cells[1].Value);
         appointmentInfo.DoctorFirstName = (string)(dataGridViewAppointments.Rows[dataGridViewAppointments.CurrentCell.RowIndex].Cells[2].Value);
         appointmentInfo.DoctorLastName  = (string)(dataGridViewAppointments.Rows[dataGridViewAppointments.CurrentCell.RowIndex].Cells[3].Value);
         //Check if appointment has status REG.
         if (appointmentInfo.Status != "REG")
         {
             MessageBox.Show("You can only cancel registered appointments that have not begun yet.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             return;
         }
         //Create and display cancel appointment form.
         FormReceptionistCancelAppointment formCancelAppointment = new FormReceptionistCancelAppointment(patientInfo, appointmentInfo);
         DialogResult res = formCancelAppointment.ShowDialog(this);
         //Select the canceled appointment if canceled.
         if (res == DialogResult.OK)
         {
             //Refresh appointments.
             searchForAppointments();
             foreach (DataGridViewRow row in dataGridViewAppointments.Rows)
             {
                 if (row.Cells[4].Value.Equals(formCancelAppointment.canceledAppointment.AppointmentID))
                 {
                     dataGridViewAppointments.CurrentCell = dataGridViewAppointments[1, row.Index];
                     break;
                 }
             }
         }
         formCancelAppointment.Dispose();
     }
     else
     {
         MessageBox.Show("Please select an appointment to cancel.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Ejemplo n.º 9
0
        private void searchForAppointments()
        {
            List <BusinessLayer.ReceptionistFacade.ReceptionistAppointment> appointments;

            //Check if any patient is selected.
            if (dataGridViewPatients.SelectedCells.Count > 0 && dataGridViewPatients.CurrentRow != null)
            {
                //Get search criteria.
                BusinessLayer.PatientInformation patientInfo = new BusinessLayer.PatientInformation();
                patientInfo.PatientID = (int)(dataGridViewPatients.Rows[dataGridViewPatients.CurrentCell.RowIndex].Cells[0].Value);
                patientInfo.FirstName = (string)(dataGridViewPatients.Rows[dataGridViewPatients.CurrentCell.RowIndex].Cells[1].Value);
                patientInfo.LastName  = (string)(dataGridViewPatients.Rows[dataGridViewPatients.CurrentCell.RowIndex].Cells[2].Value);
                patientInfo.PESEL     = (string)(dataGridViewPatients.Rows[dataGridViewPatients.CurrentCell.RowIndex].Cells[3].Value);
                DateTime?appointmentDate = null;
                if (dateTimePickerAppointmentDate.Checked)
                {
                    appointmentDate = dateTimePickerAppointmentDate.Value;
                }
                string status = null;
                if (!string.IsNullOrWhiteSpace(comboBoxStatus.Text))
                {
                    status = comboBoxStatus.Text;
                }
                //Search for appointments.
                appointments = BusinessLayer.ReceptionistFacade.GetAppointments(patientInfo, appointmentDate, status, textBoxDoctorLastName.Text);
            }
            else
            {
                //Get an empty list.
                appointments = new List <BusinessLayer.ReceptionistFacade.ReceptionistAppointment>();
            }
            //Display the appointments.
            dataGridViewAppointments.Columns.Clear();
            dataGridViewAppointments.DataSource         = appointments;
            dataGridViewAppointments.Columns[4].Visible = false;
            dataGridViewAppointments.Columns[0].Width   = 124;
            dataGridViewAppointments.Columns[1].Width   = 72;
            dataGridViewAppointments.Columns[2].Width   = 124;
            dataGridViewAppointments.Columns[3].Width   = 124;
            //Select first appointment if not empty.
            if (dataGridViewAppointments.Rows.Count > 0)
            {
                dataGridViewAppointments.CurrentCell = dataGridViewAppointments[0, 0];
            }
        }
Ejemplo n.º 10
0
        private void buttonNewAppointment_Click(object sender, EventArgs e)
        {
            //Check if any patient is selected.
            if (dataGridViewPatients.SelectedCells.Count > 0)
            {
                //Get patient information.
                BusinessLayer.PatientInformation patientInformation = new BusinessLayer.PatientInformation();
                patientInformation.PatientID = (int)(dataGridViewPatients.Rows[dataGridViewPatients.CurrentCell.RowIndex].Cells[0].Value);
                patientInformation.FirstName = (string)(dataGridViewPatients.Rows[dataGridViewPatients.CurrentCell.RowIndex].Cells[1].Value);
                patientInformation.LastName  = (string)(dataGridViewPatients.Rows[dataGridViewPatients.CurrentCell.RowIndex].Cells[2].Value);
                patientInformation.PESEL     = (string)(dataGridViewPatients.Rows[dataGridViewPatients.CurrentCell.RowIndex].Cells[3].Value);
                //Create and display new appointment form.
                FormReceptionistNewAppointment formNewAppointment = new FormReceptionistNewAppointment(patientInformation, activeReceptionistInformation);
                DialogResult res = formNewAppointment.ShowDialog(this);

                //Select the new appointment if added.
                if (res == DialogResult.OK)
                {
                    //Refresh appointments.
                    searchForAppointments();
                    //Find and select the new appointment.
                    foreach (DataGridViewRow row in dataGridViewAppointments.Rows)
                    {
                        if (row.Cells[2].Value.Equals(formNewAppointment.newAppointment.DoctorFirstName)
                            &&
                            row.Cells[3].Value.Equals(formNewAppointment.newAppointment.DoctorLastName)
                            &&
                            row.Cells[0].Value.ToString().Equals(formNewAppointment.newAppointment.Date.ToString())
                            &&
                            row.Cells[1].Value.Equals("REG"))
                        {
                            dataGridViewAppointments.CurrentCell = dataGridViewAppointments[1, row.Index];
                            break;
                        }
                    }
                }
                //Dispose of form.
                formNewAppointment.Dispose();
            }
            else
            {
                MessageBox.Show("Please select a patient to add an appointment.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Ejemplo n.º 11
0
        private void buttonAddPatient_Click(object sender, EventArgs e)
        {
            //Check if patient information is correct.
            if (!correctInformation())
            {
                return;
            }

            newPatientInformation           = new BusinessLayer.PatientInformation();
            newPatientInformation.PESEL     = textBoxPESEL.Text;
            newPatientInformation.FirstName = textBoxFirstName.Text.Trim();
            newPatientInformation.LastName  = textBoxLastName.Text.Trim();
            //Check if patient with that PESEL already exists.
            if (BusinessLayer.ReceptionistFacade.ExistsPatient(newPatientInformation))
            {
                MessageBox.Show("Patient with that PESEL already exists.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            BusinessLayer.ReceptionistFacade.AddPatient(newPatientInformation);
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 12
0
 private void buttonEditPatient_Click(object sender, EventArgs e)
 {
     //Check if any patient is selected.
     if (dataGridViewPatients.SelectedCells.Count > 0)
     {
         //Get patient information.
         BusinessLayer.PatientInformation patientInfo = new BusinessLayer.PatientInformation();
         patientInfo.PatientID = (int)(dataGridViewPatients.Rows[dataGridViewPatients.CurrentCell.RowIndex].Cells[0].Value);
         patientInfo.FirstName = (string)(dataGridViewPatients.Rows[dataGridViewPatients.CurrentCell.RowIndex].Cells[1].Value);
         patientInfo.LastName  = (string)(dataGridViewPatients.Rows[dataGridViewPatients.CurrentCell.RowIndex].Cells[2].Value);
         patientInfo.PESEL     = (string)(dataGridViewPatients.Rows[dataGridViewPatients.CurrentCell.RowIndex].Cells[3].Value);
         //Create and display edit patient form.
         FormReceptionistEditPatient formEditPatient = new FormReceptionistEditPatient(patientInfo);
         DialogResult res = formEditPatient.ShowDialog(this);
         //Select the edited patient if edited.
         if (res == DialogResult.OK)
         {
             //Refresh displayed patients.
             searchForPatients();
             foreach (DataGridViewRow row in dataGridViewPatients.Rows)
             {
                 if ((int)row.Cells[0].Value == formEditPatient.editedPatientInformation.PatientID)
                 {
                     dataGridViewPatients.CurrentCell = dataGridViewPatients[0, row.Index];
                     break;
                 }
             }
         }
         //Dispose of form.
         formEditPatient.Dispose();
     }
     else
     {
         MessageBox.Show("Please select a patient to edit.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }