Ejemplo n.º 1
0
        protected internal static void StartInformation(Clinic myClinic)
        {
            Console.ForegroundColor = ConsoleColor.Cyan;
            Doctor[] doctors = new Doctor[5];
            doctors[0] = new Doctor("Ivan Pesotsky", new DateTime(1965, 7, 13), Gender.Male, DoctorSpecialty.Allergist);
            doctors[1] = new Doctor("Petro Liashko", new DateTime(1962, 8, 31), Gender.Male, DoctorSpecialty.Ophthalmologist);
            doctors[2] = new Doctor("Svitlana Prius", new DateTime(1989, 5, 12), Gender.Female, DoctorSpecialty.Dermatologist);
            doctors[3] = new Doctor("Peter Parker", new DateTime(1974, 8, 15), Gender.Male, DoctorSpecialty.Pediatrician);
            doctors[4] = new Doctor("Victor Zhuk", new DateTime(1945, 12, 24), Gender.Male, DoctorSpecialty.Surgeon);
            Patient patient1 = new Patient("Patrick Lumumba", new DateTime(1999, 9, 9), Gender.Female);
            Patient patient2 = new Patient("Paul Pogba", new DateTime(1993, 1, 9), Gender.Male);
            Patient patient3 = new Patient("Antoine Griman", new DateTime(1990, 3, 19), Gender.Female);

            myClinic.AddDoctor(doctors[0]);
            myClinic.AddDoctor(doctors[1]);
            myClinic.AddDoctor(doctors[2]);
            myClinic.AddDoctor(doctors[3]);
            myClinic.AddDoctor(doctors[4]);
            myClinic.AddPatient(patient1);
            myClinic.AddPatient(patient2);
            myClinic.AddPatient(patient3);

            WorkDayTime[] workTime = new WorkDayTime[6];
            workTime[0] = new WorkDayTime(DayOfWeek.Monday, new DateTime(1, 1, 1, 9, 0, 0), new DateTime(1, 1, 1, 12, 0, 0, 0));
            workTime[1] = new WorkDayTime(DayOfWeek.Tuesday, new DateTime(1, 1, 1, 8, 0, 0), new DateTime(1, 1, 1, 12, 0, 0, 0));
            workTime[2] = new WorkDayTime(DayOfWeek.Wednesday, new DateTime(1, 1, 1, 9, 0, 0), new DateTime(1, 1, 1, 13, 0, 0, 0));
            workTime[3] = new WorkDayTime(DayOfWeek.Thursday, new DateTime(1, 1, 1, 10, 0, 0), new DateTime(1, 1, 1, 14, 0, 0, 0));
            workTime[4] = new WorkDayTime(DayOfWeek.Friday, new DateTime(1, 1, 1, 9, 0, 0), new DateTime(1, 1, 1, 20, 0, 0, 0));
            workTime[5] = new WorkDayTime(DayOfWeek.Saturday, new DateTime(1, 1, 1, 9, 0, 0), new DateTime(1, 1, 1, 23, 0, 0, 0));

            foreach (Doctor doctor in doctors)
            {
                myClinic.SetDoctorsSchedule(workTime, doctor.ID);
            }
        }
Ejemplo n.º 2
0
        public void SetUp()
        {
            IClinic  testClinic  = new Clinic();
            IDoctor  testDoctor  = new Dentist();
            IPatient testPatient = new Patient();

            testClinic.AddDoctor(testDoctor);
            testClinic.AddPatient(testPatient);
        }
Ejemplo n.º 3
0
        public void AddPatientTest()
        {
            // arrange
            IClinic testClinic = new Clinic();

            // act
            testClinic.AddPatient(new Patient());

            // assert
            Assert.IsNotNull(testClinic.Patients);
        }
Ejemplo n.º 4
0
        public void UseCaseTest()
        {
            // arrange

            IClinic           testClinic           = new Clinic();
            IDoctor           testDoctor           = new Dentist();
            IPatient          testPatient          = new Patient();
            IInsuranceCompany testInsuranceCompany = new InsuranceCompany();

            testInsuranceCompany.Clients.Add(testPatient.Insurance);
            testClinic.AddDoctor(testDoctor);

            // act

            //Пациент приходит в больницу с жалобой
            testPatient.PatientComplaint.Symptoms.Add(Symptom.Headache);
            testClinic.AddPatient(testPatient);

            //Его направляют к нужному врачу(лор, ортопед, стоматолог).
            IDoctor doctorForPatient = testClinic.GiveDoctor(testClinic.Patients.LastOrDefault());

            //Доктор ставит диагноз и выписывает назначение.
            Diagnosis diagnosisForPatient   = doctorForPatient.Diagnosticate(testPatient.PatientComplaint);
            Treatment appointmentForPatient = doctorForPatient.PrescribeTreatment(diagnosisForPatient);

            //Больница выставляет счет страховой компании пациента.
            Bill billForPatient = testClinic.GiveBill(appointmentForPatient);

            //Страховая компания оплачивает счет.
            testPatient.PayBill();

            //После оплаты больница начинает лечение.
            testClinic.Cure(testPatient, diagnosisForPatient, appointmentForPatient);

            // assert
            Assert.IsNull(testPatient.PatientComplaint.Symptoms);
        }
Ejemplo n.º 5
0
        protected internal static void CreateAccount(Clinic clinic)
        {
            Console.WriteLine("\n Fill next fields to create PatientCard");
            Console.Write(" Name: ");
            string name = Convert.ToString(Console.ReadLine());

            Console.Write(" Gender: ");
            foreach (int i in Enum.GetValues(typeof(Gender)))
            {
                Console.Write($" {i}. {Enum.GetName(typeof(Gender), i) + "\t"}");
            }
            Console.Write("\n Choice: ");
            Gender gender = (Gender)Convert.ToInt32(Console.ReadLine());

            Console.Write(" Phone number: ");
            string phoneNumber = Convert.ToString(Console.ReadLine());

            Console.Write(" Date of birth \n");
            Console.Write(" Year: "); int           year  = Convert.ToInt32(Console.ReadLine());
            Console.Write(" Month (number): "); int month = Convert.ToInt32(Console.ReadLine());
            Console.Write(" Day: "); int            day   = Convert.ToInt32(Console.ReadLine());
            clinic.AddPatient(name, new DateTime(year, month, day), gender, phoneNumber);
            return;
        }