示例#1
0
        private void gridView_Info_DoubleClick(object sender, EventArgs e)
        {
            this.maBenhNhan = gridView_Info.GetRowCellValue(gridView_Info.FocusedRowHandle, "MaBenhNhan").ToString();
            PSPatient infoPerson = BioBLL.GetInfoPersonByMa(maBenhNhan);

            txtTenMe.Text           = infoPerson.MotherName;
            txtTenCha.Text          = infoPerson.FatherName;
            txtNamSinhMe.EditValue  = !string.IsNullOrEmpty(infoPerson.MotherBirthday.ToString())? Convert.ToDateTime(infoPerson.MotherBirthday).ToString("dd/MM/yyyy") : string.Empty;
            txtNamSinhCha.EditValue = !string.IsNullOrEmpty(infoPerson.FatherBirthday.ToString())? Convert.ToDateTime(infoPerson.FatherBirthday).ToString("dd/MM/yyyy") : string.Empty;
            txtSDTMe.Text           = infoPerson.MotherPhoneNumber;
            txtSDTCha.Text          = infoPerson.FatherPhoneNumber;
            txtAddress.Text         = infoPerson.DiaChi;

            txtTenBenhNhan.Text          = infoPerson.TenBenhNhan;
            txtGioiTinh.EditValue        = infoPerson.GioiTinh;
            txtGioSinhBenhNhan.EditValue = !string.IsNullOrEmpty(infoPerson.NgayGioSinh.ToString()) ? Convert.ToDateTime(infoPerson.NgayGioSinh).ToString("H:mm:ss") : string.Empty;
            txtNamSinhBenhNhan.EditValue = !string.IsNullOrEmpty(infoPerson.NgayGioSinh.ToString()) ? Convert.ToDateTime(infoPerson.NgayGioSinh).ToString("dd/MM/yyyy") : string.Empty;
            txtNoiSinh.Text             = infoPerson.NoiSinh;
            lookUpDanToc.EditValue      = infoPerson.DanTocID;
            txtTuan.Value               = Convert.ToDecimal(infoPerson.TuanTuoiKhiSinh);
            txtNang.Text                = infoPerson.CanNang.ToString();
            cboPhuongPhapSinh.EditValue = infoPerson.PhuongPhapSinh;
            btnEdit.Enabled             = true;
            ReadOnlyText(true);
        }
示例#2
0
        public static PsReponse UpdatePatient(List <PSPatient> lstpsl)
        {
            PsReponse res = new PsReponse();

            try
            {
                ProcessDataSync cn = new ProcessDataSync();
                db = cn.db;
                var account = db.PSPhieuSangLocs.FirstOrDefault();
                db.Connection.Open();
                db.Transaction = db.Connection.BeginTransaction();
                foreach (var psl in lstpsl)
                {
                    var psldb = db.PSPatients.FirstOrDefault(p => p.MaKhachHang == psl.MaKhachHang);
                    if (psldb != null)
                    {
                        var term = psl.RowIDBenhNhan;
                        psldb = psl;
                        psldb.RowIDBenhNhan = term;
                        db.SubmitChanges();
                    }
                    else
                    {
                        PSPatient newpsl = new PSPatient();
                        newpsl = psl;
                        newpsl.RowIDBenhNhan = 0;
                        newpsl.isDongBo      = true;
                        db.PSPatients.InsertOnSubmit(newpsl);
                        db.SubmitChanges();
                    }
                }

                db.Transaction.Commit();
                db.Connection.Close();
                res.Result = true;
            }
            catch (Exception ex)
            {
                db.Transaction.Rollback();
                db.Connection.Close();
                res.Result      = false;
                res.StringError = ex.ToString();
            }
            return(res);
        }
示例#3
0
        public PSStudyBrowserSearchResult(PSPatient pat, PSStudy stu)
        {
            PatID        = stu.PatID;
            PatName      = pat.PatName;
            PatBirthDate = pat.PatBirthDate;
            PatSex       = pat.PatSex;

            StuInstID    = stu.StuInstID;
            AccessionNum = stu.AccessionNum;

            StuID        = stu.StuID;
            StuDateTime  = stu.StuDateTime;
            Modality     = stu.Modality;
            RefPhysician = stu.RefPhysician;
            StuDesc      = stu.StuDesc;
            DeptName     = stu.DeptName;

            NumSeries = stu.NumSeries;
            NumImages = stu.NumImages;
            StuSizeKB = stu.StuSizeKB;
        }
示例#4
0
        public static bool UpdInfoPerson(PSPatient infoPatient)
        {
            var db = new BioDAL();

            return(db.UpdInfoPerson(infoPatient));
        }
示例#5
0
 private void HienThiThongTinBenhNhan(string maBenhNhan, string maDonVi, string maKhachHang, string maTiepNhan, string rowID, string maTiepNhan2, bool isBNNguyCo)
 {
     try
     {
         this.txtMaBenhNhan.Text          = maBenhNhan;
         this.txtMaKhachHang.Text         = maKhachHang;
         this.txtRowIDBenhNhanNguyCo.Text = rowID;
         if (isBNNguyCo)
         {
             this.btnMoi.Enabled       = true;
             this.btnNguyCoGia.Enabled = true;
             this.btnNguyCoGia.Text    = "Nguy cơ giả";
         }
         else
         {
             this.btnNguyCoGia.Enabled = true;
             this.btnMoi.Enabled       = false;
             this.btnNguyCoGia.Text    = "Nguy cơ cao";
         }
         PSPatient bn = BioNet_Bus.GetThongTinBenhNhan(maBenhNhan);
         this.lstDotChanDoan.Clear();
         try
         {
             this.lstDotChanDoan = BioNet_Bus.GetDanhSachDotChanDoanCuaBenhNhan(long.Parse(rowID));
             this.LoadListTreeView();
         }
         catch (Exception ex)
         {
             MessageBox.Show("Lỗi khi danh sách đợt chẩn đoán! \r\n Lỗi chi tiết : " + ex.ToString(), "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
         this.lstChiTietKQ.Clear();
         this.lstChiTietKQCu.Clear();
         if (!string.IsNullOrEmpty(maTiepNhan2))
         {
             this.lstChiTietKQ   = BioNet_Bus.GetDanhSachTraKetQuaChiTiet(maTiepNhan2);
             this.lstChiTietKQCu = BioNet_Bus.GetDanhSachTraKetQuaChiTiet(maTiepNhan);
             this.xtraTabKQChiTietCu.PageVisible = true;
             this.LoadGCKQChiTiet();
             this.LoadGCKQChiTietCu();
         }
         else
         {
             this.lstChiTietKQ = BioNet_Bus.GetDanhSachTraKetQuaChiTiet(maTiepNhan);
             this.xtraTabKQChiTietCu.PageVisible = false;  this.LoadGCKQChiTiet();
         }
         if (bn != null)
         {
             this.txtDiaChi.Text            = bn.DiaChi;
             this.txtGioiTinh.SelectedIndex = bn.GioiTinh ?? 2;
             this.txtMaDonVi.EditValue      = maDonVi;
             this.txtNgaySinh.EditValue     = bn.NgayGioSinh;
             this.txtSDT.Text   = string.IsNullOrEmpty(bn.MotherPhoneNumber.ToString()) ? bn.FatherPhoneNumber.ToString() : bn.MotherPhoneNumber.ToString();
             this.txtTenBN.Text = string.IsNullOrEmpty(bn.TenBenhNhan.ToString()) ? "CB_" + bn.MotherName: bn.TenBenhNhan.ToString();
             this.txtTenMe.Text = bn.MotherName;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Lỗi khi lấy thông tin bệnh nhân \r\n Lỗi chi tiết : " + ex.ToString(), "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
示例#6
0
        public static PsReponse GetPatient()
        {
            PsReponse res = new PsReponse();

            res.Result = true;
            try
            {
                ProcessDataSync cn = new ProcessDataSync();
                db = cn.db;
                var account = db.PSAccount_Syncs.FirstOrDefault();
                if (account != null)
                {
                    string token = cn.GetToken(account.userName, account.passWord);
                    if (!string.IsNullOrEmpty(token))
                    {
                        var result = cn.GetRespone(cn.CreateLink(linkGet), token);
                        if (result.Result)
                        {
                            string json = result.ValueResult;
                            JavaScriptSerializer jss = new JavaScriptSerializer();

                            ObjectModel.RootObjectAPI psl = jss.Deserialize <ObjectModel.RootObjectAPI>(json);
                            //List<PSPatient> patient = jss.Deserialize<List<PSPatient>>(json);
                            List <PSPatient> lstpsl = new List <PSPatient>();
                            if (psl.TotalCount > 0)
                            {
                                foreach (var item in psl.Items)
                                {
                                    PSPatient term = new PSPatient();
                                    term = cn.CovertDynamicToObjectModel(item, term);
                                    lstpsl.Add(term);
                                }
                                //UpdatePatient(patient);
                                UpdatePatient(lstpsl);
                                res.Result = true;
                            }
                        }
                        else
                        {
                            res.Result      = false;
                            res.StringError = result.ErorrResult;
                        }
                    }
                    else
                    {
                        res.Result      = false;
                        res.StringError = "Kiểm tra lại kết nối mạng hoặc tài khoản đồng bộ!";
                    }
                }
                else
                {
                    res.Result      = false;
                    res.StringError = "Chưa có  tài khoản đồng bộ!";
                }
            }
            catch (Exception ex)
            {
                res.Result      = false;
                res.StringError = DateTime.Now.ToString() + "Lỗi khi get dữ liệu danh mục Patient từ server \r\n " + ex.Message;
            }
            return(res);
        }