Example #1
0
 public UnitOfWork(bbuContext context)
 {
     _context             = context;
     Addresses            = new AddressRepository(_context);
     AppUsers             = new AppUserRepository(_context);
     Banks                = new BankRepository(_context);
     BankAccounts         = new BankAccountRepository(_context);
     Cemeteries           = new CemeteryRepository(_context);
     Credentials          = new CredentialsRepository(_context);
     Deceaseds            = new DeceasedRepository(_context);
     Doctors              = new DoctorRepository(_context);
     Employees            = new EmployeeRepository(_context);
     Files                = new FileRepository(_context);
     Funerals             = new FuneralRepository(_context);
     FuneralDocuments     = new FuneralDocumentRepository(_context);
     Genders              = new GenderRepository(_context);
     HomeAffairsOffices   = new HomeAffairsOfficeRepository(_context);
     HomeAffairsOfficers  = new HomeAffairsOfficerRepository(_context);
     Hospitals            = new HospitalRepository(_context);
     Informants           = new InformantRepository(_context);
     Members              = new MemberRepository(_context);
     Months               = new MonthRepository(_context);
     Mortuaries           = new MortuaryRepository(_context);
     NextOfKins           = new NextOfKinRepository(_context);
     NumberConfigurations = new NumberConfigurationRepository(_context);
     Payments             = new PaymentRepository(_context);
     PaymentPeriods       = new PaymentPeriodRepository(_context);
     People               = new PersonRepository(_context);
     PurchaseItems        = new PurchaseItemRepository(_context);
     Settings             = new SettingRepository(_context);
     States               = new StateRepository(_context);
     Suppliers            = new SupplierRepository(_context);
     Tasks                = new TaskRepository(_context);
     Years                = new YearRepository(_context);
 }
Example #2
0
 public HospitalController(IPhoto iPhoto)
 {
     this.iPhoto  = iPhoto;
     dbContext    = new CaremeDBContext();
     hospitalRepo = new HospitalRepository(dbContext);
     docHosRepo   = new DoctorHospitalRepository(dbContext);
 }
Example #3
0
        public void ExistsChecksCorrectly()
        {
            //Arrange
            string name      = "test name";
            var    hospitals = new List <Hospital>
            {
                new Hospital {
                    Name = name
                },
                new Hospital {
                    Name = $"aaa{name}"
                },
                new Hospital {
                    Name = $"{name}bbb"
                }
            };
            var dbSet = hospitals.AsQueryable().BuildMockDbSet();

            context.Setup(c => c.Set <Hospital>()).Returns(dbSet.Object);
            IHospitalRepository repository = new HospitalRepository(context.Object);

            //Act
            var result = repository.Exists(name).Result;

            //Assert
            Assert.IsTrue(result);
        }
Example #4
0
 public EnfermeiroController(HospitalEnfermeiroRepository hospEnfrepository,
                             HospitalRepository hospitalRepository,
                             EnfermeiroRepository enfermeiroRepository)
 {
     _hospEnfrepository    = hospEnfrepository;
     _hospitalRepository   = hospitalRepository;
     _enfermeiroRepository = enfermeiroRepository;
 }
Example #5
0
 public BookingController()
 {
     dbContext       = new CaremeDBContext();
     scheduleRepo    = new ScheduleRepository(dbContext);
     hospitalRepo    = new HospitalRepository(dbContext);
     doctorRepo      = new DoctorRepository(dbContext);
     appointmentRepo = new AppointmentRepository(dbContext);
 }
Example #6
0
 public HomeController(IScheduleService iScheduleService)
 {
     this.iScheduleService = iScheduleService;
     dbContext             = new CaremeDBContext();
     scheduleRepo          = new ScheduleRepository(dbContext);
     hospitalRepo          = new HospitalRepository(dbContext);
     doctorRepo            = new DoctorRepository(dbContext);
     appointmentRepo       = new AppointmentRepository(dbContext);
 }
Example #7
0
 public ScheduleController(IScheduleService iScheduleService, IScheduleDelService iScheduleDelService)
 {
     this.iScheduleDelService = iScheduleDelService;
     this.iScheduleService    = iScheduleService;
     dbContext        = new CaremeDBContext();
     scheduleRepo     = new ScheduleRepository(dbContext);
     hospitalRepo     = new HospitalRepository(dbContext);
     scheduleDataRepo = new ScheduleDataRepository(dbContext);
 }
 public UnitOfWork(HospitalDbContext context)
 {
     _context  = context;
     Beds      = new BedRepository(_context);
     Cities    = new CityRepository(_context);
     Hospitals = new HospitalRepository(_context);
     Doctors   = new DoctorRepository(_context);
     Patients  = new PatientRepository(_context);
     Wards     = new WardRepository(_context);
 }
Example #9
0
 public PatientController(IPhoto iPhoto, IQueryService iQueryService)
 {
     this.iPhoto        = iPhoto;
     this.iQueryService = iQueryService;
     dbContext          = new CaremeDBContext();
     scheduleRepo       = new ScheduleRepository(dbContext);
     hospitalRepo       = new HospitalRepository(dbContext);
     doctorRepo         = new DoctorRepository(dbContext);
     appointmentRepo    = new AppointmentRepository(dbContext);
 }
Example #10
0
        public async void Test_List_Covid_Hospitals_Beds_Availability()
        {
            IEnumerable <HospitalBeds> result;

            using (var repo = new HospitalRepository())
            {
                result = await repo.HospitalsBedsWaitResultAsync();
            }

            Assert.True(result.Any());
        }
Example #11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:UCLouvain.AmbulanceSystem.Server.AmbulanceAllocator"/> class.
        /// </summary>
        /// <param name="db">Db. Do not share among threads.</param>
        public AmbulanceAtStationAllocator(MapService mapService, IDatabase db)
        {
            ambulanceRepository = new AmbulanceRepository(db);
            hospitalRepository  = new HospitalRepository(db);
            incidentRepository  = new IncidentRepository(db);

            this.mapService         = mapService;
            this.incidentsToProcess = new BlockingCollection <Incident>();

            new Thread(this.Start).Start();
        }
 public AdminController()
 {
     _doctorRepository           = new DoctorRepository();
     _hospitalRepository         = new HospitalRepository();
     _bankRepository             = new BankRepository();
     _agencyRepository           = new AgencyRepository();
     _specialityRepository       = new SpecialityRepository();
     _payRateRepository          = new PayRateRepository();
     _companionTypeRepository    = new CompanionTypeRepository();
     _companionHistoryRepository = new CompanionHistoryRepository();
     _patientHistoryRepository   = new PatientHistoryRepository();
 }
Example #13
0
        public Cancelator(IDatabase db)
        {
            ambulanceRepository  = new AmbulanceRepository(db);
            hospitalRepository   = new HospitalRepository(db);
            incidentRepository   = new IncidentRepository(db);
            allocationRepository = new AllocationRepository(db);

            sender = new RabbitMQMessageSender();
            allocationsToProcess = new BlockingCollection <Allocation>();

            new Thread(Start).Start();
        }
Example #14
0
 /// <summary>
 /// Save all hospitals into file/database.
 /// </summary>
 public bool SaveAll()
 {
     try
     {
         return(HospitalRepository.Save(_hospitals));
     }
     catch (DataInconsistencyException e)
     {
         Console.WriteLine(e.Message);
     }
     return(false);
 }
Example #15
0
        public ApiController()
        {
            var provider         = new PostgreSQLDatabaseProvider();
            var connectionString = ConfigurationManager.ConnectionStrings["postgres"].ConnectionString;
            var config           = DatabaseConfiguration.Build()
                                   .UsingConnectionString(connectionString)
                                   .UsingProvider(provider)
                                   .UsingDefaultMapper <ConventionMapper>();
            var db = new Database(config);

            ambulanceRepository  = new AmbulanceRepository(db);
            hospitalRepository   = new HospitalRepository(db);
            incidentRepository   = new IncidentRepository(db);
            allocationRepository = new AllocationRepository(db);
        }
Example #16
0
        public Checker(IDatabaseBuildConfiguration config)
        {
            this.config = config;
            var db = new Database(config);

            ambulanceRepository     = new AmbulanceRepository(db);
            hospitalRepository      = new HospitalRepository(db);
            incidentRepository      = new IncidentRepository(db);
            allocationRepository    = new AllocationRepository(db);
            configurationRepository = new ConfigurationRepository(db);

            mapService = new MapService();

            allocator = new DefaultAmbulanceAllocator(mapService, new LoggedDatabase(config));
            configurationRepository.UpdateActiveAllocator("DefaultAmbulanceAllocator");

            mobilizator           = new AmbulanceMobilizator(new Database(config));
            trafficJamReallocator = new TrafficJamReallocator(mapService, new LoggedDatabase(config));
            cancelator            = new Cancelator(new Database(config));
        }
Example #17
0
        public HomeController()
        {
            // var provider = new MonoSQLiteDatabaseProvider();
            var provider         = new PostgreSQLDatabaseProvider();
            var connectionString = ConfigurationManager.ConnectionStrings["postgres"].ConnectionString;
            var config           = DatabaseConfiguration.Build()
                                   .UsingConnectionString(connectionString)
                                   .UsingProvider(provider)
                                   .UsingDefaultMapper <ConventionMapper>();
            var db = new Database(config);

            // connection.Open();

            //logger.Info (db.ExecuteScalar<int>("select count(*) from ambulances where ambulances.ambulanceId = 'A9';"));

            ambulanceRepository  = new AmbulanceRepository(db);
            hospitalRepository   = new HospitalRepository(db);
            incidentRepository   = new IncidentRepository(db);
            allocationRepository = new AllocationRepository(db);
        }
Example #18
0
        public Orchestrator(IDatabaseBuildConfiguration config)
        {
            var db = new Database(config);

            ambulanceRepository        = new AmbulanceRepository(db);
            ambulanceStationRepository = new AmbulanceStationRepository(db);
            hospitalRepository         = new HospitalRepository(db);
            incidentRepository         = new IncidentRepository(db);
            allocationRepository       = new AllocationRepository(db);

            mapService = new MapService();

            ip = new IncidentProcessor(this);
            //allocator = new AmbulanceAllocator(mapService, new LoggedDatabase(config));
            //mobilizator = new AmbulanceMobilizator(new Database (config));
            //trafficJamReallocator = new TrafficJamReallocator(mapService, new LoggedDatabase(config));
            //cancelator = new Cancelator(new Database(config));

            checker = new Checker(config);
            checker.Start();
        }
Example #19
0
 public HospitalService()
 {
     //Initialize Hospital List from file, from database or create a new one.
     _hospitals = HospitalRepository.GetData();
 }
 public HospitalController()
 {
     repository = new HospitalRepository();
 }
 public HospitalController(ApplicationDbContext context)
 {
     _hospitalRepository = new HospitalRepository(context);
 }
Example #22
0
        public static void Main(string[] args)
        {
            //DeployAmbulanceAtStationAllocator();
            //Thread.Sleep(TimeSpan.FromSeconds(10));

            Console.WriteLine("Hello World!");
            var monitoringDelay = TimeSpan.FromSeconds(1);

            logger.Info("Connecting to database");
            var provider         = new PostgreSQLDatabaseProvider();
            var connectionString = ConfigurationManager.ConnectionStrings["postgres"].ConnectionString;

            var config = DatabaseConfiguration.Build()
                         .UsingConnectionString(connectionString)
                         .UsingProvider(provider)
                         .UsingDefaultMapper <ConventionMapper>();

            db = new Database(config);
            incidentRepository      = new IncidentRepository(db);
            ambulanceRepository     = new AmbulanceRepository(db);
            allocationRepository    = new AllocationRepository(db);
            hospitalRepository      = new HospitalRepository(db);
            configurationRepository = new ConfigurationRepository(db);
            logger.Info("Connected to database");

            logger.Info("Building KAOS model.");
            var filename = "./Models/simple.kaos";
            var parser   = new KAOSTools.Parsing.ModelBuilder();

            model = parser.Parse(File.ReadAllText(filename), filename);
            var model2 = parser.Parse(File.ReadAllText(filename), filename);

            ActiveResolutions = Enumerable.Empty <Resolution>();

            var declarations = parser.Declarations;

            logger.Info("(done)");

            logger.Info("Configuring monitors.");
            // Configure all the monitors (for all obstacles and domain properties).
            KAOSMetaModelElement[] goals     = model.Goals().ToArray();
            KAOSMetaModelElement[] obstacles = model.LeafObstacles().ToArray();
            var projection = new HashSet <string>(GetAllPredicates(goals));

            monitor = new GoalMonitor(model, goals.Union(obstacles), projection, HandleFunc,
                                      // new TimedStateInformationStorage(TimeSpan.FromMinutes(60), TimeSpan.FromMinutes(120)),
                                      monitoringDelay);
            logger.Info("(done)");

            foreach (var p in model.Predicates())
            {
                Console.WriteLine(p.FriendlyName);
            }

            // What goals and obstacles should appear in LOG
            cpsGoals     = model.Goals(x => x.CustomData.ContainsKey("log_cps"));
            cpsObstacles = model.Obstacles(x => x.CustomData.ContainsKey("log_cps"));

            // Initialize obstruction sets
            obstructionLock = new object();
            ComputeObstructionSets();

            Console.WriteLine("Waiting ...");
            Console.ReadKey();

            logger.Info("Launching monitors");
            monitor.Run(false);

            var goalMonitorProcessor = new GoalMonitorProcessor(monitor);

            csvExport = new CSVGoalExportProcessor("experiment-goal.csv", "experiment-obstacle.csv");
            // goalMonitorProcessor.AddProcessor(csvExport, monitoringDelay);

            new Timer((state) => UpdateCPS(), null, monitoringDelay, monitoringDelay);
            new Timer((state) => MonitorStep(), null, monitoringDelay, monitoringDelay);
            Thread.Sleep(TimeSpan.FromSeconds(5));
            logger.Info("Launching processors");
            //new Timer((state) => LogStatistic(), null, monitoringDelay, monitoringDelay);
            new Timer((state) => LogCSV(), null, monitoringDelay, monitoringDelay);

            // Configure optimization process.
            optimizer = new Optimizer(monitor, model2);
            new Timer((state) => Optimize(), null, TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(60));

            while (true)
            {
                ;
            }
        }
 public HospitalController(HospitalRepository repository)
 {
     _repository = repository;
 }
 public HospitalService(HospitalRepository repository, IUnitWork unitWork)
 {
     _repository = repository;
     _unitWork = unitWork;
 }
Example #25
0
        public ResultViewModel Put([FromServices] EnfermeiroRepository _enfermeiro,
                                   [FromServices] HospitalRepository _hospital,
                                   [FromServices] HospitalEnfermeiroRepository _hospitalEnfermeiro,
                                   [FromBody] EditorEnfermeiroViewModel model)
        {
            // model.Validate();
            // if (model.Invalid) {
            //   return new ResultViewModel
            //   {
            //     Success = false,
            //     Message = "Não foi possível cadastrar o produto",
            //     Data = model.Notifications
            //   };
            // }
            var hospital = _hospital.Get(model.HospitalId);

            if (hospital == null)
            {
                return(new ResultViewModel
                {
                    Success = false,
                    Message = "Hospital não encontrado !",
                    Data = model.Notifications
                });
            }

            var enfermeiro = _enfermeiro.Get(model.Id);

            if (enfermeiro == null)
            {
                return(new ResultViewModel
                {
                    Success = false,
                    Message = "Enfermeiro não encontrado !",
                    Data = null
                });
            }

            enfermeiro.Nome           = model.Nome != null ? model.Nome : enfermeiro.Nome;
            enfermeiro.CPF            = model.CPF != null ? model.CPF : enfermeiro.CPF;
            enfermeiro.Coren          = model.Coren != null ? model.Coren : enfermeiro.Coren;
            enfermeiro.DataNascimento = model.DataNascimento.GetValueOrDefault() != null?model.DataNascimento.GetValueOrDefault() : enfermeiro.DataNascimento;

            enfermeiro.UpdatedAt = DateTime.Now;

            _enfermeiro.Update(enfermeiro);

            var hospitalEnfermeiro = _hospitalEnfermeiro.GetHospitalEnfermeiro(enfermeiro.Id);

            hospitalEnfermeiro.HospitalId = hospital.Id;
            hospitalEnfermeiro.UpdatedAt  = DateTime.Now;

            _hospitalEnfermeiro.Update(hospitalEnfermeiro);


            var enfViewModel = new EditorEnfermeiroViewModel()
            {
                Id             = enfermeiro.Id,
                Nome           = enfermeiro.Nome,
                CPF            = enfermeiro.CPF,
                Coren          = enfermeiro.Coren,
                DataNascimento = enfermeiro.DataNascimento,
                Hospital       = hospital.Nome,
                HospitalId     = hospital.Id
            };


            return(new ResultViewModel
            {
                Success = true,
                Message = "Enfermeiro alterado com sucesso !",
                Data = enfViewModel
            });
        }
Example #26
0
 public ScheduleDelService()
 {
     dbContext    = new CaremeDBContext();
     scheduleRepo = new ScheduleRepository(dbContext);
     hospitalRepo = new HospitalRepository(dbContext);
 }
Example #27
0
        private void LoadRepositories()
        {
            userRepository = new UserRepository(new CSVStream <User>(userFile, new UserConverter()), new ComplexSequencer());
            // USER OK


            roomRepository = new RoomRepository(new CSVStream <Room>(roomFile, new RoomConverter()), new LongSequencer());
            // ROOM OK

            inventoryItemRepository = new InventoryItemRepository(new CSVStream <InventoryItem>(inventoryItemFile, new InventoryItemConverter()), new LongSequencer(), roomRepository);

            timeTableRepository = new TimeTableRepository(new CSVStream <TimeTable>(timeTableFile, new TimeTableConverter()), new LongSequencer());
            // TIMETABLE OK
            hospitalRepository = new HospitalRepository(new CSVStream <Hospital>(hospitalFile, new HospitalConverter()), new LongSequencer(), roomRepository);
            // HOSPITAL OK

            secretaryRepository = new SecretaryRepository(new CSVStream <Secretary>(secretaryFile, new SecretaryConverter()), new ComplexSequencer(), timeTableRepository, hospitalRepository, userRepository);
            // SECRETARY OK
            managerRepository = new ManagerRepository(new CSVStream <Manager>(managerFile, new ManagerConverter()), new ComplexSequencer(), timeTableRepository, hospitalRepository, userRepository);
            // MANAGER OK
            doctorRepository = new DoctorRepository(new CSVStream <Doctor>(doctorFile, new DoctorConverter()), new ComplexSequencer(), timeTableRepository, hospitalRepository, roomRepository, userRepository);
            // DOCTOR OK
            patientRepository = new PatientRepository(new CSVStream <Patient>(patientFile, new PatientConverter()), new ComplexSequencer(), doctorRepository, userRepository);
            // PATIENT OK



            hospitalRepository.DoctorRepository    = doctorRepository;
            hospitalRepository.ManagerRepository   = managerRepository;
            hospitalRepository.SecretaryRepository = secretaryRepository;


            //Misc repositories
            locationRepository = new LocationRepository(new CSVStream <Location>(locationFile, new LocationConverter()), new LongSequencer());
            // LOCATION OK
            notificationRepository = new NotificationRepository(new CSVStream <Notification>(notificationFile, new NotificationConverter()), new LongSequencer(), patientRepository, doctorRepository, managerRepository, secretaryRepository);
            // NOTIFICATION OK
            messageRepository = new MessageRepository(new CSVStream <Message>(messageFile, new MessageConverter()), new LongSequencer(), patientRepository, doctorRepository, managerRepository, secretaryRepository);
            // MESSAGE OK
            articleRepository = new ArticleRepository(new CSVStream <Article>(articleFile, new ArticleConverter()), new LongSequencer(), doctorRepository, managerRepository, secretaryRepository);
            //ARTICLE OK
            questionRepository = new QuestionRepository(new CSVStream <Question>(questionFile, new QuestionConverter()), new LongSequencer());
            // QUESTION OK
            doctorQuestionRepository = new QuestionRepository(new CSVStream <Question>(doctorQuestionFile, new QuestionConverter()), new LongSequencer());
            //DOCTOR QUESTION OK
            feedbackRepository       = new FeedbackRepository(new CSVStream <Feedback>(feedbackFile, new FeedbackConverter()), new LongSequencer(), questionRepository, patientRepository, doctorRepository, managerRepository, secretaryRepository);
            doctorFeedbackRepository = new DoctorFeedbackRepository(new CSVStream <DoctorFeedback>(doctorFeedbackFile, new DoctorFeedbackConverter()), new LongSequencer(), doctorQuestionRepository, patientRepository, doctorRepository);


            //Hospital management repositories
            symptomRepository = new SymptomRepository(new CSVStream <Symptom>(symptomsFile, new SymptomConverter()), new LongSequencer());
            //SYMPTOM REPO OK
            diseaseRepository = new DiseaseRepository(new CSVStream <Disease>(diseaseFile, new DiseaseConverter()), new LongSequencer(), medicineRepository, symptomRepository);
            //DISEASE REPO OK
            ingredientRepository = new IngredientRepository(new CSVStream <Ingredient>(ingredientFile, new IngredientConverter()), new LongSequencer());
            //INGREDIENT REPO OK
            medicineRepository = new MedicineRepository(new CSVStream <Medicine>(medicineFile, new MedicineConverter()), new LongSequencer(), ingredientRepository, diseaseRepository);
            //MEDICINE REPO OK


            prescriptionRepository = new PrescriptionRepository(new CSVStream <Prescription>(prescriptionFile, new PrescriptionConverter()), new LongSequencer(), doctorRepository, medicineRepository);
            //PRESCRIPTION REPO OK

            //Medical repositories

            allergyRepository = new AllergyRepository(new CSVStream <Allergy>(allergyFile, new AllergyConverter()), new LongSequencer(), ingredientRepository, symptomRepository);
            //ALLERGY REPO OK

            appointmentRepository = new AppointmentRepository(new CSVStream <Appointment>(appointmentsFile, new AppointmentConverter()), new LongSequencer(), patientRepository, doctorRepository, roomRepository);
            //GERGO REPO OK?
            therapyRepository = new TherapyRepository(new CSVStream <Therapy>(therapyFile, new TherapyConverter()), new LongSequencer(), medicalRecordRepository, medicalRecordRepository, prescriptionRepository, diagnosisRepository);

            //med record
            medicalRecordRepository = new MedicalRecordRepository(new CSVStream <MedicalRecord>(medicalRecordFile, new MedicalRecordConverter()), new LongSequencer(), patientRepository, diagnosisRepository, allergyRepository);
            //u medical record moras da set diagnosis repo
            diagnosisRepository = new DiagnosisRepository(new CSVStream <Diagnosis>(diagnosisFile, new DiagnosisConverter()), new LongSequencer(), therapyRepository, diseaseRepository, medicalRecordRepository);
            //therapy
            // therapyRepository = new TherapyRepository(new CSVStream<Therapy>(therapyFile,new TherapyConverter()),new LongSequencer(),medicalRecordRepository, )

            diseaseRepository.MedicineEagerCSVRepository = medicineRepository;
            medicineRepository.DiseaseRepository         = diseaseRepository;

            medicalRecordRepository.DiagnosisRepository       = diagnosisRepository;
            diagnosisRepository.MedicalRecordRepository       = medicalRecordRepository;
            diagnosisRepository.TherapyEagerCSVRepository     = therapyRepository;
            therapyRepository.DiagnosisCSVRepository          = diagnosisRepository;
            therapyRepository.MedicalRecordRepository         = medicalRecordRepository;
            therapyRepository.MedicalRecordEagerCSVRepository = medicalRecordRepository;



            //ODAVDDE RADITI OSTALE

            doctorStatisticRepository = new DoctorStatisticRepository(new CSVStream <StatsDoctor>(doctorStatisticsFile, new DoctorStatisticsConverter(",")), new LongSequencer(), doctorRepository);
            // Doc Stats OK

            inventoryStatisticRepository = new InventoryStatisticsRepository(new CSVStream <StatsInventory>(inventoryStatisticsFile, new InventoryStatisticsConverter(",")), new LongSequencer(), medicineRepository, inventoryItemRepository);
            // InventoryStats OK

            roomStatisticRepository = new RoomStatisticsRepository(new CSVStream <StatsRoom>(roomStatisticsFile, new RoomStatisticsConverter(",")), new LongSequencer(), roomRepository);
            // RoomStats OK

            inventoryRepository = new InventoryRepository(new CSVStream <Inventory>(inventoryFile, new InventoryConverter(",", ";")), new LongSequencer(), inventoryItemRepository, medicineRepository);
        }
        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);
        }
Example #29
0
 public HospitalService(HospitalRepository hospitalRepository)
 {
     _hospitalRepository = hospitalRepository;
 }
Example #30
0
 public HospitalDbContext() : base("HospitalProject.Messaging.Server.Properties.Settings.ConnectionString")
 {
     Database.SetInitializer(new DropCreateDatabaseAlways <HospitalDbContext>());
     Hospitals = new HospitalRepository(this);
 }