// 结算类型(1中途,2出院,3欠费) public FrmCostDiag(Action.CostType _costType, Action.FrmCostController _controller) { InitializeComponent(); costType = _costType; controller = _controller; controller.IfrmCostDiagView = this; zyConfig005 = HIS.ZY_BLL.OP_ZYConfigSetting.GetConfigValue("005"); }
/// <summary> /// 病人结算 /// </summary> /// <param name="_costType">结算类型</param> public void CostPat(CostType _costType, FrmCostController controller) { if (zyPatlist == null || zyPatlist.PatListID <= 0) { throw new Exception("请指定一个病人!"); } if (zyPatlist.CureDate.Date > XcDate.ServerDateTime.Date) { throw new Exception("入院日期大于结算日期,不能结算!"); } if (CheckFee() == false) { throw new Exception("该病人的费用发生变化,请重新核对后再结算!"); } switch (_costType) { case CostType.中途结算: #region 中途结算 if (zyPatlist.PatType != "1" && zyPatlist.PatType != "2" && zyPatlist.PatType != "7") { throw new Exception("该病人无法办理[中途]结算!"); } if (patFee.receiveFee > 0) { throw new Exception("该病人已经欠费,请先补交费用再结算!"); } #endregion break; case CostType.出院结算: #region 出院结算 if (zyConfig008 == 0) { if (zyPatlist.PatType != "3") { throw new Exception("该病人没有定义出院,无法办理[出院]结算!"); } } else { if (zyPatlist.PatType == "4" || zyPatlist.PatType == "5") { throw new Exception("该病人已经办理了出院结算!"); } } #endregion break; case CostType.费结算: #region 费结算 if (zyConfig008 == 0) { if (zyPatlist.PatType != "3") { throw new Exception("该病人没有定义出院,无法办理[欠费]结算!"); } } else { if (zyPatlist.PatType == "4" || zyPatlist.PatType == "5") { throw new Exception("该病人已经办理了出院结算!"); } } if (patFee.retreatFee > 0 || patFee.receiveFee == 0) { throw new Exception("该病人没有欠费,不能办理欠费结算!"); } #endregion break; } FrmCostDiag fcd = new FrmCostDiag(_costType, this); fcd.ShowDialog(); if (CheckFee() == false) { throw new Exception("该病人的费用发生变化,请重新核对后再结算!"); } if (fcd.isDiag) { zyPatlist = IfrmCostDiagView.zyPatList; _patType = zyPatlist.PatientCode; int CostmasterID = CostPat((int)_costType, fcd); if (CostmasterID > 0)//住院中途结算 { if (IfrmCostDiagView.Ptt != PrintTicketType.打发票) { IfrmCostView.CostPrint(CostmasterID);//打印发票 } IfrmCostView.BrushPatList(); } else { throw new Exception("结算失败!"); } } }
private void FrmCost_Load(object sender, EventArgs e) { controller = new HIS_ZYManager.Action.FrmCostController(this); }