public ParameterEx[] GetReportParameters() { List <ParameterEx> list = new List <ParameterEx>(); ParameterEx p; p = new ParameterEx(); p.Text = ReportParameterDefine.库房类型; p.Value = cboDeptType.Text; list.Add(p); p = new ParameterEx(); p.Text = ReportParameterDefine.库房名称; p.Value = cboDept.Text.Trim(); list.Add(p); p = new ParameterEx(); p.Text = ReportParameterDefine.价格统计方式; p.Value = radioButton1.Checked ? "按进价" : "按零售价"; list.Add(p); p = new ParameterEx(); p.Text = ReportParameterDefine.统计年份; p.Value = Convert.ToInt32(cboYear.Text); list.Add(p); p = new ParameterEx(); p.Text = ReportParameterDefine.统计月份; p.Value = checkBox1.Checked ? Convert.ToInt32(cboMonth.Text) : 0; list.Add(p); int cjid = Convert.ToInt32(Convertor.IsNull(this.labelTextBox1.SelectedValue, "0")); YpClass.Ypcj cj = new YpClass.Ypcj(cjid, InstanceForm.BDatabase); p = new ParameterEx(); p.Text = ReportParameterDefine.药品名称; p.Value = string.Format("{0}({1})", cj.S_YPPM, cj.S_YPSPM); list.Add(p); p = new ParameterEx(); p.Text = ReportParameterDefine.药品规格; p.Value = cj.S_YPGG; list.Add(p); p = new ParameterEx(); p.Text = ReportParameterDefine.药品单位; p.Value = cj.S_YPDW; list.Add(p); p = new ParameterEx(); p.Text = ReportParameterDefine.药品货号; p.Value = cj.CJID; list.Add(p); return(list.ToArray()); }
public ParameterEx[] GetReportParameters() { List <ParameterEx> list = new List <ParameterEx>(); ParameterEx p; p = new ParameterEx(); p.Text = ReportParameterDefine.统计时间; if (radioButton1.Checked) { p.Value = checkBox1.Checked ? string.Format("{0}年{1}月", cboYear.Text, cboMonth.Text) : string.Format("{0}年", cboYear.Text); } else { p.Value = string.Format("{0}-{1}", dateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss"), dateTimePicker2.Value.ToString("yyyy-MM-dd HH:mm:ss")); } list.Add(p); p = new ParameterEx(); p.Text = ReportParameterDefine.统计科室; p.Value = labelTextBox1.Text == "" ? "全部" : labelTextBox1.Text; list.Add(p); YpClass.Ypcj ypcj = null; if (labelTextBox2.SelectedValue != null) { ypcj = new YpClass.Ypcj(Convert.ToInt32(labelTextBox2.SelectedValue), InstanceForm.BDatabase); } p = new ParameterEx(); p.Text = ReportParameterDefine.药品名称; p.Value = ypcj == null ? "全部" : ypcj.S_YPSPM; list.Add(p); p = new ParameterEx(); p.Text = ReportParameterDefine.药品规格; p.Value = ypcj == null ? "全部" : ypcj.S_YPGG; list.Add(p); return(list.ToArray()); }
public static string GetXml(int gh, string cfrq, string EmployeeName, int ksdm, string ksmc, string mzh, string birth, string brxm, string xb, DataTable tb, string icd) { string xml = "<safe>"; xml += "<doctor_information job_number='" + gh.ToString() + "' date='" + cfrq + "'/>"; xml += "<doctor_name>" + EmployeeName + "</doctor_name>"; //医生名称 xml += "<doctor_type></doctor_type>"; //医生级别代码 xml += "<department_code>" + ksdm.ToString() + "</department_code>"; //科室代码 xml += "<department_name>" + ksmc + "</department_name>"; //科室名称 xml += "<case_id>" + mzh + "</case_id>"; //病历卡号 xml += "<inhos_code>" + mzh + cfrq.Substring(4, 6) + "</inhos_code>"; //门诊号 xml += "<bed_no></bed_no>"; //床号 xml += "<patient_information weight='' height='' birth='" + birth + "' >"; xml += "<patient_name>" + brxm + "</patient_name>"; //病人姓名 xml += "<patient_sex>" + xb + "</patient_sex>"; //性别 xml += "<physiological_statms></physiological_statms><boacterioscopy_effect></boacterioscopy_effect><bloodpressure></bloodpressure><liver_clean></liver_clean>"; xml += "<allergic_history>"; xml += "<case><case_code></case_code>"; xml += "<case_name></case_name></case>"; xml += "<case><case_code></case_code><case_name></case_name></case>"; xml += "<case><case_code></case_code><case_name></case_name></case>"; xml += "</allergic_history>"; //string strzd = "select top 1 CODING from JC_DISEASE where NAME='" + icd + "'"; //object zd = InstanceForm.BDatabase.GetDataResult(strzd); //string zdid = zd == null ? "" : zd.ToString(); //icd = "I25.101"; xml += "<diagnoses><diagnose>" + icd + "</diagnose><diagnose></diagnose><diagnose></diagnose>"; xml += "<diagnose></diagnose><diagnose></diagnose><diagnose></diagnose>"; xml += "</diagnoses></patient_information><prescriptions>"; DataRow[] dr = tb.Select("ypID>0 ", "排序序号"); int result = 0; for (int i = 0; i < dr.Length; i++) { YpClass.Ypcj cj = new YpClass.Ypcj(Convert.ToInt32(dr[i]["ypid"].ToString()), InstanceForm.BDatabase); xml += "<prescription id='" + mzh + cfrq.Substring(4, 6) + "' type='mz' current='1'>";//单个处方开始 xml += "<medicine suspension='false' judge='true'>"; if (Convert.ToInt32(dr[i]["组标志"]) == -1 || Convert.ToInt32(dr[i]["组标志"]) == 0) { xml += "<group_number>" + result + "</group_number>"; result++; } else { xml += "<group_number>" + result + "</group_number>"; } xml += "<general_name>" + dr[i]["品名"].ToString() + "</general_name>"; xml += "<license_number>" + cj.CJID.ToString() + "</license_number>"; xml += "<medicine_name>" + dr[i]["商品名"].ToString() + "</medicine_name>"; xml += "<single_dose coef='1'>" + dr[i]["剂量"].ToString() + "</single_dose>"; string yfid = InstanceForm.BDatabase.GetDataResult("select ID from JC_USAGEDICTION where NAME='" + dr[i]["用法"].ToString() + "'").ToString(); string pcid = InstanceForm.BDatabase.GetDataResult("select ID from jc_FREQUENCY where NAME='" + dr[i]["频次"].ToString() + "'").ToString(); xml += "<times>" + pcid + "</times>"; xml += "<days>" + dr[i]["天数"].ToString() + "</days>"; xml += "<unit>" + dr[i]["剂量单位"].ToString() + "</unit>"; xml += "<administer_drugs>" + yfid + "</administer_drugs>"; xml += "</medicine>"; xml += "</prescription>"; //单个处方结束 } xml += "</prescriptions>"; //循环结束 xml += "</safe>"; //结束 return(xml); }
/// <summary> /// /// </summary> /// <param name="gh">工号</param> /// <param name="cfrq">处方日期</param> /// <param name="EmployeeName">姓名</param> /// <param name="ksdm">科室代码</param> /// <param name="ksmc">科室名称</param> /// <param name="zyh">住院号</param> /// <param name="yzid">医嘱id</param> /// <param name="birth">病人出生日期</param> /// <param name="brxm">病人姓名</param> /// <param name="xb">性别</param> /// <param name="tb">处方明细</param> /// <param name="icd"></param> /// <returns></returns> public static string GetXml(int gh, string cfrq, string EmployeeName, int ksdm, string ksmc, string zyh, string birth, string brxm, string xb, DataTable tb, string icd) { string xml = "<safe>"; xml += "<doctor_information job_number='" + gh.ToString() + "' date='" + cfrq + "'/>"; //工号 系统日期 xml += "<doctor_name>" + EmployeeName + "</doctor_name>"; //医生名称 xml += "<doctor_type></doctor_type>"; //医生级别代码 xml += "<department_code>" + ksdm.ToString() + "</department_code>"; //科室代码 xml += "<department_name>" + ksmc + "</department_name>"; //科室名称 xml += "<case_id>" + zyh + "</case_id>"; //病历卡号 xml += "<inhos_code>" + zyh + cfrq.Substring(4, 6) + "</inhos_code>"; //住院号 xml += "<bed_no></bed_no>"; //床号 xml += "<patient_information weight='' height='' birth='" + birth + "' >"; //身高 体重 出生日期 xml += "<patient_name>" + brxm + "</patient_name>"; //病人姓名 xml += "<patient_sex>" + xb + "</patient_sex>"; //性别 xml += "<physiological_statms></physiological_statms><boacterioscopy_effect></boacterioscopy_effect><bloodpressure></bloodpressure><liver_clean></liver_clean>"; xml += "<allergic_history>"; xml += "<case><case_code></case_code>"; xml += "<case_name></case_name></case>"; xml += "<case><case_code></case_code><case_name></case_name></case>"; xml += "<case><case_code></case_code><case_name></case_name></case>"; xml += "</allergic_history>"; xml += "<diagnoses><diagnose>" + "type = '0',name='" + icd + "'" + "</diagnose><diagnose></diagnose><diagnose></diagnose>"; //诊断 xml += "<diagnose></diagnose><diagnose></diagnose><diagnose></diagnose>"; xml += "</diagnoses></patient_information><prescriptions>"; DataRow[] dr = tb.Select("cjid>0 ", "序号"); int result = 0; for (int i = 0; i < dr.Length; i++) { YpClass.Ypcj cj = new YpClass.Ypcj(Convert.ToInt32(dr[i]["cjid"].ToString()), InstanceForm.BDatabase); xml += "<prescription id='" + zyh + cfrq.Substring(4, 6) + "' type='T'>";//id 医嘱号 type 医嘱类型 ? xml += "<medicine suspension='false' judge='true'>"; //if (Convert.ToInt32(dr[i]["组标志"]) == -1 || Convert.ToInt32(dr[i]["组标志"]) == 0) //{ // xml += "<group_number>" + result + "</group_number>"; //组号 // result++; //} //else // xml += "<group_number>" + result + "</group_number>"; xml += "<group_number>" + result + "</group_number>"; //组号 result++; xml += "<general_name>" + dr[i]["品名"].ToString() + "</general_name>"; //通用名 xml += "<license_number>" + cj.CJID.ToString() + "</license_number>"; //大通是匹配的厂家id //医院药品代码 xml += "<medicine_name>" + dr[i]["商品名"].ToString() + "</medicine_name>"; //商品名 xml += "<single_dose coef='1'>" + Convertor.IsNull(dr[i]["剂量"], "").ToString() + "</single_dose>"; //单次量 string yfid = Convertor.IsNull(InstanceForm.BDatabase.GetDataResult("select ID from JC_USAGEDICTION where NAME='" + dr[i]["用法"].ToString() + "'").ToString(), ""); string pcid = Convertor.IsNull(InstanceForm.BDatabase.GetDataResult("select ID from jc_FREQUENCY where NAME='" + Convertor.IsNull(dr[i]["频次"], "").ToString() + "'").ToString(), ""); xml += "<frequency>" + pcid + "</frequency>"; //频次代码 string cs = ""; xml += "<times>" + cs + "</times>"; //次数 xml += "<unit>" + Convertor.IsNull(dr[i]["单位"], "").ToString() + "</unit>"; //单位(mg,g等)? xml += "<administer_drugs>" + yfid + "</administer_drugs>"; //用药途径?用法 string ksyysj = cfrq; xml += "<begin_time>" + ksyysj + "</begin_time>"; //用药开始时间(YYYY-MM-DD HH:mm:SS)? string jsyysj = cfrq; xml += "<end_time>" + jsyysj + "</end_time>"; //用药结束时间(YYYY-MM-DD HH:mm:SS)? string yzsj = cfrq; xml += "<prescription_time>" + cfrq + "</prescription_time>"; //医嘱时间(YYYY-MM-DD HH:mm:SS)? xml += "</medicine>"; xml += "</prescription>"; //单个处方结束 } xml += "</prescriptions>"; //循环结束 xml += "</safe>"; //结束 return(xml); }