Exemplo n.º 1
0
        void EditWL()
        {
            try
            {
                DataRow _dr = null;
                frm_Registration newForm = new frm_Registration(m_intCurrDevice1);
                if (_currTab == AppType.AppEnum.TabMode.Acq)
                {
                    if (_LastDoubleMode == AppType.AppEnum.DoubleMode.WorkList)
                    {
                        Utility.GotoNewRow(grdWorkList, "colPATIENT_CODE", txtID2.Text.Trim());
                        if (grdWorkList.RowCount <= 0 || grdWorkList.CurrentRow == null)
                        {
                            Utility.ShowMsg("Bạn phải chọn Bệnh nhân trên lưới để sửa", "Thông báo");
                            grdWorkList.Focus();
                            return;
                        }
                        _dr = ((DataRowView)grdWorkList.CurrentRow.DataBoundItem).Row;
                        newForm.grdList = grdWorkList;
                    }
                    if (_LastDoubleMode == AppType.AppEnum.DoubleMode.StudyList)
                    {
                        Utility.GotoNewRow(grdStudyList, "colPATIENT_CODE1", txtID2.Text.Trim());
                        if (grdStudyList.RowCount <= 0 || grdStudyList.CurrentRow == null)
                        {
                            Utility.ShowMsg("Bạn phải chọn Bệnh nhân  trên lưới để sửa", "Thông báo");
                            grdStudyList.Focus();
                            return;
                        }
                        _dr = ((DataRowView)grdStudyList.CurrentRow.DataBoundItem).Row;
                        newForm.grdList = grdStudyList;
                    }
                }

                if (_currTab == AppType.AppEnum.TabMode.WorkList)
                {
                    if (grdWorkList.RowCount <= 0 || grdWorkList.CurrentRow == null)
                    {
                        Utility.ShowMsg("Bạn phải chọn Bệnh nhân trên lưới để sửa", "Thông báo");
                        grdWorkList.Focus();
                        return;
                    }
                    _dr = ((DataRowView)grdWorkList.CurrentRow.DataBoundItem).Row;
                    newForm.grdList = grdWorkList;
                }
                if (_currTab == AppType.AppEnum.TabMode.StudyList)
                {
                    if (grdStudyList.RowCount <= 0 || grdStudyList.CurrentRow == null)
                    {
                        Utility.ShowMsg("Bạn phải chọn Bệnh nhân  trên lưới để sửa", "Thông báo");
                        grdStudyList.Focus();
                        return;
                    }
                    _dr = ((DataRowView)grdStudyList.CurrentRow.DataBoundItem).Row;
                    newForm.grdList = grdStudyList;
                }

                newForm.ImgPath = txtImgDir.Text.Trim();


                newForm.Act = action.Update;
                //newForm.lblmsg1 = lblMsg;

                newForm.dr = _dr;
                Hasresult = new RegDetailController().HasResult(Convert.ToInt64(_dr["REG_ID"]));
                newForm.Hasresult = Hasresult;
                newForm.ShowDialog();
                if (newForm.blnRegOK)
                {
                    string Folder2Changed = "";
                    //Tự động update sang phần ACQ
                    UpdatePinforinAcqTab(Utility.Int32Dbnull(newForm.dr["Patient_ID"], -1));
                    //Kiểm tra nếu tên tuổi hoặc giới tính khác thông tin cũ thì tạo luồng cập nhật dữ liệu trong các file ảnh dicom
                    if (newForm.oldSex.Trim().ToUpper() != newForm.NewSex.Trim().ToUpper() || newForm.oldName.Trim().Replace(newForm.oldAge.Trim().ToUpper(), "").Trim().ToUpper() != newForm.NewName.Trim().Replace(newForm.NewAge.Trim().ToUpper(), "").Trim().ToUpper() || newForm.oldAge.Trim().ToUpper() != newForm.NewAge.Trim().ToUpper())
                    {

                        //Duyệt tất cả các ảnh trong thư mục ảnh của BN ở thời điểm hiện tại
                        if (newForm.oldFolderName.Trim().ToUpper() == newForm.newFolderName.Trim().ToUpper())
                        {
                            Folder2Changed = newForm.oldFolderName;
                        }
                        else//Tất cả các ảnh đã được chuyển sang thư mục mới-->Cần thay đổi thông tin dicomdataset trong thư mục mới
                        {
                            Folder2Changed = newForm.newFolderName;
                        }
                        //Thực hiện duyệt các file Dicom ko có chữ IDX
                        string[] files = Directory.GetFiles(newForm.oldFolderName);
                        foreach (string _fileName in files)
                        {
                            if (Path.GetExtension(_fileName).Trim().Contains("DCM") && !Path.GetExtension(_fileName).Trim().Contains("_IDX"))
                            {
                                try
                                {
                                    //Update DicomDataset
                                    //using (DicomDataSet ds = new DicomDataSet())
                                    //{
                                    //    ds.Load(_fileName, DicomDataSetLoadFlags.LoadAndClose);
                                    //    if (newForm.oldSex.Trim().ToUpper() != newForm.NewSex.Trim().ToUpper())
                                    //    {
                                    //        Leadtools.DicomDemos.Utils.SetTag(ds, DicomTag.PatientSex, newForm.NewSex.Trim().ToUpper(), true);
                                    //    }
                                    //    if (newForm.oldPID.Trim().ToUpper() != newForm.NewPID.Trim().ToUpper())
                                    //    {
                                    //        Leadtools.DicomDemos.Utils.SetTag(ds, DicomTag.PatientID, newForm.NewPID.Trim().ToUpper(), true);
                                    //    }
                                    //    if (newForm.oldName.Trim().ToUpper() != newForm.NewName.Trim().ToUpper())
                                    //    {
                                    //        Leadtools.DicomDemos.Utils.SetTag(ds, DicomTag.PatientName, newForm.NewName.Trim().ToUpper(), true);
                                    //    }
                                    //    if (newForm.oldAge.Trim().ToUpper() != newForm.NewAge.Trim().ToUpper())
                                    //    {
                                    //        Leadtools.DicomDemos.Utils.SetTag(ds, DicomTag.PatientAge, newForm.NewAge.Trim().ToUpper(), true);
                                    //    }
                                    //    ds.Save(_fileName, DicomDataSetSaveFlags.None);
                                    //}
                                }
                                catch
                                {
                                }
                            }

                        }

                        //Update Thumbnail
                        UpdateThumbnailImgFolder(Folder2Changed, Convert.ToInt32(_dr["REG_ID"]));

                    }


                }
            }
            catch
            {
            }
            finally
            {
                _CurrAct = action.FirstOrFinished;
            }
        }
Exemplo n.º 2
0
 void InsertWL()
 {
     try
     {
         frm_Registration newForm = new frm_Registration(m_intCurrDevice1);
         newForm.ImgPath = txtImgDir.Text.Trim();
         newForm.WLDataSource = m_dtWLDataSource;
         newForm.grdList = grdWorkList;
         newForm.Act = action.Insert;
         _CurrAct = action.Insert;
         newForm.AutoGenPID = chkAutoGenPID.ImageIndex == 0;
         newForm.ShowDialog();
         SetSuspendingInfo();
         if (newForm.IsBeginExam)
         {
             ModifyWorkListButtons();
             BeginExam();
         }
     }
     catch
     {
     }
     finally
     {
         _CurrAct = action.FirstOrFinished;
         ModifyWorkListButtons();
     }
 }