public DataSet GetRecipeInfo() { //查询未缴费的处方信息,如果未缴费的处方没有的,则不需要缴费 ClinicPhysicianRecipeFacade clinicPhysicianRecipeFacade = new ClinicPhysicianRecipeFacade(); DataSet dsRecipe = clinicPhysicianRecipeFacade.FindRecipeDetailByDiagnoseID(SkyComm.DiagnoseID); string Offices = SkyComm.getvalue("使用自助缴费的执行科室ID"); string[] arrOffice = Offices.Split(','); //if (!string.IsNullOrEmpty(Offices)) //{ // foreach (DataRow row in dsRecipe.Tables[0].Rows) // { // if (row.RowState == DataRowState.Deleted) // continue; // if (!arrOffice.Contains(row["EXECOFFICEID"].ToString())) // { // row.Delete(); // } // } // dsRecipe.AcceptChanges(); //} if (dsRecipe.Tables[0].Rows.Count == 0) { SkyComm.ShowMessageInfo("没有需要缴费的处方信息!"); return(null); } dsRecipe.Tables[0].Columns.Add("PRICECHANGE", typeof(decimal)); //单价 dsRecipe.Tables[0].Columns.Add("AMOUNTCHANGE", typeof(decimal)); //数量 dsRecipe.Tables[0].Columns.Add("UNITCHANGE", typeof(string)); //单位 dsRecipe.Tables[0].Columns.Add("PITCHON1", typeof(bool)); //单位 //dsRecipe.Tables[0].Columns["PITCHON"].DataType = typeof(System.Boolean); UnitToPack unitToPack = new UnitToPack(); foreach (DataRow item in dsRecipe.Tables[0].Rows) { item["PITCHON1"] = Convert.ToBoolean(item["PITCHON"]); if (item["OUTPATIENTUNIT"].ToString().Trim() == "包装") { item.BeginEdit(); int amount = Convert.ToInt32(item["AMOUNT"]); int changeratio = Convert.ToInt32(item["CHANGERATIO"]); item["AMOUNTCHANGE"] = unitToPack.GetPackAmount(Convert.ToInt32(item["CHANGERATIO"]), Convert.ToInt32(item["AMOUNT"])); item["UNITCHANGE"] = item["PACK"]; item["PRICECHANGE"] = Convert.ToDecimal(item["UNITPRICE"]) * changeratio; item.EndEdit(); } else { item.BeginEdit(); item["PRICECHANGE"] = item["UNITPRICE"]; item["AMOUNTCHANGE"] = item["AMOUNT"]; item["UNITCHANGE"] = item["UNIT"]; item.EndEdit(); } } return(dsRecipe); }
private void FrmNoPayment_Load(object sender, EventArgs e) { //查询未缴费的处方信息 ClinicPhysicianRecipeFacade clinicPhysicianRecipeFacade = new ClinicPhysicianRecipeFacade(); DataSet dsRecipe = clinicPhysicianRecipeFacade.FindRecipeDetailByDiagnoseID(SkyComm.DiagnoseID); if (dsRecipe.Tables[0].Rows.Count == 0) { this.gdcMain.DataSource = null; return; } dsRecipe.Tables[0].Columns.Add("PRICECHANGE", typeof(decimal)); //单价 dsRecipe.Tables[0].Columns.Add("AMOUNTCHANGE", typeof(decimal)); //数量 dsRecipe.Tables[0].Columns.Add("UNITCHANGE", typeof(string)); //单位 dsRecipe.Tables[0].Columns.Add("PITCHON1", typeof(bool)); //单位 UnitToPack unitToPack = new UnitToPack(); foreach (DataRow item in dsRecipe.Tables[0].Rows) { item["PITCHON1"] = Convert.ToBoolean(item["PITCHON"]); if (item["OUTPATIENTUNIT"].ToString().Trim() == "包装") { item.BeginEdit(); int amount = Convert.ToInt32(item["AMOUNT"]); int changeratio = Convert.ToInt32(item["CHANGERATIO"]); item["AMOUNTCHANGE"] = unitToPack.GetPackAmount(Convert.ToInt32(item["CHANGERATIO"]), Convert.ToInt32(item["AMOUNT"])); item["UNITCHANGE"] = item["PACK"]; item["PRICECHANGE"] = Convert.ToDecimal(item["UNITPRICE"]) * changeratio; item.EndEdit(); } else { item.BeginEdit(); item["PRICECHANGE"] = item["UNITPRICE"]; item["AMOUNTCHANGE"] = item["AMOUNT"]; item["UNITCHANGE"] = item["UNIT"]; item.EndEdit(); } } this.gdcMain.DataSource = dsRecipe.Tables[0].Select("", "CLINICRECIPEID").CopyToDataTable(); }
public DataSet GetRecipeInfo() { //查询未缴费的处方信息,如果未缴费的处方没有的,则不需要缴费 ClinicPhysicianRecipeFacade clinicPhysicianRecipeFacade = new ClinicPhysicianRecipeFacade(); DataSet dsRecipe = clinicPhysicianRecipeFacade.FindRecipeDetailByDiagnoseID(SkyComm.DiagnoseID); if (dsRecipe.Tables[0].Rows.Count == 0) { SkyComm.ShowMessageInfo("没有需要缴费的处方信息!"); return(null); } dsRecipe.Tables[0].Columns.Add("PRICECHANGE", typeof(decimal)); //单价 dsRecipe.Tables[0].Columns.Add("AMOUNTCHANGE", typeof(decimal)); //数量 dsRecipe.Tables[0].Columns.Add("UNITCHANGE", typeof(string)); //单位 dsRecipe.Tables[0].Columns.Add("PITCHON1", typeof(bool)); //单位 //dsRecipe.Tables[0].Columns["PITCHON"].DataType = typeof(System.Boolean); UnitToPack unitToPack = new UnitToPack(); foreach (DataRow item in dsRecipe.Tables[0].Rows) { item["PITCHON1"] = Convert.ToBoolean(item["PITCHON"]); if (item["OUTPATIENTUNIT"].ToString().Trim() == "包装") { item.BeginEdit(); int amount = Convert.ToInt32(item["AMOUNT"]); int changeratio = Convert.ToInt32(item["CHANGERATIO"]); item["AMOUNTCHANGE"] = unitToPack.GetPackAmount(Convert.ToInt32(item["CHANGERATIO"]), Convert.ToInt32(item["AMOUNT"])); item["UNITCHANGE"] = item["PACK"]; item["PRICECHANGE"] = Convert.ToDecimal(item["UNITPRICE"]) * changeratio; item.EndEdit(); } else { item.BeginEdit(); item["PRICECHANGE"] = item["UNITPRICE"]; item["AMOUNTCHANGE"] = item["AMOUNT"]; item["UNITCHANGE"] = item["UNIT"]; item.EndEdit(); } } return(dsRecipe); }
/// <summary> /// 调用派昂WebService方法传数据 19797 /// </summary> private string UploadAngPaiData(DataSet detailAccountData, DataSet ecipeMedicineData, DataSet dsRecipeDetail) { PatientInfoFacade patientinfo = new PatientInfoFacade(); UnitToPack unitToPack = new UnitToPack(); DataSet dataset = patientinfo.FindInfoByDiagnoseidForLeechdom(SkyComm.DiagnoseID); string Sicknessname = string.Empty; if (dataset != null && dataset.Tables[0].Rows.Count > 0) { DataRow[] dr = dataset.Tables[0].Select("OFFICEID='" + detailAccountData.Tables[0].Rows[0]["REGISTEROFFICEID"].ToString() + "'"); if (dr != null && dr.Length > 0) { Sicknessname = dr[0]["SICKNESSNAME1"].ToString(); } } PerfromFreqFacade thePerfromFreqFacade = new PerfromFreqFacade(); DataSet dsfreq = thePerfromFreqFacade.FindAllNotStop(); string strXml = "<?xml version='1.0' encoding='GBK' standalone='yes' ?>"; strXml += "<output>"; //循环处理发药明细实体中的记录 foreach (DataRow rowYp in ecipeMedicineData.Tables[0].Rows) { strXml += "<row>"; strXml += "<diagnoseid>" + SkyComm.DiagnoseID + "</diagnoseid>"; strXml += "<sicknessname>" + Sicknessname + "</sicknessname>"; strXml += "<operatedate>" + Convert.ToDateTime(rowYp["OPERATEDATE"]).ToString("yyyy-MM-dd HH:mm:ss") + "</operatedate>"; strXml += "<patientname>" + lblxm.Text + "</patientname>"; strXml += "<registerid>" + detailAccountData.Tables[0].Rows[0][DetailAccountData.D_DETAIL_ACCOUNT_REGISTERID].ToString() + "</registerid>"; //mitao 20150427 上传当时的开单科室和开单医生 21185 strXml += "<registerofficeid>" + detailAccountData.Tables[0].Rows[0][DetailAccountData.D_DETAIL_ACCOUNT_REGISTEROFFICEID].ToString() + "</registerofficeid>"; strXml += "<doctorid>" + detailAccountData.Tables[0].Rows[0][DetailAccountData.D_DETAIL_ACCOUNT_DOCTORID].ToString() + "</doctorid>"; //strXml += "<registerofficeid>admin</registerofficeid>"; //strXml += "<doctorid>admin</doctorid>"; string ClinicrecipeId = rowYp[EcipeMedicineData.D_ECIPE_MEDICINE_ECIPENUM].ToString(); string RecipelistNum = rowYp[EcipeMedicineData.D_ECIPE_MEDICINE_SERIALNO].ToString(); if (!dsRecipeDetail.Tables[0].Columns.Contains("PRICECHANGE")) { dsRecipeDetail.Tables[0].Columns.Add("PRICECHANGE", typeof(decimal)); //单价 dsRecipeDetail.Tables[0].Columns.Add("AMOUNTCHANGE", typeof(decimal)); //数量 dsRecipeDetail.Tables[0].Columns.Add("UNITCHANGE", typeof(string)); //单位 } DataRow[] ArrRow = dsRecipeDetail.Tables[0].Select("CLINICRECIPEID='" + ClinicrecipeId + "' AND RECIPELISTNUM=" + RecipelistNum); if (ArrRow.Length > 0) { if (ArrRow[0]["OUTPATIENTUNIT"].ToString().Trim() == "单位") { ArrRow[0].BeginEdit(); ArrRow[0]["PRICECHANGE"] = ArrRow[0]["UNITPRICE"]; ArrRow[0]["AMOUNTCHANGE"] = ArrRow[0]["AMOUNT"]; ArrRow[0]["UNITCHANGE"] = ArrRow[0]["UNIT"]; ArrRow[0].EndEdit(); } if (ArrRow[0]["OUTPATIENTUNIT"].ToString().Trim() == "包装") { ArrRow[0].BeginEdit(); int amount = Convert.ToInt32(ArrRow[0]["AMOUNT"]); int changeratio = Convert.ToInt32(ArrRow[0]["CHANGERATIO"]); ArrRow[0]["AMOUNTCHANGE"] = unitToPack.GetPackAmount(Convert.ToInt32(ArrRow[0]["CHANGERATIO"]), Convert.ToInt32(ArrRow[0]["AMOUNT"])); ArrRow[0]["UNITCHANGE"] = ArrRow[0]["PACK"]; ArrRow[0]["PRICECHANGE"] = Convert.ToDecimal(ArrRow[0]["UNITPRICE"]) * changeratio; ArrRow[0].EndEdit(); } strXml += "<dose>" + ArrRow[0]["DOSE"].ToString() + "</dose>"; strXml += "<doseunit>" + ArrRow[0]["DOSEUNIT"].ToString() + "</doseunit>"; strXml += "<medusage>" + ArrRow[0]["MEDUSAGE"].ToString() + "</medusage>"; strXml += "<tohavemedicinefrequency>" + ArrRow[0]["TOHAVEMEDICINEFREQUENCY"].ToString() + "</tohavemedicinefrequency>"; DataRow[] arrfreq = dsfreq.Tables[0].Select("PERFORMFREQ='" + ArrRow[0]["TOHAVEMEDICINEFREQUENCY"].ToString() + "'"); if (arrfreq.Length > 0) { strXml += "<times>" + arrfreq[0]["TIMES"].ToString() + "</times>"; } else { strXml += "<times></times>"; } strXml += "<usedays>" + ArrRow[0]["USEDAYS"].ToString() + "</usedays>"; strXml += "<clinicrecipeid>" + ClinicrecipeId + "</clinicrecipeid>"; strXml += "<icode>" + ArrRow[0]["ICODE"].ToString() + "</icode>"; strXml += "<unitprice>" + ArrRow[0]["PRICECHANGE"].ToString() + "</unitprice>"; strXml += "<amount>" + ArrRow[0]["AMOUNTCHANGE"].ToString() + "</amount>"; strXml += "<unit>" + ArrRow[0]["UNITCHANGE"].ToString() + "</unit>"; strXml += "<totalmoney>" + ArrRow[0]["TOTALMONEY"].ToString() + "</totalmoney>"; strXml += "<storeroomid>" + rowYp[EcipeMedicineData.D_ECIPE_MEDICINE_STOREROOMID].ToString() + "</storeroomid>"; strXml += "<detailaccountid>" + rowYp[EcipeMedicineData.D_ECIPE_MEDICINE_DETAILACCOUNTID].ToString() + "</detailaccountid>"; strXml += "<pack>" + ArrRow[0]["PACK"].ToString() + "</pack>"; strXml += "<changeratio>" + rowYp[EcipeMedicineData.D_ECIPE_MEDICINE_CHANGERATIO].ToString() + "</changeratio>"; strXml += "<outpatientunit>" + rowYp[EcipeMedicineData.D_ECIPE_MEDICINE_OUTPATIENTUNIT].ToString() + "</outpatientunit>"; } strXml += "</row>"; } strXml += "</output>"; string[] detailtemp = SystemInfo.SystemConfigs["药房自动配药接口类型"].Detail.Split('#'); string pacspath = string.Empty; for (int i = 0; i < detailtemp.Length; i++) { if (detailtemp[i].IndexOf("派昂") != -1) { if (detailtemp[i].Split(',').Length != 2) { SkyComm.ShowMessageInfo("[药房自动配药接口类型]配置格式有误!"); return(""); } pacspath = detailtemp[i].Split(',')[1]; break; } } if (pacspath == string.Empty) { SkyComm.ShowMessageInfo("[药房自动配药接口类型]服务地址未配置!"); return(""); } object[] obj = new object[1]; obj[0] = strXml; try { //通过调用WebService给派昂传数据 Skynet.LoggingService.LogService.GlobalInfoMessage("调用派昂接口MZ_SetDoctorInfo方法输入参数:" + strXml); string strResult = Common.WebServiceHelper.InvokeWebService(pacspath, "MZ_SetDoctorInfo", obj).ToString(); Skynet.LoggingService.LogService.GlobalInfoMessage("调用派昂接口MZ_SetDoctorInfo方法返回值:" + strResult); if (strResult == "0" || strResult == "-1") { Skynet.LoggingService.LogService.GlobalInfoMessage("调用派昂接口MZ_SetDoctorInfo方法失败,返回值:" + strResult); SkyComm.ShowMessageInfo("调用派昂接口MZ_SetDoctorInfo方法失败,返回值:" + strResult); return(""); } else { return(strResult); } } catch (Exception ex) { Skynet.LoggingService.LogService.GlobalInfoMessage("调用派昂接口MZ_SetDoctorInfo方法失败:" + ex.Message); SkyComm.ShowMessageInfo("调用派昂接口MZ_SetDoctorInfo方法失败:" + ex.Message); return(""); } }