Example #1
0
 public ReceptionControl(DTO.BenhNhanDTO patient)
 {
     InitializeComponent();
     this.setupView();
     this.patient = patient;
     this.setupData(patient);
 }
        //MARK: Load data
        private void fetchData()
        {
            Application.AddMessageFilter(this);

            this.benhNhan = this.bus.getBenhNhan(this.hoSoBenhAn.MaBenhNhan);
            this.patientMainInformation.binding(benhNhan);
            this.txtYeuCauKham.Text = this.hoSoBenhAn.YeuCauKham;
            var phong = this.bus.getPhong(Common.User.SharedInstance.RoomId);

            this.txtPhong.Text = phong != null ? phong.TenPhong : "";

            this.txtChuanDoanBenh.Text = this.hoSoBenhAn.ChuanDoan;
            this.txtTrieuChung.Text    = this.hoSoBenhAn.TrieuChung;

            this.bus.getListNhanVien((listNhanVien, result) =>
            {
                if (result.Equals(COM.Constant.RES_SUC))
                {
                    listNhanVien.ForEach(nv =>
                    {
                        cbBacSi.Items.Add(nv);
                    });
                    this.cbBacSi.SelectedIndex = listNhanVien.FindIndex(nv => nv.MaNV.Equals(Common.User.SharedInstance.UserId));
                }
            });

            this.bus.getListKetQuaXetNghiem(this.hoSoBenhAn.MaHoSo, (listKQXNView, result) =>
            {
                if (result.Equals(COM.Constant.RES_SUC))
                {
                    this.grdKetQuaXetNghiem.DataSource = Common.ClinicBus.ConvertToDatatable(listKQXNView);
                }
            });
            this.panelResult.Height = 0;
        }
Example #3
0
 private void PatientTableWithSearch_SearchCompleted(object sender, DTO.BenhNhanDTO e)
 {
     DevExpress.Utils.WaitDialogForm f = new DevExpress.Utils.WaitDialogForm();
     this.timer1.Tick += new EventHandler((s, er) =>
     {
         var interval = (DateTime.Now - this.time).TotalSeconds;
         if (!f.IsDisposed && interval > 5)
         {
             this.timer1.Stop();
             f.Close();
             MessageBox.Show("Không thể load dữ liệu", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     });
     this.timer1.Interval = 1000;
     this.time            = DateTime.Now;
     this.timer1.Start();
     this.searchBenhNhan(e, (listPatients, result) =>
     {
         f.Close();
         this.timer1.Stop();
         if (result.Equals(COM.Constant.RES_SUC))
         {
             this.table.fetchData(listPatients);
         }
         else
         {
             MessageBox.Show("Không tìm thấy kết quả phù hợp!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
     });
 }
Example #4
0
        public void searchBenhNhan(DTO.BenhNhanDTO benhNhanEntity, Action <List <DTO.BenhNhanDTO>, string> completion)
        {
            var listResult = new List <DTO.BenhNhanDTO>();
            var result     = this.clientBus.SearchBenhNhan(benhNhanEntity, out listResult, 0);

            completion(listResult, result);
        }
Example #5
0
        public void BenhNhanInputCheck(DTO.BenhNhanDTO benhNhan, Action <string, List <string> > completion)
        {
            var listMessageError = new List <string>();
            var result           = this.clientBus.BenhNhanInputCheck(benhNhan, ref listMessageError);

            completion(result, listMessageError);
        }
Example #6
0
        public DTO.BenhNhanDTO getData()
        {
            DateTime birthDay;

            try
            {
                var dateListString = this.cbBirthDay.DateTimePicker.Text.Split('/');
                int day            = int.Parse(dateListString.First());
                int month          = int.Parse(dateListString[1]);
                int year           = int.Parse(dateListString.Last());
                birthDay = new DateTime(year, month, day);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return(new DTO.BenhNhanDTO());
            }

            var patient = new DTO.BenhNhanDTO()
            {
                HoTen       = this.txtName.Text,
                GioiTinh    = this.cbSex.ComboBox.Text.Equals("Nam") ? true : false,
                NgaySinh    = this.cbBirthDay.DateTimePicker.Text,
                SoDienThoai = this.txtPhoneNumber.Text,
                GhiChu      = this.txtNote.Text,
                DiaChi      = this.txtAddress.Text,
                CMND        = this.txtCMND.Text
            };

            return(patient);
        }
Example #7
0
        private void setupView()
        {
            Application.AddMessageFilter(this);

            this.txtChiPhi.Text = totalCharge.ToString();
            this.benhNhan       = this.bus.getBenhNhan(this.hoSoBenhAn.MaBenhNhan);
            this.patientMainInformation.binding(benhNhan);
            this.txtYeuCauKham.Text = this.hoSoBenhAn.YeuCauKham;
            var phong = this.bus.getPhong(Common.User.SharedInstance.RoomId);

            this.txtPhong.Text = phong != null ? phong.TenPhong : "";
            this.bus.getListNhanVien((listNhanVien, result) =>
            {
                if (result.Equals(COM.Constant.RES_SUC))
                {
                    listNhanVien.ForEach(nv =>
                    {
                        cbBacSi.Items.Add(nv);
                    });
                    this.cbBacSi.SelectedIndex = listNhanVien.FindIndex(nv => nv.MaNV.Equals(Common.User.SharedInstance.UserId));
                }
            });

            this.panelResult.Height = 0;
        }
Example #8
0
        public void searchBenhNhan(DTO.BenhNhanDTO benhNhanEntity, Action <List <DTO.BenhNhanDTO>, string> completion)
        {
            var listResult = new List <DTO.BenhNhanDTO>();
            var bus        = new BUS.Mdl.TiepNhanModule();
            var result     = bus.SearchBenhNhan(benhNhanEntity, out listResult, 0);

            completion(listResult, result);
        }
Example #9
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            var entity = new DTO.BenhNhanDTO {
                MaBenhNhan = this.txtMaBenhNhan.Text,
                HoTen      = this.txtHoTen.Text,
                CMND       = this.txtCMND.Text
            };

            this.SearchCompleted?.Invoke(this, entity);
        }
Example #10
0
 public void fillData(DTO.BenhNhanDTO patient)
 {
     this.name.Text         = patient.HoTen;
     this.birthDay.DateTime = DateTime.ParseExact(patient.NgaySinh, "yyyyMMdd", CultureInfo.InvariantCulture);
     this.phoneNumber.Text  = patient.SoDienThoai;
     this.identify.Text     = patient.CMND;
     this.gender.Text       = patient.GioiTinh == true ? "Nam" : "Nữ";
     this.address.Text      = patient.DiaChi;
     this.note.Text         = patient.GhiChu;
     this.maBenhNhan        = patient.MaBenhNhan;
 }
Example #11
0
        private void DetailControl_CreateClick(object sender, DTO.BenhNhanDTO patient)
        {
            var formContainer    = (sender as UserControl).Parent;
            var receptionControl = new SubForms.ReceptionControl(patient);

            receptionControl.Left   = receptionControl.Top = 0;
            receptionControl.Anchor = AnchorStyles.Left | AnchorStyles.Top;

            formContainer.Controls.Add(receptionControl);
            receptionControl.BringToFront();
        }
Example #12
0
 public BenhNhanView(DTO.BenhNhanDTO entity)
 {
     this.MaBenhNhan  = entity.MaBenhNhan;
     this.HoTen       = entity.HoTen;
     this.CMND        = entity.CMND;
     this.NgaySinh    = convertDate(entity.NgaySinh);
     this.GioiTinh    = entity.GioiTinh ? "Nam" : "Nữ";
     this.SoDienThoai = entity.SoDienThoai;
     this.DiaChi      = entity.DiaChi;
     this.GhiChu      = entity.GhiChu;
 }
Example #13
0
 private void AddPatientControl1_CreateCompleted(object sender, DTO.BenhNhanDTO e)
 {
     this.bus.insertBenhNhan(e, result =>
     {
         if (result.Equals(COM.Constant.RES_SUC))
         {
             MessageBox.Show("Thêm thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.addPatientControl1.refreshControl();
         }
     });
 }
Example #14
0
        public void saveBenhNhan(DTO.BenhNhanDTO patient, Action <string, List <string> > completion)
        {
            var listMessageError = new List <string>();
            var checkInputResult = this.clientBus.BenhNhanInputCheck(patient, ref listMessageError);

            if (checkInputResult.Equals(COM.Constant.RES_SUC))
            {
                completion(this.clientBus.UpdateBenhNhan(patient), null);
            }

            completion(checkInputResult, listMessageError);
        }
        private void fillCoreInformation(DTO.BenhNhanDTO patient)
        {
            this.txtMaBenhNhan.Text = patient.MaBenhNhan;
            this.txtCMND.Text       = patient.CMND;
            var date = patient.NgaySinh;

            this.txtNgaySinh.Text    = ClinicManagement.Common.ClinicBus.convertDateToView(date);
            this.txtGioiTinh.Text    = patient.GioiTinh ? "Nam" : "Nữ";
            this.txtHoTen.Text       = patient.HoTen;
            this.txtSoDienThoai.Text = patient.SoDienThoai;
            this.txtDiaChi.Text      = patient.DiaChi;
            this.txtGhiChu.Text      = patient.GhiChu.Split('\n').First();
        }
Example #16
0
 private void AddPatientControl_CreateCompleted(object sender, DTO.BenhNhanDTO e)
 {
     this.bus.insertBenhNhan(e, result =>
     {
         if (result.Equals(COM.Constant.RES_SUC))
         {
             MessageBox.Show("Thêm thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             var parentForm = (Form)((Control)sender).Parent;
             parentForm.Close();
             this.fetchData((msg, rslt) => { });
         }
     });
 }
Example #17
0
        public DTO.BenhNhanDTO getBenhNhan(string MaBenhNhan)
        {
            var patient = new DTO.BenhNhanDTO();
            var result  = this.clientBus.GetInformationBenhNhan(MaBenhNhan, out patient);

            if (result.Equals(COM.Constant.RES_SUC))
            {
                return(patient);
            }
            else
            {
                return(null);
            }
        }
Example #18
0
        public DTO.BenhNhanDTO getData()
        {
            var      patient  = new DTO.BenhNhanDTO();
            DateTime birthDay = this.birthDay.DateTime;

            patient.HoTen       = this.name.Text;
            patient.GioiTinh    = this.gender.Text.Equals("Nam") ? true : false;
            patient.MaBenhNhan  = this.maBenhNhan;
            patient.NgaySinh    = birthDay.ToString("yyyyMMdd");
            patient.SoDienThoai = this.phoneNumber.Text;
            patient.GhiChu      = this.note.Text;
            patient.DiaChi      = this.address.Text;
            patient.CMND        = this.identify.Text;
            return(patient);
        }
Example #19
0
        public void fillData(DTO.BenhNhanDTO patient)
        {
            this.txtName.Text = patient.HoTen;
            int year  = int.Parse(patient.NgaySinh.Substring(0, 4));
            int month = int.Parse(patient.NgaySinh.Substring(4, 2));
            int day   = int.Parse(patient.NgaySinh.Substring(6, 2));

            this.txtBirthDay.Text    = string.Format("{0}/{1}/{2}", day, month, year);
            this.txtPhoneNumber.Text = patient.SoDienThoai;
            this.txtCMND.Text        = patient.CMND;
            this.txtGender.Text      = patient.GioiTinh == true ? "Nam" : "Nữ";
            this.txtAddress.Text     = patient.DiaChi;
            this.txtNote.Text        = patient.GhiChu;
            this.idNumber            = patient.MaBenhNhan;
        }
Example #20
0
        private void FilterControl_SearchCompleted(object sender, DTO.BenhNhanDTO e)
        {
            var filterControl = (ClinicManagement.Common.ClinicComponents.FilterUserControl)sender;
            var formContainer = (Form)(filterControl.Parent);

            this.bus.searchBenhNhan(e, (listResult, result) =>
            {
                if (result.Equals(COM.Constant.RES_SUC))
                {
                    this.tableDataView1.fetchData(listResult);
                    formContainer.Close();
                }
                else
                {
                    MessageBox.Show("Không tìm thấy kết quả phù hợp", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            });
        }
Example #21
0
        public void searchHoSo(DTO.BenhNhanDTO patient, Action <List <Model.HoSoBenhAnView>, string> completion)
        {
            var listResult = new List <Model.HoSoBenhAnView>();
            var MaBenhNhan = patient.MaBenhNhan;
            var HoTen      = patient.HoTen;
            var CMND       = patient.CMND;

            this.getListHoSo((listHoSo, result) =>
            {
                listHoSo.ForEach(hoso =>
                {
                    if (hoso.MaBenhNhan.Contains(MaBenhNhan) && hoso.HoTen.Contains(HoTen) && hoso.CMND.Contains(CMND))
                    {
                        listResult.Add(hoso);
                    }
                });

                completion(listHoSo, result);
            });
        }
Example #22
0
        private void setupView()
        {
            var enterEvent = new KeyEventHandler((sender, e) =>
            {
                if (e.KeyCode != Keys.Enter)
                {
                    return;
                }
                var entity = new DTO.BenhNhanDTO()
                {
                    MaBenhNhan = this.txtMaBenh.Text,
                    HoTen      = this.txtHoTen.Text,
                    CMND       = this.txtCMND.Text
                };
                this.SearchCompleted?.Invoke(this, entity);
            });

            this.txtMaBenh.TextBox.KeyDown += enterEvent;
            this.txtHoTen.TextBox.KeyDown  += enterEvent;
            this.txtCMND.TextBox.KeyDown   += enterEvent;
        }
Example #23
0
        public DTO.BenhNhanDTO getData()
        {
            var list  = this.txtBirthDay.Text.Split('/');
            var year  = int.Parse(list.Last());
            var month = int.Parse(list[1]);
            var day   = int.Parse(list.First());

            var patient = new DTO.BenhNhanDTO()
            {
                HoTen       = this.txtName.Text,
                GioiTinh    = this.txtGender.Text.Equals("Nam") ? true : false,
                MaBenhNhan  = this.idNumber,
                NgaySinh    = string.Format("{0}{1}{2}", year, month >= 10 ? month.ToString(): "0" + month, day >= 10 ? day.ToString() : "0" + day),
                SoDienThoai = this.txtPhoneNumber.Text,
                GhiChu      = this.txtNote.Text,
                DiaChi      = this.txtAddress.Text,
                CMND        = this.txtCMND.Text
            };

            return(patient);
        }
Example #24
0
        public ExaminationConfirm(DTO.HoSoBenhAnDTO hoso, string tenPhong, DTO.BenhNhanDTO benhNhan, string chiphi = null, List <DTO.ChiTietDonThuocDTO> danhSachThuoc = null, List <DTO.XetNghiemDTO> danhSachXetNghiem = null, bool isConfirm = true)
        {
            InitializeComponent();
            this.hoso              = hoso;
            this.tenPhong          = tenPhong;
            this.benhNhan          = benhNhan;
            this.danhSachThuoc     = danhSachThuoc;
            this.danhSachXetNghiem = danhSachXetNghiem;
            this.btnXacNhan.Text   = isConfirm ? "Xác nhận" : "OK";
            this.btnBack.Visible   = isConfirm;
            if (chiphi != null)
            {
                this.txtChiPhi.Text = chiphi;
            }
            else
            {
                this.txtChiPhi.Visible = false;
            }

            this.ControlRemoved += ControlRemovedEvent;
            Application.AddMessageFilter(this);
        }
 public void binding(DTO.BenhNhanDTO patient)
 {
     this.patient = patient;
     this.fillCoreInformation(patient);
 }
Example #26
0
 public void fillData(DTO.BenhNhanDTO patient)
 {
     this.patientInformation.fillData(patient);
 }
Example #27
0
 public PatientDetail(DTO.BenhNhanDTO patient)
 {
     InitializeComponent();
     this.patientInformation.BringToFront();
     this.fillData(patient);
 }
Example #28
0
 private void tableDataView1_DoubleClick(object sender, DTO.BenhNhanDTO e)
 {
     btnDetail_Click(null, null);
 }
 public PatientMainInformation(DTO.BenhNhanDTO patient)
 {
     InitializeComponent();
     this.patient = patient;
     this.fillCoreInformation(patient);
 }
Example #30
0
 private void Table_DoubleClick(object sender, DTO.BenhNhanDTO e)
 {
     this.DoubleClick?.Invoke(this, e);
 }