예제 #1
0
 /// <summary>
 /// 导出指定病人的指定对象
 /// </summary>
 /// <param name="p_strObjectName"></param>
 /// <param name="p_strPatientId"></param>
 /// <param name="p_strVisitId"></param>
  public void ExportOnePatInfoForOneObj(string p_strObjectName,string p_strPatientId, string p_strVisitId)
  {
      //GrabInfo.InitPatDBInfo(p_strPatientId, p_strVisitId);
      DataSet _dsOnePatInfo = GrabInfo.GrabPatientInfo(p_strObjectName, p_strPatientId, p_strVisitId);
      DataTable _dt   = ConversionData.ExchangeData(_dsOnePatInfo.Tables[0]);
      //GrabInfo.ExeExport(_dt.DataSet, p_strObjectName, p_strPatientId, p_strVisitId);
      ExportXml ie = new ExportXml(_dsOnePatInfo, p_strObjectName, p_strPatientId, p_strVisitId);
      ie.Export();
  }
예제 #2
0
        /// <summary>
        /// 导出指定病人的指定对象
        /// </summary>
        /// <param name="p_strObjectName"></param>
        /// <param name="p_strPatientId"></param>
        /// <param name="p_strVisitId"></param>
        public void ExportOnePatInfoForOneObj(string p_strObjectName, string p_strPatientId, string p_strVisitId)
        {
            //GrabInfo.InitPatDBInfo(p_strPatientId, p_strVisitId);
            DataSet   _dsOnePatInfo = GrabInfo.GrabPatientInfo(p_strObjectName, p_strPatientId, p_strVisitId);
            DataTable _dt           = ConversionData.ExchangeData(_dsOnePatInfo.Tables[0]);
            //GrabInfo.ExeExport(_dt.DataSet, p_strObjectName, p_strPatientId, p_strVisitId);
            ExportXml ie = new ExportXml(_dsOnePatInfo, p_strObjectName, p_strPatientId, p_strVisitId);

            ie.Export();
        }
예제 #3
0
        /// <summary>
        /// 获取由sql查询到的病人信息
        /// </summary>
        /// <param name="dql">sql集</param>
        /// <returns>病人信息</returns>
        public static void GetPatientData()
        {
            PublicVar.m_strExportType = uctlBaseConfig.GetConfig("ExportType");
            PublicVar.m_nSuccessCount = 0;
            PublicVar.m_nFalseCount   = 0;
            string _strSQL = string.Format("select FIELD_NAME,LOCAL_VALUE,TARGET_VALUE FROM pt_comparison ");

            PublicVar.m_dtFieldDict = CommonFunction.OleExecuteBySQL(_strSQL, "", "EMR");
            InitFieldDict(PublicVar.m_dtFieldDict);

            DataTable _dtSql = GrabInfo.GetConfigSQL();

            foreach (DataRow dr in _dtSql.Rows)
            {
                PublicVar.m_strCurrentObj = dr["table_name"].ToString();
                CommonFunction.WriteLog("开始导出对象" + dr["table_name"].ToString());
                PublicVar.m_nObjSuccessCount = 0;
                PublicVar.m_nObjFalseCount   = 0;
                foreach (DataRow drpat in PublicVar.m_dtPatients.Rows)
                {
                    if (PublicVar.m_strExportType == "XML")
                    {
                        ExportXml ie = new ExportXml(PublicVar.m_dtPatients);
                        ie.Export();
                    }
                    else
                    {
                        _strSQL = string.Format(dr["sql"].ToString().Replace("@PATIENT_ID", drpat["PATIENT_ID"].ToString()).Replace("@VISIT_ID", drpat["VISIT_ID"].ToString()));
                        RemoteMessage.SendMessage("查询病人信息" + dr["TABLE_NAME"].ToString() + "---" + drpat["PATIENT_ID"].ToString() + "---" + drpat["VISIT_ID"].ToString());
                        DataTable _dtOnePatOneObj = CommonFunction.OleExecuteBySQL(_strSQL, dr["TABLE_NAME"].ToString(), "EMR");
                        _dtOnePatOneObj = ConversionData.ExchangeData(_dtOnePatOneObj);
                        ExeExport(_dtOnePatOneObj);
                    }
                }
                CommonFunction.WriteLog("成功" + PublicVar.m_nObjSuccessCount + "失败" + PublicVar.m_nObjFalseCount);
            }
            string _strMess = "总共导入成功:" + PublicVar.m_nSuccessCount + " 导入失败:" + PublicVar.m_nFalseCount;

            RemoteMessage.SendMessage(_strMess);
            CommonFunction.WriteLog(_strMess);
        }
예제 #4
0
        /// <summary>
        /// 执行导出
        /// </summary>
        public static void ExeExport(DataSet p_dsOnePatInfo, string p_strObjectName, string p_strPatientId, string p_strVisitId)
        {
            IExport ie             = null;
            string  _strExportType = uctlBaseConfig.GetConfig("ExportType");

            switch (_strExportType)
            {
            case "DB":
                ie = new ExportDB();
                PublicVar.ExportParam[0] = p_dsOnePatInfo;
                break;

            case "DBF":
                string _strDbfPath = uctlBaseConfig.GetConfig("DbfPath");
                //PublicVar.ExportParam[0] = _strDbfPath;
                //PublicVar.ExportParam[1] = p_dsOnePatInfo;
                ie = new ExportDBF(p_dsOnePatInfo.Tables[0]);
                break;

            case "EXCLE":
                ie = new ExportExcel();
                string _strExceltPath = uctlBaseConfig.GetConfig("ExceltPath");
                PublicVar.ExcelPath = _strExceltPath;
                //PublicProperty.ExcelSource = p_dtOnePatInfo;
                break;

            case "XML":
                ie = new ExportXml(p_dsOnePatInfo, p_strObjectName, p_strPatientId, p_strVisitId);
                //PublicVar.ExportParam[0] = p_dsOnePatInfo;
                break;

            default:
                CommonFunction.WriteError("未知导出类型:" + _strExportType);
                break;
            }
            ie.Export();
            //Thread t = new Thread(new ThreadStart(ie.Export));
            //t.Start();
        }
예제 #5
0
 /// <summary>
 /// 执行导出
 /// </summary>
 public static void ExeExport(DataSet p_dsOnePatInfo,string p_strObjectName ,string p_strPatientId,string p_strVisitId)
 {
     IExport ie = null;
     string _strExportType = uctlBaseConfig.GetConfig("ExportType");
     switch (_strExportType)
     {
         case "DB":
             ie = new ExportDB();
             PublicVar.ExportParam[0] = p_dsOnePatInfo;
             break;
         case "DBF":
             string _strDbfPath = uctlBaseConfig.GetConfig("DbfPath");
             //PublicVar.ExportParam[0] = _strDbfPath;
             //PublicVar.ExportParam[1] = p_dsOnePatInfo;
             ie = new ExportDBF(p_dsOnePatInfo.Tables[0]);
             break;
         case "EXCLE":
             ie = new ExportExcel();
             string _strExceltPath = uctlBaseConfig.GetConfig("ExceltPath");
             PublicVar.ExcelPath = _strExceltPath;
             //PublicProperty.ExcelSource = p_dtOnePatInfo;
             break;
         case "XML":
             ie = new ExportXml(p_dsOnePatInfo, p_strObjectName, p_strPatientId, p_strVisitId);
             //PublicVar.ExportParam[0] = p_dsOnePatInfo;
             break;
         default:
             CommonFunction.WriteError("未知导出类型:" + _strExportType);
             break;
     }
     ie.Export();
     //Thread t = new Thread(new ThreadStart(ie.Export));
     //t.Start();
 }
예제 #6
0
        /// <summary>
        /// 获取由sql查询到的病人信息
        /// </summary>
        /// <param name="dql">sql集</param>
        /// <returns>病人信息</returns>
        public static void GetPatientData()
        {
            PublicVar.m_strExportType = uctlBaseConfig.GetConfig("ExportType");
            PublicVar.m_nSuccessCount = 0;
            PublicVar.m_nFalseCount = 0;
            string _strSQL = string.Format("select FIELD_NAME,LOCAL_VALUE,TARGET_VALUE FROM pt_comparison ");
            PublicVar.m_dtFieldDict = CommonFunction.OleExecuteBySQL(_strSQL, "", "EMR");
            InitFieldDict(PublicVar.m_dtFieldDict);

            DataTable _dtSql = GrabInfo.GetConfigSQL();
            foreach (DataRow dr in _dtSql.Rows)
            {
                PublicVar.m_strCurrentObj = dr["table_name"].ToString();
                CommonFunction.WriteLog("开始导出对象" + dr["table_name"].ToString());
                PublicVar.m_nObjSuccessCount = 0;
                PublicVar.m_nObjFalseCount = 0;
                foreach (DataRow drpat in PublicVar.m_dtPatients.Rows)
                {
                    if (PublicVar.m_strExportType == "XML")
                    {
                        ExportXml ie = new ExportXml(PublicVar.m_dtPatients);
                        ie.Export();
                    }
                    else
                    {
                        _strSQL = string.Format(dr["sql"].ToString().Replace("@PATIENT_ID", drpat["PATIENT_ID"].ToString()).Replace("@VISIT_ID", drpat["VISIT_ID"].ToString()));
                        RemoteMessage.SendMessage("查询病人信息" + dr["TABLE_NAME"].ToString() + "---" + drpat["PATIENT_ID"].ToString() + "---" + drpat["VISIT_ID"].ToString());
                        DataTable _dtOnePatOneObj = CommonFunction.OleExecuteBySQL(_strSQL, dr["TABLE_NAME"].ToString(), "EMR");
                        _dtOnePatOneObj = ConversionData.ExchangeData(_dtOnePatOneObj);
                        ExeExport(_dtOnePatOneObj);
                    }
                }
                CommonFunction.WriteLog("成功" + PublicVar.m_nObjSuccessCount + "失败" + PublicVar.m_nObjFalseCount);
            }
            string _strMess = "总共导入成功:" + PublicVar.m_nSuccessCount + " 导入失败:" + PublicVar.m_nFalseCount;
            RemoteMessage.SendMessage(_strMess);
            CommonFunction.WriteLog(_strMess);
        }