Пример #1
0
        private string GetClassCode(string stat_item_code)
        {
            Model.BASE_STAT_ITEM item = HIS.SYSTEM.Core.BindEntity <Model.BASE_STAT_ITEM> .CreateInstanceDAL(oleDb).GetModel(HIS.BLL.Tables.base_stat_item.CODE + "='" + stat_item_code + "'");

            if (item == null)
            {
                return("");
            }
            else
            {
                return(item.MZFP_CODE);
            }
        }
Пример #2
0
        /// <summary>
        /// 挂号的预处理
        /// </summary>
        /// <param name="Patient"></param>
        /// <returns></returns>
        public override ChargeInfo Budget(RegPatient Patient)
        {
            //保存就诊记录
            Model.MZ_PatList mz_patlist = SavePatList(Patient);
            Patient.PatListID = mz_patlist.PatListID;

            //查找所需费用项目
            List <Model.MZ_REG_ITEM_FEE> listRegFee = BindEntity <Model.MZ_REG_ITEM_FEE> .CreateInstanceDAL(oleDb).GetListArray(BLL.Tables.mz_reg_item_fee.TYPE_CODE + "='" + Patient.RegTypeCode.Trim() + "'");

            //写入处方表
            Model.MZ_PresMaster mz_presmaster = SavePresMaster(Patient);

            Hashtable htCostOrder = new Hashtable();

            Model.MZ_CostOrder mz_costorder = null;
            foreach (Model.MZ_REG_ITEM_FEE mz_reg_item_fee in listRegFee)
            {
                Model.BASE_SERVICE_ITEMS base_service_item = BindEntity <Model.BASE_SERVICE_ITEMS> .CreateInstanceDAL(oleDb).GetModel(mz_reg_item_fee.ITEM_ID);

                if (base_service_item == null)
                {
                    throw new OperatorException("找不到项目编号为" + mz_reg_item_fee.ITEM_ID.ToString() + "的项目");
                }
                //保存明细
                Model.MZ_PresOrder mz_presorder = SavePresOrder(Patient, mz_presmaster, base_service_item);

                mz_presmaster.Total_Fee += mz_presorder.Tolal_Fee;
                if (htCostOrder.Contains(base_service_item.STATITEM_CODE))
                {
                    ((Model.MZ_CostOrder)htCostOrder[base_service_item.STATITEM_CODE]).Total_Fee += mz_presorder.Tolal_Fee;
                }
                else
                {
                    mz_costorder           = new HIS.Model.MZ_CostOrder();
                    mz_costorder.ItemType  = base_service_item.STATITEM_CODE;
                    mz_costorder.Total_Fee = mz_presorder.Tolal_Fee;
                    htCostOrder.Add(base_service_item.STATITEM_CODE, mz_costorder);
                }
            }
            //写结算记录
            Model.MZ_CostMaster mz_costmaster = SaveCostMaster(Patient, mz_presmaster);

            InvoiceItem[] invoiceItems = new InvoiceItem[htCostOrder.Count];
            int           count        = 0;

            foreach (object item in htCostOrder)
            {
                mz_costorder        = (Model.MZ_CostOrder)((DictionaryEntry)item).Value;
                mz_costorder.CostID = mz_costmaster.CostMasterID;
                BindEntity <Model.MZ_CostOrder> .CreateInstanceDAL(oleDb).Add(mz_costorder);

                Model.BASE_STAT_ITEM base_stat_item = BindEntity <Model.BASE_STAT_ITEM> .CreateInstanceDAL(oleDb).GetModel(BLL.Tables.base_stat_item.CODE + "='" + mz_costorder.ItemType.Trim() + "'");

                Model.BASE_STAT_MZFP base_stat_mzfp = BindEntity <Model.BASE_STAT_MZFP> .CreateInstanceDAL(oleDb).GetModel(BLL.Tables.base_stat_mzfp.CODE + "='" + base_stat_item.MZFP_CODE.Trim() + "'");

                invoiceItems[count].ItemName = base_stat_mzfp.ITEM_NAME;
                invoiceItems[count].ItemCode = base_stat_mzfp.CODE;
                invoiceItems[count].Cost     = mz_costorder.Total_Fee;
                count++;
            }
            //回写处方的总金额和结算号
            BindEntity <Model.MZ_PresMaster> .CreateInstanceDAL(oleDb).Update(BLL.Tables.mz_presmaster.PRESMASTERID + "=" + mz_presmaster.PresMasterID,
                                                                              BLL.Tables.mz_presmaster.TOTAL_FEE + "=" + mz_presmaster.Total_Fee,
                                                                              BLL.Tables.mz_presmaster.COSTMASTERID + "=" + mz_costmaster.CostMasterID);

            ChargeInfo regInfo = new ChargeInfo();

            regInfo.ChargeID       = mz_costmaster.CostMasterID;
            regInfo.ChargeDate     = mz_costmaster.CostDate;
            regInfo.TotalFee       = mz_costmaster.Total_Fee;
            regInfo.PrescriptionID = mz_presmaster.PresMasterID;
            regInfo.Items          = invoiceItems;

            return(regInfo);
        }