private void MakeAppointment()
        {
            SlobodniTermini selektovanTermin = (SlobodniTermini)PrikazSlobodnihTermina.SelectedItem;
            String          d     = date.Text;
            String          t     = selektovanTermin.AvailableTimes;
            DateTime        start = DateTime.Parse(d + " " + t);
            AppointmentType tipt;

            if (selektovanTermin.Ljekar.doctorType.Equals(DoctorType.generalPractitioner))
            {
                tipt = AppointmentType.generalPractitionerCheckup;
            }
            else if (selektovanTermin.Ljekar.doctorType.Equals(DoctorType.surgeon))
            {
                tipt = AppointmentType.operation;
            }
            else
            {
                tipt = AppointmentType.specialistCheckup;
            }
            int      id  = _appointmentController.GetAll().Count + 1;
            DateTime end = start.AddMinutes(trajanjePregleda);

            Room        prvaDostupnaProstorija = GetAvailableRoom(start, end);
            Appointment appointment            = new Appointment(id, start, trajanjePregleda, tipt, AppointmentStatus.scheduled, parent.Patient, selektovanTermin.Ljekar, prvaDostupnaProstorija);

            _appointmentController.Add(appointment);
            PatientExaminesAppointmentPage ptp = new PatientExaminesAppointmentPage(parent);

            updateVisibility();
            parent.startWindow.Content = ptp;
            ptp.updateTable();
        }
Ejemplo n.º 2
0
        private void ConfirmButton_Click(object sender, RoutedEventArgs e)
        {
            if (!UInt64.TryParse(AppointmentDuration.Text, out var res))
            {
                MessageBox.Show("Trajanje mora biti pozitivna celobrojna vrednost", "Nevalidan unos", MessageBoxButton.OK);
                return;
            }

            Patient         selectedPatient  = (Patient)PatientComboBox.SelectedItem;
            global::Doctor  selectedDoctor   = (global::Doctor)DoctorComboBox.SelectedItem;
            Room            selectedRoom     = (Room)RoomComboBox.SelectedItem;
            String          selectedTime     = AppointmentTime.SelectedItem.ToString();
            String          selectedDate     = DatePicker.Text;
            DateTime        selectedDateTime = DateTime.Parse(selectedDate + " " + selectedTime);
            AppointmentType appointmentType  = (AppointmentType)AppointmentTypeComboBox.SelectedIndex;
            int             id       = _appointmentController.GetAll().Count + 1;
            int             duration = Int32.Parse(AppointmentDuration.Text);

            if (selectedPatient.IsAvailable(selectedDateTime, selectedDateTime.AddMinutes(duration)))
            {
                Appointment newAppointment = new Appointment(id, selectedDateTime, duration, appointmentType, AppointmentStatus.scheduled, selectedPatient, selectedDoctor, selectedRoom);
                if (selectedDateTime < DateTime.Now)
                {
                    MessageBox.Show("Nije moguće zakazati pregled u prošlosti", "Greška u zakazivanju", MessageBoxButton.OK);
                    return;
                }

                _appointmentController.Add(newAppointment);
                this.Close();
            }
            else
            {
                MessageBox.Show("Pacijentu ne odgovara ovako dugo trajanje termina, preklapa se sa drugim obavezama", "Patient zauzet", MessageBoxButton.OK);
            }
        }
Ejemplo n.º 3
0
        public void CanApptContCreate()
        {
            //Arrange
            var ApptList = new List <Appointment>();
            var ApptCont = new AppointmentController(ApptList);

            //Act
            ApptCont.Add(new Appointment
            {
            });

            //Assemble
        }
        private void dugmePotvrdi_Click(object sender, RoutedEventArgs e)
        {
            global::Doctor l = (global::Doctor)lekar.SelectedItem;
            Patient        p = parent.Patient;

            if (time.SelectedIndex != -1)
            {
                var             item = time.SelectedItem;
                String          t    = item.ToString();
                String          d    = date.Text;
                DateTime        dt   = DateTime.Parse(d + " " + t);
                AppointmentType tipt;
                if (l.doctorType.Equals(DoctorType.generalPractitioner))
                {
                    tipt = AppointmentType.generalPractitionerCheckup;
                }
                else if (l.doctorType.Equals(DoctorType.surgeon))
                {
                    tipt = AppointmentType.operation;
                }
                else
                {
                    tipt = AppointmentType.specialistCheckup;
                }

                int id = _appointmentController.GetAll().Count + 1;

                DateTime start;
                DateTime end;
                CalculateStartAndEnd(out start, out end);

                Room        prvaDostupnaProstorija = GetAvailableRoom(start, end);
                Appointment appointment            = new Appointment(id, dt, trajanjePregleda, tipt, AppointmentStatus.scheduled, p, l,
                                                                     prvaDostupnaProstorija);
                _appointmentController.Add(appointment);
                PatientExaminesAppointmentPage ptp = new PatientExaminesAppointmentPage(parent);
                updateVisibility();
                parent.startWindow.Content = ptp;
                ptp.updateTable();
                ActivityLog activity = new ActivityLog(DateTime.Now, _patient.Username,
                                                       TypeOfActivity.makingAppointment);
                _activityLogController.AddActivity(activity);
            }
        }
Ejemplo n.º 5
0
        private void Confirm_Click(object sender, RoutedEventArgs e)
        {
            Patient patient = (Patient)PatientComboBox.SelectedItem;
            Doctor  doctor  = (Doctor)DoctorComboBox.SelectedItem;
            Room    room    = (Room)RoomComboBox.SelectedItem;

            if (ConfirmCheck())
            {
                ComboBoxItem    item     = time.SelectedItem as ComboBoxItem;
                DateTime        dateTime = DateTime.Parse(date.Text + " " + item.Content.ToString());
                AppointmentType type     = (AppointmentType)TypeComboBox.SelectedIndex;

                Appointment appointment = new Appointment(_appointmentController.GenerateNewId(), dateTime, 15, type, AppointmentStatus.scheduled, patient, doctor, room);
                _appointmentController.Add(appointment);

                parent.Main.Content = new AppointmentsPage(parent);
                this.Close();
            }
        }
Ejemplo n.º 6
0
        private void btnMakeAppointment_Click(object sender, EventArgs e)
        {
            if (cmbHospital.SelectedItem != null & cmbDoctor.SelectedItem != null & cmbDepartment.SelectedItem != null & cmbHour.SelectedItem != null)
            {
                appointmentController = new AppointmentController();
                Appointment appointment = new Appointment();
                appointment.DoctorId        = Convert.ToInt32(cmbDoctor.SelectedValue);
                appointment.AppointmentDate = dtpAppointmentDate.Value /*.Date*/;
                appointment.HourId          = ((Hour)(cmbHour.SelectedItem)).HourId;
                appointment.PatientId       = Homepage.userID;

                appointmentController.Add(appointment);
                MessageBox.Show("Randevunuz kaydedilmiştir.");
                ClearAppointments();
            }
            else
            {
                MessageBox.Show("Lütfen alanları doldurunuz.");
            }
        }
        private void PostponeButton_Click(object sender, RoutedEventArgs e)
        {
            if (AppointmentData.SelectedIndex == -1)
            {
                return;
            }

            Appointment selectedAppointment = (Appointment)AppointmentData.SelectedItem;
            int         id             = _appointmentController.GetAll().Count + 1;
            Appointment newAppointment = new Appointment(id, selectedAppointment.AppointmentDate, _appointmentDuration, _appointmentType, AppointmentStatus.scheduled, _patient, selectedAppointment.Doctor, selectedAppointment.Room);

            foreach (Appointment appointment in _appointmentsForPostponing)
            {
                Postpone(appointment);
            }

            _appointmentController.Add(newAppointment);

            _parent.Close();
            Close();
        }
Ejemplo n.º 8
0
        private static void Main(string[] args)
        {
            var control = new AppointmentController();

            AppointmentController.GenerateUniqueDigits("W");
            var appointment = new AppointmentRequest
            {
                PracticeId  = "1",
                Type        = "W",
                PatientName = "Bailey",
                User        = new User()
                {
                    FirstName    = "paritosh",
                    EmailAddress = "*****@*****.**",
                    LastName     = "baghel",
                    UserId       = "*****@*****.**"
                },

                Description = "bailey has a respiratory problem and has been having a difficult time"
            };
            var request    = JsonConvert.SerializeObject(appointment);
            var createdApi = control.Add(new APIGatewayProxyRequest
            {
                Body = request
            }, null).Result;

            var response = JsonConvert.DeserializeObject <AppointmentResponse>(createdApi.Body);

            //var data = control.Update(new APIGatewayProxyRequest()
            //{
            //    Body =JsonConvert.SerializeObject(new AppointmentRequest()
            //    {
            //        Ticket = response.Ticket,
            //        AppointmentId = response.AppointmentId,
            //        PracticeId = "DE-1",
            //    })
            //}, null).Result;
        }
        private void MakeAppointment()
        {
            global::Doctor l = (global::Doctor)ljekari.SelectedItem;
            Patient        p = parent.Patient;


            var             item  = times.SelectedItem;
            String          t     = item.ToString();
            String          d     = date.Text;
            DateTime        start = DateTime.Parse(d + " " + t);
            AppointmentType tipt;

            if (l.doctorType.Equals(DoctorType.generalPractitioner))
            {
                tipt = AppointmentType.generalPractitionerCheckup;
            }
            else if (l.doctorType.Equals(DoctorType.surgeon))
            {
                tipt = AppointmentType.operation;
            }
            else
            {
                tipt = AppointmentType.specialistCheckup;
            }
            int      id  = _appointmentController.GetAll().Count + 1;
            DateTime end = start.AddMinutes(trajanjePregleda);

            Room        prvaDostupnaProstorija = GetAvailableRoom(start, end);
            Appointment appointment            = new Appointment(id, start, trajanjePregleda, tipt, AppointmentStatus.scheduled, p, l, prvaDostupnaProstorija);

            _appointmentController.Add(appointment);
            PatientExaminesAppointmentPage ptp = new PatientExaminesAppointmentPage(parent);

            updateVisibility();
            parent.startWindow.Content = ptp;
            ptp.updateTable();
        }
Ejemplo n.º 10
0
        private void BtnMakeAppointment_Click(object sender, EventArgs e)
        {
            if (cmbHospital.SelectedItem != null & cmbDoctor.SelectedItem != null & cmbDepartment.SelectedItem != null & cmbHour.SelectedItem != null)
            {
                List <int> patientID = examinationController.ExaminationPatientId(appointmentID);

                appointmentController = new AppointmentController();
                Appointment appointment = new Appointment();
                appointment.DoctorId        = Homepage.userID;
                appointment.AppointmentDate = dtpAppointmentDate.Value;
                appointment.HourId          = ((Hour)(cmbHour.SelectedItem)).HourId;
                appointment.PatientId       = Convert.ToInt32(patientID[0]);

                appointmentController.Add(appointment);

                ExaminationSave();
                MessageBox.Show("Hastanız için gerekli randevu oluşturuldu.");
                Clear();
            }
            else
            {
                MessageBox.Show("Lütfen gerekli alanları doldurunuz.");
            }
        }