Exemplo n.º 1
0
        private void SendImgToPax()
        {
            DcmStudy stu = new DcmStudy();

            stu.strExamAccessionNum      = mStudy.EXAM_ACCESSION_NUM;
            stu.strStudyUID              = mStudy.STUDY_INSTANCE_UID;
            stu.strPatientID             = mStudy.PATIENT_ID;
            stu.strPatientLocalID        = mStudy.STUDY_ID;
            stu.strPatientName           = mStudy.PATIENT_NAME;
            stu.strPatientSex            = mStudy.PATIENT_SEX;
            stu.nPatientAge              = (int)mStudy.PATIENT_AGE;
            stu.strPatientAgeUnit        = mStudy.PATIENT_AGE_UNIT;
            stu.nSeriesNum               = 1;
            stu.nInstanceNum             = 0;
            stu.strStudyDate             = ((DateTime)mStudy.STUDY_DATE_TIME).ToString("yyyyMMdd"); //
            stu.strStudyTime             = ((DateTime)mStudy.STUDY_DATE_TIME).ToString("hhmmss.0");
            stu.strInputFileList         = this.ImgSave;                                            //
            stu.strOutputFileList        = GetDcmOutFile(this.ImgSave);                             //
            stu.strOutputFilePath        = Application.StartupPath + "\\DCM\\";
            stu.strModality              = mStudy.MODALITY;
            stu.strManufacturer          = "EC";
            stu.strAppVersionName        = "E-Charm";
            stu.nTransferSyntaxUID       = 0;     //0,DCM默认语法;1:
            stu.bHaltOnEncounteredUnsucc = false; //遇到失败,是否退出
            DcmInterface dcm = new DcmInterface();

            dcm.JPGToDCM(stu);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="paths">path1;path2;path3</param>
        /// <param name="dcm"></param>
        /// <returns></returns>
        public bool JPGToDCM(DcmStudy dcm)
        {
            //string SaveDcmDic = Application.StartupPath + "\\DCM\\";
            //string outFiles = "";
            //for (int i = 0; i < paths.Split(';').Length; i++)
            //{
            //    outFiles += i.ToString() + ".dcm;";
            //}
            //outFiles.TrimEnd(';');
            sReturnInfItem result = FpaxConvertImagesToDCM(dcm.strExamAccessionNum,
                                                           dcm.strStudyUID,
                                                           dcm.strPatientID,
                                                           dcm.strPatientLocalID,
                                                           dcm.strPatientName,
                                                           dcm.strPatientSex,
                                                           dcm.nPatientAge,
                                                           dcm.strPatientAgeUnit,
                                                           dcm.nSeriesNum,
                                                           dcm.nInstanceNum,
                                                           dcm.strStudyDate,         //
                                                           dcm.strStudyTime,         //
                                                           dcm.strInputFileList,     //
                                                           dcm.strOutputFileList,    //
                                                           dcm.strOutputFilePath,
                                                           dcm.strModality,
                                                           dcm.strManufacturer,
                                                           dcm.strAppVersionName,
                                                           dcm.nTransferSyntaxUID,      //0,DCM默认语法;1:
                                                           dcm.bHaltOnEncounteredUnsucc //遇到失败,是否退出
                                                           );                           //目前仅适用于RGB图像
            //FpaxConvertImagesToDCM(dt.Rows[0]["Exam_accession_num"].ToString(), dt.Rows[0]["study_instance_uid"].ToString(),
            //                        dt.Rows[0]["patient_id"].ToString(),dt.Rows[0]["study_id"].ToString(),
            //                        dt.Rows[0]["patient_name"].ToString(), dt.Rows[0]["patient_sex"].ToString(),
            //                        int.Parse(dt.Rows[0]["patient_age"].ToString()), dt.Rows[0]["patient_age_unit"].ToString(),
            //                        1, 0,
            //                        Convert.ToDateTime(dt.Rows[0]["study_date_time"].ToString()).ToString("yyyyMMdd"),Convert.ToDateTime(dt.Rows[0]["study_date_time"].ToString()).ToString("hhmmss.0"),
            //                        paths, outFiles, SaveDcmDic,
            //                    GetConfig.Modality, "EC",
            //                        "E-Charm", 0, false);
            //string DcmPath = SaveDcmDic + outFiles.TrimEnd(';').Replace(".dcm;", ".dcm;" + SaveDcmDic) + ";";
            //DcmPath = SaveDcmDic + "4.dcm";
            IntPtr pInt     = (IntPtr)0;
            string DcmPaths = dcm.strOutputFilePath + dcm.strOutputFileList.TrimEnd(';').Replace(".dcm;", ".dcm;" + dcm.strOutputFilePath) + ";";

            m_sReturnItem = FpaxStoreDCMSToOneSCP(DcmPaths, GetConfig.DcmServerAE, GetConfig.DcmIp, GetConfig.DcmPort, GetConfig.LocalAE, GetConfig.LocalIp, true, 20, false, false, false, 0, m_pCallBack, pInt);
            if (m_sReturnItem.m_nReturnCode != 1)
            {
                MessageBoxEx.Show("传送图片到PACS失败!请检查网络连接", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                if (dcm.strInputFileList.Split(';').Length > m_sReturnItem.m_nImgIndex)
                {
                    int failCount = dcm.strInputFileList.Split(';').Length - m_sReturnItem.m_nImgIndex;
                    MessageBoxEx.Show(failCount.ToString() + "个图象传送到PACS失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            return(true);
        }