Пример #1
0
        public async Task Initialize()
        {
            this.service = new AnamnesisService();
            this.service.ErrorCallback         = this.OnError;
            this.service.LogCallback           = this.OnLog;
            this.service.SelectProcessCallback = this.OnSelectProcess;

            await this.service.Initialize <WinProcess>();
        }
Пример #2
0
        // public PatientDTO a;
        // public DoctorDTO b;
        // public SecretaryDTO c;

        public App()
        {
            // HCI

            medicalRoles = new List <string> {
                "Svi", "Opšte Prakse", "Hirurg", "Dermatolog", "Očni lekar", "Stomatolog"
            };
            roomTypes = new List <string> {
                "Bolnička Soba", "Operaciona Sala", "Soba za preglede"
            };
            medicalAppointmentTypes = new List <string> {
                "Pregled", "Operacija", "Ležanje"
            };
            AddressDTO address = new AddressDTO("1", "Bulevar despota Stefan 7A", "Novi Sad", "Srbija", "21000");

            director     = new DirectorDTO(address, "Dusan", "Urosevic", "1231231231231", "021021", "Male", new DateTime(1990, 5, 5), 123, new TimeInterval(new DateTime(2020, 12, 12), new DateTime(2020, 12, 12)), new TimeInterval(new DateTime(2020, 12, 12), new DateTime(2020, 12, 12)), "[email protected]", "pass", "Klinicki Centar Vojvodina");
            SelectedDate = DateTime.Now;


            // Converters
            var addressConverter           = new AddressConverter();
            var patientConverter           = new PatientConverter(addressConverter);
            var medicineConverter          = new MedicineConverter();
            var questionConverter          = new QuestionConverter(patientConverter);
            var prescriptionConverter      = new PrescriptionConverter(patientConverter, medicineConverter);
            var medicalConsumableConverter = new MedicalConsumableConverter();
            var roomConverter                = new RoomConverter();
            var equipmentConverter           = new EquipmentConverter(roomConverter);
            var guestConverter               = new GuestConverter(addressConverter);
            var hospitalConverter            = new HospitalConverter();
            var doctorConverter              = new DoctorConverter(addressConverter);
            var medicalAppointmentConverter  = new MedicalAppointmentConverter(roomConverter, guestConverter, doctorConverter);
            var renovationConverter          = new RenovationConverter(roomConverter);
            var feedbackConverter            = new FeedbackConverter();
            var reviewConverter              = new ReviewConverter(doctorConverter);
            var anamnesisConvertor           = new AnamnesisConvertor();
            var secretaryConverter           = new SecretaryConverter(questionConverter, addressConverter);
            var inventoryManagementConverter = new InventoryManagementConverter(equipmentConverter, roomConverter);
            var orderConverter               = new OrderConverter(medicalConsumableConverter, medicineConverter, equipmentConverter);
            var reportConverter              = new ReportConverter();
            var approvalConverter            = new ApprovalConverter(doctorConverter);
            var propositionConverter         = new PropositionConverter(medicineConverter, approvalConverter, doctorConverter);


            var referralConverter = new ReferralConverter(medicalAppointmentConverter);


            // Repositories
            // Many to Many
            var medicalAppointmentToDoctorRepository = new MedicalAppointmentToDoctorRepository(
                new CSVStream <MedicalAppointmentToDoctor>(
                    MEDICAL_APPOINTMENT_TO_DOCTOR_FILEPATH,
                    new MedicalAppointmentToDoctorCSVConverter(DELIMITER)),
                new LongSequencer()
                );
            var inventoryManagementToEquipmentRepository = new InventoryManagementToEquipmentRepository(
                new CSVStream <InventoryManagementToEquipment>(
                    INVENTORY_EQUIPMENT_FILEPATH,
                    new InventoryManagementToEquipmentCSVConverter(DELIMITER)),
                new LongSequencer()
                );

            var addressRepository = new AddressRepository(new CSVStream <Address>(ADDRESS_FILEPATH, new AddressCSVConverter(DELIMITER)), new LongSequencer());
            var patientRepository = new PatientRepository(
                new CSVStream <Patient>(PATIENT_FILEPATH, new PatientCSVConverter(DELIMITER, DATETIME_FORMAT)),
                new CSVStream <Patient>(PATIENT_FILEPATH, new PatientCSVConverter(DELIMITER, DATETIME_FORMAT)),
                new CSVStream <Doctor>(DOCTOR_FILEPATH, new DoctorCSVConverter(DELIMITER, DATETIME_FORMAT, TIME_FORMAT)),
                new CSVStream <Secretary>(SECRETARY_FILEPATH, new SecretaryCSVConverter(DELIMITER, DATETIME_FORMAT, TIME_FORMAT)),
                addressRepository, new LongSequencer());
            var doctorRepository = new DoctorRepository(
                new CSVStream <Doctor>(DOCTOR_FILEPATH, new DoctorCSVConverter(DELIMITER, DATETIME_FORMAT, TIME_FORMAT)),
                new CSVStream <Patient>(PATIENT_FILEPATH, new PatientCSVConverter(DELIMITER, DATETIME_FORMAT)),
                new CSVStream <Doctor>(DOCTOR_FILEPATH, new DoctorCSVConverter(DELIMITER, DATETIME_FORMAT, TIME_FORMAT)),
                new CSVStream <Secretary>(SECRETARY_FILEPATH, new SecretaryCSVConverter(DELIMITER, DATETIME_FORMAT, TIME_FORMAT)),
                addressRepository,
                new LongSequencer());
            var secretaryRepository = new SecretaryRepository(
                new CSVStream <Secretary>(SECRETARY_FILEPATH, new SecretaryCSVConverter(DELIMITER, DATETIME_FORMAT, TIME_FORMAT)),
                new CSVStream <Patient>(PATIENT_FILEPATH, new PatientCSVConverter(DELIMITER, DATETIME_FORMAT)),
                new CSVStream <Doctor>(DOCTOR_FILEPATH, new DoctorCSVConverter(DELIMITER, DATETIME_FORMAT, TIME_FORMAT)),
                new CSVStream <Secretary>(SECRETARY_FILEPATH, new SecretaryCSVConverter(DELIMITER, DATETIME_FORMAT, TIME_FORMAT)),
                addressRepository,
                new LongSequencer());


            var inventoryManagementRepository = new InventoryManagementRepository(new CSVStream <InventoryManagement>(INVENTORY_FILEPATH, new InventoryManagementCSVConverter(DELIMITER, DATETIME_FORMAT)), inventoryManagementToEquipmentRepository, new LongSequencer());
            var orderDetailsRepository        = new OrderDetailsRepository(new CSVStream <OrderDetails>(ORDER_DETAILS_FILEPATH, new OrderDetailsCSVConverter(DELIMITER)), new LongSequencer());
            var questionRepository            = new QuestionRepository(new CSVStream <Question>(QUESTION_FILEPATH, new QuestionCSVConverter(DELIMITER, DATETIME_FORMAT)), new LongSequencer());


            var medicalConsumableRepository = new MedicalConsumableRepository(
                new CSVStream <MedicalConsumables>(MEDICAL_CONSUMABLE_FILEPATH, new MedicalConsumableCSVConverter(DELIMITER)),
                new CSVStream <Equipment>(EQUIPMENT_FILEPATH, new EquipmentCSVConverter(DELIMITER)),
                new CSVStream <MedicalConsumables>(MEDICAL_CONSUMABLE_FILEPATH, new MedicalConsumableCSVConverter(DELIMITER)),
                new CSVStream <Medicine>(MEDICINE_FILEPATH, new MedicineCSVConverter(DELIMITER)),
                new LongSequencer());

            var equipmentRepository = new EquipmentRepository(
                new CSVStream <Equipment>(EQUIPMENT_FILEPATH, new EquipmentCSVConverter(DELIMITER)),
                new CSVStream <Equipment>(EQUIPMENT_FILEPATH, new EquipmentCSVConverter(DELIMITER)),
                new CSVStream <MedicalConsumables>(MEDICAL_CONSUMABLE_FILEPATH, new MedicalConsumableCSVConverter(DELIMITER)),
                new CSVStream <Medicine>(MEDICINE_FILEPATH, new MedicineCSVConverter(DELIMITER)),
                new LongSequencer());
            var medicineRepository = new MedicineRepository(
                new CSVStream <Medicine>(MEDICINE_FILEPATH, new MedicineCSVConverter(DELIMITER)),
                new CSVStream <Equipment>(EQUIPMENT_FILEPATH, new EquipmentCSVConverter(DELIMITER)),
                new CSVStream <MedicalConsumables>(MEDICAL_CONSUMABLE_FILEPATH, new MedicalConsumableCSVConverter(DELIMITER)),
                new CSVStream <Medicine>(MEDICINE_FILEPATH, new MedicineCSVConverter(DELIMITER)),
                new LongSequencer());

            var prescriptionRepository = new PrescriptionRepository(new CSVStream <Prescription>(PRESCRIPTION_FILEPATH, new PrescriptionCSVConverter(DELIMITER, DATETIME_FORMAT)), medicineRepository, patientRepository, new LongSequencer());


            var medicalAppointmentRepository = new MedicalAppointmentRepository(
                new CSVStream <MedicalAppointment>(MEDICAL_APPOINTMENT_FILEPATH,
                                                   new MedicalAppointmentCSVConverter(DELIMITER, DATETIME_DETAIL_FORMAT)),
                medicalAppointmentToDoctorRepository,
                patientRepository,
                doctorRepository,
                new LongSequencer());
            var roomRepository = new RoomRepository(new CSVStream <Room>(ROOM_FILEPATH, new RoomCSVConverter(DELIMITER)), new LongSequencer(), equipmentRepository);

            var orderRepository = new OrderRepository(new CSVStream <Order>(ORDER_FILEPATH, new OrderCSVConverter(DELIMITER, DATETIME_FORMAT)), medicineRepository, equipmentRepository, medicalConsumableRepository, orderDetailsRepository, new LongSequencer());

            var renovationRepository  = new RenovationRepository(new CSVStream <Renovation>(RENOVATION_FILEPATH, new RenovationCSVConverter(DELIMITER, DATETIME_FORMAT)), new LongSequencer());
            var feedbackRepository    = new FeedbackRepository(new CSVStream <Feedback>(FEEDBACK_FILEPATH, new FeedbackCSVConverter(DELIMITER)), new LongSequencer());
            var reviewRepository      = new ReviewRepository(new CSVStream <Review>(REVIEW_FILEPATH, new ReviewCSVConverter(DELIMITER)), new LongSequencer());
            var anamnesisRepository   = new AnamnesisRepository(new CSVStream <Anamnesis>(ANAMNESIS_FILEPATH, new AnamnesisCSVConverter(DELIMITER)), new LongSequencer());
            var propositionRepository = new PropositionRepository(new CSVStream <Proposition>(PROPOSITION_FILEPATH, new PropositionCSVConverter(DELIMITER, DATETIME_FORMAT)), new LongSequencer(), medicineRepository);

            // Referral
            var admitionReferralRepository = new AdmitionReferralRepository(
                new CSVStream <Referral>(ADMITION_REFERRAL_FILEPATH, new ReferralCSVConventer(DELIMITER, DATETIME_FORMAT)),
                new LongSequencer()
                );
            var operationReferralRepository = new OperationReferralRepository(
                new CSVStream <Referral>(OPERATION_REFERRAL_FILEPATH, new ReferralCSVConventer(DELIMITER, DATETIME_FORMAT)),
                new LongSequencer());

            var examReferralRepository = new ExamReferralRepository(
                new CSVStream <Referral>(EXAM_REFERRAL_FILEPATH, new ReferralCSVConventer(DELIMITER, DATETIME_FORMAT)),
                new LongSequencer());

            var approvalRepository = new ApprovalRepository(new CSVStream <Approval>(APPROVAL_FILEPATH, new ApprovalCSVConverter(DELIMITER)), new LongSequencer());

            // Services

            var patientService            = new PatientService(patientRepository);
            var questionService           = new QuestionService(questionRepository);
            var addressService            = new AddressService(addressRepository);
            var medicineService           = new MedicineService(medicineRepository);
            var medicalConsumableService  = new MedicalConsumableService(medicalConsumableRepository);
            var prescriptionService       = new PrescriptionService(prescriptionRepository, medicineService, patientService);
            var reportService             = new ReportService();
            var guestService              = new GuestService(patientRepository);
            var equipmentService          = new EquipmentService(equipmentRepository);
            var doctorService             = new DoctorService(doctorRepository);
            var medicalAppointmentService = new MedicalAppointmentService(medicalAppointmentRepository, doctorService);
            var roomService                = new RoomService(roomRepository);
            var renovationService          = new RenovationService(renovationRepository, roomRepository);
            var feedbackService            = new FeedbackService(feedbackRepository);
            var reviewService              = new ReviewService(reviewRepository);
            var employeeService            = new EmployeeService(secretaryRepository, doctorRepository);
            var authenticationService      = new AuthenticationService(employeeService, patientService);
            var secretaryService           = new SecretaryService(secretaryRepository);
            var inventoryManagementService = new InventoryManagementService(inventoryManagementRepository);
            var orderService               = new OrderService(orderRepository);
            var anamnesisService           = new AnamnesisService(anamnesisRepository);
            var propositionService         = new PropositionService(propositionRepository);
            var approvalService            = new ApprovalService(approvalRepository);

            // Controllers
            PatientController           = new PatientController(patientService, patientConverter, guestConverter);
            GuestController             = new GuestController(guestService, guestConverter);
            AddressController           = new AddressController(addressService, addressConverter);
            MedicineController          = new MedicineController(medicineService, medicineConverter);
            QuestionController          = new QuestionController(questionService, questionConverter, patientConverter);
            MedicalConsumableController = new MedicalConsumableController(medicalConsumableService, medicalConsumableConverter);
            AuthenticationController    = new AuthenticationController();
            ReportController            = new ReportController(reportConverter);
            PrescriptionController      = new PrescriptionController(prescriptionService, prescriptionConverter);
            EquipmentController         = new EquipmentController(equipmentService, equipmentConverter);

            MedicalAppointmentController = new MedicalAppointmentController(
                medicalAppointmentService,
                medicalAppointmentConverter,
                doctorConverter,
                roomConverter
                );

            RoomController                = new RoomController(roomService, roomConverter);
            RenovationController          = new RenovationController(renovationService, renovationConverter);
            FeedbackController            = new FeedbackController(feedbackService, feedbackConverter);
            ReviewController              = new ReviewController(reviewService, reviewConverter);
            SecretaryController           = new SecretaryController(secretaryService, secretaryConverter);
            InventoryManagementController = new InventoryManagementController(inventoryManagementService, inventoryManagementConverter);
            OrderController               = new OrderController(orderService, orderConverter);
            DoctorController              = new DoctorController(doctorService, doctorConverter);
            AnamnesisController           = new AnamnesisController(anamnesisService, anamnesisConvertor);
            PropositionController         = new PropositionController(propositionService, propositionConverter);

            // Generators
            SecretaryAppointmentReportGenerator = new SecretaryAppointmentReportGenerator(REPORT_APPOINTMENT_FILEPATH);
            PatientAppointmentReportGenerator   = new PatientAppointmentReportGenerator(REPORT_APPOINTMENT_FILEPATH);
            PrescriptionReportGenerator         = new PrescriptionReportGenerator(REPORT_PRESCRIPTION_FILEPATH);
            DoctorsAppointmentReport            = new DirectorReportGenerator(REPORT_DOCTOR_APPOINTMENTS_FILEPATH, doctorRepository, medicalAppointmentRepository);
            MedicineReportGenerator             = new MedicineReportGenerator(REPORT_MEDICINE_FILEPATH, medicineRepository);


            Synchronise(RenovationController);
        }