示例#1
0
        private void btn_PrintTemplate_Click(object sender, EventArgs e)
        {
            SIS.frmPrintTemplate.Template t = new frmPrintTemplate.Template();
            t.ExamClass    = MworkList.EXAM_CLASS;
            t.ExamSubClass = MworkList.EXAM_SUB_CLASS;
            t.TemplateName = mReport.PRINT_TEMPLATE;
            frmPrintTemplate frmPrint = new frmPrintTemplate(t);
            DialogResult     dr       = frmPrint.ShowDialog();

            if (dr == DialogResult.OK && frmPrint.mpt != null)
            {
                //............................
                mReport = word.GetMReport();
                //******************
                mReport.PRINT_TEMPLATE = frmPrint.mpt.PRINT_TEMPLATE;
                mReport.FIELD_INF      = frmPrint.mpt.FIELD_INF;
                this.isInit            = true;
                //this.frmRptImg.ReSetCheck();
                this.winWordControl.QuitWord();
                FileOperator file = new FileOperator();
                file.FileSave(frmPrint.mpt.FILE_NAME, this.TempPath);
                word.WordInitChange(MworkList, mReport, TempPath);
                initAddImg();
                this.isInit = false;
            }
        }
示例#2
0
        private void PreferStaticCatch()
        {
            if (this.ptb_Gather.Image == null)
            {
                return;
            }
            try
            {
                Image img = (Image)this.ptb_Gather.Image.Clone();
                img = FileOperator.CutImg(img);
                if (frmMainForm.GatherOrRpt == 1)
                {
                    if (frmMainForm.myMainForm.qQuery.frm.isCanOpe)
                    {
                        FileOperator.BackCatchImg(img);
                        frmMainForm.myMainForm.qQuery.frm.frmRptImg.AddPreferImage(img);
                        frmMainForm.myMainForm.qQuery.frm.frmRptImg.Activate();
                        this.preferImages.LoadImages();
                        int i = Beep(1000, 500);
                        //System.Media.SystemSounds.Asterisk.Play();
                    }
                }
                if (frmMainForm.GatherOrRpt == 0 && this.Visible)
                {
                    FileOperator.BackCatchImg(img);
                    this.preferImages.AddPreferImage(img);
                    this.preferImages.Activate();
                    int i = Beep(1000, 500);

                    //System.Media.SystemSounds.Asterisk.Play();
                }
            }
            catch { }
        }
示例#3
0
 public bool SaveMark(Image image, ref string name)
 {
     try
     {
         string oldName = name;
         if (!Directory.Exists(GetConfig.Dynamic))
         {
             Directory.CreateDirectory(GetConfig.Dynamic);
         }
         if (!name.Contains("Mark"))
         {
             name = "Mark" + name;
         }
         else
         {
             oldName = name.Replace("Mark", "");
         }
         string newPath = GetConfig.Dynamic + "\\" + name;
         FileOperator.SaveAsJPEG(image, newPath, GetConfig.IMS_Quality);
         userCtrPictureEx u = (userCtrPictureEx)this.p_BackImags.Controls[oldName];
         u.Picture.LoadFile(newPath);
         u.Picture.IsMark    = true;
         u.l_Buttom.Text     = name;
         this.CurrentCtlName = u.Picture.FileName;
         this.dbClick(u.Picture);
         return(true);
     }
     catch { return(false); }
 }
示例#4
0
        private void SetLocMap(string LocalMapName)
        {
            FileOperator fileOpe = new FileOperator();

            this.drawArea.Image = fileOpe.GetImageFromFile(LocalMapsDir + LocalMapName);
            this.BindPart(LocalMapName);
            switch (LocalMapName)
            {
            case "stomach.bmp":
                this.cmb_TagImage.SelectedIndex = 0;
                break;

            case "colon.bmp":
                this.cmb_TagImage.SelectedIndex = 1;
                break;

            case "bronchus.bmp":
                this.cmb_TagImage.SelectedIndex = 2;
                break;

            case "laryngoscope.bmp":
                this.cmb_TagImage.SelectedIndex = 3;
                break;

            case "ureter.bmp":
                this.cmb_TagImage.SelectedIndex = 4;
                break;

            default:
                break;
            }
        }
示例#5
0
        /// <summary>
        /// Ç뻶¨Î»Í¼
        /// </summary>
        private void cmb_TagImage_SelectedIndexChanged(object sender, EventArgs e)
        {
            FileOperator fileOpe = new FileOperator();

            LocalMapName = "";
            switch (this.cmb_TagImage.SelectedIndex)
            {
            case 0:
                LocalMapName = "stomach.bmp";
                break;

            case 1:
                LocalMapName = "colon.bmp";
                break;

            case 2:
                LocalMapName = "bronchus.bmp";
                break;

            case 3:
                LocalMapName = "laryngoscope.bmp";
                break;

            case 4:
                LocalMapName = "ureter.bmp";
                break;

            default:
                break;
            }
            this.drawArea.Image = fileOpe.GetImageFromFile(LocalMapsDir + LocalMapName);
            initPartAndExplain(LocalMapName);
        }
示例#6
0
        /// <summary>
        /// 保存报告内容
        /// </summary>
        /// <param name="worklist"></param>
        /// <param name="xFramerControl1"></param>
        public bool SaveReport()
        {
            FileOperator FileOp     = new FileOperator();
            string       ReportPath = System.Windows.Forms.Application.StartupPath + "\\temp\\NewReport.doc";

            mReport.REPORT_NAME = FileOp.FileByte(ReportPath);
            int i = 0;

            if (bReport.Exists(mReport))
            {
                i = bReport.Update(mReport, " where EXAM_NO='" + mReport.EXAM_NO + "'");
            }
            else
            {
                i = bReport.Add(mReport);
                if (i < 0)
                {
                    return(false);
                }
                this.mWorkList.STUDY_DATE_TIME = System.DateTime.Now;
            }
            this.mWorkList.REPORT_DOCTOR = ((SIS_Model.MUser)frmMainForm.iUser).DOCTOR_ID;
            BWorkList bw = new BWorkList();

            i = bw.Update(this.mWorkList, "where EXAM_ACCESSION_NUM = '" + this.mWorkList.EXAM_ACCESSION_NUM + "'");
            return(i < 0 ? false : true);
        }
示例#7
0
 public frmHistoryExam(frmReportEdit.PicBoxClick pbClick)
 {
     InitializeComponent();
     fOpe         = new FileOperator();
     dc           = new DataChange();
     this.pbClick = pbClick;
     this.dgv_WorkList.AutoGenerateColumns = false;
 }
示例#8
0
 public frmPacsHistory(frmReportEdit.PicBoxClick pbClick)
 {
     InitializeComponent();
     fOpe         = new FileOperator();
     this.pbClick = pbClick;
     CacheDir     = Application.StartupPath + "\\PacsTemp";
     bs           = new BStudy();
     dc           = new DataChange();
     this.dgv_Study.AutoGenerateColumns = false;
 }
示例#9
0
        private void btn_Catch_Click(object sender, EventArgs e)
        {
            Image img = (Image)frmMainForm.myMainForm.iGather.GetCatch();

            if (img != null)
            {
                img = FileOperator.CutImg(img);
                FileOperator.BackCatchImg(img);
                this.frmRptImg.AddPreferImage(img);
            }
        }
示例#10
0
        public void AddBackImage(Image image)
        {
            FileOperator ope         = new FileOperator();
            string       newFileName = ope.GetNewBackFileName(GetConfig.Dynamic, System.DateTime.Now.ToString("yyyyMMdd"), ".jpg");
            string       path        = GetConfig.Dynamic + "\\" + newFileName;

            FileOperator.SaveAsJPEG(image, path, GetConfig.IMS_Quality);
            AddNewImage ani = new AddNewImage(BackAddImage);

            this.p_BackImags.BeginInvoke(ani, new object[] { path, false });
        }
示例#11
0
        public void Save()
        {
            if (this.mImage == null)
            {
                return;
            }
            Bitmap b = null, bt = null, btp = null;

            try
            {
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
                FileOperator ope         = new FileOperator();
                string       newFileName = "Map" + this.CurrentCtl.FileName.Replace("Mark", "");
                string       Newpath     = path + newFileName;
                b   = ImageOpe.FromGraphics((Control)drawArea, drawArea.Width - 2, drawArea.Height - 2);
                bt  = ImageOpe.KiResizeImage(b, 2 * GetConfig.RS_LocMapWidth, 2 * GetConfig.RS_LocMapHeight, 0);
                btp = DrawString(bt, this.cmb_Part.Text.Trim(), this.cmb_Explain.Text.Trim());
                btp.Save(Newpath);
                if (this.mLocMap == null)
                {
                    this.mLocMap               = new MLocationMap();
                    mLocMap.MAP_ID             = this.mImage.IMAGE_ID;
                    mLocMap.EXAM_ACCESSION_NUM = this.mImage.EXAM_ACCESSION_NUM;
                }
                mLocMap.MAP_PART      = this.cmb_Part.Text.Trim();
                mLocMap.MAP_EXPLAIN   = this.cmb_Explain.Text.Trim();
                mLocMap.MAP_TIME      = System.DateTime.Now;
                mLocMap.MARK_INF      = save.SavePoint(this.drawArea);
                mLocMap.MAP_NAME      = LocalMapName;
                mLocMap.MAP_PATH      = this.mImage.IMAGE_PATH.Substring(0, this.mImage.IMAGE_PATH.LastIndexOf("/") + 1) + newFileName;
                CurrentCtl.LocMapPath = Newpath;
                int       i  = 0;
                ImageCopy ic = new ImageCopy();
                i = ic.FileUpLoad(mLocMap, Newpath);
                if (i < 0)
                {
                    MessageBoxEx.Show("±£´æʧ°Ü£¡", "¾¯¸æ");
                }
                else
                {
                    ((ImgObj)CurrentCtl.ImgObj).MLocationMap = mLocMap;
                }
            }
            catch { MessageBoxEx.Show("±£´æʧ°Ü£¡", "¾¯¸æ"); }
            finally
            {
                b.Dispose();
                bt.Dispose();
                btp.Dispose();
            }
        }
示例#12
0
        //报告按模式打开,如普通模式和word模式
        public void initForm(MWorkList model, MReport mReport, bool isShowWord)
        {
            //this.Text = string.Format("检查申请号:{0}", model.EXAM_ACCESSION_NUM);
            this.isShowWord = isShowWord;
            this.mReport    = mReport;// (MReport)(bReport.GetModel(model.EXAM_ACCESSION_NUM));
            this.winWordControl.QuitWord();
            FileOperator file = new FileOperator();

            file.FilesCopy(Application.StartupPath + "\\ReportCache", Application.StartupPath + "\\temp", true);
            List <ImgObj> arr = file.ArrReportImg(frmMainForm.examInf.ArrayImages, Application.StartupPath + "\\ReportCache", Application.StartupPath + "\\temp");

            this.MworkList = model;

            initReport(arr);
        }
示例#13
0
 public void AddPreferImage(Image image)
 {
     if (frmMainForm.examInf.ExamAccessionNum != "" && frmMainForm.examInf.ReqDateTime != "")
     {
         if (!Directory.Exists(Dir))
         {
             Directory.CreateDirectory(Dir);
         }
         FileOperator ope         = new FileOperator();
         string       newFileName = ope.GetNewFileName(Dir, frmMainForm.examInf.ExamAccessionNum, ".jpg");
         string       newPath     = Dir + "\\" + newFileName;
         FileOperator.SaveAsJPEG(image, newPath, GetConfig.IMS_Quality);
         AddNewImage ani = new AddNewImage(PreferAddImage);
         this.p_PreferImages.BeginInvoke(ani, new object[] { newFileName, newPath });
     }
 }
示例#14
0
        //private void axHYImage1_OnEventCallback(object sender, EventArgs e)
        //{
        //    int size = this.axHYImage1.GetImgBufsize();
        //    byte[] data = new byte[size];
        //    int width = 768, height = 580,length=data.Length;
        //    this.axHYImage1.GetVideoData(data, ref length, ref width, ref height, 100);
        //    Bitmap bt = ImageOpe.ByteToImage(data);
        //    if (bt != null)
        //        this.ptb_Gather.Image = bt;
        //}

        private void btn_StaticCatch_Click(object sender, EventArgs e)
        {
            if (this.ptb_Gather.Image == null)
            {
                return;
            }
            Image img = FileOperator.CutImg(this.ptb_Gather.Image);

            if (this.rb_Back.Checked)
            {
                this.backImages.AddBackImage(img);
                this.backImages.Activate();
            }
            if (this.rb_Prefer.Checked)
            {
                FileOperator.BackCatchImg(img);//备份一份到本地
                this.preferImages.AddPreferImage(img);
                this.preferImages.Activate();
            }
        }
示例#15
0
 public void AddPreferImage(Image image)
 {
     if (frmMainForm.examInf.ExamAccessionNum != "" && frmMainForm.examInf.ReqDateTime != "")
     {
         if (!Directory.Exists(Dir))
         {
             Directory.CreateDirectory(Dir);
         }
         FileOperator ope         = new FileOperator();
         string       newFileName = ope.GetNewFileName(Dir, frmMainForm.examInf.ExamAccessionNum, ".jpg");
         string       path        = Dir + newFileName;
         FileOperator.SaveAsJPEG(image, path, GetConfig.IMS_Quality);
         ImgObj obj = this.AddImgObj(newFileName, path);
         if (obj != null)
         {
             AddNewImage ani = new AddNewImage(RptAddImage);
             this.p_RptImages.BeginInvoke(ani, new object[] { obj });
         }
     }
     this.l_Count.Text = "共 " + this.p_RptImages.Controls.Count.ToString() + " 张";
 }
示例#16
0
 /// <summary>
 /// 备份采集的图片
 /// </summary>
 public static void BackCatchImg(Image img)
 {
     //备份采集的图片
     try
     {
         if (frmMainForm.examInf.ExamAccessionNum != "" && frmMainForm.examInf.ReqDateTime != "")
         {
             string ReqDateTime = frmMainForm.examInf.ReqDateTime;
             string BackDir     = string.Format(Application.StartupPath + "\\BCImages\\{0}\\{1}\\", frmMainForm.examInf.ReqDateTime, frmMainForm.examInf.ExamAccessionNum);
             if (!Directory.Exists(BackDir))
             {
                 Directory.CreateDirectory(BackDir);
             }
             string FileName = frmMainForm.examInf.ExamAccessionNum + DateTime.Now.ToString("yyyyMMddhhmmssfff") + ".jpg";
             FileOperator.SaveAsJPEG(img, BackDir + FileName, GetConfig.IMS_Quality);
         }
     }
     catch
     {
         // MessageBoxEx.Show(frmMainForm.examInf.ReqDateTime);
     }
     // MessageBoxEx.Show(frmMainForm.examInf.ReqDateTime);
 }
示例#17
0
        private void btn_Save_Click(object sender, EventArgs e)
        {
            if (this.mImage == null)
            {
                return;
            }
            Bitmap b = null, bt = null, btp = null;

            try
            {
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
                FileOperator ope         = new FileOperator();
                string       newFileName = "Map" + this.Lb_ImgName.Text;
                string       Newpath     = path + newFileName;
                b   = ImageOpe.FromGraphics((Control)drawArea, drawArea.Width - 2, drawArea.Height - 2);
                bt  = ImageOpe.KiResizeImage(b, 2 * GetConfig.RS_LocMapWidth, 2 * GetConfig.RS_LocMapHeight, 0);
                btp = DrawString(bt, this.cmb_Part.Text.Trim(), this.cmb_Explain.Text.Trim());
                btp.Save(Newpath);
                if (this.mLocMap == null)
                {
                    this.mLocMap               = new MLocationMap();
                    mLocMap.MAP_ID             = this.mImage.IMAGE_ID;
                    mLocMap.EXAM_ACCESSION_NUM = this.mImage.EXAM_ACCESSION_NUM;
                }
                mLocMap.MAP_PART    = this.cmb_Part.Text.Trim();
                mLocMap.MAP_EXPLAIN = this.cmb_Explain.Text.Trim();
                mLocMap.MAP_TIME    = System.DateTime.Now;
                mLocMap.MARK_INF    = save.SavePoint(this.drawArea);
                mLocMap.MAP_NAME    = LocalMapName;
                mLocMap.MAP_PATH    = this.mImage.IMAGE_PATH.Substring(0, this.mImage.IMAGE_PATH.LastIndexOf("/") + 1) + newFileName;
                ((ImgObj)CurrentCtl.ImgObj).MLocationMap = (object)mLocMap;
                CurrentCtl.LocMapPath = Newpath;
                int       i  = 0;
                ImageCopy ic = new ImageCopy();
                i = ic.FileUpLoad(mLocMap, Newpath);
                if (i < 0)
                {
                    MessageBoxEx.Show("保存失败!", "警告");
                }
                if (this.isRpt)
                {
                    ((ImgObj)CurrentCtl.ImgObj).MLocationMap = mLocMap;
                    if (!this.CurrentCtl.GetCheck())
                    {
                        this.CurrentCtl.SetCheck(true);
                    }
                    else
                    {
                        this.word.PasteImgWithLocMap(this.CurrentCtl.FilePath, this.CurrentCtl.LocMapPath);
                    }
                    this.Close();
                }
            }
            catch { MessageBoxEx.Show("保存失败!", "警告"); }
            finally
            {
                b.Dispose();
                bt.Dispose();
                btp.Dispose();
            }
        }