Пример #1
0
 public static TreatmentService GetTreatmentServiceByTreatmentServiceID(int TreatmentServiceID)
 {
     TreatmentService treatmentService = new TreatmentService();
     SqlTreatmentServiceProvider sqlTreatmentServiceProvider = new SqlTreatmentServiceProvider();
     treatmentService = sqlTreatmentServiceProvider.GetTreatmentServiceByTreatmentServiceID(TreatmentServiceID);
     return treatmentService;
 }
Пример #2
0
 public OperationController()
 {
     operationService     = new OperationService();
     treatmentService     = new TreatmentService();
     typeOperationService = new TypeOperationService();
     medicineService      = new MedicineService();
 }
 public EditPatientView(CombinedPatientViewModel originalModel,
                        CombinedPatientViewModel patientModel,
                        PatientService patientService,
                        PersonService personService,
                        WardService wardService,
                        BedService bedService,
                        VisitService visitService,
                        TreatmentService treatmentService,
                        ProcedureService procedureService,
                        PhysicianService physicianService,
                        DiagnosisService diagnosisService,
                        ConditionService conditionService,
                        VitalRecordService vitalRecordService,
                        EmployeeService nurseService,
                        OrderServiceLayer orderServiceLayer,
                        OrderServiceService orderServiceService,
                        PatientOrderService patientOrderService,
                        OrderItemService orderItemService)
 {
     InitializeComponent();
     InfoTab.Content = new PatientInfoView(originalModel, patientModel, patientService, personService, wardService,
                                           bedService, visitService);
     TreatmentTab.Content = new TreatmentView(treatmentService, originalModel.PatientModel.PersonId, procedureService, physicianService);
     DiagnosisTab.Content = new DiagnosisView(diagnosisService, originalModel.PatientModel.PersonId,
                                              conditionService, physicianService);
     VitalRecordTab.Content =
         new VitalRecordView(vitalRecordService, originalModel.PatientModel.PersonId, nurseService);
     OrderTab.Content = new OrderView(orderServiceLayer, originalModel.PatientModel.PersonId, orderServiceService,
                                      physicianService);
     PatientOrderTab.Content = new PatientOrderView(patientOrderService, originalModel.PatientModel.PersonId, orderItemService);
 }
Пример #4
0
    public static TreatmentService GetTreatmentServiceByTreatmentServiceID(int TreatmentServiceID)
    {
        TreatmentService            treatmentService            = new TreatmentService();
        SqlTreatmentServiceProvider sqlTreatmentServiceProvider = new SqlTreatmentServiceProvider();

        treatmentService = sqlTreatmentServiceProvider.GetTreatmentServiceByTreatmentServiceID(TreatmentServiceID);
        return(treatmentService);
    }
        public TreatmentView(TreatmentService treatmentService, string patientId, ProcedureService procedureService, PhysicianService physicianService)
        {
            InitializeComponent();
            _treatmentService = treatmentService;
            var treatmentListViewModel = new TreatmentListViewModel(_treatmentService, patientId);

            DataContext = treatmentListViewModel;
        }
Пример #6
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;
 }
Пример #7
0
        public void AnimalsWithoutPlacementCantHaveTreatments()
        {
            // Arrange
            Mock <IAnimalRepository>    animalRepository    = new Mock <IAnimalRepository>();
            Mock <ITreatmentRepository> treatmentRepository = new Mock <ITreatmentRepository>();

            ITreatmentService treatmentService = new TreatmentService(treatmentRepository.Object, animalRepository.Object);

            Animal newDog = new Animal
            {
                ID              = 1,
                Name            = "Doggo",
                Birthdate       = new DateTime(2018, 10, 18),
                Age             = 2,
                Description     = "Good boi",
                AnimalType      = AnimalType.Dog,
                Race            = "Beautiful Doggos",
                Picture         = "Goodboi.png",
                DateOfDeath     = new DateTime(2021, 01, 10),
                Castrated       = true,
                ChildFriendly   = ChildFriendly.Yes,
                ReasonGivenAway = "Too good a boi",
            };
            Lodging dogGroupLocation = new Lodging
            {
                ID              = 1,
                LodgingType     = LodgingType.Group,
                MaxCapacity     = 100,
                CurrentCapacity = 10,
                AnimalType      = AnimalType.Dog,
                Stays           = new List <Stay>()
                {
                },
            };
            Treatment smallOperation = new Treatment
            {
                ID            = 1,
                Description   = "Small operation to help recovery",
                TreatmentType = TreatmentType.Operation,
                Costs         = 100,
                RequiredAge   = 1,
                DoneBy        = "Barry", // TODO: This needs a relation to the user
                Date          = new DateTime(2020, 12, 30),
            };

            animalRepository.Setup(e => e.FindByID(newDog.ID))
            .Returns(newDog);

            var ex = Assert.Throws <InvalidOperationException>(() => treatmentService.Add(smallOperation));

            Assert.Equal("AS_Services", ex.Source); // Make sure the error is actually thrown in the service, not somewhere else
            Assert.Equal("Animal needs to be placed", ex.Message);
        }
Пример #8
0
        public async Task <IHttpActionResult> GetAdmissionTreatment(PatientTreatmentModel treatment)
        {
            var Treatments = await TreatmentService.GetAdmissionTreatment(treatment);

            if (Treatments != null)
            {
                return(Ok(Treatments));
            }
            else
            {
                return(BadRequest("No Treatments Available!"));
            }
        }
Пример #9
0
    public int InsertTreatmentService(TreatmentService treatmentService)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("InsertTreatmentService", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@TreatmentServiceID", SqlDbType.Int).Direction    = ParameterDirection.Output;
            cmd.Parameters.Add("@TreatmentServiceName", SqlDbType.NVarChar).Value = treatmentService.TreatmentServiceName;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return((int)cmd.Parameters["@TreatmentServiceID"].Value);
        }
    }
Пример #10
0
    public bool UpdateTreatmentService(TreatmentService treatmentService)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("UpdateTreatmentService", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@TreatmentServiceID", SqlDbType.Int).Value        = treatmentService.TreatmentServiceID;
            cmd.Parameters.Add("@TreatmentServiceName", SqlDbType.NVarChar).Value = treatmentService.TreatmentServiceName;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return(result == 1);
        }
    }
Пример #11
0
        public async Task <IHttpActionResult> UpdateTreatment(TreatmentModel treatment)
        {
            if (treatment == null)
            {
                return(BadRequest("Please provide valid inputs!"));
            }

            if (await TreatmentService.UpdateTreatment(treatment))
            {
                return(Ok("Treatment Udpated Successfully!"));
            }
            else
            {
                return(BadRequest("Failed to Update Ward!"));
            }
        }//end of update
Пример #12
0
        private HospitalManager()
        {
            logger.Debug("Начинается инициализация управляющего блока.");

            if (SerializationService is null)
            {
                SerializationService = new JsonSerializationService();
            }
            EmployeeService  = new EmployeeService(new EmployeeRepository(SerializationService));
            DiagnosisService = new DiagnosisService(new DiagnosisRepository(SerializationService));
            TreatmentService = new TreatmentService(new TreatmentRepository(SerializationService));
            DiseaseService   = new DiseaseService(new DiseaseRepository(SerializationService));
            PatientService   = new PatientService(new PatientRepository(SerializationService));
            VisitService     = new VisitService(new VisitRepository(SerializationService));
            logger.Debug("Инициализация управляющего блока выполнена.");
        }
Пример #13
0
        public async Task <IHttpActionResult> AddTreatment(TreatmentModel treatment)
        {
            if (treatment == null)
            {
                return(BadRequest("Please provide valid inputs!"));
            }

            if (await TreatmentService.AddTreatment(treatment))
            {
                return(Ok("Treatment Saved Successfully!"));
            }
            else
            {
                return(BadRequest("Failed to Save Treatment!"));
            }
        }
Пример #14
0
    public TreatmentService GetTreatmentServiceFromReader(IDataReader reader)
    {
        try
        {
            TreatmentService treatmentService = new TreatmentService
                                                (

                DataAccessObject.IsNULL <int>(reader["TreatmentServiceID"]),
                DataAccessObject.IsNULL <string>(reader["TreatmentServiceName"])
                                                );
            return(treatmentService);
        }
        catch (Exception ex)
        {
            return(null);
        }
    }
Пример #15
0
        public void AddTreatmentTest()
        {
            var serv = new TreatmentService(new MVCHContext());

            serv.AddTreatment(new Treatment
            {
                Description = "Patient exhibits some side effects from the treatment",
                DateTime    = DateTime.Now,
                ProcedureId = "00.01",
                PatientId   = "PER-000021",
                PhysicianId = "PER-000020"
            });
            serv.AddTreatment(new Treatment
            {
                Description = "Heart functions as normal",
                DateTime    = DateTime.Now,
                ProcedureId = "00.02",
                PatientId   = "PER-000022",
                PhysicianId = "PER-000019"
            });
            serv.AddTreatment(new Treatment
            {
                Description = "Treatment successful",
                DateTime    = DateTime.Now,
                ProcedureId = "00.03",
                PatientId   = "PER-000023",
                PhysicianId = "PER-000018"
            });
            serv.AddTreatment(new Treatment
            {
                Description = "Patient exhibits some side effects after the treatment",
                DateTime    = DateTime.Now,
                ProcedureId = "00.09",
                PatientId   = "PER-000024",
                PhysicianId = "PER-000017"
            });
            serv.AddTreatment(new Treatment
            {
                Description = "Patient need to be confined for observation",
                DateTime    = DateTime.Now,
                ProcedureId = "00.91",
                PatientId   = "PER-000025",
                PhysicianId = "PER-000016"
            });
        }
Пример #16
0
        public async Task <IHttpActionResult> SearchAdmission(AdmissionTreatmentModel Admission)
        {
            //CommonResponse validatedResponse = await AuthService.ValidateUserAndToken();
            //if (!validatedResponse.IsError)
            //{
            var admission = await TreatmentService.SearchAdmission(Admission);

            if (admission != null)
            {
                return(Ok(admission));
            }
            else
            {
                return(BadRequest("Admission Number doesnt Exists!"));
            }
            //}
            //else
            //{
            //    return Unauthorized();
            //}
        }//end of search
        public async Task SaveAsyncWhenSaveReturnsSaved()
        {
            //Arrange
            var       mockTreatmentRepository    = GetDefaultITreatmentRepositoryInstance();
            var       mockPetTreatmentRepository = GetDefaultIPetTreatmentRepositoryInstance();
            var       mockUnitOfWork             = GetDefaultIUnitOfWorkInstance();
            Treatment treatment = new Treatment {
                Id = 10, Name = "Pastillas"
            };

            mockTreatmentRepository.Setup(r => r.AddAsync(treatment))
            .Returns(Task.FromResult <Treatment>(treatment));

            var service = new TreatmentService(mockTreatmentRepository.Object, mockPetTreatmentRepository.Object, mockUnitOfWork.Object);

            //Act
            TreatmentResponse result = await service.SaveAsync(treatment);

            //Assert
            result.Resource.Should().Be(treatment);
        }
        public async Task GetByIdAsyncWhenNoTreatmentFoundReturnsTreatmentNotFoundResponse()
        {
            //Arrange
            var mockTreatmentRepository    = GetDefaultITreatmentRepositoryInstance();
            var mockPetTreatmentRepository = GetDefaultIPetTreatmentRepositoryInstance();
            var mockUnitOfWork             = GetDefaultIUnitOfWorkInstance();
            var treatmentId = 1;

            mockTreatmentRepository.Setup(r => r.FindById(treatmentId))
            .Returns(Task.FromResult <Treatment>(null));

            var service = new TreatmentService(mockTreatmentRepository.Object, mockPetTreatmentRepository.Object, mockUnitOfWork.Object);

            //Act
            TreatmentResponse result = await service.GetByIdAsync(treatmentId);

            var message = result.Message;

            //Assert
            message.Should().Be("Treatment not found");
        }
Пример #19
0
 public PatientView()
 {
     _patientService       = new PatientService(new MVCHContext());
     _patientListViewModel = new PatientListViewModel(_patientService);
     _diagnosisService     = new DiagnosisService(new MVCHContext());
     _personService        = new PersonService(new MVCHContext());
     _employeeService      = new EmployeeService(new MVCHContext());
     _wardService          = new WardService(new MVCHContext());
     _bedService           = new BedService(new MVCHContext());
     _physicianService     = new PhysicianService(new MVCHContext());
     _vitalRecordService   = new VitalRecordService(new MVCHContext());
     _conditionService     = new ConditionService(new MVCHContext());
     _visitService         = new VisitService(new MVCHContext());
     _treatmentService     = new TreatmentService(new MVCHContext());
     _procedureService     = new ProcedureService(new MVCHContext());
     _orderServiceLayer    = new OrderServiceLayer(new MVCHContext());
     _orderServiceService  = new OrderServiceService(new MVCHContext());
     _patientOrderService  = new PatientOrderService(new MVCHContext());
     _orderItemService     = new OrderItemService(new MVCHContext());
     DataContext           = _patientListViewModel;
     InitializeComponent();
 }
Пример #20
0
 public static void PopulateTreatmentService(TreatmentService input, System.Data.IDataReader reader)
 {
     PopulateRecord(input, reader);
     input.RecordId = input.TreatmentServiceId = Utilities.ToInt(reader[Medical.Apartment.Common.TreatmentService.ColumnNames.TreatmentServiceId]);
     input.TreatmentId = Utilities.ToInt(reader[Medical.Apartment.Common.TreatmentService.ColumnNames.TreatmentId]);
     input.ServiceId = Utilities.ToInt(reader[Medical.Apartment.Common.TreatmentService.ColumnNames.ServiceId]);
     input.Service = Utilities.ToString(reader[Medical.Apartment.Common.TreatmentService.ColumnNames.Service]);
     input.Quantity = Utilities.ToNDecimal(reader[Medical.Apartment.Common.TreatmentService.ColumnNames.Quantity]);
     input.Unit = Utilities.ToString(reader[Medical.Apartment.Common.TreatmentService.ColumnNames.Unit]);
     input.Price = Utilities.ToNDecimal(reader[Medical.Apartment.Common.TreatmentService.ColumnNames.Price]);
     input.TotalPrice = Utilities.ToNDecimal(reader[Medical.Apartment.Common.TreatmentService.ColumnNames.TotalPrice]);
     input.Description = Utilities.ToString(reader[Medical.Apartment.Common.TreatmentService.ColumnNames.Description]);
     input.BasePrice = Utilities.ToNDecimal(reader[Medical.Apartment.Common.TreatmentService.ColumnNames.BasePrice]);
 }
Пример #21
0
    public int InsertTreatmentService(TreatmentService treatmentService)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("InsertTreatmentService", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@TreatmentServiceID", SqlDbType.Int).Direction = ParameterDirection.Output;
            cmd.Parameters.Add("@TreatmentServiceName", SqlDbType.NVarChar).Value = treatmentService.TreatmentServiceName;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return (int)cmd.Parameters["@TreatmentServiceID"].Value;
        }
    }
Пример #22
0
    public bool UpdateTreatmentService(TreatmentService treatmentService)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("UpdateTreatmentService", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@TreatmentServiceID", SqlDbType.Int).Value = treatmentService.TreatmentServiceID;
            cmd.Parameters.Add("@TreatmentServiceName", SqlDbType.NVarChar).Value = treatmentService.TreatmentServiceName;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return result == 1;
        }
    }
Пример #23
0
        public void ChippingTreatmentShouldHaveDescription()
        {
            // Arrange
            Mock <IAnimalRepository>    animalRepository    = new Mock <IAnimalRepository>();
            Mock <ITreatmentRepository> treatmentRepository = new Mock <ITreatmentRepository>();

            ITreatmentService treatmentService = new TreatmentService(treatmentRepository.Object, animalRepository.Object);

            Animal dog = new Animal
            {
                ID              = 1,
                Name            = "Doggo",
                Birthdate       = new DateTime(2018, 10, 18),
                Age             = 2,
                Description     = "Good boi",
                AnimalType      = AnimalType.Dog,
                Race            = "Beautiful Doggos",
                Picture         = "Goodboi.png",
                DateOfDeath     = null,
                Castrated       = true,
                ChildFriendly   = ChildFriendly.Yes,
                ReasonGivenAway = "Too good a boi",
            };
            Lodging dogGroupLocation = new Lodging
            {
                ID              = 1,
                LodgingType     = LodgingType.Group,
                MaxCapacity     = 100,
                CurrentCapacity = 10,
                AnimalType      = AnimalType.Dog,
                Stays           = new List <Stay>()
                {
                },
            };
            Stay stay = new Stay
            {
                ID                = 1,
                Animal            = dog,
                AnimalID          = dog.ID,
                ArrivalDate       = new DateTime(2019, 10, 18),
                AdoptionDate      = null,
                CanBeAdopted      = true,
                AdoptedBy         = null,
                LodgingLocation   = dogGroupLocation,
                LodgingLocationID = dogGroupLocation.ID,
                Comments          = new List <Comment>(),
                Treatments        = new List <Treatment>(),
            };
            Treatment vaccination = new Treatment
            {
                ID            = 1,
                TreatmentType = TreatmentType.Chipping,
                Costs         = 100,
                RequiredAge   = 1,
                DoneBy        = "Barry",
                Date          = new DateTime(2020, 12, 30),
                StayID        = 1,
                Stay          = stay,
            };

            animalRepository.Setup(e => e.FindByID(dog.ID))
            .Returns(dog);

            // Act
            var ex = Assert.Throws <InvalidOperationException>(() => treatmentService.Add(vaccination));

            // Assert
            Assert.Equal("AS_Services", ex.Source);  // Make sure the error is actually thrown in the service, not somewhere else
            Assert.Equal("Add", ex.TargetSite.Name); // Make sure the error is thrown by the Add method; not something else
            Assert.Equal("Chipping needs a description", ex.Message);
        }
Пример #24
0
        public void ProperTreatmentCanBeAddedToAnimal()
        {
            // Arrange
            Mock <IAnimalRepository>    animalRepository    = new Mock <IAnimalRepository>();
            Mock <ITreatmentRepository> treatmentRepository = new Mock <ITreatmentRepository>();

            ITreatmentService treatmentService = new TreatmentService(treatmentRepository.Object, animalRepository.Object);

            Animal dog = new Animal
            {
                ID              = 1,
                Name            = "Doggo",
                Birthdate       = new DateTime(2018, 10, 18),
                Age             = 2,
                Description     = "Good boi",
                AnimalType      = AnimalType.Dog,
                Race            = "Beautiful Doggos",
                Picture         = "Goodboi.png",
                DateOfDeath     = null,
                Castrated       = true,
                ChildFriendly   = ChildFriendly.Yes,
                ReasonGivenAway = "Too good a boi",
            };
            Lodging dogGroupLocation = new Lodging
            {
                ID              = 1,
                LodgingType     = LodgingType.Group,
                MaxCapacity     = 100,
                CurrentCapacity = 10,
                AnimalType      = AnimalType.Dog,
                Stays           = new List <Stay>()
                {
                },
            };
            Stay stay = new Stay
            {
                ID                = 1,
                Animal            = dog,
                AnimalID          = dog.ID,
                ArrivalDate       = new DateTime(2019, 10, 18),
                AdoptionDate      = null,
                CanBeAdopted      = true,
                AdoptedBy         = null,
                LodgingLocation   = dogGroupLocation,
                LodgingLocationID = dogGroupLocation.ID,
                Comments          = new List <Comment>(),
                Treatments        = new List <Treatment>(),
            };
            Treatment smallOperation = new Treatment
            {
                ID            = 1,
                Description   = "Small operation to help recovery",
                TreatmentType = TreatmentType.Operation,
                Costs         = 100,
                RequiredAge   = 1,
                DoneBy        = "Barry", // TODO: This needs a relation to the user
                Date          = new DateTime(2020, 12, 30),
                StayID        = 1,
                Stay          = stay,
            };

            animalRepository.Setup(e => e.FindByID(dog.ID))
            .Returns(dog);


            //Act
            treatmentService.Add(smallOperation);

            //Assert
            treatmentRepository.Verify(x => x.Add(smallOperation), Times.Once());
            treatmentRepository.Verify(x => x.Add(smallOperation));
        }
Пример #25
0
    public TreatmentService GetTreatmentServiceFromReader(IDataReader reader)
    {
        try
        {
            TreatmentService treatmentService = new TreatmentService
                (

                     DataAccessObject.IsNULL<int>(reader["TreatmentServiceID"]),
                     DataAccessObject.IsNULL<string>(reader["TreatmentServiceName"])
                );
             return treatmentService;
        }
        catch(Exception ex)
        {
            return null;
        }
    }
Пример #26
0
 public static bool UpdateTreatmentService(TreatmentService treatmentService)
 {
     SqlTreatmentServiceProvider sqlTreatmentServiceProvider = new SqlTreatmentServiceProvider();
     return sqlTreatmentServiceProvider.UpdateTreatmentService(treatmentService);
 }
Пример #27
0
 public static int InsertTreatmentService(TreatmentService treatmentService)
 {
     SqlTreatmentServiceProvider sqlTreatmentServiceProvider = new SqlTreatmentServiceProvider();
     return sqlTreatmentServiceProvider.InsertTreatmentService(treatmentService);
 }
Пример #28
0
    public static int InsertTreatmentService(TreatmentService treatmentService)
    {
        SqlTreatmentServiceProvider sqlTreatmentServiceProvider = new SqlTreatmentServiceProvider();

        return(sqlTreatmentServiceProvider.InsertTreatmentService(treatmentService));
    }
Пример #29
0
 void btnInsertTreatmentService_Click(object sender, RoutedEventArgs e)
 {
     Service Service = uiServiceList.SelectedItem as Service;
     if (Service != null && _selectedTreatmentId > 0)
     {
         List<TreatmentService> list = (List<TreatmentService>)gvwTreatmentService.ItemsSource;
         if (list.Count(i => i.ServiceId == Service.ServiceId) > 0)
         {
             MessageBox.Show(ResourceHelper.GetReourceValue("Common_ItemExist"));
         }
         else
         {
             TreatmentService newTreatmentService = new TreatmentService();
             newTreatmentService.TreatmentId = _selectedTreatmentId;
             newTreatmentService.ServiceId = Service.ServiceId;
             newTreatmentService.Service = Service.Name;
             newTreatmentService.IsChanged = true;
             newTreatmentService.Quantity = 1;
             newTreatmentService.Price = Service.Price;
             newTreatmentService.BasePrice = Service.Price;
             newTreatmentService.Unit = Service.Unit;
             newTreatmentService.TotalPrice = Service.Price;
             newTreatmentService.Description = Service.Description;
             list.Add(newTreatmentService);
             gvwTreatmentService.ItemsSource = null;
             gvwTreatmentService.ItemsSource = list;
         }
     }
 }
Пример #30
0
 public TreatmentReportController()
 {
     treatmentReportService = new TreatmentReportService();
     treatmentService       = new TreatmentService();
     medicineService        = new MedicineService();
 }
Пример #31
0
        private void Init()
        {
            _patientService   = new PatientService(_dbService);
            _treatmentService = new TreatmentService(_dbService);

            string teethMap = _patientService.GetTeethMap(_patientId);

            const int countX = 16;
            const int countY = 2;

            const int marginLeft   = 5;
            const int marginRight  = 5;
            const int marginTop    = 25;
            const int marginBottom = 5;

            const int spaceX = 4;
            const int spaceY = 40;

            int stageWidth  = tabPageTeeth.Width - marginLeft - marginRight;
            int stageHeight = tabPageTeeth.Height - marginTop - marginBottom;

            int buttonWidth  = (stageWidth - (countX * spaceX)) / countX;
            int buttonHeight = (stageHeight - ((countY - 1) * spaceY)) / countY;

            _teeth = new Dictionary <ToothVerticalPosition, Button[]>()
            {
                { ToothVerticalPosition.TOP, new Button[countX] },
                { ToothVerticalPosition.BOTTOM, new Button[countX] }
            };

            _flags = new Dictionary <ToothVerticalPosition, ToothStatusFlags[]>()
            {
                { ToothVerticalPosition.TOP, StringToFlags(teethMap.Substring(0, 16)) },
                { ToothVerticalPosition.BOTTOM, StringToFlags(teethMap.Substring(16, 16)) }
            };

            for (int y = 0; y < countY; y++)
            {
                for (int x = 0; x < countX; x++)
                {
                    Button button = new Button();
                    button.FlatStyle             = FlatStyle.Flat;
                    button.BackgroundImageLayout = ImageLayout.Stretch;
                    button.Width          = buttonWidth;
                    button.Height         = buttonHeight;
                    button.AccessibleName = (y == 0 ? "TOP_" : "BOTTOM_") + (x < (countX / 2) ? "LEFT_" + ((countX / 2) - x) : "RIGHT_" + (x - (countX / 2) + 1));

                    Point p = new Point();
                    p.X = marginLeft + ((buttonWidth + spaceX + (x / (countX / 2))) * x);
                    p.Y = marginTop + ((buttonHeight + spaceY) * y);

                    button.Location = p;

                    button.MouseUp += button_MouseUp;

                    _teeth[(ToothVerticalPosition)y][x] = button;

                    tabPageTeeth.Controls.Add(button);
                }
            }

            LoadTreatmentGrid();
        }
        async Task LoadTreatments()
        {
            Treatments = await TreatmentService.GetTreatmentsAsync();

            SetDurationInMinutes();
        }
Пример #33
0
    public static bool UpdateTreatmentService(TreatmentService treatmentService)
    {
        SqlTreatmentServiceProvider sqlTreatmentServiceProvider = new SqlTreatmentServiceProvider();

        return(sqlTreatmentServiceProvider.UpdateTreatmentService(treatmentService));
    }
Пример #34
0
 public TreatmentController()
 {
     treatmentService = new TreatmentService();
     doctorService    = new DoctorService();
     patientService   = new PatientService();
 }
Пример #35
0
        public App()
        {
            var medicationRepository           = new MedicationRepository(new Stream <Medication>(MEDICATION_FILE));
            var diagnosisRepository            = new DiagnosisRepository(new Stream <Diagnosis>(DIAGNOSIS_FILE));
            var allergenRepository             = new AllergensRepository(new Stream <Allergens>(ALLERGEN_FILE));
            var categoryRepository             = new MedicationCategoryRepository(new Stream <MedicationCategory>(CATEGORY_FILE));
            var symptomsRepository             = new SymptomsRepository(new Stream <Symptoms>(SYMPTOMS_FILE));
            var ingredientsRepository          = new MedicationIngredientRepository(new Stream <MedicationIngredient>(INGREDIENTS_FILE));
            var specializationRepository       = new SpecializationRepository(new Stream <Specialization>(SPECIALIZATION_FILE));
            var cityRepository                 = new CityRepository(new Stream <City>(CITY_FILE));
            var addressRepository              = new AddressRepository(new Stream <Address>(ADDRESS_FILE), cityRepository);
            var stateRepository                = new StateRepository(new Stream <State>(STATE_FILE));
            var hospitalRepository             = new HospitalRepository(new Stream <Hospital>(HOSPITAL_FILE));
            var departmentRepository           = new DepartmentRepository(hospitalRepository, new Stream <Department>(DEPARTMENT_FILE));
            var roomRepository                 = new RoomRepository(departmentRepository, new Stream <Room>(ROOM_FILE));
            var userRepository                 = new UserRepository(new Stream <RegisteredUser>(USER_FILE), cityRepository, addressRepository, departmentRepository, roomRepository);
            var renovationRepository           = new RenovationRepository(roomRepository, new Stream <Renovation>(RENOVATION_FILE));
            var medicalRecordRepository        = new MedicalRecordRepository(new Stream <MedicalRecord>(RECORD_FILE), diagnosisRepository, medicationRepository, userRepository);
            var bedRepository                  = new BedRepository(roomRepository, medicalRecordRepository, new Stream <Bed>(BED_FILE));
            var equipmentTypeRepository        = new EquipmentTypeRepository(new Stream <EquipmentType>(EQUIPMENT_TYPE_FILE));
            var equipmentRepository            = new HospitalEquipmentRepository(new Stream <HospitalEquipment>(EQUIPMENT_FILE));
            var treatmentsRepository           = new TreatmentRepository(medicationRepository, departmentRepository, new Stream <Treatment>(TREATMENTS_FILE));
            var examinationSurgeryRepository   = new ExaminationSurgeryRepository(treatmentsRepository, medicalRecordRepository, userRepository, new Stream <ExaminationSurgery>(EXAMINATION_SURGERY_FILE));
            var emergencyRequestRepository     = new EmergencyRequestRepository(medicalRecordRepository, new Stream <EmergencyRequest>(EMERGENCY_REQUEST_FILE));
            var vaccinesRepository             = new VaccinesRepository(new Stream <Vaccines>(VACCINES_FILE));
            var notificationRepository         = new NotificationRepository(userRepository, new Stream <Notification>(NOTIFICATION_FILE));
            var articleRepository              = new ArticleRepository(userRepository, new Stream <Article>(ARTICLE_FILE));
            var questionRepository             = new QuestionRepository(userRepository, new Stream <Question>(QUESTIONS_FILE));
            var doctorReviewsRepository        = new DoctorReviewRepository(userRepository, new Stream <DoctorReview>(DOCTOR_REVIEWS_FILE));
            var feedbackRepository             = new FeedbackRepository(userRepository, new Stream <Feedback>(FEEDBACK_FILE));
            var surveyRepository               = new SurveyRepository(userRepository, new Stream <Survey>(SURVEY_FILE));
            var appointmentsRepository         = new AppointmentRepository(userRepository, medicalRecordRepository, roomRepository, new Stream <Appointment>(APPOINTMENTS_FILE));
            var workDayRepository              = new WorkDayRepository(userRepository, new Stream <WorkDay>(WORK_DAY_FILE));
            var vacationRequestRepository      = new VacationRequestRepository(userRepository, new Stream <VacationRequest>(VACATION_REQUEST_FILE));
            var reportsRepository              = new ReportRepository(new Stream <Report>(REPORTS_FILE));
            var labTestTypeRepository          = new LabTestTypeRepository(new Stream <LabTestType>(LAB_TEST_TYPE_FILE));
            var validationMedicationRepository = new ValidationMedicationRepository(new Stream <ValidationMed>(VALIDATION_FILE), userRepository, medicationRepository);

            var equipmentTypeService        = new EquipmentTypeService(equipmentTypeRepository);
            var medicationService           = new MedicationService(medicationRepository, validationMedicationRepository);
            var diagnosisService            = new DiagnosisService(diagnosisRepository);
            var allergenService             = new AllergensService(allergenRepository);
            var categoryService             = new MedicationCategoryService(categoryRepository);
            var symptomsService             = new SymptomsService(symptomsRepository);
            var ingredientsService          = new MedicationIngredientService(ingredientsRepository);
            var specializationService       = new SpecializationService(specializationRepository);
            var cityService                 = new CityService(cityRepository);
            var stateService                = new StateService(stateRepository);
            var addressService              = new AddressService(addressRepository);
            var notificationService         = new NotificationService(notificationRepository, userRepository, medicalRecordRepository);
            var validationMedicationService = new ValidationMedicationService(validationMedicationRepository, notificationService);
            var hospitalService             = new HospitalService(hospitalRepository);
            var departmentService           = new DepartmentService(departmentRepository);
            var bedService                = new BedService(bedRepository);
            var medicalRecordService      = new MedicalRecordService(medicalRecordRepository);
            var treatmentService          = new TreatmentService(treatmentsRepository, notificationService);
            var examiantionSurgeryService = new ExaminationSurgeryService(examinationSurgeryRepository);
            var emergencyRequestService   = new EmergencyRequestService(emergencyRequestRepository, notificationService);
            var vaccinesService           = new VaccinesService(vaccinesRepository);
            var articleService            = new ArticleService(articleRepository);
            var questionService           = new QuestionService(questionRepository, notificationService);
            var doctorsReviewService      = new DoctorReviewService(doctorReviewsRepository);
            var feedbackService           = new FeedbackService(feedbackRepository);
            var surveyService             = new SurveyService(surveyRepository);
            var userService               = new UserService(userRepository, medicalRecordService);
            var workDayService            = new WorkDayService(workDayRepository, MAX_HOURS_PER_WEEK);
            var appointmentService        = new AppointmentService(appointmentsRepository, workDayService, notificationService, VALID_HOURS_FOR_SCHEDULING, APPOINTMENT_LENGTH_IN_MINUTES,
                                                                   SURGERY_LENGTH_IN_MINUTES, START_WORKING_HOURS, END_WORKING_HOURS);
            var vacationRequestService      = new VacationRequestService(vacationRequestRepository, notificationService, NUMBER_OF_ALLOWED_VACAY_REQUESTS);
            var reportsService              = new ReportService(reportsRepository, treatmentsRepository, medicationRepository, examinationSurgeryRepository, roomRepository);
            var labTestTypeService          = new LabTestTypeService(labTestTypeRepository);
            var roomService                 = new RoomService(roomRepository, appointmentsRepository);
            var hospitalEquipmentService    = new HospitalEquipmentService(equipmentRepository);
            var renovationService           = new RenovationService(renovationRepository, roomService, appointmentsRepository, hospitalEquipmentService, notificationService, RENOVATION_DAYS_RESTRICTION, RENOVATION_DAYS_RESTRICTION);
            var availableAppointmentService = new AvailableAppointmentService(appointmentsRepository, workDayService, VALID_HOURS_FOR_SCHEDULING,
                                                                              APPOINTMENT_LENGTH_IN_MINUTES, SURGERY_LENGTH_IN_MINUTES, START_WORKING_HOURS, END_WORKING_HOURS);

            equipmentTypeController        = new EquipmentTypeController(equipmentTypeService);
            medicationController           = new MedicationController(medicationService);
            userController                 = new UserController(userService);
            diagnosisController            = new DiagnosisController(diagnosisService);
            symptomsController             = new SymptomsController(symptomsService);
            categoryController             = new MedicationCategoryController(categoryService);
            allergensController            = new AllergensController(allergenService);
            vaccinesController             = new VaccinesController(vaccinesService);
            labTestTypeController          = new LabTestTypeController(labTestTypeService);
            medicationIngredientController = new MedicationIngredientController(ingredientsService);
            cityController                 = new CityController(cityService);
            specializationController       = new SpecializationController(specializationService);
            addressController              = new AddressController(addressService);
            stateController                = new StateController(stateService);
            departmentController           = new DepartmentController(departmentService);
            hospitalController             = new HospitalController(hospitalService);
            roomController                 = new RoomController(roomService);
            renovationController           = new RenovationController(renovationService);
            hospitalEquipmentController    = new HospitalEquipmentController(hospitalEquipmentService);
            medicalRecordController        = new MedicalRecordController(medicalRecordService);
            treatmentController            = new TreatmentController(treatmentService);
            examinationSurgeryController   = new ExaminationSurgeryController(examiantionSurgeryService);
            articleController              = new ArticleController(articleService);
            questionController             = new QuestionController(questionService);
            doctorReviewController         = new DoctorReviewController(doctorsReviewService);
            surveyController               = new SurveyController(surveyService);
            feedbackController             = new FeedbackController(feedbackService);
            workDayController              = new WorkDayController(workDayService);
            reportController               = new ReportController(reportsService);
            validationMedicationController = new ValidationMedicationController(validationMedicationService);
            vacationRequestController      = new VacationRequestController(vacationRequestService);
            bedController = new BedController(bedService);
            emergencyRequestController     = new EmergencyRequestController(emergencyRequestService);
            appointmentController          = new AppointmentController(appointmentService);
            notificationController         = new NotificationController(notificationService);
            availableAppointmentController = new AvailableAppointmentController(availableAppointmentService);

            validations = new Validations(UNDERAGE_RESTRICTION);
        }
Пример #36
0
 public TreatmentController(TreatmentService treatmentService)
 {
     _treatmentService = treatmentService;
 }
Пример #37
0
        public static TreatmentService TreatmentService(System.Data.IDataReader reader)
        {
            TreatmentService result = null;

            if (null != reader && reader.Read())
            {
                result = new TreatmentService();
                PopulateTreatmentService(result, reader);
            }

            return result;
        }