Ejemplo n.º 1
0
        public void assignTests(DTO.HoSoBenhAnDTO hoso, List <DTO.XetNghiemDTO> danhSachXN, Action <string> completion)
        {
            this.updateHoSo(hoso, rslt =>
            {
                if (rslt.Equals(COM.Constant.RES_SUC))
                {
                    var listKQXN = new List <DTO.KetQuaXetNghiemDTO>();
                    danhSachXN.ForEach(xn =>
                    {
                        listKQXN.Add(new DTO.KetQuaXetNghiemDTO()
                        {
                            MaHoSo      = hoso.MaHoSo,
                            MaXetNghiem = xn.MaXetNghiem,
                            ThanhToan   = false,
                            MaBacSi     = Common.User.SharedInstance.UserId
                        });
                    });


                    var result = this.xetNghiemBus.AssignXetNghiem(listKQXN);
                    completion(result);
                }
                else
                {
                    completion(COM.Constant.RES_FAI);
                }
            });
        }
Ejemplo n.º 2
0
        public void checkInput(DTO.HoSoBenhAnDTO hoso, Action <string, List <string> > completion)
        {
            var listMessageError = new List <string>();
            var result           = this.clientBus.InputCheck(hoso, ref listMessageError);

            completion(result, listMessageError);
        }
Ejemplo n.º 3
0
        private void accessCell(DTO.HoSoBenhAnDTO hoso)
        {
            var ketquaxetnghiem = this.bus.getKetQuaXetNghiem(hoso.MaHoSo);

            if (ketquaxetnghiem == null)
            {
                MessageBox.Show("Không thể lấy kết quả xét nghiệm!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            var formContainer = new Form()
            {
                AutoSize      = true,
                AutoSizeMode  = AutoSizeMode.GrowAndShrink,
                StartPosition = FormStartPosition.CenterParent
            };

            var detailControl = new SubForms.AnalysisDetail(hoso, ketquaxetnghiem)
            {
                Left   = Top = 0,
                Anchor = AnchorStyles.Left | AnchorStyles.Top
            };

            detailControl.WillConfirm += (childForm, ketQuaXetNghiem) =>
            {
                var toDay = DateTime.Now;

                ketQuaXetNghiem.NgayXetNghiem = toDay.ToString("yyyyMMdd");
                this.bus.xetNghiemProcessing(ketQuaXetNghiem, result =>
                {
                    if (result.Equals(COM.Constant.RES_SUC))
                    {
                        MessageBox.Show("Ghi kết quả xét nghiệm thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        //Show final result screen.
                        var finalControl = new SubForms.AnalysisConfirm(hoso, ketQuaXetNghiem.KetQua, false)
                        {
                            Left   = Top = 0,
                            Anchor = AnchorStyles.Left | AnchorStyles.Top
                        };

                        finalControl.WillConfirm += (obj, er) =>
                        {
                            formContainer.Close();
                            this.fetchData(null);
                        };

                        formContainer.Controls.Clear();
                        formContainer.Controls.Add(finalControl);
                    }
                    else
                    {
                        MessageBox.Show("Ghi kết quả xét nghiệm thất bại", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                });
            };

            formContainer.Controls.Add(detailControl);
            formContainer.ShowDialog();
        }
Ejemplo n.º 4
0
 public AnalysisConfirm(DTO.HoSoBenhAnDTO hoso, string ketQuaXetNghiem, bool isConfirm = true)
 {
     InitializeComponent();
     this.hoso            = hoso;
     this.ketQuaXetNghiem = ketQuaXetNghiem;
     this.btnConfirm.Text = isConfirm ? "Xác nhận" : "OK";
     this.btnBack.Visible = isConfirm;
 }
Ejemplo n.º 5
0
        public void getInformationToShowLatestRecord(DTO.HoSoBenhAnDTO hoso, Action <string, string, string, List <Model.ThuocView>, string> completion)
        {
            var ngayTiepNhan = Common.ClinicBus.convertDateToView(hoso.NgayKham);
            var listNhanVien = new List <DTO.NhanVienDTO>();

            this.clientBus.GetListNhanVien(Common.User.SharedInstance.RoomId, out listNhanVien);

            var bacSi = listNhanVien.Find(nv => nv.MaNV.Equals(hoso.MaBacSi));

            if (bacSi == null)
            {
                completion("", "", "", null, COM.Constant.RES_FAI);
                return;
            }

            var chuanDoan = hoso.ChuanDoan;

            var donThuoc        = new DTO.DonThuocDTO();
            var chiTietDonThuoc = new List <DTO.ChiTietDonThuocDTO>();
            var rs = this.clientBus.GetDonThuoc(hoso.MaHoSo, out donThuoc, out chiTietDonThuoc);

            if (rs.Equals(COM.Constant.RES_FAI))
            {
                completion("", "", "", null, COM.Constant.RES_FAI);
                return;
            }

            var listThuoc = new List <Model.ThuocView>();

            chiTietDonThuoc.ForEach(ctThuoc =>
            {
                var thuoc = this.getThuoc(ctThuoc.MaThuoc);

                if (thuoc != null)
                {
                    listThuoc.Add(new Model.ThuocView()
                    {
                        MaThuoc  = ctThuoc.MaThuoc,
                        TenThuoc = thuoc.TenThuoc,
                        GhiChu   = donThuoc.GhiChu,
                        SoLuong  = ctThuoc.SoLuong
                    });
                }
            });

            completion(ngayTiepNhan, bacSi.HoTenNV, chuanDoan, listThuoc, COM.Constant.RES_SUC);
        }
Ejemplo n.º 6
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            var loaiHoSo      = (DTO.LoaiHoSoDTO) this.cbLoaiHoSo.SelectedItem;
            var nguoiTiepNhan = (DTO.NhanVienDTO) this.cbNguoiTiepNhan.SelectedItem;
            var phongKham     = (DTO.PhongKhamDTO) this.cbPhong.SelectedItem;

            if (this.patient == null)
            {
                return;
            }

            var hoso = new DTO.HoSoBenhAnDTO()
            {
                MaBenhNhan   = this.patient.MaBenhNhan,
                MaHoSoTruoc  = this.cbMaHoSoTruoc.Text,
                MaLoaiHoSo   = loaiHoSo != null ? loaiHoSo.MaLoaiHoSo : "",
                MaNguoiTN    = nguoiTiepNhan != null ? nguoiTiepNhan.MaNV : "",
                NgayTiepNhan = DateTime.Now.ToString("yyyyMMdd"),
                YeuCauKham   = this.txtYeuCauKham.getText,
                MaPhongKham  = phongKham != null ? phongKham.MaPhong : ""
            };
            var thanhToan = new DTO.ThanhToanDTO()
            {
                ChiPhiKham = ClinicManagement.Common.SourceLibrary.PhiKhamTiepNhan
            };


            this.bus.TiepNhanInputCheck(hoso, thanhToan, (result, listMessageError) =>
            {
                if (result.Equals(COM.Constant.RES_FAI))
                {
                    var msg = "";
                    listMessageError.ForEach(m => msg += String.Format("{0}\n", m));
                    MessageBox.Show(msg, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                this.btnConfirm.BringToFront();
                this.btnBack.Visible = true;
                this.cbLoaiHoSo.Enabled
                            = this.cbMaHoSoTruoc.Enabled
                            = this.cbNguoiTiepNhan.Enabled
                            = this.cbPhong.Enabled
                            = this.txtYeuCauKham.Enabled
                            = false;
            });
        }
Ejemplo n.º 7
0
        public void TiepNhanInputCheck(DTO.HoSoBenhAnDTO hoso, DTO.ThanhToanDTO thanhToan, Action <string, List <string> > completion)
        {
            var listMessageError = new List <string>();
            var tiepNhanEntity   = new BUS.Inc.TiepNhanInputCheck.TiepNhanEntity()
            {
                MaHoSoTruoc  = hoso.MaHoSoTruoc,
                MaLoaiHoSo   = hoso.MaLoaiHoSo,
                NgayTiepNhan = hoso.NgayTiepNhan,
                MaNguoiTN    = hoso.MaNguoiTN,
                MaPhongKham  = hoso.MaPhongKham,
                ChiPhiKham   = thanhToan.ChiPhiKham,
                YeuCauKham   = hoso.YeuCauKham
            };
            var result = this.clientBus.TiepNhanInputCheck(tiepNhanEntity, ref listMessageError);

            completion(result, listMessageError);
        }
Ejemplo n.º 8
0
        private void accessCell(DTO.HoSoBenhAnDTO hoso)
        {
            var formContainer = new Form()
            {
                AutoSize      = true,
                AutoSizeMode  = AutoSizeMode.GrowAndShrink,
                StartPosition = FormStartPosition.CenterParent
            };

            var detailControl = new Subforms.PaymentDetail(hoso)
            {
                Left   = Top = 0,
                Anchor = AnchorStyles.Left | AnchorStyles.Top
            };

            formContainer.Controls.Add(detailControl);
            formContainer.ShowDialog();
        }
Ejemplo n.º 9
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);
        }
Ejemplo n.º 10
0
        public void keDonThuoc(DTO.HoSoBenhAnDTO hoso, List <DTO.ChiTietDonThuocDTO> danhSachThuoc, Action <string> completion)
        {
            var donThuoc = new DTO.DonThuocDTO()
            {
                MaHoSo  = hoso.MaHoSo,
                NgayLap = DateTime.Now.ToString("yyyyMMdd")
            };

            this.saveDonThuoc(donThuoc, danhSachThuoc, result =>
            {
                if (result.Equals(COM.Constant.RES_SUC))
                {
                    hoso.CoKeDon = true;
                    this.finishKham(hoso, (isFinish) =>
                    {
                        completion(isFinish);
                    });
                }
                else
                {
                    completion(COM.Constant.RES_FAI);
                }
            });
        }
Ejemplo n.º 11
0
 public PaymentConfirm(DTO.HoSoBenhAnDTO hoso, List <DTO.KetQuaXetNghiemDTO> danhSachCanThanhToan)
 {
     InitializeComponent();
     this.hoso = hoso;
     this.danhSachCanThanhToan = danhSachCanThanhToan;
 }
 public MedicalExaminationAfterTests(DTO.HoSoBenhAnDTO hoso)
 {
     InitializeComponent();
     this.hoSoBenhAn = hoso;
 }
Ejemplo n.º 13
0
 public AnalysisDetail(DTO.HoSoBenhAnDTO hoso, DTO.KetQuaXetNghiemDTO ketQuaXetNghiem)
 {
     InitializeComponent();
     this.hoso            = hoso;
     this.ketQuaXetNghiem = ketQuaXetNghiem;
 }
Ejemplo n.º 14
0
        public void finishKham(DTO.HoSoBenhAnDTO hoso, Action <string> completion)
        {
            var processingResult = this.clientBus.KhamProcessing(hoso);

            completion(processingResult);
        }
Ejemplo n.º 15
0
        public void updateHoSo(DTO.HoSoBenhAnDTO hoso, Action <string> completion)
        {
            var result = this.clientBus.UpdateHoSo(hoso);

            completion(result);
        }
Ejemplo n.º 16
0
        public void confirmReception(DTO.HoSoBenhAnDTO hoso, DTO.ThanhToanDTO thanhToan, Action <int, string> completion)
        {
            var result = this.clientBus.SaveHoSo(hoso, thanhToan);

            completion(hoso.SoThuTu, result);
        }
Ejemplo n.º 17
0
        public void confirmExaminationWithoutAssignTests(DTO.HoSoBenhAnDTO hoso, List <DTO.ChiTietDonThuocDTO> danhSachThuoc, Action <string> completion)
        {
            var result = COM.Constant.RES_SUC;

            completion(result);
        }
Ejemplo n.º 18
0
 public LatestPrescription(DTO.HoSoBenhAnDTO hoso)
 {
     InitializeComponent();
     this.hoso = hoso;
 }
Ejemplo n.º 19
0
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            var loaiHoSo      = (DTO.LoaiHoSoDTO) this.cbLoaiHoSo.SelectedItem;
            var nguoiTiepNhan = (DTO.NhanVienDTO) this.cbNguoiTiepNhan.SelectedItem;
            var phongKham     = (DTO.PhongKhamDTO) this.cbPhong.SelectedItem;

            if (this.patient == null)
            {
                return;
            }

            var hoso = new DTO.HoSoBenhAnDTO()
            {
                MaBenhNhan   = this.patient.MaBenhNhan,
                MaHoSoTruoc  = this.cbMaHoSoTruoc.Text,
                MaLoaiHoSo   = loaiHoSo != null ? loaiHoSo.MaLoaiHoSo : "",
                MaNguoiTN    = nguoiTiepNhan != null ? nguoiTiepNhan.MaNV : "",
                NgayTiepNhan = DateTime.Now.ToString("yyyyMMdd"),
                YeuCauKham   = this.txtYeuCauKham.Text,
                MaPhongKham  = phongKham != null ? phongKham.MaPhong : ""
            };
            var thanhToan = new DTO.ThanhToanDTO()
            {
                ChiPhiKham = ClinicManagement.Common.SourceLibrary.PhiKhamTiepNhan
            };

            this.bus.confirmReception(hoso, thanhToan, (stt, result) =>
            {
                if (result.Equals(COM.Constant.RES_SUC))
                {
                    DevExpress.Utils.WaitDialogForm f = new DevExpress.Utils.WaitDialogForm();
                    f.Show();

                    Report.FormSoThuTu soThuTuForm = new Report.FormSoThuTu()
                    {
                        AutoSize      = true,
                        StartPosition = FormStartPosition.CenterParent,
                        DataReport    = new Report.DataReportSoThuTu()
                        {
                            MaHoSo      = hoso.MaHoSo,
                            TenBenhNhan = patient.HoTen,
                            DiaChi      = patient.DiaChi,
                            NgayKham    = DateTime.Now.ToString("dd/MM/yyyy"),
                            SoThuTu     = hoso.SoThuTu.ToString(),
                            TenPhong    = phongKham?.TenPhong
                        }
                    };

                    soThuTuForm.FormClosed += (obj, er) =>
                    {
                        this.refreshEvent?.Invoke(this, null);
                        if (this.Parent is Form)
                        {
                            var formParent = (Form)this.Parent;
                            formParent.Close();
                        }
                    };


                    f.Close();
                    soThuTuForm.ShowDialog();
                }
            });
        }
Ejemplo n.º 20
0
 public MedicalExamination(DTO.HoSoBenhAnDTO hoso)
 {
     InitializeComponent();
     this.hoSoBenhAn = hoso;
     this.setupView();
 }
Ejemplo n.º 21
0
 public DTO.HoSoBenhAnDTO getHoSoKham(string MaHS)
 {
     DTO.HoSoBenhAnDTO hoso = null;
     this.clientBus.GetInformationHoSo(MaHS, out hoso);
     return(hoso);
 }