public ServiceResponseData BudgeBalance() { try { List <Prescription> prescriptions = requestData.GetData <List <Prescription> >(0); //预算处方 int operatorid = requestData.GetData <int>(1); //操作员ID OP_PatList curPatlist = requestData.GetData <OP_PatList>(2); //当前病人对象 int costPatTypeid = requestData.GetData <int>(3); //结算病人类型 List <int> budgePresNum = requestData.GetData <List <int> >(4); //选中的处方张数 string balanceType = NewObject <CommonMethod>().GetOpConfig(OpConfigConstant.BalanceType); //结算方式 OP_Enum.BalanceType chargeType = (OP_Enum.BalanceType)Convert.ToInt32(balanceType); BaseBalaceProcess balanceProcess = NewObject <BalanceFactory>().CreateChargeObject(chargeType); balanceProcess.BaseBalaceProcessInit(curPatlist, operatorid, chargeType, budgePresNum, costPatTypeid); //初始化 List <ChargeInfo> listChargeInfo = balanceProcess.Budget(prescriptions); //处方预算 responseData.AddData(listChargeInfo); bool isMedicarePat = NewObject <CommonMethod>().IsMedicarePat(costPatTypeid);//判断是否是医保病人 responseData.AddData(isMedicarePat); return(responseData); } catch (Exception err) { throw new Exception(err.Message); } }
/// <summary> /// 费用明细表赋值 /// </summary> /// <param name="feeItemheadid">费用头表ID</param> /// <param name="curPatlist">病人对象</param> /// <returns>返回费用明细</returns> private List <OP_FeeItemDetail> SetRegFeeDetailValue(int feeItemheadid, OP_PatList curPatlist) { DataTable dtRegFeeDetails = NewDao <IOPManageDao>().GetRegItemFees(curPatlist.RegTypeID); List <OP_FeeItemDetail> listFeeItemDetail = new List <OP_FeeItemDetail>(); for (int i = 0; i < dtRegFeeDetails.Rows.Count; i++) { OP_FeeItemDetail feeItemDetail = new OP_FeeItemDetail(); feeItemDetail.FeeItemHeadID = feeItemheadid; feeItemDetail.MemberID = curPatlist.MemberID; feeItemDetail.PatListID = curPatlist.PatListID; feeItemDetail.ItemID = Convert.ToInt32(dtRegFeeDetails.Rows[i]["itemid"]); feeItemDetail.ItemName = dtRegFeeDetails.Rows[i]["itemname"].ToString(); feeItemDetail.StatID = Convert.ToInt32(dtRegFeeDetails.Rows[i]["StatID"]); feeItemDetail.ItemType = dtRegFeeDetails.Rows[i]["ItemClass"].ToString(); feeItemDetail.Spec = dtRegFeeDetails.Rows[i]["Standard"].ToString(); feeItemDetail.PackUnit = dtRegFeeDetails.Rows[i]["UnPickUnit"].ToString(); feeItemDetail.UnitNO = Convert.ToDecimal(dtRegFeeDetails.Rows[i]["MiniConvertNum"]); feeItemDetail.StockPrice = Convert.ToDecimal(dtRegFeeDetails.Rows[i]["InPrice"]); feeItemDetail.RetailPrice = Convert.ToDecimal(dtRegFeeDetails.Rows[i]["SellPrice"]); feeItemDetail.Amount = 1; feeItemDetail.PresAmount = 1; feeItemDetail.TotalFee = feeItemDetail.RetailPrice; feeItemDetail.ExamItemID = 0; feeItemDetail.DocPresDetailID = 0; feeItemDetail.MiniUnit = dtRegFeeDetails.Rows[i]["MiniUnitName"].ToString(); listFeeItemDetail.Add(feeItemDetail); } return(listFeeItemDetail); }
public ServiceResponseData GetRegInfoByInvoiceNO() { try { string invoiceNO = requestData.GetData <string>(0);//票据号 PayMentInfoList payInfolist = new PayMentInfoList(); OP_PatList regPatList = new OP_PatList(); bool result = NewObject <RegisterProcess>().GetRegInfoByInvoiceNO(invoiceNO, out payInfolist, out regPatList); bool isMedicarePay = false; string medicarePayMentCode = NewObject <CommonMethod>().GetOpConfig(OpConfigConstant.RegMedicareCode);//获取医保对应的支付方式Code for (int index = 0; index < payInfolist.paymentInfolist.Count; index++) { //有医保支付的 if (payInfolist.paymentInfolist[index].PayMentCode == medicarePayMentCode) { isMedicarePay = true; } } responseData.AddData(result); //是否可退号 responseData.AddData(payInfolist); //原支付信息 responseData.AddData(isMedicarePay); //是否有医保支付 responseData.AddData(regPatList); //原病人对象 return(responseData); } catch (Exception err) { throw new Exception(err.Message); } }
/// <summary> /// 收费基类 /// </summary> /// <param name="patient">病人对象</param> /// <param name="operatorId">操作员ID</param> /// <param name="chargeType">结算类型</param> /// <param name="budgeGroupID">预算处方的groupid</param> /// <param name="costTypeid">结算病人类型</param> public void BaseBalaceProcessInit(OP_PatList patient, int operatorId, OP_Enum.BalanceType chargeType, List <int> budgeGroupID, int costTypeid) { curPatient = patient; this.operatorId = operatorId; this.chargeType = chargeType; this.budgeGroupID = budgeGroupID; costtypeid = costTypeid; }
/// <summary> /// 保存联动费用项目 /// </summary> /// <param name="patListId">病人Id</param> /// <param name="presType">处方类型</param> /// <param name="list">处方明细列表</param> /// <returns>true成功</returns> public bool SaveLinkFeeItems(int patListId, int presType, List <OPD_PresDetail> list) { if (presType == 1 || presType == 2) { //生成处方头 int headId = NewDao <IOPDDao>().GetFeeHeadId(patListId); OPD_PresHead head = new OPD_PresHead(); if (headId == 0) { } else { head.PresHeadID = headId; } OP_PatList op = (OP_PatList)NewObject <OP_PatList>().getmodel(patListId); head.MemberID = op.MemberID; head.PatListID = patListId; head.PresType = 3; this.BindDb(head); head.save(); int lastPresNo = -1; int lastPresGroupNo = -1; int lastChannelID = -1; for (int i = 0; i < list.Count; i++) { int presDetailId = list[i].PresDetailID; int presNo = list[i].PresNO; int presGroupNo = list[i].GroupID; int channelID = list[i].ChannelID; if (presType == 1) { if (presNo == lastPresNo && presGroupNo == lastPresGroupNo) { continue; } } else if (presType == 2) { if (presNo == lastPresNo && channelID == lastChannelID) { continue; } } InsertFeePresDetail(presType, head.PresHeadID, list[i]); lastPresNo = presNo; lastPresGroupNo = presGroupNo; lastChannelID = channelID; } } return(true); }
public ServiceResponseData SavePrescription() { OP_PatList curPatlist = requestData.GetData <OP_PatList>(0); List <Prescription> prescriptions = requestData.GetData <List <Prescription> >(1); List <int> presNum = requestData.GetData <List <int> >(2); int opratorid = requestData.GetData <int>(3); NewObject <PrescriptionProcess>().SavePrescription(curPatlist, prescriptions, presNum, opratorid); responseData.AddData(prescriptions); return(responseData); }
/// <summary> /// 卡类型索引改变事件 /// </summary> /// <param name="sender">控件对象</param> /// <param name="e">控件参数</param> private void cmbCardType_SelectedIndexChanged(object sender, EventArgs e) { if (cmbCardType.Text.Trim() == "发票号") { txtCardNO.Clear(); CurPatList = new OP_PatList(); dgPrescription.DataSource = new DataTable(); txtVistitNo.ReadOnly = true; btnGetOutpatient.Enabled = false; txtDialog.ReadOnly = true; balanceMode = 1; btnNew.Enabled = false; btnSave.Enabled = false; btnRefresh.Enabled = false; btnBalance.Enabled = false; btnRefund.Enabled = true; RefundPackAmount.Visible = true; RefundMiniAmount.Visible = true; txtPresDoc.ReadOnly = true; txtPresDept.ReadOnly = true; RefundFee.Visible = true; Selected.Visible = false; btnReadCard.Enabled = false; dgPrescription.ContextMenuStrip = null; } else { txtCardNO.Clear(); CurPatList = new OP_PatList(); dgPrescription.DataSource = new DataTable(); txtVistitNo.ReadOnly = false; btnGetOutpatient.Enabled = true; txtDialog.ReadOnly = false; balanceMode = 0; btnNew.Enabled = true; btnSave.Enabled = true; btnRefresh.Enabled = true; btnBalance.Enabled = true; btnRefund.Enabled = false; RefundPackAmount.Visible = false; RefundMiniAmount.Visible = false; txtPresDoc.ReadOnly = false; txtPresDept.ReadOnly = false; RefundFee.Visible = false; Selected.Visible = true; btnReadCard.Enabled = true; dgPrescription.ContextMenuStrip = contextMenuStrip1; } txtCardNO.Focus(); }
/// <summary> /// 将获取到的病人信息列表赋值到界面 /// </summary> /// <param name="dtMemberInfo">病人信息datatable</param> /// <param name="rowindex">行</param> private void SetPatListBasic(DataTable dtMemberInfo, int rowindex) { try { //LoginUserInfo.WorkId OP_PatList patlist = new OP_PatList(); ifrmRegister.SetMedicardReadInfo = string.Empty;//清空医保显示信息 ifrmRegister.SetMedicardReadInfo = ifrmRegister.MedicardReadInfo; patlist.MemberID = Convert.ToInt32(dtMemberInfo.Rows[rowindex]["MemberID"]); patlist.PatName = dtMemberInfo.Rows[rowindex]["MemberName"].ToString(); patlist.PatSex = dtMemberInfo.Rows[rowindex]["SexName"].ToString(); patlist.CardNO = dtMemberInfo.Rows[rowindex]["CardNO"].ToString(); patlist.Birthday = Convert.ToDateTime(dtMemberInfo.Rows[rowindex]["Birthday"]); patlist.IDNumber = dtMemberInfo.Rows[rowindex]["IDNumber"].ToString(); patlist.Allergies = dtMemberInfo.Rows[rowindex]["Allergies"].ToString(); patlist.WorkUnit = dtMemberInfo.Rows[rowindex]["WorkUnit"].ToString(); patlist.PatTypeID = Convert.ToInt32(dtMemberInfo.Rows[rowindex]["PatTypeID"]); patlist.MedicareCard = dtMemberInfo.Rows[rowindex]["MedicareCard"].ToString(); ifrmRegister.Mobile = dtMemberInfo.Rows[rowindex]["Mobile"].ToString(); ifrmRegister.Address = dtMemberInfo.Rows[rowindex]["Address"].ToString(); string age = GetAge(patlist.Birthday, DateTime.Now); int length = age.Length; string strPer = "Y"; if (ifrmRegister.AgeUnit == "岁") { strPer = "Y"; } else if (ifrmRegister.AgeUnit == "月") { strPer = "M"; } else if (ifrmRegister.AgeUnit == "天") { strPer = "D"; } patlist.Age = strPer + ifrmRegister.Age; patlist.MemberAccountID = Convert.ToInt32(dtMemberInfo.Rows[rowindex]["AccountID"]); ifrmRegister.CurPatlist = patlist; } catch (Exception err) { MessageBoxShowError(err.Message); } }
/// <summary> /// 费用头表赋值 /// </summary> /// <param name="feeitemHead">费用头表ID</param> /// <param name="presc">处方信息</param> /// <param name="curPatlist">当前病人对象</param> private void SetFeeHeadValue(OP_FeeItemHead feeitemHead, Prescription presc, OP_PatList curPatlist) { feeitemHead.FeeItemHeadID = presc.FeeItemHeadID; feeitemHead.MemberID = curPatlist.MemberID; feeitemHead.PatListID = curPatlist.PatListID; feeitemHead.PatName = curPatlist.PatName; feeitemHead.PresEmpID = presc.PresEmpID; feeitemHead.PresDeptID = presc.PresDeptID; feeitemHead.ExecDeptID = presc.ExecDeptID; feeitemHead.PresAmount = presc.PresAmount; feeitemHead.OldID = 0; feeitemHead.ChargeStatus = 0; feeitemHead.ChargeFlag = 0; feeitemHead.DistributeFlag = 0; feeitemHead.DocPresHeadID = presc.DocPresHeadID; feeitemHead.FeeNo = presc.FeeNo; feeitemHead.DocPresNO = presc.DocPresNO; }
public ServiceResponseData CompleteDiagonsis() { int patListId = requestData.GetData <int>(0); OP_PatList pat = (OP_PatList)NewObject <OP_PatList>().getmodel(patListId); pat.VisitStatus = 2; this.BindDb(pat); int iRtn = pat.save(); if (iRtn > 0) { responseData.AddData(true); } else { responseData.AddData(false); } return(responseData); }
/// <summary> /// 更新就诊医生 /// </summary> /// <param name="patListId">病人id</param> /// <param name="currentDocId">当前接诊医生Id</param> /// <param name="currentDocDeptId">当前接诊科室Id</param> /// <returns>true更新成功</returns> public bool UpdatePatCurrentDoctorID(int patListId, int currentDocId, int currentDocDeptId) { bool bRtn = true; //查询该病人是否生成处方, List <OPD_PresHead> presHeadList = NewObject <OPD_PresHead>().getlist <OPD_PresHead>("PatListID=" + patListId); //没有生成任何处方 if (presHeadList.Count == 0) { OP_PatList pat = NewObject <OP_PatList>().getmodel(patListId) as OP_PatList; //更新挂号表当前病人的就诊医生Id if (pat.CureEmpID != currentDocId) { pat.CureEmpID = currentDocId; this.BindDb(pat); int iRtn = pat.save(); bRtn = iRtn > 0 ? true : false; } } if (bRtn == true) { //更改病人信息表中的当前就诊科室 OP_PatList patList = NewObject <OP_PatList>().getmodel(patListId) as OP_PatList; //更新挂号表当前病人的就诊医生Id if (patList.CureDeptID != currentDocDeptId) { patList.CureDeptID = currentDocDeptId; this.BindDb(patList); int iRtn = patList.save(); bRtn = iRtn > 0 ? true : false; } } return(bRtn); }
/// <summary> /// 结算主表赋值 /// </summary> /// <param name="costHead">结算对象</param> /// <param name="curPatlist">病人对象</param> private void SetRegCostHead(OP_CostHead costHead, OP_PatList curPatlist) { costHead.MemberID = curPatlist.MemberID; costHead.MemberAccountID = curPatlist.MemberAccountID; costHead.CardNO = curPatlist.CardNO; costHead.PatListID = curPatlist.PatListID; costHead.PatName = curPatlist.PatName; costHead.PatTypeID = curPatlist.PatTypeID; costHead.CostDate = curPatlist.RegDate; Basic_Invoice basicInvoice = NewObject <CommonMethod>().GetCurInvoice(InvoiceType.门诊挂号, curPatlist.OperatorID); string invoiceNo = string.Empty; string perfChar = string.Empty; invoiceNo = NewObject <InvoiceManagement>().GetInvoiceCurNOAndUse(InvoiceType.门诊挂号, curPatlist.OperatorID, out perfChar); invoiceNo = perfChar + invoiceNo; costHead.BeInvoiceNO = invoiceNo; costHead.EndInvoiceNO = invoiceNo; costHead.RecipeFlag = 0; costHead.RegCategory = curPatlist.RegCategory; costHead.RegFlag = 1; costHead.ChargeEmpID = curPatlist.OperatorID; costHead.InvoiceID = basicInvoice.ID; }
/// <summary> /// 拷贝病历 /// </summary> /// <param name="currentPatId">当前病人id</param> /// <param name="hisPatListId">历史病人id</param> /// <param name="presDoctorID">处方医生Id</param> /// <param name="presDeptID">处方科室Id</param> private void CopyOMR(int currentPatId, int hisPatListId, int presDoctorID, int presDeptID) { //获取历史病人的病历 List <OPD_MedicalRecord> omrList = NewObject <OPD_MedicalRecord>().getlist <OPD_MedicalRecord>("PatListID=" + hisPatListId); //存在病历记录再复制 if (omrList.Count > 0) { //当前存在病历 List <OPD_MedicalRecord> omrCurrList = NewObject <OPD_MedicalRecord>().getlist <OPD_MedicalRecord>("PatListID=" + currentPatId); OPD_MedicalRecord copyModel = NewObject <OPD_MedicalRecord>(); //存在病历记录 更新 if (omrCurrList.Count > 0) { copyModel = omrCurrList[0]; copyModel.Symptoms = omrList[0].Symptoms; copyModel.SicknessHistory = omrList[0].SicknessHistory; copyModel.PhysicalExam = omrList[0].PhysicalExam; } else { //不存在那么 创建 OP_PatList patModel = NewObject <OP_PatList>().getmodel(currentPatId) as OP_PatList; copyModel.Symptoms = omrList[0].Symptoms; copyModel.SicknessHistory = omrList[0].SicknessHistory; copyModel.PhysicalExam = omrList[0].PhysicalExam; copyModel.PatListID = currentPatId; copyModel.PresDeptID = presDeptID; copyModel.PresDoctorID = presDoctorID; copyModel.MemberID = patModel.MemberID; } this.BindDb(copyModel); copyModel.save(); } }
public ServiceResponseData GetBackFeeByInvoiceNO() { try { OP_Enum.MemberQueryType queryType = requestData.GetData <OP_Enum.MemberQueryType>(0); //查找类型 string content = requestData.GetData <string>(1); //退费发票号 List <OP_FeeRefundHead> listRefundHead = NewObject <OP_FeeRefundHead>().getlist <OP_FeeRefundHead>(" invoicenum='" + content + "' and flag=0 and RefundPayFlag=0"); if (listRefundHead == null || listRefundHead.Count == 0) { throw new Exception("查不到该票号对应的退费消息"); } List <OP_FeeRefundDetail> refundDetailList = NewObject <OP_FeeRefundDetail>().getlist <OP_FeeRefundDetail>(" ReHeadID=" + listRefundHead[0].ReHeadID); foreach (OP_FeeRefundDetail feerefundDetail in refundDetailList) { if (feerefundDetail.RefundAmount > 0 && feerefundDetail.DistributeFlag == 1 && feerefundDetail.RefundFlag == 0) { throw new Exception("已经发药处方要先退药才能退费"); } } OP_PatList patlist = NewObject <OP_PatList>().getmodel(listRefundHead[0].PatListID) as OP_PatList; responseData.AddData(patlist); List <Prescription> preslist = NewObject <PrescriptionProcess>().GetPrescriptionByInvoiceNo(content, patlist.PatListID); DataTable dtRefund = EFWCoreLib.CoreFrame.Common.ConvertExtend.ToDataTable <Prescription>(preslist);// EFWCoreLib.CoreFrame.Common.ConvertExtend.ToDataTable(preslist); responseData.AddData(dtRefund); int costheadid = preslist[0].CostHeadID; OP_CostHead costHead = NewObject <OP_CostHead>().getmodel(costheadid) as OP_CostHead; responseData.AddData(costHead.PatTypeID); return(responseData); } catch (Exception err) { throw new Exception(err.Message); } }
/// <summary> /// 一键复制就诊记录 /// </summary> /// <param name="bDiseaseHis">病历</param> /// <param name="bWest">西药</param> /// <param name="bChinese">中草药</param> /// <param name="bFee">费用</param> /// <param name="currentPatId">当前病人Id</param> /// <param name="hisPatListId">历史病人Id</param> /// <param name="presDoctorID">处方医生Id</param> /// <param name="presDeptID">处方科室</param> /// <returns>true成功</returns> public bool OneCopy(bool bDiseaseHis, bool bWest, bool bChinese, bool bFee, int currentPatId, int hisPatListId, int presDoctorID, int presDeptID) { SysConfigManagement basic = NewObject <SysConfigManagement>(); string regValidDays = basic.GetSystemConfigValue("RegValidPeriod"); OP_PatList pat = NewObject <OP_PatList>().getmodel(currentPatId) as OP_PatList; DateTime regDate = pat.RegDate; DateTime tempDate = regDate.AddDays(Convert.ToInt32(regValidDays) - 1); if (tempDate < DateTime.Now) { throw new Exception("该病人超过挂号有效期不能复制"); } //复制病历 if (bDiseaseHis) { CopyOMR(currentPatId, hisPatListId, presDoctorID, presDeptID); } if (bWest) { CopyPres(1, currentPatId, hisPatListId, presDoctorID, presDeptID); } if (bChinese) { CopyPres(2, currentPatId, hisPatListId, presDoctorID, presDeptID); } if (bFee) { CopyPres(3, currentPatId, hisPatListId, presDoctorID, presDeptID); } return(true); }
/// <summary> /// 保存病历 /// </summary> /// <param name="omrModel">病历实体</param> /// <returns>true成功</returns> public bool SaveOMRData(OPD_MedicalRecord omrModel) { //查询病历表 List <OPD_MedicalRecord> ormList = NewObject <OPD_MedicalRecord>().getlist <OPD_MedicalRecord>("PatListID=" + omrModel.PatListID); //查询挂号表 OP_PatList op = (OP_PatList)NewObject <OP_PatList>().getmodel(omrModel.PatListID); if (ormList.Count > 0) { //主键赋值 omrModel.MedicalRecordID = ormList[0].MedicalRecordID; } //会员Id omrModel.MemberID = op.MemberID; this.BindDb(omrModel); int iRtn = omrModel.save(); if (iRtn > 0) { return(true); } return(false); }
/// <summary> /// 挂号提交 /// </summary> /// <param name="curPatlist">病人对象</param> /// <param name="paymentInfoList">支付对象</param> /// <param name="totalFee">总金额</param> /// <param name="cashFee">现金金额</param> /// <param name="posFee">POS金额</param> /// <param name="dtPrint">返回的打印数据</param> /// <param name="promFee">优惠金额</param> /// <returns>true成功false失败</returns> public bool SaveRegInfo(OP_PatList curPatlist, PayMentInfoList paymentInfoList, decimal totalFee, decimal cashFee, decimal posFee, out DataTable dtPrint, decimal promFee) { try { dtPrint = new DataTable(); bool result = false; //插入挂号就诊表记录 #region 插入挂号就诊表记录 SerialNumberSource serialNumberSource = NewObject <SerialNumberSource>(); curPatlist.VisitNO = serialNumberSource.GetSerialNumber(SnType.门诊流水号); curPatlist.CureDeptID = curPatlist.RegDeptID; curPatlist.CureEmpID = curPatlist.RegEmpID; curPatlist.RegDate = DateTime.Now; curPatlist.VisitStatus = 0; curPatlist.RegStatus = 0; curPatlist.RegCategory = 0; DataTable dtOld = NewObject <OP_PatList>().gettable(" MemberID=" + curPatlist.MemberID); if (dtOld != null && dtOld.Rows.Count > 0) { curPatlist.IsNew = 0; } else { curPatlist.IsNew = 1; } this.BindDb(curPatlist); curPatlist.save(); #endregion int iAccountType = 0; //得到当前结账ID int curAccountId = NewObject <CommonMethod>().GetAccountId(curPatlist.OperatorID, iAccountType); //插入结算主表对象 #region 插入结算主表对象 OP_CostHead costHead = new OP_CostHead(); SetRegCostHead(costHead, curPatlist); costHead.CashFee = cashFee; costHead.PosFee = posFee; costHead.TotalFee = totalFee; costHead.PromFee = promFee; costHead.AccountID = curAccountId; this.BindDb(costHead); costHead.save(); #endregion #region 插入费用表 //插入费用主表 OP_FeeItemHead OP_FeeItemHead feeItemHead = new OP_FeeItemHead(); SetRegFeeHeadValue(feeItemHead, costHead, curPatlist); this.BindDb(feeItemHead); feeItemHead.save(); //插入费用明细表 OP_FeeItemDetail List <OP_FeeItemDetail> feeDetials = SetRegFeeDetailValue(feeItemHead.FeeItemHeadID, curPatlist); foreach (OP_FeeItemDetail feeDetial in feeDetials) { this.BindDb(feeDetial); feeDetial.save(); } #endregion //插入结算明细表 #region 插入结算明细表 DataTable dtRegFeeDetail = NewDao <IOPManageDao>().GetRegItemFeeByStat(curPatlist.RegTypeID); for (int rowindex = 0; rowindex < dtRegFeeDetail.Rows.Count; rowindex++) { OP_CostDetail costDetail = new OP_CostDetail(); costDetail.CostHeadID = costHead.CostHeadID; costDetail.FeeItemHeadID = feeItemHead.FeeItemHeadID; costDetail.ExeDeptID = curPatlist.RegDeptID; costDetail.PresEmpID = curPatlist.RegEmpID; costDetail.PresDeptID = curPatlist.RegDeptID; costDetail.TotalFee = Convert.ToDecimal(dtRegFeeDetail.Rows[rowindex]["statFee"]); costDetail.StatID = Convert.ToInt32(dtRegFeeDetail.Rows[rowindex]["statId"]); this.BindDb(costDetail); costDetail.save(); } #endregion //插入结算支付方式明细表 #region 插入结算支付方式明细表 foreach (OP_CostPayMentInfo costpaymentinfo in paymentInfoList.paymentInfolist) { if (costpaymentinfo.PayMentMoney > 0) { costpaymentinfo.AccountID = curAccountId; costpaymentinfo.CostHeadID = costHead.CostHeadID; costpaymentinfo.PatListID = curPatlist.PatListID; costpaymentinfo.PatName = curPatlist.PatName; costpaymentinfo.PatType = costHead.PatTypeID.ToString(); this.BindDb(costpaymentinfo); costpaymentinfo.save(); } } #endregion //挂号记录表回写costheadid curPatlist.CostHeadID = costHead.CostHeadID; curPatlist.ChargeFlag = 1; this.BindDb(curPatlist); curPatlist.save(); //结账表插入汇总金额 NewObject <CommonMethod>().AddAccoutFee(costHead, curAccountId, 1, 0); //查数据库得到打印dtPrint dtPrint = NewObject <IOPManageDao>().GetRegPrint(curPatlist.PatListID); result = true; return(result); } catch (Exception err) { throw new Exception(err.Message); } }
/// <summary> /// 退号提交 /// </summary> /// <param name="invoiceNO">票据号</param> /// <param name="operatorID">操作员ID</param> public void BackReg(string invoiceNO, int operatorID) { int iAccountType = 0; List <OP_CostHead> costList = NewObject <OP_CostHead>().getlist <OP_CostHead>(" endInvoiceNO='" + invoiceNO + "' and regFlag=1"); if (costList == null || costList.Count == 0) { throw new Exception("找不到该票据号信息"); } else if (costList[0].CostStatus != 0) { throw new Exception("该票据号已经退费,不能再退"); } else if (costList[0].CostStatus == 0 && costList[0].CostDate.ToString("yyyy-MM-dd") != DateTime.Now.ToString("yyyy-MM-dd")) { throw new Exception("已超过退号日期,只能退当天挂的号"); } //原op_patlist变化 OP_PatList patlist = NewObject <OP_PatList>().getmodel(costList[0].PatListID) as OP_PatList; if (patlist.VisitStatus != 0) { throw new Exception("您已就诊,不能再退号"); } patlist.RegStatus = 1;//原挂号记录状态置1 this.BindDb(patlist); patlist.save(); //得到当前结账ID int curAccountId = NewObject <CommonMethod>().GetAccountId(operatorID, iAccountType); //原op_costHead变化 OP_CostHead oldCostHead = costList[0].Clone() as OP_CostHead; oldCostHead.CostStatus = 1;//原有记录状态改为1 this.BindDb(oldCostHead); oldCostHead.save(); //生成新op_costHead变化 OP_CostHead newCostHead = costList[0].Clone() as OP_CostHead; newCostHead.CostHeadID = 0; newCostHead.CostDate = DateTime.Now; newCostHead.CostStatus = 2;//新增记录状态为2 newCostHead.ChargeEmpID = operatorID; newCostHead.AccountID = curAccountId; newCostHead.CashFee = (oldCostHead.CashFee + oldCostHead.PosFee) * (-1);//退金额,POS金额退现金 newCostHead.PosFee = 0; newCostHead.PromFee = oldCostHead.PromFee * (-1); newCostHead.OldID = oldCostHead.CostHeadID;//写入原退记录ID newCostHead.TotalFee = newCostHead.TotalFee * (-1); this.BindDb(newCostHead); newCostHead.save(); //得到原来OP_FeeItemHead List <OP_FeeItemHead> listFeeitemHead = NewObject <OP_FeeItemHead>().getlist <OP_FeeItemHead>(" costheadid=" + oldCostHead.CostHeadID); OP_FeeItemHead newFeeItemHead = new OP_FeeItemHead(); if (listFeeitemHead != null && listFeeitemHead.Count > 0) { OP_FeeItemHead oldFeeItemHead = listFeeitemHead[0].Clone() as OP_FeeItemHead; oldFeeItemHead.ChargeStatus = 1;//原有记录状态改为1 this.BindDb(oldFeeItemHead); oldFeeItemHead.save(); //生成新OP_FeeItemHead变化 newFeeItemHead = listFeeitemHead[0].Clone() as OP_FeeItemHead; newFeeItemHead.FeeItemHeadID = 0; newFeeItemHead.ChargeStatus = 2; newFeeItemHead.CostHeadID = newCostHead.CostHeadID; newFeeItemHead.TotalFee = newFeeItemHead.TotalFee * (-1); newFeeItemHead.OldID = oldFeeItemHead.FeeItemHeadID;//写入原退记录ID this.BindDb(newFeeItemHead); newFeeItemHead.save(); List <OP_FeeItemDetail> listFeeItemDetail = NewObject <OP_FeeItemDetail>().getlist <OP_FeeItemDetail>(" FeeItemHeadID=" + oldFeeItemHead.FeeItemHeadID); foreach (OP_FeeItemDetail oldfeeitemDetail in listFeeItemDetail) { OP_FeeItemDetail newfeeitemDetail = oldfeeitemDetail.Clone() as OP_FeeItemDetail; newfeeitemDetail.PresDetailID = 0; newfeeitemDetail.FeeItemHeadID = newFeeItemHead.FeeItemHeadID; newfeeitemDetail.TotalFee = newfeeitemDetail.TotalFee * (-1); newfeeitemDetail.Amount = oldfeeitemDetail.Amount * (-1); this.BindDb(newfeeitemDetail); newfeeitemDetail.save(); } } //生成新op_costDetail List <OP_CostDetail> costDetailList = NewObject <OP_CostDetail>().getlist <OP_CostDetail>(" costheadid=" + oldCostHead.CostHeadID); foreach (OP_CostDetail oldcostDetail in costDetailList) { OP_CostDetail newCostDetail = oldcostDetail.Clone() as OP_CostDetail; newCostDetail.CostHeadID = newCostHead.CostHeadID; newCostDetail.FeeItemHeadID = newFeeItemHead.FeeItemHeadID; newCostDetail.TotalFee = oldcostDetail.TotalFee * (-1); newCostDetail.CostDetailID = 0; this.BindDb(newCostDetail); newCostDetail.save(); } //生成新OP_CostPayMentInfo List <OP_CostPayMentInfo> costPayMentInfoList = NewObject <OP_CostPayMentInfo>().getlist <OP_CostPayMentInfo>(" costheadid=" + oldCostHead.CostHeadID); decimal oldposfee = 0; foreach (OP_CostPayMentInfo oldCostpayInfo in costPayMentInfoList) { if (oldCostpayInfo.PayMentCode == "02") { oldposfee = oldCostpayInfo.PayMentMoney; } } foreach (OP_CostPayMentInfo oldCostpayInfo in costPayMentInfoList) { OP_CostPayMentInfo newCostPayInfo = oldCostpayInfo.Clone() as OP_CostPayMentInfo; newCostPayInfo.AccountID = curAccountId; newCostPayInfo.ID = 0; newCostPayInfo.CostHeadID = newCostHead.CostHeadID; //POS if (oldCostpayInfo.PayMentCode == "02") { newCostPayInfo.PayMentMoney = 0; } //现金 if (oldCostpayInfo.PayMentCode == "01") { newCostPayInfo.PayMentMoney = (oldCostpayInfo.PayMentMoney + oldposfee) * (-1); } else { newCostPayInfo.PayMentMoney = oldCostpayInfo.PayMentMoney * (-1); } this.BindDb(newCostPayInfo); newCostPayInfo.save(); } //结账表插入汇总金额 NewObject <CommonMethod>().AddAccoutFee(newCostHead, curAccountId, 0, 1); }
/// <summary> /// 通过票据号获取票据号对应的挂号支付信息 /// </summary> /// <param name="invoiceNO">票据号</param> /// <param name="payMentInfoList">支付信息</param> /// <param name="opPatlist">病人对象</param> /// <returns>挂号支付信息</returns> public bool GetRegInfoByInvoiceNO(string invoiceNO, out PayMentInfoList payMentInfoList, out OP_PatList opPatlist) { bool result = false; List <OP_CostHead> costList = NewObject <OP_CostHead>().getlist <OP_CostHead>(" EndInvoiceNO='" + invoiceNO + "' and regflag=1"); if (costList == null || costList.Count == 0) { throw new Exception("找不到该票据号对应的挂号信息"); } else if (costList[0].CostStatus != 0) { throw new Exception("该票据号已经退费,不能再退"); } else if (costList[0].CostStatus == 0 && costList[0].CostDate.ToString("yyyy-MM-dd") != DateTime.Now.ToString("yyyy-MM-dd")) { throw new Exception("已超过退号日期,只能退当天挂的号"); } else { opPatlist = NewObject <OP_PatList>().getmodel(costList[0].PatListID) as OP_PatList; if (opPatlist.VisitStatus != 0) { throw new Exception("您已就诊,不能再退号"); } payMentInfoList = new PayMentInfoList(); List <OP_CostPayMentInfo> payInfos = NewObject <OP_CostPayMentInfo>().getlist <OP_CostPayMentInfo>(" costheadid=" + costList[0].CostHeadID); payMentInfoList.paymentInfolist = payInfos; result = true; } return(result); }
/// <summary> /// 处方保存 /// </summary> /// <param name="curPalist">病人对象</param> /// <param name="prescriptions">处方对象</param> /// <param name="feeHeadCount">费用头ID</param> /// <param name="operatorid">操作员ID</param> public void SavePrescription(OP_PatList curPalist, List <Prescription> prescriptions, List <int> feeHeadCount, int operatorid) { try { DrugStoreManagement drugManager = NewObject <DrugStoreManagement>(); DateTime presdate = DateTime.Now; for (int i = 0; i < feeHeadCount.Count; i++) { int groupid = feeHeadCount[i]; List <Prescription> presModifyDetails = prescriptions.Where(p => p.PrescGroupID == groupid && p.SubTotalFlag == 0 && p.ModifyFlag == 1).ToList(); if (presModifyDetails.Count == 0) { continue; } List <Prescription> presDetails = prescriptions.Where(p => p.PrescGroupID == groupid && p.SubTotalFlag == 0).ToList(); if (presDetails.Count > 0) { OP_FeeItemHead feeitemHead = new OP_FeeItemHead(); //OP_FeeItemHead赋值 SetFeeHeadValue(feeitemHead, presDetails[0], curPalist); feeitemHead.ChargeEmpID = operatorid; decimal roundingMoney = 0; feeitemHead.TotalFee = NewObject <PrescMoneyCalculate>().GetPrescriptionTotalMoney(presDetails, out roundingMoney); feeitemHead.RoungingFee = roundingMoney; if (feeitemHead.DocPresHeadID > 0) { feeitemHead.PresDate = presDetails[0].DocPresDate; } else { feeitemHead.PresDate = presdate; } feeitemHead.RegFlag = 0; if (feeitemHead.FeeItemHeadID == 0) { feeitemHead.FeeNo = DateTime.Now.Ticks;// Convert.ToDecimal( DateTime.Now.ToString("yyyyMMddHHmmssffff"));// GetTimeStamp();//生成费用流水号 } if (Convert.ToInt32(presDetails[0].ItemType) == (int)OP_Enum.ItemType.药品) { if (presDetails[0].StatID == 100) { feeitemHead.PresType = "1";//西药处方 } else if (presDetails[0].StatID == 101) { feeitemHead.PresType = "2";//中成药处方 } else if (presDetails[0].StatID == 102) { feeitemHead.PresType = "3";//中草药处方 } } else { feeitemHead.PresType = "0";//非药品处方 } this.BindDb(feeitemHead); feeitemHead.save(); for (int j = 0; j < prescriptions.Count; j++) { if (prescriptions[j].PrescGroupID == groupid && prescriptions[j].SubTotalFlag == 0) { OP_FeeItemDetail feeDetail = new OP_FeeItemDetail(); //OP_FeeItemDetail赋值 SetFeeDetailValue(feeDetail, prescriptions[j], curPalist); if (feeDetail.Amount == 0) { throw new Exception("【" + feeDetail.ItemName + "】数量为零,请输入一个大于零的数"); } if (Convert.ToInt32(feeDetail.ItemType) == (int)ItemType.药品 && prescriptions[j].Selected == 1) { //判断实时库存 decimal storAmount = drugManager.GetStorage(feeDetail.ItemID, feeitemHead.ExecDeptID); if (storAmount < feeDetail.Amount) { throw new Exception("【" + feeDetail.ItemName + "】库存不足,请重新输入"); } } feeDetail.FeeItemHeadID = feeitemHead.FeeItemHeadID; this.BindDb(feeDetail); feeDetail.save(); prescriptions[j].FeeItemHeadID = feeitemHead.FeeItemHeadID; prescriptions[j].PresDetailID = feeDetail.PresDetailID; prescriptions[j].FeeNo = feeitemHead.FeeNo; prescriptions[j].ModifyFlag = 0; } } this.BindDb(curPalist); curPalist.save(); } } } catch (Exception err) { throw new Exception(err.Message); } }
/// <summary> /// 费用主表赋值 /// </summary> /// <param name="feeItemHead">费用主表对象</param> /// <param name="costHead">结算对象</param> /// <param name="curPatlist">病人对象</param> private void SetRegFeeHeadValue(OP_FeeItemHead feeItemHead, OP_CostHead costHead, OP_PatList curPatlist) { feeItemHead.CostHeadID = costHead.CostHeadID; feeItemHead.MemberID = curPatlist.MemberID; feeItemHead.PatListID = curPatlist.PatListID; feeItemHead.PatName = curPatlist.PatName; feeItemHead.PresType = "0"; feeItemHead.PresEmpID = curPatlist.RegEmpID; feeItemHead.PresDeptID = curPatlist.RegDeptID; feeItemHead.ExecDeptID = curPatlist.RegDeptID; feeItemHead.ExecEmpID = curPatlist.RegEmpID; feeItemHead.ChargeEmpID = curPatlist.OperatorID; feeItemHead.PresAmount = 1; feeItemHead.TotalFee = costHead.TotalFee; feeItemHead.InvoiceNO = costHead.EndInvoiceNO; feeItemHead.ChargeStatus = 0; feeItemHead.ChargeFlag = 1; feeItemHead.PresDate = curPatlist.RegDate; feeItemHead.DocPresHeadID = 0; feeItemHead.ChargeDate = curPatlist.RegDate; feeItemHead.FeeNo = 0; feeItemHead.RegFlag = 1; }
public bool SaveRegister() { //调用医保读卡接口,获取医保卡号和医保卡相关信息 OP_PatList curPatlist = ifrmRegister.CurPatlist; curPatlist.OperatorID = LoginUserInfo.EmpId; if (!string.IsNullOrEmpty(ifrmRegister.MedicardReadInfo)) { try { //调用医保接口正式结算 如果医保结算失败,直接return MIOPInterface.MiRegister(ifrmRegPayMentInfo.MIBudgetID, string.Empty); } catch (Exception err) { MessageBoxShow(err.Message, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); return(false); } } try { decimal totalRegFee = ifrmRegPayMentInfo.RegTotalFee; string regPayMentCode = ifrmRegPayMentInfo.GetPatMentCode; //decimal medicarcPay = ifrmRegPayMentInfo.MedicarePay; decimal medicarcPay = ifrmRegPayMentInfo.MedicareMIPay; decimal medicarePersPay = ifrmRegPayMentInfo.MedicarePersPay; decimal shouldPay = ifrmRegPayMentInfo.ShoudPay; decimal promFee = ifrmRegPayMentInfo.PromFee; Action <ClientRequestData> requestAction = ((ClientRequestData request) => { request.AddData(curPatlist); //病人对象 request.AddData(totalRegFee); //挂号总金额 request.AddData(regPayMentCode); //支付方式Code request.AddData(medicarcPay); //医保统筹支付金额 request.AddData(shouldPay); //应付金额 request.AddData(promFee); //优惠金额 request.AddData(medicarePersPay); //医保个账支付金额 }); ServiceResponseData retdata = InvokeWcfService("OPProject.Service", "RegisterController", "SaveRegister", requestAction); DataTable dtRegPrint = retdata.GetData <DataTable>(0); OP_PatList backPatlist = retdata.GetData <OP_PatList>(1); if (dtRegPrint == null || dtRegPrint.Rows.Count == 0) { MessageBoxShowError("找不到打印数据"); return(false); } if (!string.IsNullOrEmpty(ifrmRegister.MedicardReadInfo)) { MIOPInterface.MiRegisterComplete(ifrmRegPayMentInfo.MIBudgetID, backPatlist.VisitNO, dtRegPrint.Rows[0]["invoiceNO"].ToString()); } //票据打印 RegInvoicePrint(dtRegPrint); return(true); } catch (Exception err) { MessageBoxShow(err.Message, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); if (ifrmRegPayMentInfo.MIBudgetID > 0) { //需要回退医保挂号 MIOPInterface.MiRefundRegister(string.Empty, ifrmRegPayMentInfo.MIBudgetID.ToString(), string.Empty); } return(false); } }
public ServiceResponseData Balance() { try { List <Prescription> prescriptions = requestData.GetData <List <Prescription> >(0); //预算处方 int operatoreid = requestData.GetData <int>(1); //操作员ID OP_PatList curPatlist = requestData.GetData <OP_PatList>(2); //当前病人对象 List <ChargeInfo> budgeInfo = requestData.GetData <List <ChargeInfo> >(3); //金额预算信息 string balanceType = NewObject <CommonMethod>().GetOpConfig(OpConfigConstant.BalanceType); OP_Enum.BalanceType chargeType = (OP_Enum.BalanceType)Convert.ToInt32(balanceType); BaseBalaceProcess balanceProcess = NewObject <BalanceFactory>().CreateChargeObject(chargeType); balanceProcess.Balance(curPatlist, operatoreid, budgeInfo, prescriptions);//处方正式结算 responseData.AddData(budgeInfo); string curInvoiceNO = NewObject <CommonMethod>().GetCurInvoiceNO(InvoiceType.门诊收费, operatoreid); responseData.AddData(curInvoiceNO);//当前可用票据号 //过滤药品数据 List <Prescription> resultUser = prescriptions.FindAll( delegate(Prescription user) { return(user.StatID == 100 || user.StatID == 101 || user.StatID == 102); }); // 根据过滤出的药品数据 过滤出不同的药房 if (resultUser.Count > 0) { // 根据药房生成消息 IEnumerable <IGrouping <string, Prescription> > query = resultUser.GroupBy(x => x.ExecDetpName); foreach (IGrouping <string, Prescription> info in query) { List <Prescription> sl = info.ToList <Prescription>(); // 生成消息 #region "保存业务消息数据 --Add By ZhangZhong" // 保存业务消息数据 Dictionary <string, string> msgDic = new Dictionary <string, string>(); int workId = requestData.GetData <int>(4); int userId = requestData.GetData <int>(5); int deptId = requestData.GetData <int>(6); msgDic.Add("WorkID", workId.ToString()); // 消息机构ID msgDic.Add("SendUserId", userId.ToString()); // 消息生成人ID msgDic.Add("SendDeptId", deptId.ToString()); // 消息生成科室ID msgDic.Add("PatListID", curPatlist.PatListID.ToString()); // 病人ID msgDic.Add("ExecDeptName", sl[0].ExecDetpName); // 病人ID NewObject <BusinessMessage>().GenerateBizMessage(MessageType.门诊新处方, msgDic); #endregion } } //获取发票打印信息 DataTable dtInvoice = NewDao <IOPManageDao>().GetBalancePrintInvoiceDt(budgeInfo[0].CostHeadID); //票据信息 DataTable dtInvoiceDetail = NewDao <IOPManageDao>().GetBalancePrintDetailDt(budgeInfo[0].CostHeadID); //票据详细信息 DataTable dtInvoiceStatDetail = NewDao <IOPManageDao>().GetBalancePrintStatDt(budgeInfo[0].CostHeadID); //项目信息 responseData.AddData(dtInvoice); responseData.AddData(dtInvoiceDetail); responseData.AddData(dtInvoiceStatDetail); return(responseData); } catch (Exception err) { throw new Exception(err.Message); } }
/// <summary> /// 费用明细表赋值 /// </summary> /// <param name="feeitemDetail">费用明细对象</param> /// <param name="presc">处方对象</param> /// <param name="curPatlist">病人对象</param> private void SetFeeDetailValue(OP_FeeItemDetail feeitemDetail, Prescription presc, OP_PatList curPatlist) { feeitemDetail.PresDetailID = presc.PresDetailID; feeitemDetail.DocPresDetailID = presc.DocPresDetailID; feeitemDetail.MemberID = curPatlist.MemberID; feeitemDetail.PatListID = curPatlist.PatListID; feeitemDetail.ItemID = presc.ItemID; feeitemDetail.ItemType = presc.ItemType; feeitemDetail.StatID = presc.StatID; feeitemDetail.ItemName = presc.ItemName; feeitemDetail.Spec = presc.Spec; feeitemDetail.PackUnit = presc.PackUnit; feeitemDetail.UnitNO = presc.UnitNO; feeitemDetail.StockPrice = presc.StockPrice; feeitemDetail.RetailPrice = presc.RetailPrice; feeitemDetail.Amount = (presc.PackAmount * presc.UnitNO) + presc.MiniAmount; feeitemDetail.PresAmount = presc.PresAmount; feeitemDetail.TotalFee = presc.TotalFee; feeitemDetail.ExamItemID = presc.ExamItemID; feeitemDetail.DocPresDetailID = presc.DocPresDetailID; feeitemDetail.MiniUnit = presc.MiniUnit; feeitemDetail.Memo = presc.Memo; feeitemDetail.DocPresDate = presc.DocPresDate; }
/// <summary> /// 挂号支付界面初始化 /// </summary> /// <returns>返回初始化是否成功</returns> private bool RegPayDataInit() { try { OP_PatList curPatlist = ifrmRegister.CurPatlist; Action <ClientRequestData> requestAction = ((ClientRequestData request) => { request.AddData(LoginUserInfo.EmpId); //人员ID request.AddData(curPatlist.RegTypeID); //挂号类别ID request.AddData(curPatlist.PatTypeID); //病人类型ID }); ServiceResponseData retdata = InvokeWcfService("OPProject.Service", "RegisterController", "RegPayMentInit", requestAction); string invoiceNO = retdata.GetData <string>(0); //票据号 decimal regFee = retdata.GetData <decimal>(1); //挂号费 DataTable dtPayMent = retdata.GetData <DataTable>(2); bool isMedicardPat = retdata.GetData <bool>(3); ifrmRegPayMentInfo.RegDeptName = curPatlist.RegDeptName; ifrmRegPayMentInfo.MedicarePay = 0; ifrmRegPayMentInfo.MedicareMIPay = 0; ifrmRegPayMentInfo.MedicarePersPay = 0; ifrmRegPayMentInfo.PromFee = 0; ifrmRegPayMentInfo.GetRegPayment(dtPayMent); ifrmRegPayMentInfo.RegTotalFee = Convert.ToDecimal(regFee.ToString("0.00")); ifrmRegPayMentInfo.InvoiceNO = invoiceNO; ifrmRegPayMentInfo.ActPay = ifrmRegPayMentInfo.RegTotalFee; //如果病人类型是医保类型,则直接调用医保挂号预算接口,算出医保预算支付金额 if (isMedicardPat == true) { if (string.IsNullOrEmpty(ifrmRegister.MedicardReadInfo)) { PatientInfo miPatInfo = MIOPInterface.ReadMediaCard(); if (!MIOPInterface.PatCheck(curPatlist.PatName, curPatlist.MedicareCard, curPatlist.IDNumber, miPatInfo)) { return(false); } string medicareCardNO = miPatInfo.CardNo; ifrmRegPayMentInfo.SocialCard = miPatInfo.CardNo; ifrmRegPayMentInfo.IdentityNum = miPatInfo.IcNo; curPatlist.MedicareCard = miPatInfo.CardNo; ifrmRegister.MedicardReadInfo = miPatInfo.ShowMiPatInfo; //PatientInfo miPatInfo = MIOPInterface.ReadMediaCard(); //string MedicareCardNO = miPatInfo.CardNo;// "12345678900987654"; //string MedicardInfo = "卡号:" + miPatInfo.CardNo + " 姓名:" + miPatInfo.PersonName + " 医保类别:" + miPatInfo.PersonType + " 身份证号码:" + miPatInfo.IdNo + " 余额:" + miPatInfo.PersonCount; //"12345678900987654"; //ifrmRegister.MedicardReadInfo = MedicardInfo; //curPatlist.MedicareCard = miPatInfo.CardNo; } Action <ClientRequestData> requestAction1 = ((ClientRequestData request) => { request.AddData(curPatlist.RegTypeID); }); ServiceResponseData retdata1 = InvokeWcfService("OPProject.Service", "RegisterController", "GetRegInfoByRegId", requestAction1); DataTable dtRegInfo = retdata1.GetData <DataTable>(0); //医保预算 Dictionary <string, string> dic = MIOPInterface.MiRegBuget(ifrmRegPayMentInfo.SocialCard, LoginUserInfo.EmpName, LoginUserInfo.EmpId, curPatlist, regFee, dtRegInfo, ifrmRegPayMentInfo.InvoiceNO, ifrmRegPayMentInfo.IdentityNum); decimal dMedicarePay = Convert.ToDecimal(dic["MedicarePay"].ToString()); // ifrmRegPayMentInfo.RegTotalFee;//假数据 ifrmRegPayMentInfo.MedicarePay = dMedicarePay; decimal dMedicareMIPay = Convert.ToDecimal(dic["MedicareMIPay"].ToString()); // ifrmRegPayMentInfo.RegTotalFee;//假数据 ifrmRegPayMentInfo.MedicareMIPay = dMedicareMIPay; // ifrmRegPayMentInfo.RegTotalFee;//假数据 decimal dMedicarePersPay = Convert.ToDecimal(dic["MedicarePersPay"].ToString()); // ifrmRegPayMentInfo.RegTotalFee;//假数据 ifrmRegPayMentInfo.MedicarePersPay = dMedicarePersPay; ifrmRegPayMentInfo.SetMedicardInfo = dic["MedicardInfo"].ToString(); // "43625436"; ifrmRegPayMentInfo.MIBudgetID = Convert.ToInt32(dic["ID"]); //医保预结算ID } else { ifrmRegPayMentInfo.ShoudPay = Convert.ToDecimal(regFee.ToString("0.00")) - Convert.ToDecimal(ifrmRegPayMentInfo.MedicarePay);//应付金额 } ifrmRegPayMentInfo.ReadMedicareEnabled = isMedicardPat; ifrmRegPayMentInfo.ExpMedicardInfoVisible = isMedicardPat; return(true); } catch (Exception err) { MessageBoxShow(err.Message, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); return(false); } }
public string BalancePres(string visitNO) { try { // string visitNO = "34"; int empid = 100; int deptid = 1048; SysLoginRight sys = new EFWCoreLib.CoreFrame.Business.SysLoginRight(); sys.WorkId = 1; //获取病人信息 Action <ClientRequestData> requestAction = ((ClientRequestData request) => { request.LoginRight = sys; request.AddData(6); request.AddData(visitNO); }); ServiceResponseData retdata = InvokeWcfService("OPProject.Service", "BalanceController", "GetRegPatListByCardNo", requestAction); List <OP_PatList> patlist = retdata.GetData <List <OP_PatList> >(0); if (patlist.Count == 0) { return("Falg:1"); } OP_PatList curPatlist = patlist[0]; //获取处方 requestAction = ((ClientRequestData request) => { request.LoginRight = sys; request.AddData(curPatlist.PatListID); request.AddData(OP_Enum.PresStatus.未收费); }); retdata = InvokeWcfService("OPProject.Service", "BalanceController", "GetPatPrescription", requestAction); DataTable dtPresc = retdata.GetData <DataTable>(0); //预算 List <Prescription> budgePres = new List <Prescription>(); List <int> budgeNums = new List <int>(); List <Prescription> prescriptions = EFWCoreLib.CoreFrame.Common.ConvertExtend.ToList <Prescription>(dtPresc); budgeNums = GetBudgePrescriptionAmbitList(prescriptions); if (budgeNums.Count == 0) { throw new Exception("没有选中的处方需要收费"); } budgePres = prescriptions.Where(p => p.Selected == 1 && p.SubTotalFlag == 0).ToList(); requestAction = ((ClientRequestData request) => { request.LoginRight = sys; request.AddData(budgePres); //处方 request.AddData(empid); //操作员ID request.AddData(curPatlist); //当前病人对象 request.AddData(curPatlist.PatTypeID); //结算病人类型 request.AddData(budgeNums); //选中的处方张数 }); retdata = InvokeWcfService("OPProject.Service", "BalanceController", "BudgeBalance", requestAction); List <ChargeInfo> budgeInfo = retdata.GetData <List <ChargeInfo> >(0); //正式结算 List <OP_CostPayMentInfo> paylist = new List <OP_CostPayMentInfo>(); OP_CostPayMentInfo payment = new OP_CostPayMentInfo(); payment.PayMentID = 1002; payment.PayMentMoney = 600; paylist.Add(payment); budgeInfo[0].PayInfoList = paylist; budgeInfo[0].PayTotalFee = 600; budgeInfo[0].FavorableTotalFee = 0; budgeInfo[0].PosFee = 0; budgeInfo[0].CashFee = 600;//现金 budgeInfo[0].RoundFee = 0; budgeInfo[0].ChangeFee = 0; requestAction = ((ClientRequestData request) => { request.LoginRight = sys; request.AddData(budgePres); //费用明细对象 request.AddData(empid); //操作员ID request.AddData(curPatlist); //当前病人对象 request.AddData(budgeInfo); //预算对象 request.AddData(1); request.AddData(empid); request.AddData(deptid); }); retdata = InvokeWcfService("OPProject.Service", "BalanceController", "Balance", requestAction); return("Falg:0"); } catch (Exception err) { throw new Exception(err.Message); } }
/// <summary> /// 医保收费预算 /// </summary> /// <param name="workid"></param> /// <param name="presList">处方数据</param> /// <param name="curPatList">病人对象</param> /// <param name="costPatTypeid">收费病人类型</param> /// <param name="diagnosisList">诊断信息</param> /// <param name="invoiceNO">发票号</param> /// <returns></returns> public static Dictionary <string, string> MIBalanceBuget(int workid, List <Prescription> presList, OP_PatList curPatList, int costPatTypeid, List <OPD_DiagnosisRecord> diagnosisList, string invoiceNO) { ResultClass resultClass = new ResultClass(); string sSocialCreateNumSocialCreateNum = string.Empty; resultClass = MIInterFaceFactory.Mz_GetRegisterTradeNo(curPatList.VisitNO); if (resultClass.bSucess) { sSocialCreateNumSocialCreateNum = resultClass.sRemarks; } else { throw new Exception("异常!" + resultClass.sRemarks); } InputClass input = new InputClass(); Dictionary <InputType, object> dicStr = new Dictionary <InputType, object>(); TradeData tradeData = new TradeData(); Tradeinfo tradeinfo = new Tradeinfo(); RecipeList recipeList = new RecipeList(); FeeitemList feeitemList = new FeeitemList(); tradeinfo.tradeType = TradeType.普通门诊; tradeinfo.billtype = "0"; tradeinfo.feeno = invoiceNO; List <Recipe> recipes = new List <Recipe>(); List <Feeitem> feeitems = new List <Feeitem>(); int diagnoseCount = diagnosisList.Count > 3 ? 3 : diagnosisList.Count;//最多取三条诊断 List <Prescription> feeItemHeadIDList = GetPresHeadList(presList); for (int i = 0; i < diagnoseCount; i++) { int diagNo = i + 1; foreach (Prescription pres in feeItemHeadIDList) { Recipe recipe = new Recipe(); recipe.diagnoseno = diagNo.ToString(); recipe.recipeno = pres.FeeItemHeadID.ToString(); recipe.recipedate = DateTime.Now.ToString("yyyyMMddHHmmss"); recipe.drid = "0999"; recipe.drname = curPatList.RegDocName.ToString(); recipe.sectioncode = curPatList.RegDeptID.ToString(); recipe.sectionname = curPatList.RegDeptName.ToString(); recipe.hissectionname = curPatList.RegDeptName.ToString(); recipe.diagnosecode = diagnosisList[i].DiagnosisCode.Equals("")?"0000": diagnosisList[i].DiagnosisCode; recipe.diagnosename = diagnosisList[i].DiagnosisName; recipe.registertradeno = sSocialCreateNumSocialCreateNum; recipe.recipetype = pres.IsReimbursement == 1?"2":"1"; if (pres.StatID == 100 || pres.StatID == 101) { recipe.billstype = "2"; } else if (pres.StatID == 102) { recipe.billstype = "4"; } else { recipe.billstype = "5"; } recipes.Add(recipe); } } foreach (Prescription pres in presList) { if (pres.SubTotalFlag == 0 && pres.Selected == 1) { Feeitem feeitem = new Feeitem(); feeitem.itemno = pres.PresDetailID.ToString();// dr["PresDetailID"].ToString(); feeitem.recipeno = pres.FeeItemHeadID.ToString(); feeitem.hiscode = pres.ItemID.ToString(); if (pres.StatID == 102) { feeitem.itemname = "中药饮片及药材"; feeitem.specification = pres.ItemName.ToString().Trim(); feeitem.unitprice = (pres.RetailPrice / pres.UnitNO).ToString("0.000"); feeitem.count = (pres.TotalFee * pres.UnitNO / pres.RetailPrice).ToString("0.00"); //pres.Amount.ToString(); decimal totalfee = Convert.ToDecimal(feeitem.unitprice) * Convert.ToDecimal(feeitem.count); feeitem.unit = pres.MiniUnit; feeitem.days = pres.PresAmount.ToString(); feeitem.fee = totalfee.ToString("0.00"); feeitem.packaging = pres.MiniUnit; feeitem.minpackage = pres.MiniUnit; feeitem.conversion = "1"; } else if (pres.ItemType.Equals("1")) { feeitem.itemname = pres.ItemName.ToString().Trim(); feeitem.specification = pres.Spec.ToString(); feeitem.unitprice = pres.RetailPrice.ToString("0.000"); feeitem.count = (pres.TotalFee / pres.RetailPrice).ToString("0.00"); //pres.Amount.ToString(); feeitem.unit = pres.PackUnit; feeitem.days = pres.Days.ToString(); feeitem.fee = pres.TotalFee.ToString("0.00"); feeitem.packaging = pres.PackUnit; feeitem.minpackage = pres.DosageUnit; feeitem.conversion = (Convert.ToDecimal(pres.Factor) * pres.UnitNO).ToString(); //待测试的 //feeitem.unitprice = (pres.RetailPrice / pres.UnitNO).ToString("0.000"); //feeitem.count = (pres.TotalFee * pres.UnitNO / pres.RetailPrice).ToString("0.00"); //pres.Amount.ToString(); //decimal totalfee = Convert.ToDecimal(feeitem.unitprice) * Convert.ToDecimal(feeitem.count); //feeitem.unit = pres.MiniUnit; //feeitem.days = pres.Days.ToString(); //feeitem.fee = totalfee.ToString("0.00"); } else { feeitem.itemname = pres.ItemName.ToString().Trim(); feeitem.specification = pres.Spec.ToString(); feeitem.unitprice = pres.RetailPrice.ToString("0.000"); feeitem.count = (pres.TotalFee / pres.RetailPrice).ToString("0.00"); //pres.Amount.ToString(); feeitem.unit = pres.PackUnit; feeitem.days = pres.Days.ToString(); feeitem.fee = pres.TotalFee.ToString("0.00"); feeitem.packaging = feeitem.unit; feeitem.minpackage = feeitem.unit; feeitem.conversion = "1"; //待测试的 //feeitem.unitprice = (pres.RetailPrice / pres.UnitNO).ToString("0.000"); //feeitem.count = (pres.TotalFee * pres.UnitNO / pres.RetailPrice).ToString("0.00"); //pres.Amount.ToString(); //decimal totalfee = Convert.ToDecimal(feeitem.unitprice) * Convert.ToDecimal(feeitem.count); //feeitem.unit = pres.MiniUnit; //feeitem.days = pres.Days.ToString(); //feeitem.fee = totalfee.ToString("0.00"); } feeitem.itemtype = Convert.ToInt32(pres.ItemType) == Convert.ToInt32(OP_Enum.ItemType.药品) ? "0" : "1"; feeitem.babyflag = "0"; feeitem.dosage = pres.Dosage.ToString(); feeitem.dose = pres.DosageId.ToString(); feeitem.howtouse = pres.FrequencyID.ToString();//"02";//pres.FrequencyName; if (feeitem.itemtype == "0") { feeitem.drugapprovalnumber = pres.DrugApprovalnumber; } else { feeitem.drugapprovalnumber = string.Empty; } feeitems.Add(feeitem); } } feeitemList.feeitems = feeitems; recipeList.recipes = recipes; #region 新版,诊断分类型增加 //List<Recipe> recipes = new List<Recipe>(); //List<Feeitem> feeitems = new List<Feeitem>(); ////1按项目类型分类 //var fL = from item in presList // group item by new { item.ItemType } into g // select new // { // ItemType = g.Key.ItemType // }; //int recCount = 0; ////2.分类型插入诊断和项目 //foreach (var f in fL) //{ // //2.1添加诊断 // Recipe recipe = new Recipe(); // recipe.diagnoseno = recCount.ToString(); // recipe.recipeno = recCount.ToString(); // recipe.recipedate = DateTime.Now.ToString("yyyyMMddHHmmss"); // recipe.drid = "0999";//curPatList.RegEmpID.ToString(); // recipe.drname = curPatList.RegDocName.ToString(); // recipe.sectioncode = curPatList.RegDeptID.ToString(); // recipe.sectionname = curPatList.RegDeptName.ToString(); // recipe.hissectionname = curPatList.RegDeptName.ToString(); // recipe.diagnosecode = curPatList.DiseaseCode; // recipe.diagnosename = curPatList.DiseaseName; // recipe.registertradeno = sSocialCreateNumSocialCreateNum; // recipe.billstype = f.ItemType.Equals("1") ? "2" : "5"; // recipes.Add(recipe); // //2.2添加明细 // List<Prescription> PrescriptionList = presList.FindAll(x => x.ItemType == f.ItemType); // foreach (Prescription pres in PrescriptionList) // { // if (pres.SubTotalFlag == 0 && pres.Selected == 1) // { // Feeitem feeitem = new Feeitem(); // feeitem.itemno = pres.PresDetailID.ToString();// dr["PresDetailID"].ToString(); // feeitem.recipeno = recCount.ToString();//pres.FeeItemHeadID.ToString(); // feeitem.hiscode = pres.ItemID.ToString(); // feeitem.itemname = pres.ItemName.ToString().Trim(); // feeitem.itemtype = Convert.ToInt32(pres.ItemType) == Convert.ToInt32(OP_Enum.ItemType.药品) ? "0" : "1"; // feeitem.unitprice = pres.RetailPrice.ToString("0.000"); // feeitem.count = (pres.TotalFee / pres.RetailPrice).ToString("0.00"); //pres.Amount.ToString(); // feeitem.fee = pres.TotalFee.ToString("0.00"); // feeitem.babyflag = "0"; // feeitem.dosage = pres.Dosage; // feeitem.dose = pres.DosageName; // feeitem.days = pres.Days.ToString(); // feeitem.howtouse = pres.FrequencyName; // feeitem.specification = pres.Spec; // feeitem.unit = pres.MiniUnit; // if (feeitem.itemtype == "0") // { // feeitem.drugapprovalnumber = pres.DrugApprovalnumber; // } // else // { // feeitem.drugapprovalnumber = string.Empty; // } // feeitems.Add(feeitem); // } // } // recCount += 1; //} //recipeList.recipes = recipes; //feeitemList.feeitems = feeitems; #endregion #region 老版,只传一个诊断 //List<Recipe> recipes = new List<Recipe>(); //Recipe recipe = new Recipe(); //recipe.diagnoseno = "1"; //recipe.recipeno = "1"; //recipe.recipedate = DateTime.Now.ToString("yyyyMMddHHmmss"); //recipe.drid = "0999";//curPatList.RegEmpID.ToString(); //recipe.drname = curPatList.RegDocName.ToString(); //recipe.sectioncode = curPatList.RegDeptID.ToString(); //recipe.sectionname = curPatList.RegDeptName.ToString(); //recipe.hissectionname = curPatList.RegDeptName.ToString(); //recipe.diagnosecode = curPatList.DiseaseCode; //recipe.diagnosename = curPatList.DiseaseName; //recipe.registertradeno = string.Empty; //recipes.Add(recipe); //recipeList.recipes = recipes; //List<Feeitem> feeitems = new List<Feeitem>(); //foreach (Prescription pres in presList) //{ // if (pres.SubTotalFlag == 0 && pres.Selected==1) // { // Feeitem feeitem = new Feeitem(); // feeitem.itemno = pres.PresDetailID.ToString();// dr["PresDetailID"].ToString(); // feeitem.recipeno = "1";//pres.FeeItemHeadID.ToString(); // feeitem.hiscode = pres.ItemID.ToString(); // feeitem.itemname = pres.ItemName.ToString().Trim(); // feeitem.itemtype = Convert.ToInt32(pres.ItemType) == Convert.ToInt32(OP_Enum.ItemType.药品) ? "0" : "1"; // feeitem.unitprice = pres.RetailPrice.ToString("0.000"); // feeitem.count = (pres.TotalFee / pres.RetailPrice).ToString("0.00"); //pres.Amount.ToString(); // feeitem.fee = pres.TotalFee.ToString("0.00"); // feeitem.babyflag = "0"; // if (feeitem.itemtype == "0") // { // feeitem.drugapprovalnumber = pres.DrugApprovalnumber; // } // else // { // feeitem.drugapprovalnumber = string.Empty; // } // feeitems.Add(feeitem); // } //} //feeitemList.feeitems = feeitems; #endregion tradeData.MIID = costPatTypeid; tradeData.SerialNo = curPatList.VisitNO; tradeData.tradeinfo = tradeinfo; tradeData.recipeList = recipeList; tradeData.feeitemList = feeitemList; dicStr.Add(InputType.TradeData, JsonHelper.SerializeObject(tradeData)); dicStr.Add(InputType.bFlag, true); input.SInput = dicStr; resultClass = MIInterFaceFactory.MZ_PreviewCharge(input); if (resultClass.bSucess) { Dictionary <string, string> resultDic = (Dictionary <string, string>)resultClass.oResult; Dictionary <string, string> myDic = new Dictionary <string, string>(); myDic.Add("ID", resultDic["Id"]);//医保预结算ID decimal medicarepay = Convert.ToDecimal(resultDic["fund"]) + Convert.ToDecimal(resultDic["personcountpay"]); myDic.Add("MedicarePay", medicarepay.ToString("0.00")); myDic.Add("MedicareMIPay", Convert.ToDecimal(resultDic["fund"]).ToString("0.00")); myDic.Add("MedicarePersPay", Convert.ToDecimal(resultDic["personcountpay"]).ToString("0.00")); StringBuilder strBuild = new StringBuilder(); strBuild.Append("统筹支付:" + Convert.ToDecimal(resultDic["fund"]).ToString("0.00") + " "); strBuild.Append("现金支付:" + Convert.ToDecimal(resultDic["cash"]).ToString("0.00") + " "); strBuild.Append("个帐支付:" + Convert.ToDecimal(resultDic["personcountpay"]).ToString("0.00") + " "); myDic.Add("MedicardInfo", strBuild.ToString()); if (!resultClass.sRemarks.Equals("")) { MessageBox.Show("警告:" + resultClass.sRemarks); } return(myDic); } else { throw new Exception("异常!" + resultClass.sRemarks); } }
/// <summary> /// 医保挂号预算 /// </summary> /// <param name="userName">操作员姓名</param> /// <param name="empID">操作员ID</param> /// <param name="curPatList">当前病人挂号对象</param> /// <param name="totalFee">挂号总金额</param> /// <param name="dtRegInfo"></param> /// <param name="invoiceNO">发票号</param> public static Dictionary <string, string> MiRegBuget(string sCardNum, string userName, int empID, OP_PatList curPatList, decimal totalFee, DataTable dtRegInfo, string invoiceNO, string IdentityNum) { MI_Register register = new MI_Register(); register.StaffName = userName; register.RegTime = System.DateTime.Now; register.StaffID = empID.ToString(); register.BedNo = string.Empty; register.ICDCode = string.Empty; register.DiagnDocID = curPatList.CureEmpID.ToString(); register.DiagnosisName = string.Empty; register.SocialCreateNum = string.Empty; register.DeptID = curPatList.RegDeptID; register.DeptName = curPatList.RegDeptName; register.Doctor = curPatList.RegDocName; register.PatientName = curPatList.PatName; register.GHFee = totalFee; register.JCFee = 0; register.MedicalClass = curPatList.PatTypeID.ToString(); register.SerialNO = string.Empty; register.PersonalCode = sCardNum; register.IdentityNum = IdentityNum; Dictionary <InputType, object> dicStr = new Dictionary <InputType, object>(); dicStr.Clear(); dicStr.Add(InputType.MI_Register, JsonHelper.SerializeObject(register)); #region 增加挂号明细数据 DataTable dt = new DataTable(); DataColumn dcItemCode = new DataColumn("ItemCode", Type.GetType("System.String")); DataColumn dcItemName = new DataColumn("ItemName", Type.GetType("System.String")); DataColumn dcPrice = new DataColumn("Price", Type.GetType("System.String")); DataColumn dcCount = new DataColumn("Count", Type.GetType("System.String")); DataColumn dcFee = new DataColumn("Fee", Type.GetType("System.String")); dt.Columns.Add(dcItemCode); dt.Columns.Add(dcItemName); dt.Columns.Add(dcPrice); dt.Columns.Add(dcCount); dt.Columns.Add(dcFee); foreach (DataRow dr in dtRegInfo.Rows) { DataRow drNew = dt.NewRow(); drNew["ItemCode"] = dr["itemid"]; drNew["ItemName"] = dr["itemname"]; drNew["Price"] = dr["sellprice"]; drNew["Count"] = "1"; drNew["Fee"] = dr["sellprice"]; dt.Rows.Add(drNew); } dicStr.Add(InputType.DataTable, dt); #endregion dicStr.Add(InputType.InvoiceNo, invoiceNO); InputClass input = new InputClass(); input.SInput = dicStr; ResultClass resultClass = MIInterFaceFactory.MZ_PreviewRegister(input); if (resultClass.bSucess) { Dictionary <string, string> resultDic = (Dictionary <string, string>)resultClass.oResult; Dictionary <string, string> myDic = new Dictionary <string, string>(); myDic.Add("ID", resultDic["Id"]);//医保预结算ID decimal medicarepay = Convert.ToDecimal(resultDic["fund"]) + Convert.ToDecimal(resultDic["personcountpay"]); myDic.Add("MedicarePay", medicarepay.ToString("0.00")); myDic.Add("MedicareMIPay", Convert.ToDecimal(resultDic["fund"]).ToString("0.00")); myDic.Add("MedicarePersPay", Convert.ToDecimal(resultDic["personcountpay"]).ToString("0.00")); StringBuilder strBuild = new StringBuilder(); strBuild.Append("统筹支付:" + Convert.ToDecimal(resultDic["fund"]).ToString("0.00") + "\n"); strBuild.Append("现金支付:" + Convert.ToDecimal(resultDic["cash"]).ToString("0.00") + "\n"); strBuild.Append("个帐支付:" + Convert.ToDecimal(resultDic["personcountpay"]).ToString("0.00") + "\n"); myDic.Add("MedicardInfo", strBuild.ToString()); return(myDic); } else { throw new Exception("异常!" + resultClass.sRemarks); } }
/// <summary> /// 处方正式结算 /// </summary> /// <param name="curPatlist">当前病人对象</param> /// <param name="operatoreid">操作员ID</param> /// <param name="budgeInfo">预算对象</param> /// <param name="prescriptions">处方对象</param> public override void Balance(OP_PatList curPatlist, int operatoreid, List <ChargeInfo> budgeInfo, List <Prescription> prescriptions) { #region 医生站处方判断和状态修改,医技确费状态修改 CheckDocPrsc(prescriptions); #endregion DateTime chargedate = DateTime.Now; int iAccountType = 0; //得到当前结账ID int curAccountId = NewObject <CommonMethod>().GetAccountId(operatoreid, iAccountType); //实际上多张处方一次结算只有一条记录 foreach (ChargeInfo chargeInfo in budgeInfo) { string invoiceNo = string.Empty; Basic_Invoice basicInvoice = NewObject <CommonMethod>().GetCurInvoice(InvoiceType.门诊收费, operatoreid); string perfChar = string.Empty; invoiceNo = NewObject <InvoiceManagement>().GetInvoiceCurNOAndUse(InvoiceType.门诊收费, operatoreid, out perfChar); invoiceNo = perfChar + invoiceNo; //多张处方一张票号 int costheadid = chargeInfo.CostHeadID; int[] feeHeadids = chargeInfo.FeeItemHeadIDs; chargeInfo.InvoiceCount = 1; chargeInfo.ChargeDate = chargedate; OP_CostHead costHead = NewObject <OP_CostHead>().getmodel(costheadid) as OP_CostHead; if (costHead != null && costHead.CostHeadID > 0) { //结算主表状态和金额写入 costHead.ChargeEmpID = operatoreid; costHead.CostStatus = 0;//正常收费标志改为0 costHead.CostDate = chargedate; costHead.CashFee = chargeInfo.CashFee; costHead.PosFee = chargeInfo.PosFee; costHead.PromFee = chargeInfo.FavorableTotalFee; costHead.RoundingFee = chargeInfo.RoundFee; costHead.EndInvoiceNO = invoiceNo; costHead.BeInvoiceNO = invoiceNo; costHead.AccountID = curAccountId; costHead.InvoiceID = basicInvoice.ID;//保存使用票据的发票卷序号 this.BindDb(costHead); costHead.save(); //费用主表状态修改 NewDao <IOPManageDao>().UpdateFeeItemHeadStatus(costHead.CostHeadID, invoiceNo, chargedate, operatoreid); //插入结算支付方式表 foreach (OP_CostPayMentInfo payment in chargeInfo.PayInfoList) { payment.PatListID = curPatlist.PatListID; payment.PatName = curPatlist.PatName; payment.PatType = costHead.PatTypeID.ToString(); payment.AccountID = curAccountId; payment.CostHeadID = costHead.CostHeadID; Basic_Payment basePayment = NewObject <Basic_Payment>().getmodel(payment.PayMentID) as Basic_Payment; payment.PayMentCode = basePayment.PayCode; payment.PayMentName = basePayment.PayName; this.BindDb(payment); payment.save(); } //减虚拟库存 MinisStorage(prescriptions, false); //会员积分 AddScore(curPatlist.MemberAccountID, costHead.TotalFee, costHead.CostHeadID.ToString(), operatoreid); if (chargeInfo.FavorableTotalFee > 0) { SavePromData(costHead.PatTypeID, costHead.MemberAccountID, costHead.TotalFee, prescriptions, operatoreid, costHead.CostHeadID); } AddAccoutFee(costHead, curAccountId, 1, 0); } else { throw new Exception("没有找到结算号的记录!"); } } }
/// <summary> /// 收费结算 /// </summary> /// <param name="patlist">当前病人对象</param> /// <param name="operatoreid">操作员ID</param> /// <param name="budgeInfo">预算对象</param> /// <param name="prescriptions">收费处方</param> public abstract void Balance(OP_PatList patlist, int operatoreid, List <ChargeInfo> budgeInfo, List <Prescription> prescriptions);