/// <summary> /// ִ�е��� /// </summary> public static void ExeExport() { IExport ie = null; string _strExportType = uctlBaseConfig.GetConfig("ExportType"); switch (_strExportType) { case "DB": ie = new ExportDB(); PublicProperty.ExportParam[0] = PublicProperty.ExportData; break; case "DBF": ie = new ExportDBF(); string _strDbfPath = uctlBaseConfig.GetConfig("DbfPath"); PublicProperty.ExportParam[0] = _strDbfPath; PublicProperty.ExportParam[1] = PublicProperty.ExportData.Tables[0]; break; case "EXCLE": ie = new ExportExcel(); string _strExceltPath = uctlBaseConfig.GetConfig("ExceltPath"); PublicProperty.ExcelPath = _strExceltPath; PublicProperty.ExcelSource = PublicProperty.ExportData.Tables[0]; break; case "XML": ie = new ExportXml(); PublicProperty.ExportParam[0] = PublicProperty.ExportData; break; default: CommonFunction.WriteError("δ֪��������:" + _strExportType); break; } Thread t = new Thread(new ThreadStart(ie.Export)); t.Start(); }
private void dataGridView1_CellClick_1(object sender, DataGridViewCellEventArgs e) { //string _strSQLValue = ExportDB.GetSQL(dataGridView1.CurrentRow.Cells["TABLE_NAME"].Value.ToString()); //rtb_sql.Text = _strSQLValue; string _strTableName = dataGridView1.CurrentRow.Cells["TABLE_NAME"].Value.ToString(); this.rtb_xml.Text = ExportXml.GetXML(_strTableName); }
/// <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(); }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { string _strXML = ExportXml.GetXML(dataGridView1.CurrentRow.Cells["TABLE_NAME"].Value.ToString()); this.rtb_xml.Text = _strXML; string _strSQL = string.Format(@"select table_name,class,chapter_name,data_detail,'' CHOSE from pt_chapter_dict where table_name = '{0}'", GetCurrentObjectName()); DataTable _dtChapter = CommonFunction.OleExecuteBySQL(_strSQL, "", "EMR"); dataGridView2.DataSource = _dtChapter; }
/// <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(); }
public string GetTableColumns() { List <string> _lField = ExportXml.GetFiledFromXml(m_strChapter); string _strField = "SELECT \nPATIENT_ID,\nVISIT_ID,"; foreach (string var in _lField) { _strField += "\n" + var.Replace("[", "").Replace("]", "").Trim() + ","; } _strField = _strField.Trim(','); _strField += " \nFROM 表名 \nWHERE PATIENT_ID = '@PATIENT_ID' \nAND VISIT_ID = @VISIT_ID"; return(_strField); }
private void button7_Click(object sender, EventArgs e) { string _strBandedSQL = string.Empty; DataGridViewRow _drObject = dataGridView1.CurrentRow; string _strExportType = uctlBaseConfig.GetConfig("ExportType"); string _strObjectName = _drObject.Cells["TABLE_NAME"].Value.ToString(); string _strSQL = string.Empty;// string.Format(@"delete pt_chapter_dict where table_name = '{0}'", _strObjectName); DataTable _dtObject = null; if (DialogResult.OK == MessageBox.Show("确定同步[章节]数据?", "Message", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning)) { _dtObject = ExportXml.GetObject(_strObjectName); //rtb_sql.Text = _strBandedSQL; SycnChapterData(_strObjectName, _dtObject); InitData(); } }
private void button1_Click(object sender, EventArgs e) { string _strXML = string.Empty; DataGridViewRow var = dataGridView1.CurrentRow; string _strTableName = var.Cells["TABLE_NAME"].Value.ToString(); string _strMs = var.Cells["MS"].Value.ToString(); _strXML = rtb_xml.Text; if (true == ExportXml.SaveXML(_strXML, _strTableName)) { uctlMessageBox.frmDisappearShow("保存成功!"); } else { uctlMessageBox.frmDisappearShow("保存失败,详见错误日志。"); } }
/// <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); }
/// <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(); }
private void button7_Click(object sender, EventArgs e) { string _strBandedSQL = string.Empty; DataGridViewRow _drObject = dataGridView1.CurrentRow; string _strExportType = uctlBaseConfig.GetConfig("ExportType"); string _strObjectName = _drObject.Cells["TABLE_NAME"].Value.ToString(); string _strSQL = string.Empty;// string.Format(@"delete pt_chapter_dict where table_name = '{0}'", _strObjectName); DataTable _dtObject = null; if (DialogResult.OK == MessageBox.Show("确定同步[章节]数据?", "Message", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning)) { //CommonFunction.OleExecuteNonQuery(_strSQL, "EMR"); switch (_strExportType) { case "DB": _strBandedSQL = ExportDB.GetObjectBandedSQL(_strObjectName); break; case "XML": _dtObject = ExportXml.GetObject(_strObjectName); break; case "EXCEL": break; case "DBF": break; default: break; } rtb_sql.Text = _strBandedSQL; //SycnChapterData(_strObjectName, _dtObject); InitData(); } }
/// <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(); }