Exemplo n.º 1
0
 private void ExamList_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.RowIndex < 0)
     {
         return;
     }
     if (e.ColumnIndex == this.colFilePath.Index)
     {
         ExamResult examResult = this.ExamList.Rows[e.RowIndex].Cells[this.colFilePath.Index].Tag as ExamResult;
         if (examResult == null)
         {
             return;
         }
         if (string.IsNullOrEmpty(examResult.FILE_PATH))
         {
             return;
         }
         string dstFilePath = string.Format("{0}\\{1}\\{2}\\{3}\\{4}.pdf"
                                            , SystemParam.Instance.WorkPath
                                            , "temp"
                                            , SystemParam.Instance.PatVisitInfo.PATIENT_ID
                                            , SystemParam.Instance.PatVisitInfo.VISIT_ID
                                            , examResult.EXAM_ID);
         if (!File.Exists(dstFilePath))
         {
             bool result = ShareFolderRead.Download(examResult.FILE_PATH, dstFilePath);
             if (!result)
             {
                 MessageBoxEx.ShowError("报告下载失败");
                 return;
             }
         }
         CommandHandler.Instance.SendCommand("报告查看", this.MainForm, dstFilePath);
     }
 }
Exemplo n.º 2
0
        private void btnPrintPacs_Click(object sender, EventArgs e)
        {
            if (this.ExamList.Rows.Count <= 0)
            {
                MessageBoxEx.ShowMessage("没有要打印的报告");
                return;
            }
            List <string> lstFileList     = new List <string>();
            List <string> lstExamID       = new List <string>();
            string        szMergeFileName = string.Empty;

            WorkProcess.Instance.Initialize(this, this.ExamList.Rows.Count, "正在下载检查报告....");
            foreach (DataGridViewRow item in this.ExamList.Rows)
            {
                if (WorkProcess.Instance.Canceled)
                {
                    WorkProcess.Instance.Close();
                    return;
                }
                WorkProcess.Instance.Show(item.Index + 1);
                if (item.Cells[this.colResultStatus.Index].Value.ToString() != "确认报告")
                {
                    continue;
                }
                if (item.Cells[this.colCheckBox.Index].Value != null &&
                    item.Cells[this.colCheckBox.Index].Value.ToString().ToLower() == "true"
                    )
                {
                    ExamResult examResult = item.Cells[this.colFilePath.Index].Tag as ExamResult;
                    if (examResult != null &&
                        !string.IsNullOrEmpty(examResult.FILE_PATH))
                    {
                        //下载文件
                        string dstFilePath = string.Format("{0}\\{1}\\{2}\\{3}\\{4}.pdf"
                                                           , SystemParam.Instance.WorkPath
                                                           , "temp"
                                                           , SystemParam.Instance.PatVisitInfo.PATIENT_ID
                                                           , SystemParam.Instance.PatVisitInfo.VISIT_ID
                                                           , examResult.EXAM_ID);
                        if (!File.Exists(dstFilePath))
                        {
                            bool result = ShareFolderRead.Download(examResult.FILE_PATH, dstFilePath);
                            if (!result)
                            {
                                MessageBoxEx.ShowError("报告下载失败");
                                WorkProcess.Instance.Close();
                                return;
                            }
                        }
                        lstFileList.Add(examResult.FILE_PATH);
                        lstExamID.Add(examResult.EXAM_ID);
                    }
                }
            }
            WorkProcess.Instance.Close();
            if (lstFileList.Count <= 0)
            {
                MessageBoxEx.ShowMessage("没有要打印的报告");

                return;
            }
            szMergeFileName = string.Format("{0}\\temp\\{1}\\{2}\\{3}.pdf"
                                            , SystemParam.Instance.WorkPath
                                            , SystemParam.Instance.PatVisitInfo.PATIENT_ID
                                            , SystemParam.Instance.PatVisitInfo.VISIT_ID
                                            , string.Join("_", lstExamID.ToArray()));
            if (!File.Exists(szMergeFileName))
            {
                bool result = PdfHelper.MergePDFFiles(lstFileList.ToArray(), szMergeFileName);
                if (!result)
                {
                    MessageBoxEx.ShowError("报告合并打印失败");
                    return;
                }
            }
            CommandHandler.Instance.SendCommand("报告查看", this.MainForm, szMergeFileName);
        }