/// <summary> /// 得到农合产生的编码 /// </summary> /// <returns></returns> public static string GetNccmNo() { try { DateTime date = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime; string datestr = date.ToString("yyyyMMdd"); IpatListDao patlistDao = DaoFactory.GetObject <IpatListDao>(typeof(PatListDao)); patlistDao.oleDb = BaseBLL.oleDb; string datestr2 = patlistDao.GetNewNccmNo(date); if (datestr2.Length == 1) { datestr2 = "00" + datestr2; } else if (datestr2.Length == 2) { datestr2 = "0" + datestr2; } return(datestr + datestr2); } catch (System.Exception e) { throw new Exception(e.Message); } }
/// <summary> /// 得到新病人的住院号 /// </summary> /// <returns>住院号</returns> public string GetPatNo() { try { IpatListDao patlistDao = DaoFactory.GetObject <IpatListDao>(typeof(PatListDao)); patlistDao.oleDb = oleDb; return(patlistDao.GetNewCureNo().ToString()); } catch (System.Exception e) { throw new Exception(e.Message + "获取住院号失败!"); } }
/// <summary> /// 取消结算 /// </summary> /// <param name="zyCostM"></param> /// <returns></returns> public void CanelCostPat(ZY_CostMaster zyCostM) { try { oleDb.BeginTransaction(); //更改处方结算标志 IpresDao ipD = DaoFactory.GetObject <IpresDao>(typeof(PresDao)); ipD.oleDb = oleDb; IcostDao icD = DaoFactory.GetObject <IcostDao>(typeof(CostDao)); icD.oleDb = oleDb; IpatListDao ipLD = DaoFactory.GetObject <IpatListDao>(typeof(PatListDao)); ipLD.oleDb = oleDb; ipD.AlterCostID(zyCostM.CostMasterID, 0); //修改结算表的记录标识1,为被退(外面添加收费人代码和取消结算时间) icD.UpdateRecord_Flag(zyCostM.CostMasterID, 1); //删除所有结算汇总表的记录||update 新增对应多的付记录,不然在交款表按发票项目分类金额不对 string strWhere = "COSTID =" + zyCostM.CostMasterID; //BindEntity<ZY_CostOrder>.CreateInstanceDAL(oleDb).Delete(strWhere); update zenghao 20090826 List <ZY_CostOrder> zy_coList = BindEntity <ZY_CostOrder> .CreateInstanceDAL(oleDb).GetListArray(strWhere); //如果为取消中途结算,预交金的处理 //if (zyCostM.Ntype == 1)//? 出院结算取消也把ID修改回去 //{ strWhere = "DELETE_FLAG =" + zyCostM.CostMasterID; //string str1 = Tables.zy_chargelist.RECORD_FLAG + oleDb.EuqalTo() + "3"; string str2 = "DELETE_FLAG = 0"; BindEntity <ZY_ChargeList> .CreateInstanceDAL(oleDb).Update(strWhere, str2); //} //添加一条红冲记录,记录标识为2,红冲 zyCostM.Total_Fee = 0 - zyCostM.Total_Fee; zyCostM.Deptosit_Fee = 0 - zyCostM.Deptosit_Fee; zyCostM.Self_Fee = 0 - zyCostM.Self_Fee; zyCostM.Village_Fee = 0 - zyCostM.Village_Fee; zyCostM.Favor_Fee = 0 - zyCostM.Favor_Fee; zyCostM.Reality_Fee = 0 - zyCostM.Reality_Fee; zyCostM.Pos_Fee = 0 - zyCostM.Pos_Fee; zyCostM.Money_Fee = 0 - zyCostM.Money_Fee; zyCostM.WorkUnit_Fee = 0 - zyCostM.WorkUnit_Fee; zyCostM.NotWorkUnit_Fee = 0 - zyCostM.NotWorkUnit_Fee; zyCostM.Record_Flag = 2; zyCostM.OldID = zyCostM.CostMasterID; zyCostM.AccountID = 0; //add zenghao zyCostM.CostDate = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime; BindEntity <ZY_CostMaster> .CreateInstanceDAL(oleDb).Add(zyCostM); //取消结算,结算明细表插付记录 for (int i = 0; i < zy_coList.Count; i++) { zy_coList[i].CostID = zyCostM.CostMasterID; zy_coList[i].Total_Fee = 0 - zy_coList[i].Total_Fee; BindEntity <ZY_CostOrder> .CreateInstanceDAL(oleDb).Add(zy_coList[i]); } //更改住院病人登记表病人类型为3,出院未结算 if (zyCostM.Ntype == 1)//如果是中途结算 { ipLD.AlterPatType(zyCostM.PatListID, 2); } else { ipLD.AlterPatType(zyCostM.PatListID, 3); } oleDb.CommitTransaction(); } catch (System.Exception e) { oleDb.RollbackTransaction(); throw new Exception(e.Message); } }