//获取文件到硬盘 private void PackSubFileToISO_Study(string subFileName, string NowParentDirectNamePath, string ServerPath) { DataTable ImageDatatable = b_Instance.GetList(" STUDY_KEY ='" + subFileName + "'"); SIS_Function.FileTransfer socket = new SIS_Function.FileTransfer(ILL.GetConfig.ServerIp, ILL.GetConfig.ServerPort);//连接SOCKET //创建二级目录 string NowSubDirectNamePath = NowParentDirectNamePath + "\\" + subFileName; Directory.CreateDirectory(NowSubDirectNamePath); //NeroFolder subFolder = new NeroFolderClass(); //ParentFloder.Folders.Add(subFolder); //subFolder.Name = studySet.series_instance_uid[j].ToString(); PACS_Model.MReport m_Report = (PACS_Model.MReport)b_report.GetModel(subFileName); //读取WROD报告 if (m_Report != null) { FileOp.FileSave(m_Report.REPORT_NAME, NowSubDirectNamePath + "\\" + subFileName + ".DOC"); } for (int i = 0; i < ImageDatatable.Rows.Count; i++) { string tPath = ImageDatatable.Rows[i]["PATH_NAME"].ToString().Replace('/', '\\'); socket.FileDown(ServerPath + tPath, NowSubDirectNamePath + tPath.Substring(tPath.LastIndexOf('\\'), tPath.Length - tPath.LastIndexOf('\\'))); } }
/// <summary> /// 下载报告 /// </summary> /// <returns></returns> public IModel ReportDownLoad(IModel iWorklist, string saveDir) { string ReportPath = saveDir + "\\report.doc"; try { if (GetConfig.DALAndModel == "SIS") { SIS_Model.MWorkList mWorklist = (SIS_Model.MWorkList)iWorklist; SIS_Model.MReport mReport = (SIS_Model.MReport)bReport.GetModel(mWorklist.EXAM_ACCESSION_NUM); if (mReport == null || mReport.REPORT_NAME == null) { if (mReport == null) { mReport = new SIS_Model.MReport(); } SIS_Model.MPrintTemplateDict mPrint = (SIS_Model.MPrintTemplateDict)bPrint.GetModel(mWorklist.EXAM_CLASS, mWorklist.EXAM_SUB_CLASS); if (mPrint != null) { FileOp.FileSave(mPrint.FILE_NAME, ReportPath); mReport.FIELD_INF = mPrint.FIELD_INF; mReport.PRINT_TEMPLATE = mPrint.PRINT_TEMPLATE; } else//无此检查类别,检查子类的打印模版时,下载此检查类别下的默认打印模版 { DataTable dt = bPrint.GetList("EXAM_CLASS = '" + mWorklist.EXAM_CLASS + "'"); if (dt.Rows.Count > 0) { mPrint = (SIS_Model.MPrintTemplateDict)bPrint.GetModel(dt.Rows[0]); FileOp.FileSave(mPrint.FILE_NAME, ReportPath); mReport.FIELD_INF = mPrint.FIELD_INF; mReport.PRINT_TEMPLATE = mPrint.PRINT_TEMPLATE; } else { return(null); } } } else { FileOp.FileSave(mReport.REPORT_NAME, ReportPath); } return(mReport); } else { PACS_Model.MWorkList mWorklist = (PACS_Model.MWorkList)iWorklist; PACS_Model.MReport mReport = (PACS_Model.MReport)bReport.GetModel(mWorklist.EXAM_ACCESSION_NUM); if (mReport == null || mReport.REPORT_NAME == null) { if (mReport == null) { mReport = new PACS_Model.MReport(); } PACS_Model.MPrintTemplateDict mPrint = (PACS_Model.MPrintTemplateDict)bPrint.GetModel(mWorklist.EXAM_CLASS, mWorklist.EXAM_SUB_CLASS); if (mPrint != null) { FileOp.FileSave(mPrint.FILE_NAME, ReportPath); mReport.FIELD_INF = mPrint.FIELD_INF; mReport.PRINT_TEMPLATE = mPrint.PRINT_TEMPLATE; } else//无此检查类别,检查子类的打印模版时,下载此检查类别下的默认打印模版 { DataTable dt = bPrint.GetList("EXAM_CLASS = '" + mWorklist.EXAM_CLASS + "'"); if (dt.Rows.Count > 0) { mPrint = (PACS_Model.MPrintTemplateDict)bPrint.GetModel(dt.Rows[0]); FileOp.FileSave(mPrint.FILE_NAME, ReportPath); mReport.FIELD_INF = mPrint.FIELD_INF; mReport.PRINT_TEMPLATE = mPrint.PRINT_TEMPLATE; } else { return(null); } } } else { FileOp.FileSave(mReport.REPORT_NAME, ReportPath); } return(mReport); } } catch { return(null); } }