public void InitializeComboBoxes()
        {
            _departmentService = new DepartmentService();
            _credentialsService = new CredentialsService();
            _doctorService = new DoctorService();

            _deptsList = _departmentService.FindAll();
            _statusList = new List<string>() { "active", "inactive" };
            ComboBoxItem cbm;
            if (_deptsList != null)
            {
                foreach (Department d in _deptsList)
                {
                    cbm = new ComboBoxItem();
                    cbm.Content = d.Name;
                    cbm.Tag = d.Id;
                    departmentComboBox.Items.Add(cbm);
                }
            }
            foreach (KeyValuePair<int, string> status in DoctorStatus.DoctorStatuses)
            {
                cbm = new ComboBoxItem();
                cbm.Content = status.Value;
                cbm.Tag = status.Key;
                statusComoBox.Items.Add(cbm);
            }
        }
        public void Find_No_Available_Doctors()
        {
            DoctorService service = new DoctorService(CreateOperationStubRepository(), CreateAppointmentStubRepository(), CreateScheduleStubRepository(), CreateDoctorStubRepository());

            List <DoctorUser> appointments = service.GetAvailableDoctors("Pulmonology", "02/02/2020", 2);

            appointments.ShouldBeEmpty();
        }
        public ActionResult SearchName(string doctor_ID)
        {
            var           a   = doctor_ID;
            DoctorService d   = new DoctorService();
            var           res = d.GetDoctorByName(doctor_ID);

            return(Json(res, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Change(string predoctor_ID, string doctor_ID, string doctor_name, string doctor_dept,
                                   string doctor_position, float salary, int age, string sex, int is_arranged)
        {
            DoctorService d   = new DoctorService();
            var           res = d.ChangeDoctorByID(predoctor_ID, doctor_ID, doctor_name, doctor_dept, doctor_position, salary, age, sex, is_arranged);

            return(Json(res, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 5
0
        public void Not_found_doctors_by_specialization()
        {
            DoctorService doctorService = new DoctorService(CreateDoctorStubRepository());

            List <Doctor> result = doctorService.GetAllDoctorsBySpecialization(3);

            Assert.Empty(result);
        }
        public ActionResult AddNew(string doctor_ID, string doctor_name, string doctor_dept,
                                   string doctor_position, float salary, int age, string sex, int is_arranged)
        {
            DoctorService d   = new DoctorService();
            var           res = d.AddNewDoctor(doctor_ID, doctor_name, doctor_dept, doctor_position, salary, age, sex, is_arranged);

            return(Json(res));
        }
        public void TestSaveDoctor()
        {
            IDataBaseService   iDataBaseService  = new DataBaseService();
            DoctorService      dService          = new DoctorService(iDataBaseService);
            StaticDataServices staticDataService = new StaticDataServices(iDataBaseService);
            ILogger            logger            = new Logger(iDataBaseService);

            DataServices.DataServices dServ   = new DataServices.DataServices(iDataBaseService);
            ViewModelFactory          factory = new ViewModelFactory(dServ, staticDataService);
            DoctorMapper     dMapper          = new DoctorMapper(factory);
            DoctorController dController      = new DoctorController(staticDataService, dServ, factory, dMapper, logger);

            dController.Request = new HttpRequestMessage
            {
                RequestUri = new Uri("http://localhost/Doctor/SaveDoctor")
            };
            dController.Configuration = new HttpConfiguration();
            dController.Configuration.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional });

            dController.RequestContext.RouteData = new HttpRouteData(
                route: new HttpRoute(),
                values: new HttpRouteValueDictionary {
                { "controller", "doctor" }
            });

            RequestCarrier req = new RequestCarrier();

            req.From     = "Test";
            req.TanentId = -1;

            DoctorViewModel dvModel = new DoctorViewModel(staticDataService.GetCountry(), staticDataService.GetState(), staticDataService.GetCity(), staticDataService.GetHospital(), staticDataService.GetDegree(), staticDataService.GetSpecialization(), staticDataService.GetDesease());

            dvModel.Address1             = "12, DP Pharma Road";
            dvModel.CityID               = 1;
            dvModel.CreatedBy            = 1;
            dvModel.CreatedByEntity      = 1;
            dvModel.DoctorDegree         = new List <int>();
            dvModel.DoctorDesease        = new List <int>();
            dvModel.DoctorHospital       = new List <int>();
            dvModel.DoctorSpecialization = new List <int>();
            dvModel.EmailAddress         = "*****@*****.**";
            dvModel.FirstName            = "Reaj";
            dvModel.LastName             = "Sharma";
            dvModel.OtherInformation     = "Heart Specilist";
            dvModel.PhoneNumber          = "8989889889";
            dvModel.Pincode              = "411014";
            dvModel.ProfilePhotoID       = 1;
            dvModel.RegistrationNumber   = "RJ12123";
            dvModel.TanentId             = -1;
            //dvModel.UpdatedBy = 1;
            req.PayLoad = dvModel;
            var response = dController.SaveDoctor(req);

            Assert.IsNotNull(response);
        }
Ejemplo n.º 8
0
        public void Get_available_appointments_including_date_range_priority_invalid()
        {
            DoctorService        doctorService        = new DoctorService(CreateDoctorStubRepository());
            DoctorWorkDayService doctorWorkDayService = new DoctorWorkDayService(CreateDoctorWorkDayStubRepository(), doctorService);

            Dictionary <int, List <Appointment> > result = doctorWorkDayService.GetAvailableAppointmentsByDateRangeAndDoctorIdIncludingPriority(new DateTime(2022, 12, 8), new DateTime(2022, 12, 8), 3, "DateRange");

            Assert.NotEqual(47, result[4].Count + result[6].Count + result[8].Count);
        }
Ejemplo n.º 9
0
 public VisitController(VisitService service
                        , DoctorService doctorService
                        , PacientService pacientService
                        , DoctorTypeService doctorTypeService) : base(service)
 {
     DoctorService     = doctorService;
     PacientService    = pacientService;
     DoctorTypeService = doctorTypeService;
 }
        public ActionResult RtState(string doctor_ID)
        {
            DoctorService docserve    = new DoctorService();
            List <int>    statelist   = new List <int>();
            int           is_arranged = docserve.RtState(doctor_ID);

            statelist.Add(is_arranged);
            return(Json(statelist));
        }
 // GET: Doctor
 public ActionResult Index()
 {
     using (MyContext ctx = new MyContext())
     {
         DoctorService d   = new DoctorService();
         var           res = d.GetAllDoctor();
         return(View(res));
     }
 }
        private void AppointmentDoctorSpecializationComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DoctorService doctorService = new DoctorService();

            SpecialtyDTO     selectedSpecialty            = (SpecialtyDTO)AppointmentDoctorSpecializationComboBox.SelectedItem;
            List <DoctorDTO> doctorsWithSelectedSpecialty = doctorService.GetDoctorsBySpecialty(selectedSpecialty.Id);

            AppointmentDoctorComboBox.ItemsSource = doctorsWithSelectedSpecialty;
        }
        private void button5_Click(object sender, EventArgs e)
        {
            addDoctorControl1.Visible  = false;
            doctorListGridView.Visible = true;

            DoctorService doctorService = new DoctorService();

            doctorListGridView.DataSource = doctorService.GetAll();
        }
 public DataServices(IDataBaseService dataBaseService)
 {
     LoginService         = new LoginService(dataBaseService);
     UserService          = new UserService(dataBaseService);
     DoctorService        = new DoctorService(dataBaseService);
     ConsultationService  = new ConsultationService(dataBaseService);
     SecureFileService    = new SecureFileService(dataBaseService, FileServiceFactory.GetFileSystem());
     NonSecureFileService = new NonSecureFileService(dataBaseService, FileServiceFactory.GetFileSystem());
 }
Ejemplo n.º 15
0
        private static DoctorFacade CreateDoctorFacade(Mock <QueryObjectBase <DoctorDto, Doctor, DoctorFilterDto, IQuery <Doctor> > > doctorQueryMock, Mock <IRepository <Doctor> > doctorRepository)
        {
            var uowMock       = FacadeMockManager.ConfigureUowMock();
            var mapperMock    = FacadeMockManager.ConfigureRealMapper();
            var doctorService = new DoctorService(mapperMock, doctorRepository.Object, doctorQueryMock.Object);

            var doctorFacade = new DoctorFacade(uowMock.Object, doctorService);

            return(doctorFacade);
        }
Ejemplo n.º 16
0
 public DoctorDashboardController(PatientService patientsService, DiagnoseService diagnoseService,
                                  HealthCheckService healthCheckService, UserManager <ApplicationUser> userManager, DoctorService doctorService, TreatmentService treatmentService)
 {
     _patientsService    = patientsService;
     _diagnoseService    = diagnoseService;
     _healthCheckService = healthCheckService;
     _doctorService      = doctorService;
     _userManager        = userManager;
     _treatmentService   = treatmentService;
 }
Ejemplo n.º 17
0
        public IActionResult Index()
        {
            var dtos = Service.GetDTOs();

            ViewData["Title"]        = "Список карт посещений";
            ViewData["doctors"]      = DoctorService.GetDTOs();
            ViewData["doctor_types"] = DoctorTypeService.GetDTOs();
            ViewData["pacients"]     = PacientService.GetDTOs();

            return(View(dtos));
        }
        public ActionResult RtSalary()
        {
            List <float>  salalist = new List <float>();
            DoctorService docserve = new DoctorService();
            NurseService  nurserve = new NurseService();
            float         total1   = docserve.RetrunDoctorTotalSalary();
            float         total2   = nurserve.ReturnNurseTotalSalary();

            salalist.Add(total1 + total2);
            return(Json(salalist));
        }
Ejemplo n.º 19
0
        public IActionResult Delete(int id)
        {
            var dto = Service.GetDTO(id);

            ViewData["doctors"]      = DoctorService.GetDTOs();
            ViewData["pacients"]     = PacientService.GetDTOs();
            ViewData["doctor_types"] = DoctorTypeService.GetDTOs();
            ViewData["Title"]        = "Удалить карточку";

            return(PartialView(dto));
        }
Ejemplo n.º 20
0
        public IActionResult Edit(int id)
        {
            var dto = Service.GetDTO(id);

            ViewData["doctors"]      = DoctorService.GetDTOs();
            ViewData["pacients"]     = PacientService.GetDTOs();
            ViewData["doctor_types"] = DoctorTypeService.GetDTOs();
            ViewData["Title"]        = "Редактировать карточку";

            return(PartialView(nameof(Create), dto));
        }
Ejemplo n.º 21
0
        public ActionResult GetDoctorBar(string keyValue)
        {
            IDoctorService service = new DoctorService();

            var result = service.getUsers(keyValue);

            return(new JsonResult()
            {
                Data = result
            });
        }
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="shiftService"></param>
 /// <param name="doctorService"></param>
 /// <param name="patientService"></param>
 /// <param name="patientContactService"></param>
 /// <param name="dialysisService"></param>
 /// <param name="bloodPressureService"></param>
 /// <param name="weightService"></param>
 public SyncController(ShiftService shiftService, DoctorService doctorService, PatientService patientService, PatientContactService patientContactService,
                       DialysisService dialysisService, BloodPressureService bloodPressureService, WeightService weightService)
 {
     _shiftService          = shiftService;
     _doctorService         = doctorService;
     _patientService        = patientService;
     _patientContactService = patientContactService;
     _dialysisService       = dialysisService;
     _bloodPressureService  = bloodPressureService;
     _weightService         = weightService;
 }
Ejemplo n.º 23
0
        public async Task DeleteTest()
        {
            var fakeRepository = Mock.Of <IDoctorRepository>();
            var doctorService  = new DoctorService(fakeRepository);

            var doctor = new Doctor()
            {
                Firstname = "Dias", Lastname = " Isabekov", Certificate = "IITU doctor"
            };
            await doctorService.Delete(doctor);
        }
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="service"></param>
 public PatientController(PatientService service, WeightService weightService, BloodPressureService bloodPressureService, BloodSugarService bloodSugarService, WaterService waterService, HandRingService handRingService, DialysisService dialysisService, HospitalService hospitalService, DoctorService doctorService)
 {
     _service              = service;
     _weightService        = weightService;
     _bloodPressureService = bloodPressureService;
     _bloodSugarService    = bloodSugarService;
     _waterService         = waterService;
     _handRingService      = handRingService;
     _dialysisService      = dialysisService;
     _hospitalService      = hospitalService;
     _doctorService        = doctorService;
 }
Ejemplo n.º 25
0
        public IActionResult Create()
        {
            ViewData["doctors"]      = DoctorService.GetDTOs();
            ViewData["pacients"]     = PacientService.GetDTOs();
            ViewData["doctor_types"] = DoctorTypeService.GetDTOs();
            ViewData["Title"]        = "Создать карточку";

            return(PartialView(nameof(Create), new VisitViewModel()
            {
                VisitDate = DateTime.Now
            }));
        }
Ejemplo n.º 26
0
    protected void ShowGrid_Click(object sender, EventArgs e)
    {
        ShowDataGridForDoctor.Visible = false;
        ShowDataGridForUser.Visible   = false;
        //get the selected index in dropdownlist
        int x = ShowAllData.SelectedIndex;
        //write query in DoctorService and UserService I DID IT

        //if index is 1 Doctor, 2 for user, if the index is 0 print Choose who do you want to see
        DataSet ds;

        if (x == 1)
        {
            DoctorService docSer = new DoctorService();
            string where = " where CityId=DoctorCity and SpecialityId=DoctorSpecailty";
            ds           = docSer.ShowDoctorForManager(where);
            if (ds.Tables[0].Rows.Count != 0)
            {
                ShowDataGridForDoctor.Visible    = true;
                ShowDataGridForUser.Visible      = false;
                ShowDataGridForDoctor.DataSource = ds;
                ShowDataGridForDoctor.DataBind();
                CloseGrid.Visible = true;
            }
        }
        else if (x == 2)
        {
            UserService userSer = new UserService();
            ds = userSer.ShowUserForManager();
            if (ds.Tables[0].Rows.Count != 0)
            {
                ShowDataGridForDoctor.Visible  = false;
                ShowDataGridForUser.Visible    = true;
                ShowDataGridForUser.DataSource = ds;
                ShowDataGridForUser.DataBind();
                CloseGrid.Visible = true;
            }
        }
        else
        {
            //tell the manager that he need to choose between doctor and user
            Response.Write("<script>alert('עליך לבחור בין רופאים ללקוחות')</script>");
        }

        //make the close button visible true
        //check if dataset is empty
        //write Delete query in DoctorService and UserService
        //add labels and textbox under the grid view in order to contect
        //check if the content is valid
        //add to message service the manegar ID as a doctor
        //when you show data in one grid the other one is visible false
    }
        public List <string> GetDoctorFullNames()
        {
            var doctors = DoctorService.GetAllDoctors();

            var results = new List <string>(doctors.Count);

            foreach (var doctor in doctors)
            {
                results.Add(doctor.FullName);
            }

            return(results);
        }
Ejemplo n.º 28
0
        public DoctorServiceCreateDto Create(DoctorServiceCreateDto doctorService)
        {
            if (doctorService != null)
            {
                var NewDoctorService = new DoctorService();
                NewDoctorService.DoctorId  = doctorService.DoctorId;
                NewDoctorService.ServiceId = doctorService.ServiceId;
                _doctorServiceRepository.Create(NewDoctorService);
                _unitOfWork.Complete();
            }

            return(doctorService);
        }
Ejemplo n.º 29
0
        public async Task <IActionResult> EditPost(VisitViewModel dto)
        {
            if (ModelState.IsValid)
            {
                await Service.SaveAsync(dto);
            }
            ViewData["doctors"]      = DoctorService.GetDTOs();
            ViewData["pacients"]     = PacientService.GetDTOs();
            ViewData["doctor_types"] = DoctorTypeService.GetDTOs();
            ViewData["Title"]        = dto.Id > 0 ? "Редактировать карточку" : "Создать карточку";

            return(PartialView(nameof(Create), dto));
        }
Ejemplo n.º 30
0
 private App()
 {
     EmailVerificationService = new EmailVerificationService();
     SftpService               = new SftpService();
     HttpService               = new HttpService();
     TenderService             = new TenderService();
     MedicalExaminationService = new MedicalExaminationService(
         new MedicalExaminationRepository(new MySQLStream <MedicalExamination>(), new IntSequencer()));
     PatientFeedbackService = new PatientFeedbackService(
         new PatientFeedbackRepository(new MySQLStream <PatientFeedback>(), new IntSequencer()));
     MedicalExaminationReportService = new MedicalExaminationReportService(
         new MedicalExaminationReportRepository(new MySQLStream <MedicalExaminationReport>(), new IntSequencer()));
     PrescriptionService = new PrescriptionService(
         new PrescriptionRepository(new MySQLStream <Prescription>(), new IntSequencer()));
     MedicalRecordService = new MedicalRecordService(
         new MedicalRecordRepository(new MySQLStream <MedicalRecord>(), new IntSequencer()), EmailVerificationService);
     QuestionService = new QuestionService(
         new QuestionRepository(new MySQLStream <Question>(), new IntSequencer()));
     AnswerService = new AnswerService(
         new AnswerRepository(new MySQLStream <Answer>(), new IntSequencer()), QuestionService);
     AllergiesService = new AllergiesService(
         new AllergiesRepository(new MySQLStream <Allergies>(), new IntSequencer()));
     PatientService = new PatientService(
         new PatientRepository(new MySQLStream <Patient>(), new IntSequencer()));
     SurveyService = new SurveyService(
         new SurveyRepository(new MySQLStream <Survey>(), new IntSequencer()), MedicalExaminationService, AnswerService);
     DoctorService = new DoctorService(
         new DoctorRepository(new MySQLStream <Doctor>(), new IntSequencer()));
     ReportService = new ReportService(
         new ReportRepository(new MySQLStream <Report>(), new IntSequencer()), SftpService);
     DoctorWorkDayService = new DoctorWorkDayService(
         new DoctorWorkDayRepository(new MySQLStream <DoctorWorkDay>(), new IntSequencer()), DoctorService);
     SpetialitationService = new SpetialitationService(
         new SpecialitationRepository(new MySQLStream <Specialitation>(), new IntSequencer()));
     AppointmentService = new AppointmentService(
         new AppointmentRepository(new MySQLStream <Appointment>(), new IntSequencer()), PatientService);
     EPrescriptionService = new EPrescriptionService(
         new EPrescriptionRepository(new MySQLStream <EPrescription>(), new IntSequencer()), SftpService);
     PharmacyService = new PharmacyService(
         new PharmacyRepository(new MySQLStream <Pharmacies>(), new IntSequencer()));
     RoomService = new RoomService(
         new RoomRepository(new MySQLStream <Room>(), new IntSequencer()));
     ManagerService = new ManagerService(
         new ManagerRepository(new MySQLStream <Manager>(), new IntSequencer()));
     SecretaryService = new SecretaryService(
         new SecretaryRepository(new MySQLStream <Secretary>(), new IntSequencer()));
     SystemAdministratorService = new SystemAdministratorService(
         new SystemAdministratorRepository(new MySQLStream <SystemAdministrator>(), new IntSequencer()));
     UserService = new UserService(
         new UserRepository(new MySQLStream <User>(), new IntSequencer()), PatientService, SystemAdministratorService);
 }
Ejemplo n.º 31
0
        public void DoctorExistsTest()
        {
            int UserId = 1;

            var fakeRepositoryMock = new Mock <IDoctorRepository>();

            fakeRepositoryMock.Setup(x => x.DoctorExists(UserId)).Returns(true);

            var doctorService = new DoctorService(fakeRepositoryMock.Object);

            var isExist = doctorService.DoctorExists(UserId);

            Assert.True(isExist);
        }
Ejemplo n.º 32
0
        /// <summary>
        /// opens a connection to the database and initializes necessary services
        /// </summary>
        private void OpenConnection()
        {
            try
            {
                DBConnection.CreateConnection("localhost", "xe", "hr", "hr");
            }
            catch (Exception)
            {
                try
                {
                    DBConnection.CreateConnection("localhost", "ORCL", "hr", "roxana");
                }
                catch (Exception e)
                {
                    throw e;
                }
            }

            credentialsService = new CredentialsService();
            administratorService = new AdministratorService();
            patientService = new PatientService();
            doctorService = new DoctorService();
            departmentService = new DepartmentService();
            appointmentService = new AppointmentService();
            resultService = new ResultsService();
            scheduleService = new ScheduleService();
        }
 private void PopulateDoctorsList(int departmentId)
 {
     _doctorService = new DoctorService();
     List<Doctor> doctors = _doctorService.FindAllByProperty("id_dept", departmentId.ToString());
     ComboBoxItem cmb;
     if (doctors != null)
     {
         foreach (Doctor d in doctors)
         {
             cmb = new ComboBoxItem();
             cmb.Content = d.FirstName + " " + d.LastName;
             cmb.Tag = d.Id;
             comboBoxDoctors.Items.Add(cmb);
         }
         comboBoxDoctors.IsEnabled = true;
     }
 }
        /// <summary>
        /// gets all doctors using DoctorService
        /// and buid a Expander control with header= doctor name and content= department
        /// for each expander create a new row in  gridDoctors
        /// </summary>
        private void PopulateDoctorGrid()
        {
            _doctorService = new DoctorService();
            List<Doctor> doctors = _doctorService.FindAll();
            List<Department> departments = _deptService.FindAll();
            int i = 0;

            foreach (Doctor doctor in doctors)
            {
                //select only doctors that are active
                //a doctor with status 0 means that he does not work at this clinic anymore
                if (doctor.Status == 1)
                {
                    Expander expander = new Expander();
                    expander.Header = doctor.FirstName + " " + doctor.LastName;
                    StackPanel stackPanel = new StackPanel();
                    TextBlock txt = new TextBlock();
                    txt.Text = GetDepartmentName(doctor.IdDept, departments);//doctorDept.Name + ", " + doctorDept.Floor;
                    stackPanel.Children.Add(txt);
                    expander.Content = stackPanel;
                    gridDoctors.RowDefinitions.Add(new RowDefinition());
                    gridDoctors.RowDefinitions[i].Height = new GridLength(50);
                    Grid.SetRow(expander, i);
                    i++;
                    gridDoctors.Children.Add(expander);
                }
            }
        }