Example #1
0
        public ActionResult LockExamInfo(KcbLuotkham objPatientExam)
        {
            try
            {
                using (var scope = new TransactionScope())
                {
                    using (var sh = new SharedDbConnectionScope())
                    {
                        new Update(KcbLuotkham.Schema)
                        .Set(KcbLuotkham.Columns.Locked).EqualTo(objPatientExam.Locked)
                        .Set(KcbLuotkham.Columns.NguoiKetthuc).EqualTo(objPatientExam.NguoiKetthuc)
                        .Set(KcbLuotkham.Columns.NgayKetthuc).EqualTo(objPatientExam.NgayKetthuc)
                        .Where(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(objPatientExam.MaLuotkham)
                        .And(KcbLuotkham.Columns.IdBenhnhan).IsEqualTo(objPatientExam.IdBenhnhan).Execute();
                    }

                    scope.Complete();
                    return(ActionResult.Success);
                }
            }
            catch (Exception exception)
            {
                log.Error("Loi trong qua trinh chuyen vien khoi noi tru {0}", exception);
                return(ActionResult.Error);
            }
        }
Example #2
0
 void LayLichsuTamung()
 {
     try
     {
         objLuotkham = Utility.getKcbLuotkhamFromGrid(grdList);
         m_dtTamung  = new KCB_THAMKHAM().NoitruTimkiemlichsuNoptientamung(Utility.sDbnull(grdList.GetValue(KcbLuotkham.Columns.MaLuotkham)),
                                                                           Utility.Int32Dbnull(grdList.GetValue(KcbLuotkham.Columns.IdBenhnhan)),
                                                                           0,
                                                                           -1, (byte)1
                                                                           );
         Utility.SetDataSourceForDataGridEx_Basic(grdTamung, m_dtTamung, false, true, "1=1", NoitruTamung.Columns.NgayTamung + " desc");
         grdTamung.MoveFirst();
         if (grdTamung.GetDataRows().Length <= 0)
         {
             objTamung        = null;
             dtpNgaythu.Value = globalVariables.SysDate;
             txtSotien.Text   = "0";
             txtLydo.SetCode("-1");
             txtNguoithu.SetId(globalVariables.gv_intIDNhanvien);
         }
     }
     catch (Exception ex)
     {
     }
     finally
     {
         setTongtienStatus();
         ShowLSuTamung();
     }
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="objPatientExam"></param>
        /// <param name="Khoanoitru_tonghop">true= Khoa nội trú tự chốt dữ liệu;fasle= Khoa tổng hợp chốt dữ liệu</param>
        /// <returns></returns>
        public static ActionResult TongHopChiPhi(KcbLuotkham objPatientExam,short idKhoanoitru, bool Khoanoitru_tonghop)
        {
            try
            {

                using (var scope = new TransactionScope())
                {
                    using (var sh = new SharedDbConnectionScope())
                    {
                        new Update(KcbLuotkham.Schema)
                        .Set(KcbLuotkham.Columns.TrangthaiNoitru).EqualTo(Utility.Int32Dbnull(objPatientExam.TrangthaiNoitru))
                        .Set(KcbLuotkham.Columns.TthaiThopNoitru).EqualTo(Utility.Int32Dbnull(objPatientExam.TthaiThopNoitru))
                        .Set(KcbLuotkham.Columns.NguoiSua).EqualTo(globalVariables.UserName)
                        .Set(KcbLuotkham.Columns.NgaySua).EqualTo(DateTime.Now)
                        .Where(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(objPatientExam.MaLuotkham)
                        .And(KcbLuotkham.Columns.IdBenhnhan)
                        .IsEqualTo(Utility.Int32Dbnull(objPatientExam.IdBenhnhan))
                        .Execute();
                        SPs.NoitruChotdulieuravien(objPatientExam.MaLuotkham, objPatientExam.IdBenhnhan, idKhoanoitru, Utility.Bool2byte(Khoanoitru_tonghop), (byte)(Utility.Byte2Bool(KcbLuotkham.Columns.TthaiThopNoitru) ? 1 : 0)).Execute();
                    }
                    scope.Complete();
                    return ActionResult.Success;
                }
            }
            catch (Exception ex)
            {
                return ActionResult.Error;
            }
        }
 public static bool NoptienTamung(NoitruTamung objTamung)
 {
     try
     {
         using (var scope = new TransactionScope())
         {
             using (var sh = new SharedDbConnectionScope())
             {
                 objTamung.Save();
                 KcbLuotkham objKcbLuotkham = Utility.getKcbLuotkham(objTamung.IdBenhnhan, objTamung.MaLuotkham);
                 if (objKcbLuotkham != null)
                 {
                     objKcbLuotkham.IsNew = false;
                     objKcbLuotkham.MarkOld();
                     if (Utility.ByteDbnull(objKcbLuotkham.TrangthaiNoitru, 0) == 1)
                     {
                         objKcbLuotkham.TrangthaiNoitru = 2;
                         objKcbLuotkham.Save();
                     }
                 }
             }
             scope.Complete();
         }
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Example #5
0
 /// <summary>
 /// hàm thực hiện việc lấy thôn gtin của dữ liệu
 /// </summary>
 private void getData()
 {
     objLuotkham = new Select().From(KcbLuotkham.Schema)
                   .Where(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(objLuotkham.MaLuotkham)
                   .And(KcbLuotkham.Columns.IdBenhnhan).IsEqualTo(objLuotkham.IdBenhnhan).ExecuteSingle <KcbLuotkham>();
     if (objLuotkham != null)
     {
         txtKhoanoitru.SetId(objLuotkham.IdKhoanoitru);
         if (!string.IsNullOrEmpty(objLuotkham.NgayNhapvien.ToString()))
         {
             dtNgayNhapVien.Value = Convert.ToDateTime(objLuotkham.NgayNhapvien);
         }
         else
         {
             dtNgayNhapVien.Value = globalVariables.SysDate;
         }
         txtGhiChu.Text = Utility.sDbnull(objLuotkham.MotaNhapvien);
         //txtSoBenhAn.Text = objLuotkham.SoBenhAn;
         txtSoBenhAn.Text = string.IsNullOrEmpty(Utility.sDbnull(objLuotkham.SoBenhAn, ""))
            ? THU_VIEN_CHUNG.LaySoBenhAn()
            : Utility.sDbnull(objLuotkham.SoBenhAn, "");
     }
     else
     {
         Utility.SetMsg(lblMsg, "Chưa chọn bệnh nhân để nhập viện", true);
     }
 }
        /// <summary>
        /// hàm thực hiện việc tính phần trăm của bảo hiểm y tế của thuốc
        /// </summary>
        /// <param name="objPatientExam"></param>
        public static void TinhPtramBHYTForThuoc(KcbLuotkham objPatientExam)
        {
            SqlQuery sqlQuery = new Select().From(KcbDonthuocChitiet.Schema)
                                .Where(KcbDonthuocChitiet.Columns.IdDonthuoc).In(
                new Select(KcbDonthuoc.Columns.IdDonthuoc).From(KcbDonthuoc.Schema).Where(
                    KcbDonthuoc.Columns.MaLuotkham).IsEqualTo(
                    objPatientExam.MaLuotkham).And(KcbDonthuoc.Columns.IdBenhnhan).IsEqualTo(
                    objPatientExam.IdBenhnhan).And(KcbDonthuoc.Columns.Noitru).IsEqualTo(1));
            KcbDonthuocChitietCollection objPresDetailCollection = sqlQuery.ExecuteAsCollection <KcbDonthuocChitietCollection>();

            foreach (KcbDonthuocChitiet objPresDetail in objPresDetailCollection)
            {
                decimal PtramBHYT = Utility.DecimaltoDbnull(objPatientExam.PtramBhyt, 0);
                TinhGiaThuoc.GB_TinhPhtramBHYT(objPresDetail, PtramBHYT);
                //if (objPatientExam.MaDoiTuong == "BHYT")
                //{
                //    objPresDetail.PhuThu = 0;
                //}
                new Update(KcbDonthuocChitiet.Schema)

                .Set(KcbDonthuocChitiet.Columns.DonGia).EqualTo(objPresDetail.DonGia)
                .Set(KcbDonthuocChitiet.Columns.BnhanChitra).EqualTo(objPresDetail.BnhanChitra)
                .Set(KcbDonthuocChitiet.Columns.BhytChitra).EqualTo(objPresDetail.BhytChitra)
                .Set(KcbDonthuocChitiet.Columns.PhuThu).EqualTo(objPresDetail.PhuThu)
                .Where(KcbDonthuocChitiet.Columns.IdChitietdonthuoc).IsEqualTo(objPresDetail.IdChitietdonthuoc).Execute();
            }
        }
 private void FrmThongTinDonThuoc_Load(object sender, EventArgs e)
 {
     //
     objDKho =
         new Select().From(TDmucKho.Schema)
         .Where(TDmucKho.Columns.IdKho)
         .IsEqualTo(idkhosaochep)
         .ExecuteSingle <TDmucKho>();
     objLuotkham =
         new Select().From(KcbLuotkham.Schema)
         .Where(KcbLuotkham.Columns.MaLuotkham)
         .IsEqualTo(txtPatientCode.Text.Trim())
         .ExecuteSingle <KcbLuotkham>();
     m_dtqheCamchidinhChungphieu = globalVariables.gv_dtDmucQheCamCLSChungPhieu;
     _bhytPtramTraituyennoitru   =
         Utility.DecimaltoDbnull(
             THU_VIEN_CHUNG.Laygiatrithamsohethong("BHYT_PTRAM_TRAITUYENNOITRU", "0", false), 0m);
     if (!string.IsNullOrEmpty(txtMaBenhChinh.Text.Trim()))
     {
         LoadThongTinChanDoan(txtMaBenhChinh.Text);
     }
     m_dtDonthuocChitiet = _kedonthuoc.LaythongtinchitietdonthuocDeSaoChep(Utility.Int64Dbnull(txtPres_ID.Text));
     if (m_dtDonthuocChitiet.Rows.Count > 0)
     {
         Utility.SetDataSourceForDataGridEx(grdPresDetail, m_dtDonthuocChitiet, false, true, "", "");
         grdPresDetail.CheckAllRecords();
         m_dtDonthuocChitiet_View = m_dtDonthuocChitiet.Clone();
     }
 }
Example #8
0
        public void SetValues(bool Chuyenvien, DmucDoituongkcb objDoituongKCB, KcbLuotkham objLuotkham)
        {
            this.Chuyenvien     = Chuyenvien;
            this.objDoituongKCB = objDoituongKCB;
            this.objLuotkham    = objLuotkham;
            //Gan gia tri
            chkCapCuu.Checked    = Utility.Int32Dbnull(objLuotkham.TrangthaiCapcuu, 0) == 1;
            chkTraiTuyen.Checked = Utility.Int32Dbnull(objLuotkham.DungTuyen, 0) == 0;
            lblTuyenBHYT.Text    = chkTraiTuyen.Checked ? "TRÁI TUYẾN" : "ĐÚNG TUYẾN";
            txtDiachi_bhyt._Text = Utility.sDbnull(objLuotkham.DiachiBhyt);
            if (!string.IsNullOrEmpty(Utility.sDbnull(objLuotkham.NgaybatdauBhyt)))
            {
                dtInsFromDate.Value = Convert.ToDateTime(objLuotkham.NgaybatdauBhyt);
            }
            if (!string.IsNullOrEmpty(Utility.sDbnull(objLuotkham.NgayketthucBhyt)))
            {
                dtInsToDate.Value = Convert.ToDateTime(objLuotkham.NgayketthucBhyt);
            }
            txtPtramBHYT.Text     = Utility.sDbnull(objLuotkham.PtramBhyt, "0");
            txtptramDauthe.Text   = Utility.sDbnull(objLuotkham.PtramBhytGoc, "0");
            txtMaDtuong_BHYT.Text = Utility.sDbnull(objLuotkham.MaDoituongBhyt);

            txtMaQuyenloi_BHYT.Text   = Utility.sDbnull(objLuotkham.MaQuyenloi);
            txtNoiDongtrusoKCBBD.Text = Utility.sDbnull(objLuotkham.NoiDongtrusoKcbbd);
            txtOthu4.Text             = Utility.sDbnull(objLuotkham.MatheBhyt).Substring(5, 2);
            txtOthu5.Text             = Utility.sDbnull(objLuotkham.MatheBhyt).Substring(7, 3);
            txtOthu6.Text             = Utility.sDbnull(objLuotkham.MatheBhyt).Substring(10, 5);

            txtMaDTsinhsong.SetCode(objLuotkham.MadtuongSinhsong);
            chkGiayBHYT.Checked = Utility.Byte2Bool(objLuotkham.GiayBhyt);

            txtNoiphattheBHYT.Text = Utility.sDbnull(objLuotkham.MaNoicapBhyt);
            txtNoiDKKCBBD.Text     = Utility.sDbnull(objLuotkham.MaKcbbd);
            pnlBHYT.Enabled        = true;
        }
        public void InsertAssignDetail(KcbChidinhcl objKcbChidinhcls, KcbLuotkham objLuotkham, KcbChidinhclsChitiet[] assignDetail)
        {
            using (var scope = new TransactionScope())
             {
                 if (objLuotkham == null) return;
                 foreach (KcbChidinhclsChitiet objAssignDetail in assignDetail)
                 {
                     log.Info("Them moi thong tin cua phieu chi dinh chi tiet voi ma phieu Assign_ID=" +
                              objKcbChidinhcls.IdChidinh);
                     TinhCLS.TinhGiaChiDinhCLS(objLuotkham, objAssignDetail);
                     objAssignDetail.IdDoituongKcb = Utility.Int16Dbnull(objLuotkham.IdDoituongKcb);
                     objAssignDetail.IdChidinh = Utility.Int32Dbnull(objKcbChidinhcls.IdChidinh);
                     objAssignDetail.IdKham = Utility.Int32Dbnull(objKcbChidinhcls.IdKham, -1);
                     decimal PtramBHYT = Utility.DecimaltoDbnull(objLuotkham.PtramBhyt, 0);
                     TinhCLS.GB_TinhPhtramBHYT(objAssignDetail, objLuotkham, PtramBHYT);
                     objAssignDetail.MaLuotkham = objKcbChidinhcls.MaLuotkham;
                     objAssignDetail.IdBenhnhan = objKcbChidinhcls.IdBenhnhan;
                     if (Utility.Int32Dbnull(objAssignDetail.SoLuong) <= 0) objAssignDetail.SoLuong = 1;
                     if (objAssignDetail.IdChitietchidinh <= 0)
                     {

                         objAssignDetail.IsNew = true;
                         objAssignDetail.Save();
                     }
                     else
                     {
                         objAssignDetail.MarkOld();
                         objAssignDetail.IsNew = false;
                         objAssignDetail.Save();
                     }
                 }
                 scope.Complete();
             }
        }
Example #10
0
        public static string Canhbaotamung(KcbLuotkham objLuotkham, DataSet dsData, DataTable dtTamung)
        {
            try
            {
                decimal Tong_CLS = Utility.DecimaltoDbnull(dsData.Tables[0].Compute("SUM(TT_BN)", "1=1"));
                decimal Tong_Thuoc = Utility.DecimaltoDbnull(dsData.Tables[1].Compute("SUM(TT_BN)", "1=1"));
                decimal Tong_VTTH = Utility.DecimaltoDbnull(dsData.Tables[2].Compute("SUM(TT_BN)", "1=1"));
                decimal Tong_Giuong = Utility.DecimaltoDbnull(dsData.Tables[3].Compute("SUM(TT_BN)", "1=1"));
                decimal Tong_Goi = Utility.DecimaltoDbnull(dsData.Tables[4].Compute("SUM(TT_BN)", "1=1"));
                decimal Tong_Tamung = Utility.DecimaltoDbnull(dtTamung.Compute("SUM(so_tien)", "1=1"));
                decimal Tong_chiphi = Tong_CLS + Tong_Thuoc + Tong_Giuong + Tong_Goi + Tong_VTTH;
                Decimal Gioihancanhbao = Utility.DecimaltoDbnull(THU_VIEN_CHUNG.Laygiatrithamsohethong("NOITRU_GIOIHAN_NOPTIENTAMUNG", "0", true), 0);
                if (Tong_Tamung - Tong_chiphi > Gioihancanhbao)//OK
                {
                    return "";
                }
                string s1 = String.Format(Utility.FormatDecimal(), Gioihancanhbao);
                string s2 = String.Format(Utility.FormatDecimal(), String.Format(Utility.FormatDecimal(), Convert.ToDecimal((Tong_Tamung - Tong_chiphi).ToString())));
                string s3 = String.Format(Utility.FormatDecimal(), Gioihancanhbao - (Tong_Tamung - Tong_chiphi));
                string result = string.Format("Giới hạn cảnh báo <={0}. Hiện tại, Tổng tạm ứng - Tổng chi phí = {1}(Cần đóng thêm: {2})", s1, s2,s3);
                return result;
            }
            catch (Exception ex)
            {
                return ex.Message;

            }
        }
 /// <summary>
 /// </summary>
 /// <param name="objPatientExam"></param>
 /// <param name="Khoanoitru_tonghop">true= Khoa nội trú tự chốt dữ liệu;fasle= Khoa tổng hợp chốt dữ liệu</param>
 /// <returns></returns>
 public static ActionResult TongHopChiPhi(KcbLuotkham objPatientExam, short idKhoanoitru, bool Khoanoitru_tonghop)
 {
     try
     {
         using (var scope = new TransactionScope())
         {
             using (var sh = new SharedDbConnectionScope())
             {
                 new Update(KcbLuotkham.Schema)
                 .Set(KcbLuotkham.Columns.TrangthaiNoitru)
                 .EqualTo(Utility.Int32Dbnull(objPatientExam.TrangthaiNoitru))
                 .Set(KcbLuotkham.Columns.TthaiThopNoitru)
                 .EqualTo(Utility.Int32Dbnull(objPatientExam.TthaiThopNoitru))
                 .Set(KcbLuotkham.Columns.NguoiSua).EqualTo(globalVariables.UserName)
                 .Set(KcbLuotkham.Columns.NgaySua).EqualTo(DateTime.Now)
                 .Where(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(objPatientExam.MaLuotkham)
                 .And(KcbLuotkham.Columns.IdBenhnhan)
                 .IsEqualTo(Utility.Int32Dbnull(objPatientExam.IdBenhnhan))
                 .Execute();
                 SPs.NoitruChotdulieuravien(objPatientExam.MaLuotkham, objPatientExam.IdBenhnhan, idKhoanoitru,
                                            Utility.Bool2byte(Khoanoitru_tonghop),
                                            (byte)(Utility.Byte2Bool(KcbLuotkham.Columns.TthaiThopNoitru) ? 1 : 0)).Execute();
             }
             scope.Complete();
             return(ActionResult.Success);
         }
     }
     catch (Exception ex)
     {
         return(ActionResult.Error);
     }
 }
Example #12
0
        public static string Canhbaotamung( KcbLuotkham objLuotkham)
        {
            try
            {
                DataTable dtTamung = SPs.NoitruTimkiemlichsuNoptientamung(objLuotkham.MaLuotkham, (int)objLuotkham.IdBenhnhan, 0, -1,(byte)( objLuotkham.TrangthaiNoitru > 0 ? 1 : 0)).GetDataSet().Tables[0];
                DataSet dsData = SPs.NoitruTongchiphi(objLuotkham.MaLuotkham, (int)objLuotkham.IdBenhnhan).GetDataSet();
                decimal Tong_CLS = Utility.DecimaltoDbnull(dsData.Tables[0].Compute("SUM(TT_BN)", "1=1"));
                decimal Tong_Thuoc = Utility.DecimaltoDbnull(dsData.Tables[1].Compute("SUM(TT_BN)", "1=1"));
                decimal Tong_VTTH = Utility.DecimaltoDbnull(dsData.Tables[2].Compute("SUM(TT_BN)", "1=1"));
                decimal Tong_Giuong = Utility.DecimaltoDbnull(dsData.Tables[3].Compute("SUM(TT_BN)", "1=1"));
                decimal Tong_Goi = Utility.DecimaltoDbnull(dsData.Tables[4].Compute("SUM(TT_BN)", "1=1"));
                decimal Tong_Tamung = Utility.DecimaltoDbnull(dtTamung.Compute("SUM(so_tien)", "1=1"));
                decimal Tong_chiphi = Tong_CLS + Tong_Thuoc + Tong_Giuong + Tong_Goi + Tong_VTTH;
                Decimal Gioihancanhbao = Utility.DecimaltoDbnull(THU_VIEN_CHUNG.Laygiatrithamsohethong("NOITRU_GIOIHAN_NOPTIENTAMUNG", "0", true), 0);
                if (Tong_Tamung - Tong_chiphi > Gioihancanhbao)//OK
                {
                    return "";
                }
                string s1=String.Format(Utility.FormatDecimal(), Gioihancanhbao);
                string s2=String.Format(Utility.FormatDecimal(), String.Format(Utility.FormatDecimal(), Convert.ToDecimal((Tong_Tamung - Tong_chiphi).ToString())));
                string result=string.Format("Giới hạn cảnh báo <={0}. Hiện tại, Tổng tạm ứng - Tổng chi phí = {1}", s1, s2);
                return result;
            }
            catch (Exception ex)
            {
                return ex.Message;

            }
        }
        public void InBienlai(bool IsTongHop, int _Payment_ID, KcbLuotkham objLuotkham)
        {
            try
               {
               ActionResult actionResult = new KCB_THANHTOAN().Capnhattrangthaithanhtoan(_Payment_ID);
               if (actionResult == ActionResult.Success)
               {
                   switch (objLuotkham.MaDoituongKcb)
                   {
                       case "DV":
                           Inbienlai_Dichvu(_Payment_ID, IsTongHop);
                           break;
                       case "BHYT":
                           Inbienlai_BHYT(_Payment_ID, IsTongHop);
                           break;
                       default:
                           Inbienlai_Dichvu(_Payment_ID, IsTongHop);
                           break;
                   }
               }
               }
               catch (Exception ex)
               {
               Utility.ShowMsg(string.Format("Lỗi trong quá trình in phiếu dịch vụ ={0}", ex.ToString()));

               }
               finally
               {

               }
        }
Example #14
0
 bool isValidXoatamung()
 {
     objLuotkham = Utility.getKcbLuotkham(objLuotkham.IdBenhnhan, objLuotkham.MaLuotkham);
     if (objLuotkham == null)
     {
         Utility.SetMsg(lblMsg, "Bạn cần chọn Bệnh nhân cần tạm ứng", true);
         return(false);
     }
     if (objTamung.TrangThai == 1)
     {
         Utility.SetMsg(lblMsg, "Đã hoàn ứng cho phần tạm ứng đang chọn nên bạn không thể hủy tạm ứng", true);
         return(false);
     }
     if (objLuotkham.TrangthaiNoitru <= 0 && THU_VIEN_CHUNG.Laygiatrithamsohethong("KCB_THANHTOAN_KICHHOAT_TAMUNG_NGOAITRU", true) == "1")
     {
         return(true);
     }
     if (objLuotkham.TrangthaiNoitru == 6)
     {
         Utility.ShowMsg("Bệnh nhân đã xuất viện nên bạn không thể hủy tiền tạm ứng");
         return(false);
     }
     if (objLuotkham.TrangthaiNoitru == 5)
     {
         Utility.ShowMsg("Bệnh nhân đã được tài chính duyệt nên bạn không thể hủy tiền tạm ứng");
         return(false);
     }
     if (objLuotkham.TrangthaiNoitru == 4)
     {
         Utility.ShowMsg("Bệnh nhân đã được tổng hợp xuất viện nên bạn không thể hủy tiền tạm ứng");
         return(false);
     }
     return(true);
 }
Example #15
0
 public void InsertAssignDetail(KcbChidinhcl objAssignInfo, KcbLuotkham objPatientExam, KcbChidinhclsChitiet[] assignDetail)
 {
     if (objPatientExam == null)
     {
         return;
     }
     foreach (KcbChidinhclsChitiet objAssignDetail in assignDetail)
     {
         log.Info("Them moi thong tin cua phieu chi dinh chi tiet voi ma phieu Assign_ID=" +
                  objAssignInfo.IdChidinh);
         TinhCLS.TinhGiaChiDinhCLS(objPatientExam, objAssignDetail);
         objAssignDetail.IdDoituongKcb = Utility.Int16Dbnull(objPatientExam.IdDoituongKcb);
         objAssignDetail.IdChidinh     = Utility.Int32Dbnull(objAssignInfo.IdChidinh);
         objAssignDetail.IdKham        = Utility.Int32Dbnull(objAssignInfo.IdKham, -1);
         decimal PtramBHYT = Utility.DecimaltoDbnull(objPatientExam.PtramBhyt, 0);
         TinhCLS.GB_TinhPhtramBHYT(objAssignDetail, objPatientExam, PtramBHYT);
         objAssignDetail.MaLuotkham = objAssignInfo.MaLuotkham;
         objAssignDetail.IdBenhnhan = objAssignInfo.IdBenhnhan;
         if (Utility.Int32Dbnull(objAssignDetail.SoLuong) <= 0)
         {
             objAssignDetail.SoLuong = 1;
         }
         if (objAssignDetail.IdChitietchidinh <= 0)
         {
             objAssignDetail.IsNew = true;
             objAssignDetail.Save();
         }
         else
         {
             objAssignDetail.MarkOld();
             objAssignDetail.IsNew = false;
             objAssignDetail.Save();
         }
     }
 }
        private void cmdSuaChiDinh_Click(object sender, EventArgs e)
        {
            KcbLuotkham objLuotkham = CreatePatientExam();

            if (objLuotkham != null)
            {
                if (!InValiUpdateChiDinh())
                {
                    return;
                }
                frm_Chidinh_Maukiemnghiem frm = new frm_Chidinh_Maukiemnghiem("MAUKIEMNGHIEM", 3);
                frm.HosStatus = 0;

                frm.Exam_ID           = Utility.Int32Dbnull(-1, -1);
                frm.objLuotkham       = CreatePatientExam();
                frm.m_eAction         = action.Update;
                frm.txtAssign_ID.Text = Utility.sDbnull(grdDetail.GetValue(KcbChidinhclsChitiet.Columns.IdChidinh), "-1");
                frm.ShowDialog();
                if (!frm.m_blnCancel)
                {
                    //  LoadChiDinhCLS();
                    LoadChiDinh();
                    UpdateSumOfChiDinh();
                }
                ModifycommandAssignDetail();
            }
            ModifyCommand();
        }
Example #17
0
        public static ActionResult CapnhatGiatheodoituong(KcbLuotkham objLuotkham)
        {
            using (var Scope = new TransactionScope())
            {
                ActionResult _ActionResult = ActionResult.Success;

                _ActionResult = CapnhatChiphiKCB(objLuotkham);
                if (_ActionResult == ActionResult.Cancel)
                {
                    return(_ActionResult);
                }
                _ActionResult = CapnhatChiphiCLS(objLuotkham);
                if (_ActionResult == ActionResult.Cancel)
                {
                    return(_ActionResult);
                }
                _ActionResult = CapnhatChiphiThuoc(objLuotkham);
                if (_ActionResult == ActionResult.Cancel)
                {
                    return(_ActionResult);
                }
                Scope.Complete();
                return(ActionResult.Success);
            }
        }
Example #18
0
 bool isValidXoatamung()
 {
     objLuotkham = Utility.getKcbLuotkham(objLuotkham.IdBenhnhan, objLuotkham.MaLuotkham);
     if (objLuotkham == null)
     {
         Utility.SetMsg(lblMsg, "Bạn cần chọn Bệnh nhân cần tạm ứng", true);
         return(false);
     }
     if (objLuotkham.TrangthaiNoitru == 6)
     {
         Utility.ShowMsg("Bệnh nhân đã xuất viện nên bạn không thể hủy tiền tạm ứng");
         return(false);
     }
     if (objLuotkham.TrangthaiNoitru == 5)
     {
         Utility.ShowMsg("Bệnh nhân đã được tài chính duyệt nên bạn không thể hủy tiền tạm ứng");
         return(false);
     }
     if (objLuotkham.TrangthaiNoitru == 4)
     {
         Utility.ShowMsg("Bệnh nhân đã được tổng hợp xuất viện nên bạn không thể hủy tiền tạm ứng");
         return(false);
     }
     return(true);
 }
Example #19
0
        private void BindData()
        {
            SqlQuery sqlQuery = new Select().From(KcbLuotkham.Schema)
                .Where(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(txtMaLanKham.Text);
            if (sqlQuery.GetRecordCount() > 0)
            {
                objLuotkham = sqlQuery.ExecuteSingle<KcbLuotkham>();
                if (objLuotkham != null)
                {
                    txtMaLanKham.Text = Utility.sDbnull(objLuotkham.MaLuotkham);
                    txtSoBHYT.Text = Utility.sDbnull(objLuotkham.MatheBhyt);
                    DmucKhoaphong objLDepartment = DmucKhoaphong.FetchByID(objLuotkham.IdKhoanoitru);
                    if (objLDepartment != null)
                    {
                        txtDepartment_ID.Text = Utility.sDbnull(objLDepartment.IdKhoaphong);
                        txtDepartmentName.Tag = Utility.sDbnull(objLDepartment.IdKhoaphong);
                        txtDepartmentName.Text = Utility.sDbnull(objLDepartment.TenKhoaphong);
                    }
                    KcbDanhsachBenhnhan objPatientInfo = KcbDanhsachBenhnhan.FetchByID(objLuotkham.IdBenhnhan);
                    if (objPatientInfo != null)
                    {
                        txtPatient_Name.Text = Utility.sDbnull(objPatientInfo.TenBenhnhan);
                        txtPatient_ID.Text = Utility.sDbnull(objLuotkham.IdBenhnhan);
                        txtNamSinh.Text = Utility.sDbnull(objPatientInfo.NamSinh);
                        txtTuoi.Text = Utility.sDbnull(DateTime.Now.Year - objPatientInfo.NamSinh);
                        txtPatientSex.Text =objPatientInfo.GioiTinh;// Utility.Int32Dbnull(objPatientInfo.) == 0 ? "Nam" : "Nữ";
                    }
                    NoitruPhanbuonggiuong objPhanbuonggiuong = noitru_nhapvien.LaythongtinBuonggiuongHtai(objLuotkham);
                    if (objPhanbuonggiuong != null)
                    {
                        dtNgayvao.Value = objPhanbuonggiuong.NgayVaokhoa;
                        txtPatientDept_ID.Text = Utility.sDbnull(objPhanbuonggiuong.Id);
                        NoitruDmucBuong objRoom = NoitruDmucBuong.FetchByID(objPhanbuonggiuong.IdBuong);
                        if (objRoom != null)
                        {
                            txtSoPhong.Text = Utility.sDbnull(objRoom.TenBuong);
                            txtSoPhong.Tag = Utility.sDbnull(objPhanbuonggiuong.IdBuong);
                        }
                        NoitruDmucGiuongbenh objNoitruDmucGiuongbenh = NoitruDmucGiuongbenh.FetchByID(objPhanbuonggiuong.IdGiuong);
                        if (objNoitruDmucGiuongbenh != null)
                        {
                            txtSoGiuong.Text = Utility.sDbnull(objNoitruDmucGiuongbenh.TenGiuong);
                            txtSoGiuong.Tag = Utility.sDbnull(objPhanbuonggiuong.IdGiuong);
                        }
                    }
                    DataTable dtGia = new dmucgiagiuong_busrule().dsGetList("-1").Tables[0];
                    dtGia.DefaultView.Sort = NoitruGiabuonggiuong.Columns.SttHthi + "," + NoitruGiabuonggiuong.Columns.TenGia;
                    txtGia.Init(dtGia, new System.Collections.Generic.List<string>() { NoitruGiabuonggiuong.Columns.IdGia, NoitruGiabuonggiuong.Columns.MaGia, NoitruGiabuonggiuong.Columns.TenGia });

                    m_dtDataRoom = THU_VIEN_CHUNG.NoitruTimkiembuongTheokhoa(Utility.Int32Dbnull(txtDepartment_ID.Text));
                    Utility.SetDataSourceForDataGridEx_Basic(grdBuong, m_dtDataRoom, true, true, "1=1", "sluong_giuong_trong desc,ten_buong");
                    if (grdBuong.DataSource != null)
                    {
                        grdBuong.MoveFirst();
                    }
                }
            }
        }
Example #20
0
        private bool IsValidData()
        {
            KcbLuotkham objKcbLuotkham = Utility.getKcbLuotkham(Utility.Int64Dbnull(txtPatient_ID.Text), txtMaLanKham.Text);

            if (objKcbLuotkham != null && objKcbLuotkham.TrangthaiNoitru < 1)
            {
                Utility.ShowMsg("Bệnh nhân này chưa nhập viện nên không được phép phân buồng giường", "Thông báo",
                                MessageBoxIcon.Warning);
                txtMaLanKham.Focus();
                txtMaLanKham.SelectAll();
                return(false);
            }

            if (!Utility.isValidGrid(grdBuong))
            {
                Utility.ShowMsg("Bạn phải chọn Buồng cần chuyển", "Thông báo", MessageBoxIcon.Warning);
                // cboPhong.Focus();
                txtRoom_code.Focus();
                txtRoom_code.SelectAll();
                return(false);
            }


            if (!Utility.isValidGrid(grdGiuong))
            {
                Utility.ShowMsg("Bạn phải chọn giường cần chuyển", "Thông báo", MessageBoxIcon.Warning);
                txtBedCode.Focus();
                txtBedCode.SelectAll();
                // cboGiuong.Focus();
                return(false);
            }
            if (lblGiaBG.Visible && Utility.Int32Dbnull(txtGia.MyID, -1) == -1)
            {
                Utility.SetMsg(lblMsg, "Bạn phải chọn giá buồng giường", true);
                txtGia.Focus();
                txtGia.SelectAll();
                return(false);
            }
            DataTable dt = new noitru_nhapvien().NoitruKiemtraBuongGiuong((int)objLuotkham.IdKhoanoitru, Utility.Int16Dbnull(grdBuong.GetValue(NoitruDmucGiuongbenh.Columns.IdBuong)), Utility.Int16Dbnull(grdGiuong.GetValue(NoitruDmucGiuongbenh.Columns.IdGiuong)));

            if (dt != null && dt.Rows.Count > 0)
            {
                Utility.SetMsg(lblMsg, string.Format("Giường này đang được nằm bởi bệnh nhân\n{0}\nMời bạn chọn giường khác", Utility.sDbnull(dt.Rows[0][KcbDanhsachBenhnhan.Columns.TenBenhnhan])), true);
                txtBedCode.Focus();
                txtBedCode.SelectAll();
            }
            if (Utility.Int32Dbnull(Utility.DecimaltoDbnull(txtSoluong.Text)) != THU_VIEN_CHUNG.Songay(dtNgayvao.Value, dtNgayChuyen.Value))
            {
                if (!Utility.AcceptQuestion(string.Format("Bạn có chắc chắn số ngày nằm viện trước khi chuyển là {0} thay vì {1}(Hệ thống tự động tính toán) hay không?", txtSoluong.Text, THU_VIEN_CHUNG.Songay(dtNgayvao.Value, dtNgayChuyen.Value).ToString()), "Cảnh báo", true))
                {
                    txtSoluong.Focus();
                }
                txtSoluong.SelectAll();
                return(false);
            }

            return(true);
        }
 public void Init(KcbLuotkham objLuotkham, NoitruPhieudieutri objPhieudieutri)
 {
     this.objLuotkham = objLuotkham;
     this.objPhieudieutri = objPhieudieutri;
     LaydanhsachbacsiChidinh();
     LaydanhSachKhoaNoitru();
     txtMaBenhChinh.Init(globalVariables.gv_dtDmucBenh, new List<string>() { DmucBenh.Columns.IdBenh, DmucBenh.Columns.MaBenh, DmucBenh.Columns.TenBenh });
     txtMaBenhphu.Init(globalVariables.gv_dtDmucBenh, new List<string>() { DmucBenh.Columns.IdBenh, DmucBenh.Columns.MaBenh, DmucBenh.Columns.TenBenh });
 }
Example #22
0
 public static NoitruPhanbuonggiuong LaythongtinBuonggiuongHtai(KcbLuotkham objPatientExam)
 {
     NoitruPhanbuonggiuong objPhanbuonggiuong = new Select().From(NoitruPhanbuonggiuong.Schema)
         .Where(NoitruPhanbuonggiuong.Columns.MaLuotkham).IsEqualTo(objPatientExam.MaLuotkham)
         .And(NoitruPhanbuonggiuong.Columns.IdBenhnhan).IsEqualTo(objPatientExam.IdBenhnhan)
         .And(NoitruPhanbuonggiuong.Columns.NoiTru).IsEqualTo(1)
         .And(NoitruPhanbuonggiuong.Columns.TrangThai).IsEqualTo(0).ExecuteSingle<NoitruPhanbuonggiuong>();
     return objPhanbuonggiuong;
 }
Example #23
0
 public void ChangePatients(KcbLuotkham objLuotkham, string maloailydothu)
 {
     AllowedChanged   = false;
     this.objLuotkham = objLuotkham;
     if (maloailydothu != string.Empty)
     {
         txtLydo.LOAI_DANHMUC = maloailydothu;
     }
     Init();
 }
Example #24
0
        public static NoitruPhanbuonggiuong LaythongtinBuonggiuongHtai(KcbLuotkham objPatientExam)
        {
            NoitruPhanbuonggiuong objPhanbuonggiuong = new Select().From(NoitruPhanbuonggiuong.Schema)
                                                       .Where(NoitruPhanbuonggiuong.Columns.MaLuotkham).IsEqualTo(objPatientExam.MaLuotkham)
                                                       .And(NoitruPhanbuonggiuong.Columns.IdBenhnhan).IsEqualTo(objPatientExam.IdBenhnhan)
                                                       .And(NoitruPhanbuonggiuong.Columns.NoiTru).IsEqualTo(1)
                                                       .And(NoitruPhanbuonggiuong.Columns.TrangThai).IsEqualTo(0).ExecuteSingle <NoitruPhanbuonggiuong>();

            return(objPhanbuonggiuong);
        }
        private void PerformAction()
        {
            //if (Utility.AcceptQuestion("Bạn có muốn chuyển bệnh nhân vào Buồng và giường đang chọn không", "Thông báo",
            //    true))
            //{
            var ngaychuyenkhoa = new DateTime(dtNgayChuyen.Value.Year, dtNgayChuyen.Value.Month,
                                              dtNgayChuyen.Value.Day, Utility.Int32Dbnull(txtGio.Text),
                                              Utility.Int32Dbnull(txtPhut.Text), 00);

            _objPatientExam =
                new Select().From <KcbLuotkham>()
                .Where(KcbLuotkham.Columns.MaLuotkham)
                .IsEqualTo(ObjPhanbuonggiuong.MaLuotkham)
                .And(KcbLuotkham.Columns.IdBenhnhan)
                .IsEqualTo(ObjPhanbuonggiuong.IdBenhnhan)
                .ExecuteSingle <KcbLuotkham>();
            if (_objPatientExam != null)
            {
                ObjPhanbuonggiuong.Id           = Utility.Int32Dbnull(txtPatientDept_ID.Text);
                ObjPhanbuonggiuong.NgayVaokhoa  = ngaychuyenkhoa;
                ObjPhanbuonggiuong.IdBuong      = Utility.Int16Dbnull(grdBuong.GetValue(NoitruDmucBuong.Columns.IdBuong));
                ObjPhanbuonggiuong.IdGiuong     = Utility.Int16Dbnull(grdGiuong.GetValue(NoitruDmucGiuongbenh.Columns.IdGiuong));
                ObjPhanbuonggiuong.IsGhepGiuong = Utility.ByteDbnull(chkGhepgiuong.Checked);
                if (chkGhepgiuong.Checked)
                {
                    ObjPhanbuonggiuong.SoLuongGhep = Utility.Int16Dbnull(txtsoluongghep.Text, 0);
                }
                ObjPhanbuonggiuong.IdGia = Utility.Int32Dbnull(txtGia.MyID, -1);
                ActionResult actionResult = new noitru_nhapvien().PhanGiuongDieuTri(ObjPhanbuonggiuong,
                                                                                    _objPatientExam,
                                                                                    ngaychuyenkhoa,
                                                                                    Utility.Int16Dbnull(
                                                                                        grdBuong.GetValue(
                                                                                            NoitruDmucBuong.Columns.IdBuong)),
                                                                                    Utility.Int16Dbnull(
                                                                                        grdGiuong.GetValue(
                                                                                            NoitruDmucGiuongbenh.Columns.IdGiuong)));
                switch (actionResult)
                {
                case ActionResult.Success:
                    txtPatientDept_ID.Text = Utility.sDbnull(ObjPhanbuonggiuong.Id);
                    Utility.SetMsg(lblMsg, "Bạn chuyển bênh nhân vào giường thành công", true);
                    ProcessChuyenKhoa();
                    BCancel = false;
                    Close();

                    break;

                case ActionResult.Error:
                    Utility.ShowMsg("Lỗi trong quá trình phân buồng giường", "Thông báo", MessageBoxIcon.Error);
                    break;
                }
            }
            //  }
        }
Example #26
0
        public ActionResult ThemDonThuoc(KcbLuotkham objLuotkham, KcbDonthuoc objDonthuoc, KcbDonthuocChitiet[] arrDonthuocChitiet, KcbChandoanKetluan _KcbChandoanKetluan, ref int p_intIdDonthuoc, ref Dictionary <long, long> lstChitietDonthuoc)
        {
            // Query _Query = KcbDonthuoc.CreateQuery();
            try
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    using (SharedDbConnectionScope sh = new SharedDbConnectionScope())
                    {
                        if (objLuotkham != null)
                        {
                            if (objDonthuoc.NgayKedon <= Convert.ToDateTime("01/01/1900"))
                            {
                                objDonthuoc.NgayKedon = globalVariables.SysDate;
                            }

                            objDonthuoc.IsNew       = true;
                            objDonthuoc.TenDonthuoc = THU_VIEN_CHUNG.TaoTenDonthuoc(objLuotkham.MaLuotkham,
                                                                                    Utility.Int32Dbnull(
                                                                                        objLuotkham.IdBenhnhan,
                                                                                        -1));

                            objDonthuoc.Save();
                            if (!Utility.Byte2Bool(objDonthuoc.Noitru))
                            {
                                CapnhatChandoan(_KcbChandoanKetluan);
                            }
                            p_intIdDonthuoc = objDonthuoc.IdDonthuoc;
                            decimal PtramBH = Utility.DecimaltoDbnull(objLuotkham.PtramBhyt, 0);

                            foreach (KcbDonthuocChitiet objDonthuocChitiet in arrDonthuocChitiet)
                            {
                                objDonthuocChitiet.IdKham     = objDonthuoc.IdKham;
                                objDonthuocChitiet.MaLuotkham = objDonthuoc.MaLuotkham;
                                objDonthuocChitiet.IdBenhnhan = objDonthuoc.IdBenhnhan;
                                objDonthuocChitiet.IdDonthuoc = objDonthuoc.IdDonthuoc;
                                ThemChitiet(objDonthuoc, objDonthuocChitiet, PtramBH, objLuotkham);
                                if (!lstChitietDonthuoc.ContainsKey(objDonthuocChitiet.IdThuockho.Value))
                                {
                                    lstChitietDonthuoc.Add(objDonthuocChitiet.IdThuockho.Value, objDonthuocChitiet.IdChitietdonthuoc);
                                }
                            }
                        }
                    }
                    scope.Complete();
                    return(ActionResult.Success);
                }
            }
            catch (Exception exception)
            {
                log.Error("Loi trong qua trinh luu don thuoc {0}", exception);
                return(ActionResult.Error);
            }
        }
Example #27
0
        public ActionResult AddNewPatientExam(KcbDanhsachBenhnhan objPatientInfo, KcbLuotkham objLuotkham, KcbDangkyKcb objRegExam, int KieuKham)
        {
            try
            {
                using (var scope = new TransactionScope())
                {
                    using (var dbscope = new SharedDbConnectionScope())
                    {
                        UpdatePatientInfo(objPatientInfo);
                        SqlQuery sqlQueryPatientExam = new Select().From(KcbLuotkham.Schema)
                           .Where(KcbLuotkham.Columns.IdBenhnhan).IsNotEqualTo(objLuotkham.IdBenhnhan)
                           .And(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(objLuotkham.MaLuotkham);
                        if (sqlQueryPatientExam.GetRecordCount() > 0)//Nếu BN khác đã lấy mã này
                        {

                            objLuotkham.MaLuotkham = THU_VIEN_CHUNG.KCB_SINH_MALANKHAM();

                        }
                        objLuotkham.IsNew = true;
                        objLuotkham.Save();
                        if (objLuotkham.TrangthaiNoitru >= 1)
                        {
                            SqlQuery sqlQuery = new Select().From(KcbLuotkham.Schema).Where(
                                KcbLuotkham.Columns.MaLuotkham).IsNotEqualTo(objLuotkham.MaLuotkham)
                                .And(KcbLuotkham.Columns.SoBenhAn).IsEqualTo(objLuotkham.SoBenhAn)
                                .And(KcbLuotkham.Columns.TrangthaiNoitru).IsGreaterThanOrEqualTo(1);

                            if (sqlQuery.GetRecordCount() > 0)
                            {
                                var query = new Update(KcbLuotkham.Schema)
                                     .Set(KcbLuotkham.Columns.SoBenhAn).EqualTo(THU_VIEN_CHUNG.LaySoBenhAn())
                                     .Where(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(objLuotkham.MaLuotkham).
                                     Execute();
                            }

                        }
                        if (objRegExam != null)
                        {
                            objRegExam.MaLuotkham = Utility.sDbnull(objLuotkham.MaLuotkham);
                            objRegExam.IdBenhnhan = Utility.Int32Dbnull(objLuotkham.IdBenhnhan);
                            AddRegExam(objRegExam,objLuotkham, false, KieuKham);
                        }
                        scope.Complete();
                        return ActionResult.Success;
                    }
                }
            }
            catch (Exception ex)
            {
                return ActionResult.Error;
            }
        }
        private KcbLuotkham CreatePatientExam()
        {
            string      MaLuotkham  = Utility.sDbnull(grdList.GetValue(KcbLuotkham.Columns.MaLuotkham));
            int         Patient_ID  = Utility.Int32Dbnull(grdList.GetValue(KcbLuotkham.Columns.IdBenhnhan));
            KcbLuotkham objLuotkham = new KcbLuotkham();

            SqlQuery sqlQuery = new Select().From(KcbLuotkham.Schema)
                                .Where(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(MaLuotkham)
                                .And(KcbLuotkham.Columns.IdBenhnhan).IsEqualTo(Patient_ID);

            objLuotkham = sqlQuery.ExecuteSingle <KcbLuotkham>();
            return(objLuotkham);
        }
        private bool IsValidData()
        {
            KcbLuotkham objKcbLuotkham = Utility.getKcbLuotkham(ObjPhanbuonggiuong.IdBenhnhan,
                                                                ObjPhanbuonggiuong.MaLuotkham);

            if (objKcbLuotkham != null && objKcbLuotkham.TrangthaiNoitru < 1)
            {
                Utility.ShowMsg("Bệnh nhân này chưa nhập viện nên không được phép phân buồng giường", "Thông báo",
                                MessageBoxIcon.Warning);
                return(false);
            }


            if (!Utility.isValidGrid(grdBuong))
            {
                Utility.SetMsg(lblMsg, "Bạn phải chọn Buồng cần chuyển", true);
                txtRoom_code.Focus();
                txtRoom_code.SelectAll();
                return(false);
            }


            if (!Utility.isValidGrid(grdGiuong))
            {
                Utility.SetMsg(lblMsg, "Bạn phải chọn giường cần chuyển", true);
                txtBedCode.Focus();
                txtBedCode.SelectAll();
                return(false);
            }
            if (lblGiaBG.Visible && Utility.Int32Dbnull(txtGia.MyID, -1) == -1)
            {
                Utility.SetMsg(lblMsg, "Bạn phải chọn giá buồng giường", true);
                txtGia.Focus();
                txtGia.SelectAll();
                return(false);
            }
            DataTable dt = new noitru_nhapvien().NoitruKiemtraBuongGiuong(ObjPhanbuonggiuong.IdKhoanoitru,
                                                                          Utility.Int16Dbnull(grdBuong.GetValue(NoitruDmucGiuongbenh.Columns.IdBuong)),
                                                                          Utility.Int16Dbnull(grdGiuong.GetValue(NoitruDmucGiuongbenh.Columns.IdGiuong)));

            if (dt != null && dt.Rows.Count > 0)
            {
                Utility.SetMsg(lblMsg,
                               string.Format("Giường này đang được nằm bởi bệnh nhân: {0}. Mời bạn chọn giường khác",
                                             Utility.sDbnull(dt.Rows[0][KcbDanhsachBenhnhan.Columns.TenBenhnhan])), true);
                txtBedCode.Focus();
                txtBedCode.SelectAll();
                return(false);
            }
            return(true);
        }
Example #30
0
        private void BindData()
        {
            SqlQuery sqlQuery = new Select().From(KcbLuotkham.Schema)
                                .Where(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(txtMaLanKham.Text);

            if (sqlQuery.GetRecordCount() > 0)
            {
                objLuotkham = sqlQuery.ExecuteSingle <KcbLuotkham>();
                if (objLuotkham != null)
                {
                    txtMaLanKham.Text = Utility.sDbnull(objLuotkham.MaLuotkham);
                    txtSoBHYT.Text    = Utility.sDbnull(objLuotkham.MatheBhyt);
                    DmucKhoaphong objDmucKhoaphong = DmucKhoaphong.FetchByID(objLuotkham.IdKhoanoitru);
                    if (objDmucKhoaphong != null)
                    {
                        txtDepartmentName.Tag  = Utility.sDbnull(objDmucKhoaphong.IdKhoaphong);
                        txtDepartment_ID.Text  = Utility.sDbnull(objDmucKhoaphong.IdKhoaphong);
                        txtDepartmentName.Text = Utility.sDbnull(objDmucKhoaphong.TenKhoaphong);
                    }

                    KcbDanhsachBenhnhan objPatientInfo = KcbDanhsachBenhnhan.FetchByID(objLuotkham.IdBenhnhan);
                    if (objPatientInfo != null)
                    {
                        txtPatient_Name.Text = Utility.sDbnull(objPatientInfo.TenBenhnhan);
                        txtPatient_ID.Text   = Utility.sDbnull(objLuotkham.IdBenhnhan);
                        txtNamSinh.Text      = Utility.sDbnull(objPatientInfo.NamSinh);
                        txtTuoi.Text         = Utility.sDbnull(DateTime.Now.Year - objPatientInfo.NamSinh);
                        txtPatientSex.Text   = objPatientInfo.GioiTinh;// Utility.Int32Dbnull(objPatientInfo.PatientSex) == 0 ? "Nam" : "Nữ";
                    }
                    objPhanbuonggiuong = NoitruPhanbuonggiuong.FetchByID(objLuotkham.IdRavien);
                    dtNgayvao.Value    = objPhanbuonggiuong.NgayVaokhoa;
                    if (objPhanbuonggiuong != null)
                    {
                        txtPatientDept_ID.Text = Utility.sDbnull(objPhanbuonggiuong.Id);
                        NoitruDmucBuong objRoom = NoitruDmucBuong.FetchByID(objPhanbuonggiuong.IdBuong);
                        if (objRoom != null)
                        {
                            txtSoPhong.Text = Utility.sDbnull(objRoom.TenBuong);
                            txtSoPhong.Tag  = Utility.sDbnull(objPhanbuonggiuong.IdBuong);
                        }
                        NoitruDmucGiuongbenh objNoitruDmucGiuongbenh = NoitruDmucGiuongbenh.FetchByID(objPhanbuonggiuong.IdGiuong);
                        if (objNoitruDmucGiuongbenh != null)
                        {
                            txtSoGiuong.Text = Utility.sDbnull(objNoitruDmucGiuongbenh.TenGiuong);
                            txtSoGiuong.Tag  = Utility.sDbnull(objPhanbuonggiuong.IdGiuong);
                        }
                    }
                }
            }
            ModifyCommand();
        }
Example #31
0
 public static ActionResult Chuyendoituong(KcbLuotkham objLuotkham,decimal PtramBHYTcu)
 {
     try
     {
     ActionResult _ActionResult = ActionResult.Success;
         using (var Scope = new TransactionScope())
         {
             using (var dbScope = new SharedDbConnectionScope())
             {
                 //if (PtramBHYTcu != objLuotkham.PtramBhyt.Value )
                    _ActionResult= CapnhatGiatheodoituong(objLuotkham);
                 if (_ActionResult == ActionResult.Cancel)
                 {
                     return _ActionResult;
                 }
                 new Update(KcbLuotkham.Schema)
                    .Set(KcbLuotkham.Columns.LuongCoban).EqualTo(objLuotkham.LuongCoban)
                    .Set(KcbLuotkham.Columns.TthaiChuyendi).EqualTo(objLuotkham.TthaiChuyendi)
                    .Set(KcbLuotkham.Columns.MatheBhyt).EqualTo(objLuotkham.MatheBhyt)
                    .Set(KcbLuotkham.Columns.MaNoicapBhyt).EqualTo(objLuotkham.MaNoicapBhyt)
                    .Set(KcbLuotkham.Columns.MaQuyenloi).EqualTo(objLuotkham.MaQuyenloi)
                    .Set(KcbLuotkham.Columns.NgaybatdauBhyt).EqualTo(objLuotkham.NgaybatdauBhyt)
                    .Set(KcbLuotkham.Columns.NgayketthucBhyt).EqualTo(objLuotkham.NgayketthucBhyt)
                    .Set(KcbLuotkham.Columns.NoicapBhyt).EqualTo(objLuotkham.NoicapBhyt)
                    .Set(KcbLuotkham.Columns.IdDoituongKcb).EqualTo(objLuotkham.IdDoituongKcb)
                    .Set(KcbLuotkham.Columns.MaKcbbd).EqualTo(objLuotkham.MaKcbbd)
                    .Set(KcbLuotkham.Columns.NoiDongtrusoKcbbd).EqualTo(objLuotkham.NoiDongtrusoKcbbd)
                    .Set(KcbLuotkham.Columns.MaDoituongBhyt).EqualTo(objLuotkham.MaDoituongBhyt)
                    .Set(KcbLuotkham.Columns.DungTuyen).EqualTo(objLuotkham.DungTuyen)
                    .Set(KcbLuotkham.Columns.MaDoituongKcb).EqualTo(objLuotkham.MaDoituongKcb)
                    .Set(KcbLuotkham.Columns.NguoiSua).EqualTo(globalVariables.UserName)
                    .Set(KcbLuotkham.Columns.NgaySua).EqualTo(globalVariables.SysDate)
                    .Set(KcbLuotkham.Columns.MadtuongSinhsong).EqualTo(objLuotkham.MadtuongSinhsong)
                    .Set(KcbLuotkham.Columns.GiayBhyt).EqualTo(objLuotkham.GiayBhyt)
                    .Set(KcbLuotkham.Columns.PtramBhyt).EqualTo(objLuotkham.PtramBhyt)
                    .Set(KcbLuotkham.Columns.PtramBhytGoc).EqualTo(objLuotkham.PtramBhytGoc)
                    .Set(KcbLuotkham.Columns.DiachiBhyt).EqualTo(objLuotkham.DiachiBhyt)
                    .Where(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(objLuotkham.MaLuotkham)
                    .And(KcbLuotkham.Columns.IdBenhnhan).IsEqualTo(objLuotkham.IdBenhnhan)
                    .Execute();
             }
             Scope.Complete();
             return ActionResult.Success;
         }
     }
     catch (Exception ex)
     {
         Utility.ShowMsg("Lỗi khi chuyển đối tượng:\n"+ex.Message);
         return ActionResult.Exception;
     }
 }
Example #32
0
 public static ActionResult Chuyendoituong(KcbLuotkham objLuotkham, decimal PtramBHYTcu)
 {
     try
     {
         ActionResult _ActionResult = ActionResult.Success;
         using (var Scope = new TransactionScope())
         {
             using (var dbScope = new SharedDbConnectionScope())
             {
                 //if (PtramBHYTcu != objLuotkham.PtramBhyt.Value )
                 _ActionResult = CapnhatGiatheodoituong(objLuotkham);
                 if (_ActionResult == ActionResult.Cancel)
                 {
                     return(_ActionResult);
                 }
                 new Update(KcbLuotkham.Schema)
                 .Set(KcbLuotkham.Columns.LuongCoban).EqualTo(objLuotkham.LuongCoban)
                 .Set(KcbLuotkham.Columns.TthaiChuyendi).EqualTo(objLuotkham.TthaiChuyendi)
                 .Set(KcbLuotkham.Columns.MatheBhyt).EqualTo(objLuotkham.MatheBhyt)
                 .Set(KcbLuotkham.Columns.MaNoicapBhyt).EqualTo(objLuotkham.MaNoicapBhyt)
                 .Set(KcbLuotkham.Columns.MaQuyenloi).EqualTo(objLuotkham.MaQuyenloi)
                 .Set(KcbLuotkham.Columns.NgaybatdauBhyt).EqualTo(objLuotkham.NgaybatdauBhyt)
                 .Set(KcbLuotkham.Columns.NgayketthucBhyt).EqualTo(objLuotkham.NgayketthucBhyt)
                 .Set(KcbLuotkham.Columns.NoicapBhyt).EqualTo(objLuotkham.NoicapBhyt)
                 .Set(KcbLuotkham.Columns.IdDoituongKcb).EqualTo(objLuotkham.IdDoituongKcb)
                 .Set(KcbLuotkham.Columns.MaKcbbd).EqualTo(objLuotkham.MaKcbbd)
                 .Set(KcbLuotkham.Columns.NoiDongtrusoKcbbd).EqualTo(objLuotkham.NoiDongtrusoKcbbd)
                 .Set(KcbLuotkham.Columns.MaDoituongBhyt).EqualTo(objLuotkham.MaDoituongBhyt)
                 .Set(KcbLuotkham.Columns.DungTuyen).EqualTo(objLuotkham.DungTuyen)
                 .Set(KcbLuotkham.Columns.MaDoituongKcb).EqualTo(objLuotkham.MaDoituongKcb)
                 .Set(KcbLuotkham.Columns.NguoiSua).EqualTo(globalVariables.UserName)
                 .Set(KcbLuotkham.Columns.NgaySua).EqualTo(globalVariables.SysDate)
                 .Set(KcbLuotkham.Columns.MadtuongSinhsong).EqualTo(objLuotkham.MadtuongSinhsong)
                 .Set(KcbLuotkham.Columns.GiayBhyt).EqualTo(objLuotkham.GiayBhyt)
                 .Set(KcbLuotkham.Columns.PtramBhyt).EqualTo(objLuotkham.PtramBhyt)
                 .Set(KcbLuotkham.Columns.PtramBhytGoc).EqualTo(objLuotkham.PtramBhytGoc)
                 .Set(KcbLuotkham.Columns.DiachiBhyt).EqualTo(objLuotkham.DiachiBhyt)
                 .Where(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(objLuotkham.MaLuotkham)
                 .And(KcbLuotkham.Columns.IdBenhnhan).IsEqualTo(objLuotkham.IdBenhnhan)
                 .Execute();
             }
             Scope.Complete();
             return(ActionResult.Success);
         }
     }
     catch (Exception ex)
     {
         Utility.ShowMsg("Lỗi khi chuyển đối tượng:\n" + ex.Message);
         return(ActionResult.Exception);
     }
 }
 public void InsertAssignDetail(KcbChidinhcl objChidinh, KcbLuotkham objLuotkham, KcbChidinhclsChitiet[] assignDetail)
 {
     using (var scope = new TransactionScope())
     {
         if (objLuotkham == null)
         {
             return;
         }
         foreach (KcbChidinhclsChitiet objChidinhCtiet in assignDetail)
         {
             log.Info("1.1 Them moi thong tin cua phieu chi dinh chi tiet voi ma phieu Id_chidinh=" +
                      objChidinh.IdChidinh);
             objChidinhCtiet.IdDoituongKcb = Utility.Int16Dbnull(objLuotkham.IdDoituongKcb);
             objChidinhCtiet.IdChidinh     = Utility.Int32Dbnull(objChidinh.IdChidinh);
             objChidinhCtiet.IdKham        = Utility.Int32Dbnull(objChidinh.IdKham, -1);
             decimal ptramBHYT = Utility.DecimaltoDbnull(objLuotkham.PtramBhyt, 0);
             TinhCLS.GB_TinhPhtramBHYT(objChidinhCtiet, objLuotkham, Utility.Byte2Bool(objChidinh.Noitru), ptramBHYT);
             objChidinhCtiet.MaLuotkham = objChidinh.MaLuotkham;
             objChidinhCtiet.IdBenhnhan = objChidinh.IdBenhnhan;
             if (Utility.DecimaltoDbnull(objChidinhCtiet.SoLuong) <= 0)
             {
                 objChidinhCtiet.SoLuong = 1;
             }
             if (objChidinhCtiet.IdChitietchidinh <= 0)
             {
                 log.Info("1.2 Bat dau them moi Id_chidinh=" + objChidinh.IdChidinh + "timeprocess in : " + globalVariables.SysDate.ToString());
                 var sp = SPs.SpKcbThemmoiChitietChidinh(objChidinhCtiet.IdChitietchidinh, objChidinhCtiet.IdKham, objChidinhCtiet.IdChidinh, objChidinhCtiet.IdChidinhChuyengoi
                                                         , objChidinhCtiet.IdDichvu, objChidinhCtiet.IdChitietdichvu, objChidinhCtiet.PtramBhytGoc, objChidinhCtiet.PtramBhyt, objChidinhCtiet.GiaDanhmuc, objChidinhCtiet.MadoituongGia
                                                         , objChidinhCtiet.DonGia, objChidinhCtiet.PhuThu, objChidinhCtiet.NguoiTao, objChidinhCtiet.IdLoaichidinh, objChidinhCtiet.NgayTao, objChidinhCtiet.TrangthaiThanhtoan
                                                         , objChidinhCtiet.NgayThanhtoan, objChidinhCtiet.TrangthaiHuy, objChidinhCtiet.TuTuc, objChidinhCtiet.LoaiChietkhau, objChidinhCtiet.IdDoituongKcb
                                                         , objChidinhCtiet.IdBenhnhan, objChidinhCtiet.MaLuotkham, objChidinhCtiet.SoLuong, objChidinhCtiet.TrangThai, objChidinhCtiet.TrangthaiBhyt, objChidinhCtiet.HienthiBaocao
                                                         , objChidinhCtiet.BhytChitra, objChidinhCtiet.BnhanChitra, objChidinhCtiet.IdThanhtoan, objChidinhCtiet.IdKhoaThuchien, objChidinhCtiet.IdPhongThuchien
                                                         , objChidinhCtiet.TileChietkhau, objChidinhCtiet.TienChietkhau, objChidinhCtiet.KieuChietkhau, objChidinhCtiet.IdGoi, objChidinhCtiet.TrongGoi
                                                         , objChidinhCtiet.IdBacsiThuchien, objChidinhCtiet.NguoiThuchien, objChidinhCtiet.NgayThuchien, objChidinhCtiet.ImgPath1, objChidinhCtiet.ImgPath2, objChidinhCtiet.ImgPath3, objChidinhCtiet.ImgPath4
                                                         , objChidinhCtiet.FTPImage, objChidinhCtiet.KetQua, objChidinhCtiet.ChidinhGoidichvu, objChidinhCtiet.NguonThanhtoan, objChidinhCtiet.IpMaytao, objChidinhCtiet.TenMaytao
                                                         , objChidinhCtiet.ChitieuPhantich, objChidinhCtiet.MahoaMau, objChidinhCtiet.MauUutien, objChidinhCtiet.NgayhenTrakq, objChidinhCtiet.ThetichkhoiluongMau, objChidinhCtiet.TinhtrangMau
                                                         );
                 sp.Execute();
                 objChidinhCtiet.IdChitietchidinh = Utility.Int64Dbnull(sp.OutputValues[0]);
                 objChidinhCtiet.MahoaMau         = Utility.sDbnull(sp.OutputValues[1]);
                 log.Info("1.3 ket thuc them moi Id_chidinh=" + objChidinh.IdChidinh + "timeprocess out: " + globalVariables.SysDate.ToString());
             }
             else
             {
                 SPs.SpKcbCapnhatChitietChidinh(objChidinhCtiet.IdChitietchidinh, objChidinhCtiet.SoLuong, objChidinhCtiet.NgaySua, objChidinhCtiet.NguoiSua
                                                , objChidinhCtiet.IpMaysua, objChidinhCtiet.TenMaysua).Execute();
             }
         }
         scope.Complete();
     }
 }
Example #34
0
        void SearchData()
        {
            try
            {
                AllowChanged = false;
                objLuotkham  = null;
                ma_luotkham  = "ALL";
                KcbChidinhcl objchidinh =
                    new Select().From(KcbChidinhcl.Schema).Where(KcbChidinhcl.Columns.MaChidinh).IsEqualTo(
                        txtMaluotkham.Text).ExecuteSingle <KcbChidinhcl>();
                ma_luotkham = objchidinh.MaLuotkham;
                //if (Utility.DoTrim(txtMaluotkham.Text) != "")
                //    ma_luotkham = Utility.AutoFullPatientCode(txtMaluotkham.Text);
                //  txtMaluotkham.Text = ma_luotkham;
                objLuotkham = KcbLuotkham.FetchByID(ma_luotkham);
                if (objLuotkham == null)
                {
                    Utility.ShowMsg("Không tìm thấy dữ liệu theo mã lượt khám " + ma_luotkham + ". Mời bạn nhập lại thông tin");
                    txtMaluotkham.SelectAll();
                    txtMaluotkham.Focus();
                    return;
                }
                dsData = SPs.HisLisLaydulieuchuyensangLis(dtNgaychidinh.Value.ToString("dd/MM/yyyy"), objLuotkham.IdBenhnhan, objLuotkham.MaLuotkham).GetDataSet();
                if (dsData == null || dsData.Tables.Count <= 0)
                {
                    Utility.ShowMsg("Không tìm thấy dữ liệu chỉ định dịch vụ theo điều kiện mã lượt khám = " + ma_luotkham + ". Mời bạn nhập lại thông tin");
                    txtMaluotkham.SelectAll();
                    txtMaluotkham.Focus();
                    return;
                }

                id_benhnhan = objLuotkham.IdBenhnhan;
                ma_luotkham = objLuotkham.MaLuotkham;
                DataTable dtPatientInfor = SPs.CommonLaythongtinbenhnhantheoIdMaluotkham(id_benhnhan, ma_luotkham).GetDataSet().Tables[0];
                if (dtPatientInfor.Rows.Count > 0)
                {
                    FillPatientData(dtPatientInfor.Rows[0]);
                }
                else
                {
                    FillPatientData(null);
                }
                Hienthiphieuchidinh();
                AllowChanged = true;
            }
            catch (Exception)
            {
                ma_luotkham = "";
            }
        }
        public static void TinhPhanTramBHYT(NoitruPhanbuonggiuong objNoitruPhanbuonggiuong,KcbLuotkham objLuotkham, decimal PtramBHYT)
        {
            try
               {
             decimal  BHYT_PTRAM_TRAITUYENNOITRU = Utility.DecimaltoDbnull(THU_VIEN_CHUNG.Laygiatrithamsohethong("BHYT_PTRAM_TRAITUYENNOITRU", "0", false), 0m);
               if (Utility.Int32Dbnull(objNoitruPhanbuonggiuong.TrongGoi, 0) == 1)
               {
                   objNoitruPhanbuonggiuong.BhytChitra = 0;// Utility.DecimaltoDbnull(objNoitruPhanbuonggiuong.DonGia, 0) * PtramBHYT / 100;
                   objNoitruPhanbuonggiuong.BnhanChitra = 0;
               }
               else//Ngoài gói
               {
                   if (objNoitruPhanbuonggiuong.TuTuc == 1)
                   {
                       objNoitruPhanbuonggiuong.BhytChitra = 0;
                       objNoitruPhanbuonggiuong.BnhanChitra = Utility.DecimaltoDbnull(objNoitruPhanbuonggiuong.DonGia, 0);
                   }
                   else
                   {
                       decimal BHCT = 0m;
                       if (objLuotkham.DungTuyen == 1)
                       {
                           BHCT = Utility.DecimaltoDbnull(objNoitruPhanbuonggiuong.DonGia,0) * (Utility.DecimaltoDbnull(objLuotkham.PtramBhytGoc, 0) / 100);
                       }
                       else
                       {
                           if (objLuotkham.TrangthaiNoitru <= 0)
                               BHCT = Utility.DecimaltoDbnull(objNoitruPhanbuonggiuong.DonGia,0) * (Utility.DecimaltoDbnull(objLuotkham.PtramBhyt, 0) / 100);
                           else//Nội trú cần tính=đơn giá * % đầu thẻ * % tuyến
                               BHCT = Utility.DecimaltoDbnull(objNoitruPhanbuonggiuong.DonGia, 0) * (Utility.DecimaltoDbnull(objLuotkham.PtramBhytGoc, 0) / 100) * (BHYT_PTRAM_TRAITUYENNOITRU / 100);
                       }

                       objNoitruPhanbuonggiuong.BhytChitra = BHCT;// Utility.DecimaltoDbnull(objNoitruPhanbuonggiuong.DonGia, 0) * PtramBHYT / 100;
                       objNoitruPhanbuonggiuong.BnhanChitra = Utility.DecimaltoDbnull(objNoitruPhanbuonggiuong.DonGia, 0) -
                                               BHCT;
                   }
               }
               //if (Utility.Int32Dbnull(objNoitruPhanbuonggiuong.TuTuc) == 1 && Utility.Int32Dbnull(objNoitruPhanbuonggiuong.TrongGoi) == 1)
               //{
               //    objNoitruPhanbuonggiuong.BnhanChitra = 0;
               //    objNoitruPhanbuonggiuong.BhytChitra = 0;
               //}

               }
               catch (Exception)
               {

               // throw;
               }
        }
Example #36
0
 private void InPhieuDCT(KcbLuotkham objPatientExam)
 {
     m_dtReportPhieuThu =
         SPs.BhytLaydulieuinphieudct(objPatientExam.MaLuotkham,
                                     Utility.Int32Dbnull(objPatientExam.IdBenhnhan)).GetDataSet().Tables[
             0];
     if (m_dtReportPhieuThu.Rows.Count <= 0)
     {
         Utility.ShowMsg("Không tìm thấy bản ghi nào", "Thông báo", MessageBoxIcon.Warning);
         return;
     }
     new VNS.HIS.Classes.INPHIEU_THANHTOAN_NGOAITRU().
     INPHIEU_DONGCHITRA(m_dtReportPhieuThu, dtNgayIn.Value, "PHIẾU THU ĐỒNG CHI TRẢ");
 }
Example #37
0
        bool isValidData()
        {
            Utility.SetMsg(lblMsg, "", true);
            objLuotkham = Utility.getKcbLuotkham(objLuotkham.IdBenhnhan, objLuotkham.MaLuotkham);
            if (objLuotkham == null)
            {
                Utility.SetMsg(lblMsg, "Bạn cần chọn Bệnh nhân cần tạm ứng", true);
                return(false);
            }
            //Kiểm tra tạm ứng ngoại trú
            if (objLuotkham.TrangthaiNoitru <= 0 && THU_VIEN_CHUNG.Laygiatrithamsohethong("KCB_THANHTOAN_KICHHOAT_TAMUNG_NGOAITRU", true) == "1")
            {
                return(true);
            }
            if (Utility.Byte2Bool(objLuotkham.TthaiThopNoitru) && objLuotkham.TrangthaiNoitru == 5)
            {
                Utility.ShowMsg("Bệnh nhân đã hoàn ứng và ra viện nên bạn không thể nộp thêm tiền tạm ứng");
                return(false);
            }
            if (!THU_VIEN_CHUNG.IsBaoHiem(objLuotkham.IdLoaidoituongKcb) && !new noitru_TamungHoanung().DathanhtoanhetNgoaitru(objLuotkham.IdBenhnhan, objLuotkham.MaLuotkham))
            {
                Utility.SetMsg(lblMsg, "Bệnh nhân Dịch vụ chưa thanh toán hết tiền ngoại trú", true);
                return(false);
            }
            if (Utility.DecimaltoDbnull(txtSotien.Text) <= 0)
            {
                Utility.SetMsg(lblMsg, "Bạn cần nhập số tiền tạm ứng >0 ", true);
                txtSotien.SelectAll();
                txtSotien.Focus();
                return(false);
            }
            if (Utility.DoTrim(txtLydo.Text) == "")
            {
                Utility.SetMsg(lblMsg, "Bạn cần nhập lý do thu tiền tạm ứng ", true);
                txtLydo.SelectAll();
                txtLydo.Focus();
                return(false);
            }
            if (txtNguoithu.MyID.ToString() == "-1")
            {
                Utility.SetMsg(lblMsg, "Bạn cần nhập tên người thu tiền tạm ứng(Có thể xóa trắng và nhập phím cách để ra tất cả các nhân viên trong hệ thống)", true);
                txtNguoithu.SelectAll();
                txtNguoithu.Focus();
                return(false);
            }

            return(true);
        }
Example #38
0
        private bool IsValidData()
        {
            objLuotkham = Utility.getKcbLuotkham(objLuotkham.MaLuotkham);
            if (objLuotkham == null)
            {
                Utility.ShowMsg("Không lấy được dữ liệu lượt khám của bệnh nhân. Đề nghị bạn kiểm tra lại");
                return(false);
            }
            if (objLuotkham.TrangthaiNoitru == 0)
            {
                Utility.ShowMsg("Bệnh nhân chưa nhập viện nội trú nên bạn không thể chuyển khoa. Đề nghị bạn kiểm tra lại");
                return(false);
            }
            if (objLuotkham.TrangthaiNoitru == 4)
            {
                Utility.ShowMsg("Bệnh nhân đã được xác nhận dữ liệu thanh toán nội trú nên bạn không thể chuyển khoa");
                return(false);
            }
            if (objLuotkham.TrangthaiNoitru == 5)
            {
                Utility.ShowMsg("Bệnh nhân đã được duyệt thanh toán nội trú nên bạn không thể chuyển khoa");
                return(false);
            }
            if (Utility.Byte2Bool(objLuotkham.TthaiThanhtoannoitru) || objLuotkham.TrangthaiNoitru == 6)
            {
                Utility.ShowMsg("Bệnh nhân đã được thanh toán nội trú nên bạn không thể  chuyển khoa");
                return(false);
            }

            if (Utility.Int32Dbnull(txtKhoanoitru.MyID, -1) == -1)
            {
                Utility.ShowMsg("Bạn phải chọn khoa nội trú chuyển đến", "Thông báo", MessageBoxIcon.Warning);
                txtKhoanoitru.Focus();
                return(false);
            }
            if (Utility.Int32Dbnull(Utility.DecimaltoDbnull(txtSoluong.Text)) != THU_VIEN_CHUNG.Songay(dtNgayvao.Value, dtNgayChuyen.Value))
            {
                if (!Utility.AcceptQuestion(string.Format("Bạn có chắc chắn số ngày nằm viện trước khi chuyển là {0} thay vì {1}(Hệ thống tự động tính toán) hay không?", txtSoluong.Text, THU_VIEN_CHUNG.Songay(dtNgayvao.Value, dtNgayChuyen.Value).ToString()), "Cảnh báo", true))
                {
                    txtSoluong.Focus();
                }
                txtSoluong.SelectAll();
                return(false);
            }
            return(true);
        }
        private void SearchPatient()
        {
            try
            {
                ClearControl();
                _malankham    = "";
                _objkcbdangky = null;
                ObjBenhnhan   = null;
                ObjLuotkham   = null;
                if (_dtIcdPhu != null)
                {
                    _dtIcdPhu.Clear();
                }
                if (_mDtAssignDetail != null)
                {
                    _mDtAssignDetail.Clear();
                }
                if (_mDtPresDetail != null)
                {
                    _mDtPresDetail.Clear();
                }
                _mDtDanhsachbenhnhanthamkham =
                    _kcbThamkham.KcbLichsuKcbTimkiemBenhnhan(dtFromDate.Value, dtToDate.Value,
                                                             Utility.DoTrim(txtmaluotkham.Text),
                                                             Utility.Int32Dbnull(txtIdBenhnhan.Text, -1),
                                                             Utility.DoTrim(txtTenBN.Text), Utility.DoTrim(txtTheBHYT.Text),
                                                             Utility.Int32Dbnull(txtBacsikham.MyID, -1), _thamso);
                Utility.SetDataSourceForDataGridEx_Basic(grdList, _mDtDanhsachbenhnhanthamkham, true, true, "",
                                                         KcbDanhsachBenhnhan.Columns.TenBenhnhan);
                if (_dtIcdPhu != null && !_dtIcdPhu.Columns.Contains(DmucBenh.Columns.MaBenh))
                {
                    _dtIcdPhu.Columns.Add(DmucBenh.Columns.MaBenh, typeof(string));
                }
                if (_dtIcdPhu != null && !_dtIcdPhu.Columns.Contains(DmucBenh.Columns.TenBenh))
                {
                    _dtIcdPhu.Columns.Add(DmucBenh.Columns.TenBenh, typeof(string));
                }
                grd_ICD.DataSource = _dtIcdPhu;

                grdList.MoveFirst();
            }
            catch (Exception ex)
            {
                Utility.CatchException(ex);
            }
        }
Example #40
0
        public TPhieuXuatthuocBenhnhan CreatePhieuXuatBenhNhan(KcbDonthuoc objDonthuoc, KcbDanhsachBenhnhan objBenhnhan, KcbLuotkham objLuotkham)
        {
            TPhieuXuatthuocBenhnhan objPhieuXuatBnhan = new TPhieuXuatthuocBenhnhan();
            objPhieuXuatBnhan.IdBenhnhan = objDonthuoc.IdBenhnhan;
            objPhieuXuatBnhan.MaLuotkham = objDonthuoc.MaLuotkham;
            objPhieuXuatBnhan.NgayXacnhan = globalVariables.SysDate;
            objPhieuXuatBnhan.IdPhongChidinh = Utility.Int16Dbnull(objDonthuoc.IdPhongkham);
            objPhieuXuatBnhan.IdKhoaChidinh = Utility.Int16Dbnull(objDonthuoc.IdKhoadieutri);
            objPhieuXuatBnhan.IdBacsiKedon = Utility.Int16Dbnull(objDonthuoc.IdBacsiChidinh);
            objPhieuXuatBnhan.IdDonthuoc = Utility.Int32Dbnull(objDonthuoc.IdDonthuoc);
            objPhieuXuatBnhan.IdNhanvien = globalVariables.gv_intIDNhanvien;
            //objPhieuXuatBnhan.HienThi = 1;
            if (objLuotkham != null)
            {
                objPhieuXuatBnhan.ChanDoan = Utility.sDbnull(objLuotkham.ChanDoan);
                objPhieuXuatBnhan.MabenhChinh = Utility.sDbnull(objLuotkham.MabenhChinh);
                objPhieuXuatBnhan.IdDoituongKcb = Utility.Int16Dbnull(objLuotkham.IdDoituongKcb);
                objPhieuXuatBnhan.MaDoituongKcb = objLuotkham.MaDoituongKcb;
                objPhieuXuatBnhan.MatheBhyt = Utility.sDbnull(objLuotkham.MatheBhyt);
            }
            else//Đơn thuốc tại quầy thì objLuotkham=null;
            {
                objPhieuXuatBnhan.ChanDoan = "";
                objPhieuXuatBnhan.MabenhChinh = "";
                objPhieuXuatBnhan.IdDoituongKcb = -1;
                objPhieuXuatBnhan.MaDoituongKcb = "DV";
                objPhieuXuatBnhan.MatheBhyt = "";
            }
            objPhieuXuatBnhan.GioiTinh = objBenhnhan.GioiTinh;
            objPhieuXuatBnhan.KieuThuocvattu = objDonthuoc.KieuThuocvattu;
            objPhieuXuatBnhan.TenBenhnhan = Utility.sDbnull(objBenhnhan.TenBenhnhan);
            objPhieuXuatBnhan.TenKhongdau = Utility.sDbnull(Utility.UnSignedCharacter(objBenhnhan.TenBenhnhan));
            objPhieuXuatBnhan.DiaChi = Utility.sDbnull(objBenhnhan.DiaChi);
            objPhieuXuatBnhan.NamSinh = Utility.Int32Dbnull(objBenhnhan.NamSinh);

            objPhieuXuatBnhan.NgayKedon = objDonthuoc.NgayKedon;
            objPhieuXuatBnhan.NgayTao = globalVariables.SysDate;
            objPhieuXuatBnhan.NguoiTao = objDonthuoc.NguoiTao;//Dùng cho báo cáo kê đơn theo bác sĩ(trạng thái đã cấp phát để biết người tạo là Admin)
            objPhieuXuatBnhan.NguoiPhatthuoc = globalVariables.UserName;
            objPhieuXuatBnhan.QuayThuoc = (byte)(objDonthuoc.KieuDonthuoc == 2 ? 1 : 0);//0= Đơn thuốc thường;1= Đơn thuốc bổ sung;2=Đơn thuốc tại quầy;3=Đơn tiêm chủng
            objPhieuXuatBnhan.Noitru = objDonthuoc.Noitru;
            objPhieuXuatBnhan.LoaiPhieu = (byte?)LoaiPhieu.PhieuXuatKhoBenhNhan;

            return objPhieuXuatBnhan;
        }
Example #41
0
        /// <summary>
        /// hàm thực hiện viec tính toán giá đặc biệt cho bệnh nhân
        /// </summary>
        /// <param name="objChidinhChitiet"></param>
        /// <param name="objLuotkham"></param>
        /// <param name="paymentTypeId"></param>
        public static void PtramBHYTDacBiet(KcbChidinhclsChitiet objChidinhChitiet, KcbLuotkham objLuotkham, int paymentTypeId, ref bool bExist)
        {
            bExist = false;
            string          isDungTuyen = "DT";
            DmucDoituongkcb objectType  = DmucDoituongkcb.FetchByID(objLuotkham.IdDoituongKcb);

            if (objectType != null)
            {
                switch (objectType.MaDoituongKcb)
                {
                case "BHYT":
                    if (Utility.Int32Dbnull(objLuotkham.DungTuyen, "0") == 1)
                    {
                        isDungTuyen = "DT";
                    }
                    else
                    {
                        isDungTuyen = "TT";
                    }
                    break;

                default:
                    isDungTuyen = "KHAC";
                    break;
                }
            }
            SqlQuery sqlQuery = new Select().From(DmucBhytChitraDacbiet.Schema)
                                .Where(DmucBhytChitraDacbiet.Columns.IdDichvuChitiet).IsEqualTo(objChidinhChitiet.IdChitietchidinh)
                                .And(DmucBhytChitraDacbiet.Columns.MaLoaithanhtoan).IsEqualTo(paymentTypeId)
                                .And(DmucBhytChitraDacbiet.Columns.DungtuyenTraituyen).IsEqualTo(isDungTuyen)
                                .And(DmucBhytChitraDacbiet.Columns.MaDoituongKcb).IsEqualTo(objLuotkham.MaDoituongKcb);
            DmucBhytChitraDacbiet objDetailPtramBhyt = sqlQuery.ExecuteSingle <DmucBhytChitraDacbiet>();

            if (objDetailPtramBhyt != null)
            {
                objChidinhChitiet.IdLoaichidinh = 1;
                objChidinhChitiet.BhytChitra    = Gia_BHYT(objDetailPtramBhyt.TileGiam, Utility.DecimaltoDbnull(objChidinhChitiet.DonGia, 0));
                objChidinhChitiet.BnhanChitra   = Utility.DecimaltoDbnull(objChidinhChitiet.DonGia, 0) -
                                                  objChidinhChitiet.BhytChitra;
                objChidinhChitiet.PtramBhyt     = Utility.DecimaltoDbnull(objDetailPtramBhyt.TileGiam, 0);
                objChidinhChitiet.LoaiChietkhau = 1;
                bExist = true;
                // objChidinhChitiet.DonGia =
            }
        }
Example #42
0
 /// <summary>
 /// hàm thực hiện việc tính phàn trăm bảo hiểm
 /// </summary>
 public void TinhPtramBHYT()
 {
     try
     {
         LaySoTheBHYT();
         if (!string.IsNullOrEmpty(Laymathe_BHYT()) && Laymathe_BHYT().Length >= 15)
         {
             if ((!string.IsNullOrEmpty(GetSoBHYT)) && (!string.IsNullOrEmpty(txtNoiDKKCBBD.Text)))
             {
                 var objLuotkham = new KcbLuotkham();
                 objLuotkham.MaNoicapBhyt      = Utility.sDbnull(txtNoiphattheBHYT.Text);
                 objLuotkham.NoiDongtrusoKcbbd = Utility.sDbnull(txtNoiDongtrusoKCBBD.Text);
                 objLuotkham.MatheBhyt         = Laymathe_BHYT();
                 objLuotkham.MaDoituongBhyt    = txtMaDtuong_BHYT.Text;
                 objLuotkham.DungTuyen         = !chkTraiTuyen.Visible ? 1 : (((byte?)(chkTraiTuyen.Checked ? 0 : 1)));
                 objLuotkham.MadtuongSinhsong  = txtMaDTsinhsong.myCode;
                 objLuotkham.GiayBhyt          = Utility.Bool2byte(chkGiayBHYT.Checked);
                 objLuotkham.MaKcbbd           = Utility.sDbnull(txtNoiDKKCBBD.Text);
                 objLuotkham.IdDoituongKcb     = objDoituongKCB.IdDoituongKcb;
                 objLuotkham.MaQuyenloi        = Utility.Int32Dbnull(txtMaQuyenloi_BHYT.Text);
                 THU_VIEN_CHUNG.TinhPtramBhyt(objLuotkham);
                 txtPtramBHYT.Text   = objLuotkham.PtramBhyt.ToString();
                 txtptramDauthe.Text = objLuotkham.PtramBhytGoc.ToString();
             }
             else
             {
                 txtPtramBHYT.Text   = "0";
                 txtptramDauthe.Text = "0";
             }
         }
         else
         {
             txtPtramBHYT.Text   = "0";
             txtptramDauthe.Text = "0";
         }
     }
     catch (Exception)
     {
         txtPtramBHYT.Text   = "0";
         txtptramDauthe.Text = "0";
     }
     finally
     {
     }
 }
 public ActionResult InsertDataChiDinhCLS(KcbChidinhcl objKcbChidinhcls, KcbLuotkham objLuotkham, KcbChidinhclsChitiet[] arrAssignDetails)
 {
     try
      {
          using (var scope = new TransactionScope())
          {
              using (var sh = new SharedDbConnectionScope())
              {
                  if (objKcbChidinhcls != null)
                  {
                      if (objLuotkham == null)
                      {
                          objLuotkham = new Select().From(KcbLuotkham.Schema)
                              .Where(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(objKcbChidinhcls.MaLuotkham)
                              .And(KcbLuotkham.Columns.IdBenhnhan).IsEqualTo(
                                  Utility.Int32Dbnull(objKcbChidinhcls.IdBenhnhan)).ExecuteSingle<KcbLuotkham>();
                      }
                      if (objLuotkham != null)
                      {
                          objKcbChidinhcls.MaChidinh = THU_VIEN_CHUNG.SinhMaChidinhCLS();
                          objKcbChidinhcls.MaDoituongKcb = objLuotkham.MaDoituongKcb;
                          objKcbChidinhcls.IdLoaidoituongKcb = objLuotkham.IdLoaidoituongKcb;
                          objKcbChidinhcls.IdDoituongKcb = objLuotkham.IdDoituongKcb;
                          objKcbChidinhcls.MaKhoaChidinh = globalVariables.MA_KHOA_THIEN;
                          objKcbChidinhcls.IsNew = true;
                          objKcbChidinhcls.Save();
                          InsertAssignDetail(objKcbChidinhcls, objLuotkham, arrAssignDetails);
                      }
                      else
                      {
                          return ActionResult.Error;
                      }
                  }
              }
              scope.Complete();
              return ActionResult.Success;
          }
      }
      catch (Exception exception)
      {
          log.InfoException("Loi thong tin {0}", exception);
          return ActionResult.Error;
      }
 }
Example #44
0
        public static ActionResult CapnhatGiatheodoituong(KcbLuotkham objLuotkham)
        {
            using (var Scope = new TransactionScope())
            {
                ActionResult _ActionResult = ActionResult.Success;

                _ActionResult = CapnhatChiphiKCB(objLuotkham);
                if (_ActionResult == ActionResult.Cancel)
                    return _ActionResult;
                _ActionResult = CapnhatChiphiCLS(objLuotkham);
                if (_ActionResult == ActionResult.Cancel)
                    return _ActionResult;
                _ActionResult = CapnhatChiphiThuoc(objLuotkham);
                if (_ActionResult == ActionResult.Cancel)
                    return _ActionResult;
                Scope.Complete();
                return ActionResult.Success;
            }
        }
Example #45
0
 public static void LayThongTinGia(NoitruPhanbuonggiuong objPhanbuonggiuong, KcbLuotkham objPatientExam)
 {
     objPhanbuonggiuong.TuTuc = 0;
     SqlQuery sqlQuery = new Select().From<NoitruQheDoituongBuonggiuong>()
         .Where(NoitruQheDoituongBuonggiuong.Columns.IdGiuong).IsEqualTo(objPhanbuonggiuong.IdGiuong)
         .And(NoitruQheDoituongBuonggiuong.Columns.MaDoituongKcb).IsEqualTo(objPatientExam.MaDoituongKcb);
     NoitruQheDoituongBuonggiuong objRoomBedObjectType = sqlQuery.ExecuteSingle<NoitruQheDoituongBuonggiuong>();
     if (objRoomBedObjectType != null)
     {
         objPhanbuonggiuong.DonGia = Utility.DecimaltoDbnull(objRoomBedObjectType.DonGia);
         objPhanbuonggiuong.PhuThu = Utility.Byte2Bool(objPatientExam.DungTuyen) ? Utility.DecimaltoDbnull(objRoomBedObjectType.PhuthuDungtuyen) : Utility.DecimaltoDbnull(objRoomBedObjectType.PhuthuTraituyen);
         NoitruDmucGiuongbenh objLBed = NoitruDmucGiuongbenh.FetchByID(objPhanbuonggiuong.IdGiuong);
         {
             objPhanbuonggiuong.TuTuc = objLBed.TthaiTunguyen;
             objPhanbuonggiuong.TenHienthi = Utility.sDbnull(objLBed.TenGiuong);
             objPhanbuonggiuong.GiaGoc = Utility.DecimaltoDbnull(objLBed.DonGia);
             objPhanbuonggiuong.KieuThue = "GIUONG";
         }
     }
     else
     {
         NoitruDmucGiuongbenh objLBed = NoitruDmucGiuongbenh.FetchByID(objPhanbuonggiuong.IdGiuong);
         if (objLBed != null)
         {
             objPhanbuonggiuong.TenHienthi = Utility.sDbnull(objLBed.TenGiuong);
             objPhanbuonggiuong.DonGia = Utility.DecimaltoDbnull(objLBed.DonGia);
             objPhanbuonggiuong.PhuThu = Utility.DecimaltoDbnull(0);
             objPhanbuonggiuong.TuTuc = objLBed.TthaiTunguyen;
             objPhanbuonggiuong.KieuThue = "GIUONG";
             objPhanbuonggiuong.GiaGoc = Utility.DecimaltoDbnull(objLBed.DonGia);
             if (!THU_VIEN_CHUNG.IsBaoHiem( objPatientExam.IdLoaidoituongKcb))
             {
                 objPhanbuonggiuong.TuTuc = 0;
             }
         }
     }
         objPhanbuonggiuong.TrongGoi = 0;// Utility.ByteDbnull(objPhanbuonggiuong.TrongGoi);
     if (objPhanbuonggiuong.IdGiuong > 0 || objPhanbuonggiuong.IdBuong > 0)//Có giường thì mới tính
         TinhToanPtramBHYT.TinhPhanTramBHYT(objPhanbuonggiuong,objPatientExam, Utility.DecimaltoDbnull(objPatientExam.PtramBhytGoc));
 }
Example #46
0
 /// <summary>
 /// hàm thực hiện việc tính phàn trăm bảo hiểm y tế cho cận lâm sàng
 /// </summary>
 /// <param name="objPatientExam"></param>
 public static void TinhPtramBHYTForCLS(KcbLuotkham objPatientExam)
 {
     SqlQuery sqlQuery = new Select().From(KcbChidinhclsChitiet.Schema)
        .Where(KcbChidinhclsChitiet.Columns.IdChidinh).In(
            new Select(KcbChidinhcl.Columns.IdChidinh).From(KcbChidinhcl.Schema).Where(
                KcbChidinhcl.Columns.MaLuotkham).IsEqualTo(
                    objPatientExam.MaLuotkham).And(KcbChidinhcl.Columns.IdBenhnhan).IsEqualTo(
                        objPatientExam.IdBenhnhan).And(KcbChidinhcl.Columns.Noitru).IsEqualTo(1));
        KcbChidinhclsChitietCollection objAssignDetailCollection = sqlQuery.ExecuteAsCollection<KcbChidinhclsChitietCollection>();
        decimal PtramBHYT = Utility.DecimaltoDbnull(objPatientExam.PtramBhyt);
        foreach (KcbChidinhclsChitiet objAssignDetail in objAssignDetailCollection)
        {
        TinhCLS.GB_TinhPhtramBHYT(objAssignDetail, objPatientExam, PtramBHYT);
        new Update(KcbChidinhclsChitiet.Schema)
            .Set(KcbChidinhclsChitiet.Columns.NgaySua).EqualTo(globalVariables.SysDate)
            .Set(KcbChidinhclsChitiet.Columns.NguoiSua).EqualTo(globalVariables.UserName)
            .Set(KcbChidinhclsChitiet.Columns.PtramBhyt).EqualTo(objAssignDetail.PtramBhyt)
            .Set(KcbChidinhclsChitiet.Columns.BnhanChitra).EqualTo(objAssignDetail.BnhanChitra)
            .Set(KcbChidinhclsChitiet.Columns.BhytChitra).EqualTo(objAssignDetail.BhytChitra)
            .Set(KcbChidinhclsChitiet.Columns.PhuThu).EqualTo(objAssignDetail.PhuThu)
            .Where(KcbChidinhclsChitiet.Columns.IdChitietchidinh).IsEqualTo(objAssignDetail.IdChitietchidinh).Execute();
        }
 }
Example #47
0
        private void UpdatePatient()
        {
            KcbDanhsachBenhnhan objBenhnhan = CreatePatientInfo();
            objLuotkham = CreatePatientExam();
            KcbDangkyKcb objRegExam = CreateNewRegExam();
            ActionResult actionResult = _KCB_DANGKY.UpdateLanKham(objBenhnhan, objLuotkham, objRegExam,
                                                                         Utility.Int32Dbnull(cboKieuKham.Value, -1),PtramBhytCu,PtramBhytGocCu);
            // THEM_PHI_DVU_KYC(objLuotkham);
            switch (actionResult)
            {
                case ActionResult.Success:

                    //gọi lại nếu thay đổi địa chỉ
                    m_blnHasJustInsert = false;
                    PtramBhytCu = Utility.DecimaltoDbnull(txtPtramBHYT.Text, 0);
                    PtramBhytGocCu = Utility.DecimaltoDbnull(txtptramDauthe.Text, 0);
                    setMsg(uiStatusBar1.Panels["MSG"], "Bạn sửa thông tin Bệnh nhân thành công", false);
                    LaydanhsachdangkyKCB();
                    UpdateBNVaoTrenLuoi();
                    if (_OnActionSuccess != null) _OnActionSuccess();
                    if (objRegExam != null)
                    {
                        Utility.GotoNewRowJanus(grdRegExam, KcbDangkyKcb.Columns.IdKham, Utility.sDbnull(objRegExam.IdKham));
                        if (PropertyLib._MayInProperties.InPhieuKCBsaukhiluu)
                        {
                            InPhieu();
                        }
                        else
                        {
                            cmdInPhieuKham.Focus();
                        }
                    }
                    if (string.IsNullOrEmpty(objLuotkham.MatheBhyt))
                    {
                        dtInsFromDate.Value = globalVariables.SysDate;
                        dtInsToDate.Value = globalVariables.SysDate;
                        txtPtramBHYT.Text = "";
                        txtptramDauthe.Text = "";
                        txtMaDtuong_BHYT.Clear();
                        txtMaQuyenloi_BHYT.Clear();
                        txtNoiDongtrusoKCBBD.Clear();
                        txtOthu4.Clear();
                        txtOthu5.Clear();
                        txtOthu6.Clear();
                        chkTraiTuyen.Checked = false;
                        lblTuyenBHYT.Text = chkTraiTuyen.Checked ? "TRÁI TUYẾN" : "ĐÚNG TUYẾN";
                        chkChuyenVien.Checked = false;
                        txtNoiphattheBHYT.Clear();
                        txtNoiDKKCBBD.Clear();
                    }
                    LoadThongTinChoKham();
                    Utility.GotoNewRowJanus(grdList, KcbLuotkham.Columns.MaLuotkham, txtMaLankham.Text);
                    m_blnCancel = false;

                    break;
                case ActionResult.Error:
                    setMsg(uiStatusBar1.Panels["MSG"], "Bạn thực hiện sửa thông tin không thành công !", true);
                    break;
                case ActionResult.Cancel:
                    Utility.ShowMsg(string.Format( "Bệnh nhân này đã thanh toán một số dịch vụ nên bạn không được phép chuyển đối tượng hoặc thay đổi phần trăm BHYT\nPhần trăm cũ {0} % - Phần trăm mới {1} %",PtramBhytCu.ToString(),txtPtramBHYT.Text),"Cảnh báo");
                    break;
            }
        }
Example #48
0
        /// <summary>
        /// hàm thực hiện việc tính phàn trăm bảo hiểm
        /// </summary>
        private void TinhPtramBHYT()
        {
            try
            {
                LaySoTheBHYT();
                if (!string.IsNullOrEmpty(Laymathe_BHYT()) && Laymathe_BHYT().Length >= 15)
                {
                    if ((!string.IsNullOrEmpty(GetSoBHYT)) && (!string.IsNullOrEmpty(txtNoiDKKCBBD.Text)))
                    {
                        var objLuotkham = new KcbLuotkham();
                        objLuotkham.MaNoicapBhyt = Utility.sDbnull(txtNoiphattheBHYT.Text);
                        objLuotkham.NoiDongtrusoKcbbd = Utility.sDbnull(txtNoiDongtrusoKCBBD.Text);
                        objLuotkham.MatheBhyt = Laymathe_BHYT();
                        objLuotkham.MaDoituongBhyt = txtMaDtuong_BHYT.Text;
                        objLuotkham.DungTuyen = !chkTraiTuyen.Visible ? 1 : (((byte?)(chkTraiTuyen.Checked ? 0 : 1)));
                        objLuotkham.MadtuongSinhsong = txtMaDTsinhsong.myCode;
                        objLuotkham.GiayBhyt = Utility.Bool2byte(chkGiayBHYT.Checked);
                        objLuotkham.MaKcbbd = Utility.sDbnull(txtNoiDKKCBBD.Text);
                        objLuotkham.IdDoituongKcb = _IdDoituongKcb;
                        objLuotkham.MaQuyenloi = Utility.Int32Dbnull(txtMaQuyenloi_BHYT.Text);
                        THU_VIEN_CHUNG.TinhPtramBHYT(objLuotkham);
                        txtPtramBHYT.Text = objLuotkham.PtramBhyt.ToString();
                        txtptramDauthe.Text = objLuotkham.PtramBhytGoc.ToString();
                    }
                    else
                    {
                        txtPtramBHYT.Text = "0";
                        txtptramDauthe.Text = "0";
                    }
                }
                else
                {
                    txtPtramBHYT.Text = "0";
                    txtptramDauthe.Text = "0";
                }
            }
            catch (Exception)
            {
                txtPtramBHYT.Text = "0";
                txtptramDauthe.Text = "0";
            }
            finally
            {

            }
        }
Example #49
0
        private void THEM_PHI_DVU_KYC(KcbLuotkham objLuotkham)
        {
            //DmucDichvukcb lexam =
            //    DmucDichvukcb.FetchByID(Utility.Int32Dbnull(cboKieuKham.Value));
            //if (lexam != null)
            //{
            //    if (Utility.Int32Dbnull(lexam.IdPhikemtheo, -1) > 0)
            //    {
            //        SqlQuery sql = new Select().From(KcbChidinhcl.Schema).Where(KcbChidinhcl.Columns.MaLuotkham).
            //            IsEqualTo(objLuotkham.MaLuotkham)
            //            .And(KcbChidinhcl.Columns.IdBenhnhan).IsEqualTo(objLuotkham.IdBenhnhan).And(
            //                KcbChidinhcl.Columns.IsPHIDvuKtheo).IsEqualTo(1);
            //        if (sql.GetRecordCount() > 0)
            //        {
            //            return;
            //        }
            //        int IdDv = -1;
            //        string[] Ma_UuTien = globalVariables.MA_UuTien.Split(',');
            //        if (globalVariables.MA_KHOA_THIEN != "KYC")
            //        {
            //            if (THU_VIEN_CHUNG.IsNgoaiGio())
            //            {
            //                IdDv = Utility.Int32Dbnull(lexam.IdPhiKtheoNgio, -1);
            //            }
            //            else
            //            {
            //                if (!Ma_UuTien.Contains(Utility.sDbnull(txtMaQuyenloi_BHYT.Text)))
            //                {
            //                    IdDv = Utility.Int32Dbnull(lexam.IdPhiKtheo, -1);
            //                }
            //                else
            //                {
            //                    IdDv = -1;
            //                }
            //            }
            //        }
            //        else
            //        {
            //            IdDv = Utility.Int32Dbnull(lexam.IdPhiKtheo, -1);
            //        }
            //        LServiceDetail lServiceDetail = LServiceDetail.FetchByID(IdDv);
            //        if (lServiceDetail != null)
            //        {
            //            var objAssignInfo = new KcbChidinhcl();
            //            objAssignInfo.IdKham = -1;
            //            objAssignInfo.MaLuotkham = Utility.sDbnull(objLuotkham.MaLuotkham, "");
            //            objAssignInfo.IdBenhnhan = Utility.Int32Dbnull(objLuotkham.IdBenhnhan, "");
            //            objAssignInfo.ServiceId = -1;
            //            objAssignInfo.ServiceTypeId = -1;
            //            objAssignInfo.RegDate = globalVariables.SysDate;
            //            objAssignInfo.DepartmentId = globalVariables.DepartmentID;
            //            objAssignInfo.TrangthaiThanhtoan = 0;
            //            objAssignInfo.CreatedBy = globalVariables.UserName;
            //            objAssignInfo.NgayTao = globalVariables.SysDate;
            //            objAssignInfo.Actived = 0;
            //            objAssignInfo.MaKhoaThien = globalVariables.MA_KHOA_THIEN;
            //            objAssignInfo.NoiTru = 0;
            //            objAssignInfoIdDoituongKcb = _IdDoituongKcb;
            //            objAssignInfo.DiagPerson = globalVariables.gv_StaffID;
            //            objAssignInfo.DepartmentId = globalVariables.DepartmentID;
            //            objAssignInfo.IsPHIDvuKtheo = 1;
            //            objAssignInfo.IsNew = true;
            //            objAssignInfo.Save();

            //            var objAssignDetail = new TAssignDetail();
            //            objAssignDetail.IdKham = -1;
            //            objAssignDetail.AssignId = objAssignInfo.AssignId;
            //            objAssignDetail.ServiceId = lServiceDetail.ServiceId;
            //            objAssignDetail.ServiceDetailId = lServiceDetail.ServiceDetailId;
            //            objAssignDetail.DiscountPrice = 0;
            //            objAssignDetail.PtramBhyt = 0;
            //            objAssignDetail.DiscountType = 0;
            //            objAssignDetail.OriginPrice = Utility.DecimaltoDbnull(lServiceDetail.Price, 0);
            //            objAssignDetail.DiscountPrice = Utility.DecimaltoDbnull(lServiceDetail.Price, 0);
            //            objAssignDetail.SurchargePrice = 0;
            //            objAssignDetail.UserId = globalVariables.UserName;
            //            objAssignDetail.AssignTypeId = 0;
            //            objAssignDetail.NgayTiepdon = globalVariables.SysDate;
            //            objAssignDetail.TrangthaiThanhtoan = 0;
            //            objAssignDetail.IsPayment = (byte?) (Utility.sDbnull(objLuotkham.MaDoituongKcb) == "DV" ? 0 : 1);
            //            objAssignDetail.Quantity = 1;
            //            objAssignDetail.AssignDetailStatus = 0;
            //            objAssignDetail.SDesc = "Chi phí đi kèm thêm phòng khám khi đăng ký khám bệnh theo yêu cầu";
            //            objAssignDetail.BhytStatus = 0;
            //            objAssignDetail.DisplayOnReport = 1;
            //            objAssignDetail.GiaBhytCt = 0;
            //            objAssignDetail.GiaBnct = Utility.DecimaltoDbnull(lServiceDetail.Price, 0);
            //            objAssignDetail.IpMayTao = globalVariables.IpAddress;
            //            objAssignDetail.IpMacTao = globalVariables.IpMacAddress;
            //            objAssignDetail.ChoPhepIn = 0;
            //            objAssignDetail.AssignDetailStatus = 0;
            //            objAssignDetail.DiagPerson = globalVariables.gv_StaffID;
            //            objAssignDetailIdDoituongKcb = _IdDoituongKcb;
            //            objAssignDetail.Stt = 1;
            //            objAssignDetail.IsNew = true;
            //            objAssignDetail.Save();
            //        }
            //    }
            //}
        }
Example #50
0
        private void ThemLanKham()
        {
            KcbDanhsachBenhnhan objBenhnhan = CreatePatientInfo();
            objLuotkham = CreatePatientExam();
            KcbDangkyKcb objRegExam = CreateNewRegExam();
            ActionResult actionResult = _KCB_DANGKY.ThemmoiLuotkham(objBenhnhan, objLuotkham, objRegExam,
                                                                             Utility.Int32Dbnull(cboKieuKham.Value, -1));

            switch (actionResult)
            {
                case ActionResult.Success:

                    PtramBhytCu = Utility.DecimaltoDbnull(txtPtramBHYT.Text, 0);
                    PtramBhytGocCu = Utility.DecimaltoDbnull(txtptramDauthe.Text, 0);
                    txtMaLankham.Text = Utility.sDbnull(objLuotkham.MaLuotkham);
                    txtMaBN.Text = Utility.sDbnull(objLuotkham.IdBenhnhan);
                    UpdateStatusQMS();
                    m_blnHasJustInsert = true;
                    m_enAction = action.Update;
                    LaydanhsachdangkyKCB();
                    setMsg(uiStatusBar1.Panels["MSG"], "Bạn thêm mới lần khám bệnh nhân thành công", false);
                    ThemMoiLanKhamVaoLuoi();
                    if (_OnActionSuccess != null) _OnActionSuccess();
                    if (objRegExam != null)
                    {
                        Utility.GotoNewRowJanus(grdRegExam, KcbDangkyKcb.Columns.IdKham, Utility.sDbnull(objRegExam.IdKham));
                        if (PropertyLib._MayInProperties.InPhieuKCBsaukhiluu)
                        {
                            InPhieu();
                        }
                        else
                        {
                            cmdInPhieuKham.Focus();
                        }
                    }
                    LoadThongTinChoKham();
                    Utility.GotoNewRowJanus(grdList, KcbLuotkham.Columns.MaLuotkham, txtMaLankham.Text);
                    cmdThemMoiBN_Click(cmdThemMoiBN, new EventArgs());
                    m_blnCancel = false;
                    break;
                case ActionResult.Error:
                    setMsg(uiStatusBar1.Panels["MSG"], "Lỗi trong quá trình thêm lần khám !", true);
                    cmdSave.Focus();
                    break;
            }
        }
Example #51
0
        void Thanhtoan(bool askbeforepayment)
        {
            try
            {
                if (!Utility.isValidGrid(grdRegExam)) return;
                int IdKham = Utility.Int32Dbnull(grdRegExam.GetValue(KcbDangkyKcb.Columns.IdKham));
                SqlQuery sqlQuery = new Select().From(KcbDangkyKcb.Schema)
                    .Where(KcbDangkyKcb.Columns.IdKham).IsEqualTo(IdKham)
                    .And(KcbDangkyKcb.Columns.TrangthaiThanhtoan).IsEqualTo(1);
                if (sqlQuery.GetRecordCount() > 0)
                {
                    Utility.ShowMsg("Bản ghi này đã thanh toán. Mời bạn xem lại", "Thông báo", MessageBoxIcon.Information);
                    return;
                }
                if (PropertyLib._KCBProperties.Hoitruockhithanhtoan)
                    if (askbeforepayment)
                        if (!Utility.AcceptQuestion("Bạn có muốn thực hiện việc thanh toán khám bệnh cho bệnh nhân không ?",
                                                   "Thông báo", true))
                            return;

                int Payment_Id = -1;
                if (objLuotkham == null)
                    objLuotkham = CreatePatientExam();
                if (Utility.Int32Dbnull(objLuotkham.TrangthaiNoitru, 0) >= Utility.Int32Dbnull(THU_VIEN_CHUNG.Laygiatrithamsohethong("KCB_THANHTOAN_CHAN_THANHTOANNGOAITRU", "2", false), 2))
                {
                    Utility.ShowMsg("Bệnh nhân này đã ở trạng thái nội trú nên hệ thống không cho phép hủy thanh toán ngoại trú nữa");
                    return;
                }
                KcbThanhtoan objPayment = CreatePayment();
                List<int> lstRegID = new List<int>();
                decimal TTBN_Chitrathucsu = 0;
                ActionResult actionResult = new KCB_THANHTOAN().Payment4SelectedItems(objPayment, objLuotkham, CreatePaymmentDetail(ref lstRegID).ToList<KcbThanhtoanChitiet>(),
                                                   ref Payment_Id, -1, false, ref TTBN_Chitrathucsu);

                switch (actionResult)
                {
                    case ActionResult.Success:
                        if (objPayment.IdThanhtoan != Payment_Id)
                        {
                            Payment_Id = Utility.Int32Dbnull(objPayment.IdThanhtoan);
                        }

                        foreach (DataRow _row in m_dataDataRegExam.Rows)
                        {
                            if (lstRegID.Contains(Utility.Int32Dbnull(_row[KcbDangkyKcb.Columns.IdKham], -1)))
                            {
                                _row["ten_trangthai_thanhtoan"] = "Đã thanh toán";
                                _row[KcbDangkyKcb.Columns.IdThanhtoan] = Payment_Id;
                                _row[KcbDangkyKcb.Columns.TrangthaiThanhtoan] = 1;
                            }
                        }
                        m_dataDataRegExam.AcceptChanges();
                        Payment_Id = Utility.Int32Dbnull(objPayment.IdThanhtoan);
                        if (PropertyLib._MayInProperties.TudonginhoadonSaukhiThanhtoan && TTBN_Chitrathucsu>0)
                        {
                            int KCB_THANHTOAN_KIEUINHOADON = Utility.Int32Dbnull(THU_VIEN_CHUNG.Laygiatrithamsohethong("KCB_THANHTOAN_KIEUINHOADON", "1", false));
                            if (KCB_THANHTOAN_KIEUINHOADON == 1 || KCB_THANHTOAN_KIEUINHOADON == 3)
                                InHoadon(Payment_Id);
                            if (KCB_THANHTOAN_KIEUINHOADON == 2 || KCB_THANHTOAN_KIEUINHOADON == 3)
                                new INPHIEU_THANHTOAN_NGOAITRU().InBienlai(false, Payment_Id, objLuotkham);
                        }
                        break;
                    case ActionResult.Error:
                        Utility.ShowMsg("Lỗi trong quá trình lưu thông tin ", "Thông báo");
                        break;
                }
            }
            catch
            {
            }
            finally
            {
                ModifyButtonCommandRegExam();
            }
        }
Example #52
0
        private void LoadThongtinBenhnhan()
        {
            PtramBhytCu = 0m;
            PtramBhytGocCu = 0m;
            AllowTextChanged = false;
            KcbDanhsachBenhnhan objBenhnhan = KcbDanhsachBenhnhan.FetchByID(txtMaBN.Text);
            if (objBenhnhan != null)
            {
                txtTEN_BN.Text = Utility.sDbnull(objBenhnhan.TenBenhnhan);
                txtNamSinh.Text = Utility.sDbnull(objBenhnhan.NamSinh);
                txtSoDT.Text = Utility.sDbnull(objBenhnhan.DienThoai);
                txtDiachi_bhyt._Text = Utility.sDbnull(objBenhnhan.DiachiBhyt);
                txtDiachi._Text = Utility.sDbnull(objBenhnhan.DiaChi);
                if (objBenhnhan.NgaySinh != null) dtpBOD.Value = objBenhnhan.NgaySinh.Value;
                else dtpBOD.Value = new DateTime((int)objBenhnhan.NamSinh, 1, 1);
                txtNamSinh.Text = Utility.sDbnull(objBenhnhan.NamSinh);
                txtTuoi.Text = Utility.sDbnull(globalVariables.SysDate.Year - Utility.Int32Dbnull(objBenhnhan.NamSinh));
                txtNgheNghiep._Text = Utility.sDbnull(objBenhnhan.NgheNghiep);
                cboPatientSex.SelectedIndex =Utility.GetSelectedIndex(cboPatientSex, Utility.sDbnull(objBenhnhan.IdGioitinh));
                if(Utility.Int32Dbnull(objBenhnhan.DanToc)>0)
                txtDantoc._Text = objBenhnhan.DanToc;
                txtEmail.Text = Utility.sDbnull(objBenhnhan.Email);
                txtCMT.Text = Utility.sDbnull(objBenhnhan.Cmt);

            }
             objLuotkham = new Select().From(KcbLuotkham.Schema)
                .Where(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(txtMaLankham.Text)
                .And(KcbLuotkham.Columns.IdBenhnhan).IsEqualTo(Utility.Int32Dbnull(txtMaBN.Text, -1)).ExecuteSingle
                <KcbLuotkham>();
            if (objLuotkham != null)
            {
                m_strMaluotkham = objLuotkham.MaLuotkham;

                txtSolankham.Text = Utility.sDbnull(objLuotkham.SolanKham);
                _IdDoituongKcb = objLuotkham.IdDoituongKcb;
                dtpInputDate.Value = objLuotkham.NgayTiepdon;
                dtCreateDate.Value = objLuotkham.NgayTiepdon;
                chkCapCuu.Checked = Utility.Int32Dbnull(objLuotkham.TrangthaiCapcuu, 0) == 1;
                chkTraiTuyen.Checked = Utility.Int32Dbnull(objLuotkham.DungTuyen, 0) == 0;
                lblTuyenBHYT.Text = chkTraiTuyen.Checked ? "TRÁI TUYẾN" : "ĐÚNG TUYẾN";
                txtEmail.Text = objLuotkham.Email;
                txtNoigioithieu.Text = objLuotkham.NoiGioithieu;
                txtLoaiBN.SetCode(objLuotkham.NhomBenhnhan);
                _MaDoituongKcb = Utility.sDbnull( objLuotkham.MaDoituongKcb);
                objDoituongKCB = new Select().From(DmucDoituongkcb.Schema).Where(DmucDoituongkcb.MaDoituongKcbColumn).IsEqualTo(_MaDoituongKcb).ExecuteSingle<DmucDoituongkcb>();

                ChangeObjectRegion();
                PtramBhytCu = Utility.DecimaltoDbnull(objLuotkham.PtramBhyt, 0);
                PtramBhytGocCu = Utility.DecimaltoDbnull(objLuotkham.PtramBhytGoc, 0);
                _IdDoituongKcb = objDoituongKCB.IdDoituongKcb;
                _TenDoituongKcb = objDoituongKCB.TenDoituongKcb;
                cboDoituongKCB.SelectedIndex = Utility.GetSelectedIndex(cboDoituongKCB, _MaDoituongKcb);
                chkChuyenVien.Checked = Utility.Int32Dbnull(objLuotkham.TthaiChuyenden, 0) == 1;
                txtNoichuyenden.SetId(Utility.Int32Dbnull(objLuotkham.IdBenhvienDen, -1));
                if (!string.IsNullOrEmpty(objLuotkham.MatheBhyt))//Thông tin BHYT
                {
                    txtTrieuChungBD._Text = Utility.sDbnull(objLuotkham.TrieuChung);
                    if (!string.IsNullOrEmpty(Utility.sDbnull(objLuotkham.NgaybatdauBhyt)))
                        dtInsFromDate.Value = Convert.ToDateTime(objLuotkham.NgaybatdauBhyt);
                    if (!string.IsNullOrEmpty(Utility.sDbnull(objLuotkham.NgayketthucBhyt)))
                        dtInsToDate.Value = Convert.ToDateTime(objLuotkham.NgayketthucBhyt);
                    txtPtramBHYT.Text = Utility.sDbnull(objLuotkham.PtramBhyt,"0");
                    txtptramDauthe.Text = Utility.sDbnull(objLuotkham.PtramBhytGoc, "0");
                    //HS7010340000005
                    txtMaDtuong_BHYT.Text = Utility.sDbnull(objLuotkham.MaDoituongBhyt);

                    txtMaQuyenloi_BHYT.Text = Utility.sDbnull(objLuotkham.MaQuyenloi);
                    txtNoiDongtrusoKCBBD.Text = Utility.sDbnull(objLuotkham.NoiDongtrusoKcbbd);
                    txtOthu4.Text = Utility.sDbnull(objLuotkham.MatheBhyt).Substring(5, 2);
                    txtOthu5.Text = Utility.sDbnull(objLuotkham.MatheBhyt).Substring(7, 3);
                    txtOthu6.Text = Utility.sDbnull(objLuotkham.MatheBhyt).Substring(10, 5);

                    txtMaDTsinhsong.SetCode(objLuotkham.MadtuongSinhsong);
                    chkGiayBHYT.Checked = Utility.Byte2Bool(objLuotkham.GiayBhyt);

                    txtNoiphattheBHYT.Text = Utility.sDbnull(objLuotkham.MaNoicapBhyt);
                    txtNoiDKKCBBD.Text = Utility.sDbnull(objLuotkham.MaKcbbd);
                    pnlBHYT.Enabled = true;
                }
                else
                {
                    XoathongtinBHYT(true);
                }
            }
            else
            {
            }
            chkChuyenVien_CheckedChanged(chkChuyenVien, new EventArgs());
        }
Example #53
0
 private void InphieuKham()
 {
     int reg_id = GetrealRegID();
     KcbDangkyKcb objRegExam = KcbDangkyKcb.FetchByID(reg_id);
     if (objRegExam != null)
     {
         new Update(KcbDangkyKcb.Schema)
             .Set(KcbDangkyKcb.Columns.TrangthaiIn).EqualTo(1)
             .Set(KcbDangkyKcb.Columns.NgaySua).EqualTo(globalVariables.SysDate)
             .Set(KcbDangkyKcb.Columns.NguoiSua).EqualTo(globalVariables.UserName)
             .Where(KcbDangkyKcb.Columns.IdKham).IsEqualTo(objRegExam.IdKham).Execute();
         IEnumerable<GridEXRow> query = from kham in grdRegExam.GetDataRows()
                                        where
                                            kham.RowType == RowType.Record &&
                                            Utility.Int32Dbnull(kham.Cells[KcbDangkyKcb.Columns.IdKham].Value, -1) ==
                                            Utility.Int32Dbnull(objRegExam.IdKham)
                                        select kham;
         if (query.Count() > 0)
         {
             GridEXRow gridExRow = query.FirstOrDefault();
             gridExRow.BeginEdit();
             gridExRow.Cells[KcbDangkyKcb.Columns.TrangthaiIn].Value = 1;
             gridExRow.EndEdit();
             grdRegExam.UpdateData();
         }
         DataTable v_dtData = _KCB_DANGKY.LayThongtinInphieuKCB(reg_id);
         Utility.CreateBarcodeData(ref v_dtData, Utility.sDbnull(grdRegExam.GetValue(KcbDangkyKcb.Columns.MaLuotkham)));
         v_dtData.AcceptChanges();
         if (v_dtData.Rows.Count <= 0)
         {
             Utility.ShowMsg("Không tìm thấy bản ghi nào", "Thông báo");
             return;
         }
         if (objLuotkham == null)
             objLuotkham = CreatePatientExam();
         if (objLuotkham != null)
             KCB_INPHIEU.INPHIEU_KHAM(Utility.sDbnull(objLuotkham.MaDoituongKcb), v_dtData,
                                           "PHIẾU KHÁM BỆNH", PropertyLib._MayInProperties.CoGiayInPhieuKCB == Papersize.A5 ? "A5" : "A4");
     }
 }
Example #54
0
        private void HuyThanhtoan()
        {
            try
            {
                string ma_lydohuy = "";
                if (!Utility.isValidGrid(grdRegExam)) return;

                if (objLuotkham == null)
                {
                    objLuotkham = CreatePatientExam();
                }
                if (objLuotkham == null)
                {
                    Utility.ShowMsg("Không lấy được thông tin bệnh nhân dựa vào dữ liệu trên lưới danh sách bệnh nhân. Liên hệ 0915 150148 để được hỗ trợ");
                    return;
                }
                if (Utility.Int32Dbnull( objLuotkham.TrangthaiNoitru,0) >= Utility.Int32Dbnull(THU_VIEN_CHUNG.Laygiatrithamsohethong("KCB_THANHTOAN_CHAN_THANHTOANNGOAITRU", "2", false), 2))
                {
                    Utility.ShowMsg("Bệnh nhân này đã ở trạng thái nội trú nên hệ thống không cho phép hủy thanh toán ngoại trú nữa");
                    return;
                }
                //if (PropertyLib._ThanhtoanProperties.Hoitruockhihuythanhtoan)
                //    if (!Utility.AcceptQuestion("Bạn có muốn thực hiện việc hủy thanh toán cho dịch vụ KCB đang chọn không ?",
                //                               "Thông báo", true))
                //        return;

                int v_Payment_ID = Utility.Int32Dbnull(grdRegExam.CurrentRow.Cells["Id_thanhtoan"].Value, -1);
                if (v_Payment_ID != -1)
                {
                    List<int> lstRegID = GetIDKham();
                    if (PropertyLib._ThanhtoanProperties.Hienthihuythanhtoan)
                    {
                        frm_HuyThanhtoan frm = new frm_HuyThanhtoan();
                        frm.objLuotkham = objLuotkham;
                        frm.v_Payment_Id = v_Payment_ID;
                        frm.Chuathanhtoan = 0;
                        frm.ShowCancel = true;
                        frm.ShowDialog();
                        if (!frm.m_blnCancel)
                        {
                            foreach (DataRow _row in m_dataDataRegExam.Rows)
                            {
                                if (lstRegID.Contains(Utility.Int32Dbnull(_row[KcbDangkyKcb.Columns.IdKham], -1)))
                                {
                                    _row["ten_trangthai_thanhtoan"] = "Chưa thanh toán";
                                    _row[KcbDangkyKcb.Columns.IdThanhtoan] = -1;
                                    _row[KcbDangkyKcb.Columns.TrangthaiThanhtoan] = 0;
                                }
                            }
                        }
                    }
                    else
                    {
                        if (THU_VIEN_CHUNG.Laygiatrithamsohethong("KCB_THANHTOAN_BATNHAPLYDO_HUYTHANHTOAN", "1", false) == "1")
                        {
                            frm_Chondanhmucdungchung _Nhaplydohuythanhtoan = new frm_Chondanhmucdungchung("LYDOHUYTHANHTOAN", "Hủy thanh toán tiền Bệnh nhân", "Nhập lý do hủy thanh toán trước khi thực hiện...", "Lý do hủy thanh toán");
                            _Nhaplydohuythanhtoan.ShowDialog();
                            if (_Nhaplydohuythanhtoan.m_blnCancel) return;
                            ma_lydohuy = _Nhaplydohuythanhtoan.ma;
                        }
                        bool HUYTHANHTOAN_HUYBIENLAI = THU_VIEN_CHUNG.Laygiatrithamsohethong("HUYTHANHTOAN_HUYBIENLAI", "1", true) == "1";
                        ActionResult actionResult = new KCB_THANHTOAN().HuyThanhtoan(v_Payment_ID, objLuotkham, ma_lydohuy, Utility.Int32Dbnull(grdRegExam.CurrentRow.Cells[KcbThanhtoan.Columns.IdHdonLog], -1), HUYTHANHTOAN_HUYBIENLAI);
                        switch (actionResult)
                        {
                            case ActionResult.Success:
                                foreach (DataRow _row in m_dataDataRegExam.Rows)
                                {
                                    if (lstRegID.Contains(Utility.Int32Dbnull(_row[KcbDangkyKcb.Columns.IdKham], -1)))
                                    {
                                        _row["ten_trangthai_thanhtoan"] = "Chưa thanh toán";
                                        _row[KcbDangkyKcb.Columns.IdThanhtoan] = -1;
                                        _row[KcbDangkyKcb.Columns.TrangthaiThanhtoan] = 0;
                                    }
                                }
                                break;
                            case ActionResult.ExistedRecord:
                                break;
                            case ActionResult.Error:
                                Utility.ShowMsg("Lỗi trong quá trình hủy thông tin thanh toán", "Thông báo", MessageBoxIcon.Error);
                                break;
                            case ActionResult.UNKNOW:
                                Utility.ShowMsg("Lỗi không xác định", "Thông báo", MessageBoxIcon.Error);
                                break;
                            case ActionResult.Cancel:
                                break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.ShowMsg("Lỗi khi hủy thanh toán", "Thông báo", MessageBoxIcon.Error);
            }
            finally
            {
                ModifyButtonCommandRegExam();
            }
        }
Example #55
0
        // private  b_QMSStop=false;
        /// <summary>
        /// hàm thực hiện việc lấy thông tin của phần dữ liệu
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frm_KCB_DANGKY_Load(object sender, EventArgs e)
        {
            try
            {
                AllowTextChanged = false;
                b_HasLoaded = false;
                dtInsFromDate.Value = new DateTime(globalVariables.SysDate.Year, 1, 1);
                dtInsToDate.Value = new DateTime(globalVariables.SysDate.Year, 12, 31);
                Utility.SetColor(lblDiachiBHYT, THU_VIEN_CHUNG.Laygiatrithamsohethong("KCB_BATNHAP_DIACHI_BHYT", "1", false) == "1" ? lblHoten.ForeColor : lblMatheBHYT.ForeColor);
                Utility.SetColor(lblDiachiBN, THU_VIEN_CHUNG.Laygiatrithamsohethong("KCB_BATNHAP_DIACHI_BENHNHAN", "1", false) == "1" ? lblHoten.ForeColor : lblMatheBHYT.ForeColor);
                chkTraiTuyen.Visible = THU_VIEN_CHUNG.Laygiatrithamsohethong("KCB_CHOPHEPTIEPDON_TRAITUYEN", "1", false) == "1";

                XoathongtinBHYT(true);
                AddAutoCompleteDiaChi();
                Get_DanhmucChung();
                AutocompleteBenhvien();
                LoadThongTinChoKham();
                NapThongtinDichvuKCB();
                DataBinding.BindDataCombobox(cboDoituongKCB, THU_VIEN_CHUNG.LaydanhsachDoituongKcb(), DmucDoituongkcb.Columns.MaDoituongKcb, DmucDoituongkcb.Columns.TenDoituongKcb, "", false);
                objDoituongKCB = new Select().From(DmucDoituongkcb.Schema).Where(DmucDoituongkcb.MaDoituongKcbColumn).IsEqualTo(_MaDoituongKcb).ExecuteSingle<DmucDoituongkcb>();
                cboDoituongKCB.SelectedIndex = Utility.GetSelectedIndex(cboDoituongKCB, _MaDoituongKcb);
                ChangeObjectRegion();
                if (m_enAction == action.Insert)//Thêm mới BN
                {
                    objLuotkham = null;
                    if (PropertyLib._KCBProperties.SexInput)
                        cboPatientSex.SelectedIndex = -1;
                    SinhMaLanKham();
                    txtTEN_BN.Select();
                }
                else if (m_enAction == action.Update)//Cập nhật thông tin Bệnh nhân
                {
                    LoadThongtinBenhnhan();
                    LaydanhsachdangkyKCB();
                    txtTEN_BN.Select();
                }
                else if (m_enAction == action.Add) //Thêm mới lần khám
                {
                    objLuotkham = null;
                    string ngay_kham = globalVariables.SysDate.ToString("dd/MM/yyyy");
                    if (!NotPayment(txtMaBN.Text.Trim(), ref ngay_kham))//Nếu đã thanh toán xong hết thì thêm lần khám mới
                    {
                        SinhMaLanKham();
                        LoadThongtinBenhnhan();
                        LaydanhsachdangkyKCB();
                        txtKieuKham.Select();
                    }
                    else//Còn lần khám chưa thanh toán-->Kiểm tra
                    {
                        //nếu là ngày hiện tại thì đặt về trạng thái sửa
                        if (ngay_kham == "NOREG" || ngay_kham==globalVariables.SysDate.ToString("dd/MM/yyyy"))
                        {
                            LoadThongtinBenhnhan();
                            if (ngay_kham == "NOREG")//Bn chưa đăng ký phòng khám nào cả.
                            {
                                //Nếu ngày hệ thống=Ngày đăng ký gần nhất-->Sửa
                                if (globalVariables.SysDate.ToString("dd/MM/yyyy") == dtpInputDate.Value.ToString("dd/MM/yyyy"))
                                {
                                    m_enAction = action.Update;

                                    Utility.ShowMsg(
                                       "Bệnh nhân vừa được đăng ký ngày hôm nay nên hệ thống sẽ chuyển về chế độ Sửa thông tin. Nhấn OK để bắt đầu sửa");
                                    LaydanhsachdangkyKCB();
                                    txtTEN_BN.Select();
                                }
                                else//Thêm lần khám cho ngày mới
                                {
                                    m_enAction = action.Add;
                                    SinhMaLanKham();
                                    LaydanhsachdangkyKCB();
                                    txtKieuKham.Select();
                                }
                            }
                            else//Quay về trạng thái sửa
                            {
                                m_enAction = action.Update;

                                Utility.ShowMsg(
                                   "Bệnh nhân vừa được đăng ký ngày hôm nay nên hệ thống sẽ chuyển về chế độ Sửa thông tin. Nhấn OK để bắt đầu sửa");
                                LaydanhsachdangkyKCB();
                                txtTEN_BN.Select();
                            }
                        }
                        else //Không cho phép thêm lần khám khác nếu chưa thanh toán lần khám của ngày hôm trước
                        {
                            Utility.ShowMsg(
                                "Bệnh nhân đang có lần khám chưa được thanh toán. Cần thanh toán hết các lần đến khám bệnh của Bệnh nhân trước khi thêm lần khám mới. Nhấn OK để hệ thống chuyển về trạng thái thêm mới Bệnh nhân");
                            cmdThemMoiBN_Click(cmdThemMoiBN, new EventArgs());
                        }
                    }
                }
                StatusControl();
                ModifyCommand();
                AllowTextChanged = true;
            }
            catch
            {
            }
            finally
            {
                this.Text = "Đăng ký KCB -->Demo 5000";
                SetActionStatus();
                if (Nhieuhon2Manhinh())
                {
                    pThongTinQMS.Enabled = true;
                    b_HasSecondScreen = true;
                    ShowScreen();
                }
                else
                {
                    b_HasSecondScreen = false;
                    pThongTinQMS.Enabled = false;
                }

                ModifyCommand();
                ModifyButtonCommandRegExam();

                b_HasLoaded = true;
                CanhbaoInphoi();

            }
        }
Example #56
0
        /// <summary>
        /// hàm thực hiện việc khwoir tạo thoog tin PatietnExam
        /// </summary>
        /// <returns></returns>
        private KcbLuotkham CreatePatientExam()
        {
            objLuotkham = new KcbLuotkham();
            if (m_enAction == action.Insert || m_enAction == action.Add)
            {
                //Bỏ đi do đã sinh theo cơ chế bảng danh mục mã lượt khám. Nếu ko sẽ mất mã lượt khám hiện thời.
               // txtMaLankham.Text = THU_VIEN_CHUNG.KCB_SINH_MALANKHAM();
                objLuotkham.IsNew = true;
            }
            else
            {
                objLuotkham.MarkOld();
                objLuotkham.IsNew = false;
            }

            objLuotkham.MaKhoaThuchien = globalVariables.MA_KHOA_THIEN;
            objLuotkham.Noitru = 0;
            objLuotkham.IdDoituongKcb = _IdDoituongKcb;
            objLuotkham.IdLoaidoituongKcb = _IdLoaidoituongKcb;
            objLuotkham.Locked = 0;
            objLuotkham.HienthiBaocao = 1;
            objLuotkham.TrangthaiCapcuu = chkCapCuu.Checked ? 1 : 0;
            objLuotkham.IdKhoatiepnhan = globalVariables.idKhoatheoMay;
            objLuotkham.NguoiTao = globalVariables.UserName;
            objLuotkham.NgayTao = globalVariables.SysDate;
            objLuotkham.Cmt = Utility.sDbnull(txtCMT.Text, "");
            objLuotkham.DiaChi = txtDiachi.Text;
            objLuotkham.Email = txtEmail.Text;
            objLuotkham.NoiGioithieu = txtNoigioithieu.Text;
            objLuotkham.NhomBenhnhan = txtLoaiBN.myCode;
            objLuotkham.IdBenhvienDen = Utility.Int16Dbnull(txtNoichuyenden.MyID, -1);
            objLuotkham.TthaiChuyenden = (byte)(chkChuyenVien.Checked ? 1 : 0);
            if (THU_VIEN_CHUNG.IsBaoHiem(_IdLoaidoituongKcb))
            {
                Laymathe_BHYT();
                objLuotkham.MaKcbbd = Utility.sDbnull(txtNoiDKKCBBD.Text, "");
                objLuotkham.NoiDongtrusoKcbbd = Utility.sDbnull(txtNoiDongtrusoKCBBD.Text, "");
                objLuotkham.MaNoicapBhyt = Utility.sDbnull(txtNoiphattheBHYT.Text);
                objLuotkham.LuongCoban = globalVariables.LUONGCOBAN;
                objLuotkham.MatheBhyt = Laymathe_BHYT();
                objLuotkham.MaDoituongBhyt = Utility.sDbnull(txtMaDtuong_BHYT.Text);
                objLuotkham.MaQuyenloi = Utility.Int32Dbnull(txtMaQuyenloi_BHYT.Text, null);
                objLuotkham.DungTuyen= !chkTraiTuyen.Visible ? 1 : (((byte?)(chkTraiTuyen.Checked ? 0 : 1)));

                objLuotkham.MadtuongSinhsong = txtMaDTsinhsong.myCode;
                objLuotkham.GiayBhyt = Utility.Bool2byte(chkGiayBHYT.Checked);

                objLuotkham.NgayketthucBhyt = dtInsToDate.Value.Date;
                objLuotkham.NgaybatdauBhyt = dtInsFromDate.Value.Date;
                objLuotkham.NoicapBhyt = Utility.GetValue(lblNoiCapThe.Text, false);
                objLuotkham.DiachiBhyt = Utility.sDbnull(txtDiachi_bhyt.Text);

            }
            else
            {
                objLuotkham.GiayBhyt = 0;
                objLuotkham.MadtuongSinhsong = "";
                objLuotkham.MaKcbbd = "";
                objLuotkham.NoiDongtrusoKcbbd = "";
                objLuotkham.MaNoicapBhyt = "";
                objLuotkham.LuongCoban = globalVariables.LUONGCOBAN;
                objLuotkham.MatheBhyt = "";
                objLuotkham.MaDoituongBhyt = "";
                objLuotkham.MaQuyenloi = -1;
                objLuotkham.DungTuyen = 0;

                objLuotkham.NgayketthucBhyt = null;
                objLuotkham.NgaybatdauBhyt = null;
                objLuotkham.NoicapBhyt = "";
                objLuotkham.DiachiBhyt = "";

            }

            objLuotkham.SolanKham = Utility.Int16Dbnull(txtSolankham.Text, 0);
            objLuotkham.TrieuChung = Utility.ReplaceStr(txtTrieuChungBD.Text);
            //Tránh lỗi khi update người dùng nhập mã lần khám lung tung
            if (m_enAction == action.Update) txtMaLankham.Text = m_strMaluotkham;
            objLuotkham.MaLuotkham = Utility.sDbnull(txtMaLankham.Text, "");
            objLuotkham.IdBenhnhan = Utility.Int64Dbnull(txtMaBN.Text, -1);
            DmucDoituongkcb objectType = DmucDoituongkcb.FetchByID(_IdDoituongKcb);
            if (objectType != null)
            {
                objLuotkham.MaDoituongKcb = Utility.sDbnull(objectType.MaDoituongKcb, "");
            }
            if (m_enAction == action.Update)
            {
                objLuotkham.NgayTiepdon = dtCreateDate.Value;
                objLuotkham.NguoiSua = globalVariables.UserName;
                objLuotkham.NgaySua = globalVariables.SysDate;
                objLuotkham.IpMaysua = globalVariables.gv_strIPAddress;
                objLuotkham.TenMaysua = globalVariables.gv_strComputerName;
            }
            if (m_enAction == action.Add || m_enAction == action.Insert)
            {
                objLuotkham.NgayTiepdon = dtCreateDate.Value;
                objLuotkham.NguoiTiepdon = globalVariables.UserName;

                objLuotkham.IpMaytao = globalVariables.gv_strIPAddress;
                objLuotkham.TenMaytao = globalVariables.gv_strComputerName;
            }
            objLuotkham.PtramBhytGoc = Utility.DecimaltoDbnull(txtptramDauthe.Text, 0);
            objLuotkham.PtramBhyt =Utility.DecimaltoDbnull(txtPtramBHYT.Text, 0);//chkTraiTuyen.Visible ?Utility.DecimaltoDbnull(txtPtramBHYT.Text, 0):(objLuotkham.DungTuyen == 0 ? 0 : Utility.DecimaltoDbnull(txtPtramBHYT.Text, 0));
            return objLuotkham;
        }
        private KcbLuotkham CreatePatientExam()
        {
            string MaLuotkham = Utility.sDbnull(grdList.GetValue(KcbLuotkham.Columns.MaLuotkham));
            int Patient_ID = Utility.Int32Dbnull(grdList.GetValue(KcbLuotkham.Columns.IdBenhnhan));
            KcbLuotkham objLuotkham = new KcbLuotkham();

            SqlQuery sqlQuery = new Select().From(KcbLuotkham.Schema)
                .Where(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(MaLuotkham)
                .And(KcbLuotkham.Columns.IdBenhnhan).IsEqualTo(Patient_ID);
            objLuotkham = sqlQuery.ExecuteSingle<KcbLuotkham>();
            return objLuotkham;
        }
        void ProcessData()
        {
            long v_RegId = -1;
            if (objLuotkham == null) objLuotkham = CreatePatientExam();
            if(objLuotkham!=null)
            {
                KcbDangkyKcb objRegExam = CreateNewRegExam();
                if (objRegExam != null)
                {
                    objRegExam.MaLuotkham = Utility.sDbnull(grdList.GetValue(KcbLuotkham.Columns.MaLuotkham));
                    objRegExam.IdBenhnhan = Utility.Int32Dbnull(grdList.GetValue(KcbLuotkham.Columns.IdBenhnhan));

                    ActionResult actionResult = _KCB_DANGKY.InsertRegExam(objRegExam, objLuotkham, ref v_RegId, Utility.Int32Dbnull(cboKieuKham.Value));
                    if (actionResult == ActionResult.Success)
                    {
                        if (m_dataDataRegExam != null)
                        {
                            BindRegExam();
                            Utility.GonewRowJanus(grdRegExam, KcbDangkyKcb.Columns.IdKham, v_RegId.ToString());
                            cmdInPhieuKham.Focus();
                        }
                        //Reset cac thong tin chi dinh phong kham
                        cboKieuKham.Text = "CHỌN PHÒNG KHÁM";
                        cboKieuKham.SelectedIndex = -1;
                        txtKieuKham.Clear();
                        txtPhongkham.Clear();
                        txtIDPkham.Text = "-1";
                        txtIDKieuKham.Text = "-1";
                        txtExamtypeCode.Text = "-1";
                        m_dataDataRegExam.AcceptChanges();
                    }
                    if (actionResult == ActionResult.Error)
                    {
                        Utility.ShowMsg("Lỗi trong quá trình cập nhập thông tin ", "Thông báo lỗi", MessageBoxIcon.Error);
                        return;
                    }
                }
            }
        }
Example #59
0
        private void txtPatient_Code_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                var dtPatient = new DataTable();
                if (e.KeyCode == Keys.Enter)
                {
                    string _patient_Code = Utility.AutoFullPatientCode(txtPatient_Code.Text);
                    ClearControl();
                    dtPatient = _KCB_THAMKHAM.TimkiemBenhnhan(txtPatient_Code.Text,
                                                   -1,(byte)1, 0);

                    DataRow[] arrPatients = dtPatient.Select(KcbLuotkham.Columns.MaLuotkham + "='" + _patient_Code + "'");
                    if (arrPatients.GetLength(0) <= 0)
                    {
                        if (dtPatient.Rows.Count > 1)
                        {
                            var frm = new frm_DSACH_BN_TKIEM();
                            frm.MaLuotkham = txtPatient_Code.Text;
                            frm.dtPatient = dtPatient;
                            frm.ShowDialog();
                            if (!frm.has_Cancel)
                            {
                                txtPatient_Code.Text = frm.MaLuotkham;
                            }
                        }
                        else
                            txtPatient_Code.Text = _patient_Code;
                    }
                    else
                    {
                        txtPatient_Code.Text = _patient_Code;
                    }
                    objLuotkham = Utility.getKcbLuotkham(txtPatient_Code.Text);

                    if (objLuotkham!=null)
                    {
                        AllowTextChanged = false;
                        GetData();
                        txtPatient_Code.SelectAll();
                        if (objLuotkham.TrangthaiNoitru == 0)
                        {
                            Utility.ShowMsg("Bệnh nhân chưa nhập viện nội trú nên bạn không thể lập phiếu ra viện được. Đề nghị bạn kiểm tra lại");

                        }
                        //Kiểm tra lần nhập viện hoặc chuyển khoa gần nhất phải được phân buồng giường trước khi ra viện
                        NoitruPhanbuonggiuong objNoitruPhanbuonggiuong = NoitruPhanbuonggiuong.FetchByID(objLuotkham.IdRavien);
                        bool isValid = Utility.Int16Dbnull(objNoitruPhanbuonggiuong.IdBuong, 0) > 0 && Utility.Int16Dbnull(objNoitruPhanbuonggiuong.IdBuong, 0) > 0;
                        if (!isValid)
                        {
                            Utility.ShowMsg("Hệ thống phát hiện Bệnh nhân chưa được phân buồng giường cho lần chuyển khoa gần nhất nên bạn không thể tổng hợp ra viện được.");
                        }
                        cmdRavien.Enabled = cmdTonghop.Enabled = isValid && objLuotkham.TrangthaiNoitru > 0;
                    }
                    else
                    {
                        string sPatientTemp = txtPatient_Code.Text;
                        ClearControl();
                        ModifyCommmands();
                        txtPatient_Code.Text = sPatientTemp;
                        Utility.ShowMsg("Không tìm được Bệnh nhân nào có mã lượt khám " + txtPatient_Code.Text);
                        txtPatient_Code.SelectAll();
                        cmdRavien.Enabled = cmdTonghop.Enabled = false;

                    }

                }
            }
            catch (Exception)
            {
                Utility.ShowMsg("Có lỗi trong quá trình lấy thông tin bệnh nhân");
            }
            finally
            {
                AllowTextChanged = true;
            }
        }
Example #60
0
        private void InsertPatient()
        {
            KcbDanhsachBenhnhan objBenhnhan = CreatePatientInfo();
            objLuotkham = CreatePatientExam();
            KcbDangkyKcb objRegExam = CreateNewRegExam();
            long v_id_kham = -1;
            ActionResult actionResult = _KCB_DANGKY.ThemmoiBenhnhan(objBenhnhan, objLuotkham, objRegExam,
                                                                            Utility.Int32Dbnull(cboKieuKham.Value, -1), ref v_id_kham);

            switch (actionResult)
            {
                case ActionResult.Success:

                    PtramBhytCu = Utility.DecimaltoDbnull(txtPtramBHYT.Text, 0);
                    PtramBhytGocCu = Utility.DecimaltoDbnull(txtptramDauthe.Text, 0);
                    txtMaLankham.Text = Utility.sDbnull(objLuotkham.MaLuotkham);
                    txtMaBN.Text = Utility.sDbnull(objLuotkham.IdBenhnhan);
                    mavuasinh = Utility.sDbnull(objLuotkham.IdBenhnhan);
                    UpdateStatusQMS();
                    m_enAction = action.Update;
                    m_blnHasJustInsert = true;
                    m_strMaluotkham = txtMaLankham.Text;
                    LaydanhsachdangkyKCB();
                    ThemMoiLanKhamVaoLuoi();
                    if (_OnActionSuccess != null) _OnActionSuccess();
                    setMsg(uiStatusBar1.Panels["MSG"], "Bạn thêm mới bệnh nhân thành công", false);
                    Utility.GotoNewRowJanus(grdList, KcbLuotkham.Columns.MaLuotkham, txtMaLankham.Text);
                    Utility.GotoNewRowJanus(grdRegExam, KcbDangkyKcb.Columns.IdKham, v_id_kham.ToString());
                    m_blnCancel = false;
                    if (objRegExam != null)
                    {
                        Utility.GotoNewRowJanus(grdRegExam, KcbDangkyKcb.Columns.IdKham, Utility.sDbnull(objRegExam.IdKham));
                        if (PropertyLib._MayInProperties.InPhieuKCBsaukhiluu && THU_VIEN_CHUNG.Laygiatrithamsohethong("KCB_TIEPDON_INPHIEUKCB", "0", false) == "1")
                        {
                            InPhieu();
                        }
                        else
                        {
                            cmdInPhieuKham.Focus();
                        }
                    }
                    if (Utility.Byte2Bool(objDoituongKCB.TudongThanhtoan)) Thanhtoan(false);
                    cboKieuKham.Text = "CHỌN PHÒNG KHÁM";
                    cboKieuKham.SelectedIndex = -1;
                    txtKieuKham.ClearMe();
                    txtPhongkham.ClearMe();
                    if (PropertyLib._KCBProperties.Tudongthemmoi) cmdThemMoiBN_Click(cmdThemMoiBN, new EventArgs());
                    txtMaBN.Text = Utility.sDbnull(mavuasinh);
                    LoadThongTinChoKham();
                    break;
                case ActionResult.Error:
                    setMsg(uiStatusBar1.Panels["MSG"], "Bạn thực hiện thêm dữ liệu không thành công !", true);
                    cmdSave.Focus();
                    break;
            }
        }