Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        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;
                }
            }
            //  }
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        /// <summary>
        /// hàm thực hiện việc hoạt động lưu lại thông tin
        /// </summary>
        private void PerformAction()
        {
            NoitruPhanbuonggiuong objPhanbuonggiuong = NoitruPhanbuonggiuong.FetchByID(Utility.Int32Dbnull(txtPatientDept_ID.Text));

            if (objPhanbuonggiuong != null)
            {
                if (Utility.AcceptQuestion("Bạn có muốn chuyển Buồng và giường 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);
                    objPhanbuonggiuong.SoLuong         = Utility.Int32Dbnull(Utility.DecimaltoDbnull(txtSoluong.Text));
                    objPhanbuonggiuong.SoluongGio      = Utility.Int32Dbnull(txtTotalHour.Text);
                    objPhanbuonggiuong.CachtinhSoluong = (byte)(chkAutoCal.Checked ? 0 : 1);
                    ActionResult actionResult = new noitru_nhapvien().ChuyenGiuongDieuTri(objPhanbuonggiuong,
                                                                                          objLuotkham,
                                                                                          ngaychuyenkhoa,
                                                                                          Utility.Int16Dbnull(
                                                                                              grdBuong.GetValue(NoitruDmucBuong.Columns.IdBuong)),
                                                                                          Utility.Int16Dbnull(
                                                                                              grdGiuong.GetValue(NoitruDmucGiuongbenh.Columns.IdGiuong)), Utility.Int32Dbnull(txtGia.MyID, -1));
                    switch (actionResult)
                    {
                    case ActionResult.Success:
                        txtPatientDept_ID.Text = Utility.sDbnull(objPhanbuonggiuong.Id);
                        Utility.SetMsg(lblMsg, "Bạn chuyển Buồng thành công", true);
                        // Utility.ShowMsg("Bạn chuyển Buồng thành công", "Thông báo", MessageBoxIcon.Information);
                        if (b_CallParent)
                        {
                            ProcessChuyenKhoa();
                            b_Cancel = false;
                            Close();
                        }
                        else
                        {
                            ClearControl();
                        }
                        break;

                    case ActionResult.Error:
                        Utility.ShowMsg("Lỗi trong quá trình chuyển khoa", "Thông báo", MessageBoxIcon.Error);
                        break;
                    }
                }
            }
        }
Exemplo n.º 5
0
        private void cmdHUY_VAO_VIEN_Click(object sender, EventArgs e)
        {
            try
            {
                Utility.SetMsg(lblMsg, "", false);
                if (!InValiHuyVaoVien())
                {
                    return;
                }
                if (Utility.AcceptQuestion("Bạn có muốn thực hiện việc hủy nhập viện cho bệnh nhân nội trú không,\n Nếu hủy thì bệnh nhân sẽ trở lại ngoại trú,Thông tin gói dịch vụ nội trú sẽ bị xóa theo ?", "Thông báo", true))
                {
                    if (objLuotkham != null)
                    {
                        ActionResult actionResult =
                            new noitru_nhapvien().Huynhapvien(
                                objLuotkham);
                        switch (actionResult)
                        {
                        case ActionResult.Success:
                            objLuotkham.TrangthaiNoitru = 0;
                            objLuotkham.SoBenhAn        = string.Empty;
                            objLuotkham.NgayNhapvien    = null;
                            objLuotkham.IdKhoanoitru    = -1;
                            objLuotkham.MotaNhapvien    = "";
                            objLuotkham.IdNhapvien      = -1;
                            txtSoBenhAn.Clear();
                            ModifyCommand();
                            Utility.SetMsg(lblMsg, "Bạn hủy nội trú cho bệnh nhân thành công", false);
                            break;

                        case ActionResult.Error:
                            Utility.SetMsg(lblMsg, "Lỗi trong quá trình hủy nội trú cho bệnh nhân", true);
                            break;
                        }
                    }
                }
            }
            catch
            { }
            finally
            {
                ModifyCommand();
            }
        }
Exemplo n.º 6
0
        private void PerformAction()
        {
            NoitruPhanbuonggiuong objPhanbuonggiuong = NoitruPhanbuonggiuong.FetchByID(Utility.Int32Dbnull(txtPatientDept_ID.Text));

            if (objPhanbuonggiuong != null)
            {
                if (Utility.AcceptQuestion(string.Format("Bạn có chắc chắn muốn chuyển khoa điều trị từ {0} đến {1} hay không?", txtDepartmentName.Text, txtKhoanoitru.Text), "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);
                    objPhanbuonggiuong.SoLuong         = Utility.Int32Dbnull(Utility.DecimaltoDbnull(txtSoluong.Text));
                    objPhanbuonggiuong.SoluongGio      = Utility.Int32Dbnull(Utility.DecimaltoDbnull(txtTotalHour.Text));
                    objPhanbuonggiuong.CachtinhSoluong = (byte)(chkAutoCal.Checked ? 0 : 1);

                    ActionResult actionResult = new noitru_nhapvien().ChuyenKhoaDieuTri(objPhanbuonggiuong,
                                                                                        objLuotkham,
                                                                                        ngaychuyenkhoa,
                                                                                        Utility.Int16Dbnull(txtKhoanoitru.MyID, -1), -1,
                                                                                        -1);
                    switch (actionResult)
                    {
                    case ActionResult.Success:
                        txtPatientDept_ID.Text = Utility.sDbnull(objPhanbuonggiuong.Id);
                        Utility.SetMsg(lblMsg, "Bạn chuyển phòng thành công", true);
                        if (b_CallParent)
                        {
                            b_Cancel = false;
                            Close();
                        }
                        break;

                    case ActionResult.Error:
                        Utility.ShowMsg("Lỗi trong quá trình chuyển khoa", "Thông báo", MessageBoxIcon.Error);
                        break;
                    }
                }
            }
        }
Exemplo n.º 7
0
        private void IN_PHIEU_KHAM_VAO_VIEN()
        {
            DataTable dsTable =
                new noitru_nhapvien().NoitruLaythongtinInphieunhapvien(objLuotkham.MaLuotkham, Utility.Int32Dbnull(objLuotkham.IdBenhnhan));

            if (dsTable.Rows.Count <= 0)
            {
                Utility.ShowMsg("Không tìm thấy bản ghi nào\n Mời bạn xem lại", "Thông báo", MessageBoxIcon.Error);
                return;
            }

            SqlQuery sqlQuery = new Select().From(KcbChandoanKetluan.Schema)
                                .Where(KcbChandoanKetluan.Columns.MaLuotkham).IsEqualTo(objLuotkham.MaLuotkham)
                                .And(KcbChandoanKetluan.Columns.IdBenhnhan).IsEqualTo(objLuotkham.IdBenhnhan).OrderAsc(
                KcbChandoanKetluan.Columns.NgayChandoan);
            var    objInfoCollection = sqlQuery.ExecuteAsCollection <KcbChandoanKetluanCollection>();
            string chandoan          = "";
            string mabenh            = "";
            string phongkhamvaovien  = "";
            string khoanoitru        = "";

            foreach (KcbChandoanKetluan objDiagInfo in objInfoCollection)
            {
                string ICD_Name = "";
                string ICD_Code = "";
                GetChanDoan(Utility.sDbnull(objDiagInfo.MabenhChinh, ""),
                            Utility.sDbnull(objDiagInfo.MabenhPhu, ""), ref ICD_Name, ref ICD_Code);
                chandoan += string.IsNullOrEmpty(objDiagInfo.Chandoan)
                                ? ICD_Name
                                : Utility.sDbnull(objDiagInfo.Chandoan);
                mabenh += ICD_Code;
            }

            //txtkbMa.Text = Utility.sDbnull(mabenh);

            DataSet   ds       = new noitru_nhapvien().KcbLaythongtinthuocKetquaCls(objLuotkham.MaLuotkham, Utility.Int32Dbnull(objLuotkham.IdBenhnhan));
            DataTable dtThuoc  = ds.Tables[0];
            DataTable dtketqua = ds.Tables[1];

            string[] query = (from thuoc in dtThuoc.AsEnumerable()
                              let y = Utility.sDbnull(thuoc["ten_thuoc"])
                                      select y).ToArray();
            string donthuoc = string.Join(";", query);

            string[] querykq = (from kq in dtketqua.AsEnumerable()
                                let y = Utility.sDbnull(kq["ketqua"])
                                        select y).ToArray();
            string ketquaCLS = string.Join("; ", querykq);



            //foreach (DataRow dr in dsTable.Rows)
            //{
            DataRow dr = dsTable.Rows[0];

            if (dr != null)
            {
                dr["thuockedon"]       = donthuoc;
                dr["CHANDOAN_VAOVIEN"] = chandoan;
                dr["KETQUA_CLS"]       = ketquaCLS;
            }

            dsTable.AcceptChanges();
            VNS.HIS.UI.Baocao.noitru_baocao.Inphieunhapvien(dsTable, "PHIẾU NHẬP VIỆN", globalVariables.SysDate);
        }
Exemplo n.º 8
0
        /// <summary>
        /// hàm thuwchj hiện việc nhập viện không có gói, gói sẽ là nulll cho bệnh nhân
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdAccept_Click(object sender, EventArgs e)
        {
            try
            {
                Utility.SetMsg(lblMsg, "", false);
                bool question = true;
                if (!IsValidData())
                {
                    return;
                }
                //txtSoBenhAn.Text = string.IsNullOrEmpty(Utility.sDbnull(txtSoBenhAn.Text, ""))
                //    ? THU_VIEN_CHUNG.LaySoBenhAn()
                //    : Utility.sDbnull(txtSoBenhAn.Text, "-1");
                //if (Utility.AcceptQuestion("Bạn có muốn nhập viện cho bệnh nhân này không","Thông báo nhập viện",true))
                //{
                objLuotkham.SoBenhAn     = Utility.sDbnull(txtSoBenhAn.Text);
                objLuotkham.MotaNhapvien = Utility.DoTrim(txtGhiChu.Text);
                ActionResult actionResult = new noitru_nhapvien().Nhapvien(TaoBuonggiuong(), objLuotkham, null);
                switch (actionResult)
                {
                case ActionResult.Success:
                    txtSoBenhAn.Text            = Utility.sDbnull(objLuotkham.SoBenhAn, "");
                    objLuotkham.IdKhoanoitru    = Utility.Int16Dbnull(txtKhoanoitru.MyID, -1);
                    objLuotkham.TrangthaiNoitru = 1;
                    objLuotkham.SoBenhAn        = Utility.sDbnull(txtSoBenhAn.Text);
                    objLuotkham.NgayNhapvien    = dtNgayNhapVien.Value;
                    objLuotkham.MotaNhapvien    = Utility.DoTrim(txtGhiChu.Text);

                    b_Cancel = true;
                    Utility.SetMsg(lblMsg,
                                   Utility.sDbnull(cmdAccept.Tag, "0") == "0"
                                ? "Bạn thực hiện nhập viện cho bệnh nhân thành công"
                                : "Bạn thực hiện cập nhật khoa nội trú cho bệnh nhân thành công", false);
                    // this.Close();
                    if (chkInNgaySauKhiNhapVien.Checked)
                    {
                        IN_PHIEU_KHAM_VAO_VIEN();
                    }
                    if (chkThoatngaysaukhinhapvien.Checked)
                    {
                        this.Close();
                    }
                    break;

                case ActionResult.Error:
                    Utility.SetMsg(lblMsg, "Lỗi trong quá trình nhập viện ", true);
                    break;

                case ActionResult.ExistedRecord:
                    Utility.SetMsg(lblMsg, "Bệnh nhân đã thanh toán, Mời bạn xem lại ", true);
                    break;
                }
                //}
            }
            catch (Exception ex)
            {
                Utility.sDbnull("Lỗi:" + ex.Message);
            }

            finally
            {
                ModifyCommand();
            }
        }