Esempio n. 1
0
        private void PatientDetails_Load(object sender, System.EventArgs e)
        {
            Patient p = PatientController.getByUsername(this.username);

            if (p.Id == -1)
            {
                MessageBox.Show("Patient not found!");
                this.Hide();
                new FormManager().Show();
            }

            nameTextBox.Text      = p.Name;
            surnameTextBox.Text   = p.Surname;
            bloodTypeTextBox.Text = p.BloodType;
            List <Prescription> prList = PrescriptionController.getPatientPrescription(p.Id);

            prescriptionListView.Clear();

            prescriptionListView.Columns.Add("Prescription List", 100);
            prescriptionListView.Columns.Add("Medic Name", 150);
            prescriptionListView.Columns.Add("Medic Specialisation", 150);

            prescriptionListView.BeginUpdate();

            foreach (Prescription pr in prList)
            {
                ListViewItem lvi = new ListViewItem();
                lvi.SubItems.Add(pr.MedicName);
                lvi.SubItems.Add(pr.MedicSpecialisation);
                lvi.SubItems.Add(pr.PrescriptionText);
                prescriptionListView.Items.Add(lvi);
            }

            prescriptionListView.EndUpdate();
        }
Esempio n. 2
0
        private void btnCopy_Click(object sender, EventArgs e)
        {
            if (dgvPresc.CurrentCell == null)
            {
                return;
            }
            if (dgvPresc.Rows.Count == 0)
            {
                return;
            }
            if (MessageBox.Show("确定要复制当前指定的处方吗?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }

            int presmasterId = Convert.ToInt32(dgvPresc[PresID.Name, dgvPresc.CurrentCell.RowIndex].Value);
            PrescriptionController presController = new PrescriptionController( );

            try
            {
                presController.CopyPrescription(presmasterId);
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 3
0
 private void generatePrescriptionDocButton_Click(object sender, EventArgs e)
 {
     if (PrescriptionController.savePrescription(prescriptionTextBox.Text, this.medicId, this.patientId))
     {
         DocumentGenerator.generatePrescription(this.currentUser, this.selectedPatient, prescriptionTextBox.Text);
         MessageBox.Show("Document generated.");
         this.Hide();
         new PatientForm(this.username).Show();
     }
     else
     {
         MessageBox.Show("Error");
     }
 }
        private void btnPrescriptions_Click(object sender, EventArgs e)
        {
            prescriptionController = new PrescriptionController();
            string identityNo = txtIdentity.Text;

            if (identityNo.Length == 11)
            {
                dgvPrescriptionList.DataSource = prescriptionController.BeforePrescription(identityNo);
            }
            else
            {
                MessageBox.Show("Doğru bir TC No girdiğinizden emin olunuz.");
                identityNo = string.Empty;
            }
        }
        /// <summary>
        /// 初始化数据
        /// </summary>
        public void Initailze()
        {
            ControllerInitalizeEndArgs e = new ControllerInitalizeEndArgs( );

            //加载数据
            LoadBaseData( );
            //加载收费员发票
            LoadInvoiceInfo( );

            prescController = new PrescriptionController( );

            if (ControllerInitalizeEnd != null)
            {
                ControllerInitalizeEnd(this, e);
            }
        }
        private void btnPrescriptionList_Click(object sender, EventArgs e)
        {
            lbPrescriptionList.Items.Clear();
            PrescriptionController       prescriptionController = new PrescriptionController();
            List <Entities.Prescription> prescriptions          = prescriptionController.GetAll();

            int.TryParse(txtPrescriptionNo.Text, out int prescriptionNo);
            foreach (Entities.Prescription item in prescriptions)
            {
                if (item.PrescriptionId == prescriptionNo)
                {
                    lbPrescriptionList.Items.Add(item.Description);
                    return;
                }
            }
            MessageBox.Show("Böyle bir reçete bulunmamaktadır.");
        }
Esempio n. 7
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string description = txtPrescription.Text;

            if (description.Length > 0)
            {
                prescriptionController = new PrescriptionController();
                Entities.Prescription prescription = new Entities.Prescription();
                prescription.Description   = txtPrescription.Text;
                prescription.ExaminationId = Examination.examinationID;
                prescriptionController.Add(prescription);
                int prescriptionNo = prescription.PrescriptionId;

                MessageBox.Show("Reçete Numarası: " + prescriptionNo);
                Hide();
            }
            else
            {
                MessageBox.Show("Lütfen reçete bilgilerini doldurunuz.");
            }
        }
Esempio n. 8
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);
        }