Пример #1
0
        /// <summary>
        /// 删除收费明细数据
        /// </summary>
        /// <param name="billDetailList"></param>
        /// <returns>0:失败 1:成功 2:校验主键已存在</returns>
        public int DeleteBillDetail(MED_INP_BILL_DETAIL billDetailList)
        {
            int result = dapper.Set <MED_INP_BILL_DETAIL>().Delete(d => d.PATIENT_ID == billDetailList.PATIENT_ID && d.VISIT_ID == billDetailList.VISIT_ID && d.OPER_ID == billDetailList.OPER_ID &&
                                                                   d.ITEM_NO == billDetailList.ITEM_NO);

            dapper.SaveChanges();
            return(result);
        }
Пример #2
0
        /// <summary>
        /// 获取病人费用明细记录
        /// </summary>
        /// <param name="patientID">患者ID</param>
        /// <param name="visitID">住院次数</param>
        /// <param name="operID">手术次数</param>
        /// <returns></returns>
        public IList <MED_INP_BILL_DETAIL> GetBillDetailList(string patientID, int visitID, decimal operID)
        {
            List <MED_INP_BILL_DETAIL> billDetail = new List <MED_INP_BILL_DETAIL>();
            string sql = sqlDict.GetSQLByKey("GetBillDetailQuery");

            billDetail = dapper.Set <MED_INP_BILL_DETAIL>().Query(sql, new
            {
                patientID = patientID,
                visitID   = visitID,
                operID    = operID,
            });
            if (billDetail.Count == 0)
            {
                IList <MED_ANES_VALUATION_LIST> valuationList = GetAnesValuationList(patientID, visitID, operID);
                foreach (MED_ANES_VALUATION_LIST val in valuationList)
                {
                    MED_INP_BILL_DETAIL detail = new MED_INP_BILL_DETAIL();
                    detail.PATIENT_ID        = val.PATIENT_ID;
                    detail.VISIT_ID          = val.VISIT_ID;
                    detail.OPER_ID           = val.OPER_ID;
                    detail.ITEM_NO           = billDetail.Count + 1;
                    detail.ITEM_CLASS        = val.PRICE_CLASS;
                    detail.PRICE_CLASS_NAME  = val.PRICE_CLASS_NAME;
                    detail.ANES_ITEM_NAME    = val.ANES_ITEM_NAME;
                    detail.ITEM_CODE         = val.PRICE_CODE;
                    detail.ITEM_NAME         = val.PRICE_NAME;
                    detail.ITEM_SPEC         = val.PRICE_SPEC;
                    detail.UNITS             = val.UNITS;
                    detail.PRICE             = val.PRICE;
                    detail.AMOUNT            = val.AMOUNT.HasValue ? val.AMOUNT : 1;
                    detail.METHOD            = val.METHOD;
                    detail.TECHNICIAN        = val.TECHNICIAN;
                    detail.ORDERED_BY        = val.ORDERED_BY;
                    detail.BILLING_DATE_TIME = val.BILLING_DATE_TIME;
                    //if (!string.IsNullOrEmpty(val.PRICE_METHOD) && val.PRICE_METHOD.Equals("1"))
                    //{
                    //    detail.COSTS = val.PRICE;
                    //    detail.CHARGES = (string.IsNullOrEmpty(val.BILL_INDICATOR) || val.BILL_INDICATOR == "T") ? detail.COSTS * (val.SPEC.HasValue ? val.SPEC : 1) : 0;

                    //}
                    //else if (!string.IsNullOrEmpty(val.PRICE_METHOD) && val.PRICE_METHOD.Equals("3"))
                    //{
                    //    detail.COSTS = val.PRICE * (val.DOSAGE / val.BASE_TIME);
                    //    detail.CHARGES = (string.IsNullOrEmpty(val.BILL_INDICATOR) || val.BILL_INDICATOR == "T") ? detail.COSTS * (val.SPEC.HasValue ? val.SPEC : 1) : 0;
                    //}
                    //else
                    {
                        detail.COSTS   = val.PRICE * val.AMOUNT;
                        detail.CHARGES = detail.COSTS * (val.SPEC.HasValue ? val.SPEC : 1);
                    }
                    detail.EXCHANGE_STATUS = 0;
                    billDetail.Add(detail);
                }
            }
            return(billDetail);
        }
Пример #3
0
        public MED_INP_BILL_DETAIL AddInpBillDetail(AddDetailCharge val, string patientID, int visitID, int operID, int count)
        {
            MED_INP_BILL_DETAIL detail = new MED_INP_BILL_DETAIL();

            detail.PATIENT_ID       = patientID;
            detail.VISIT_ID         = visitID;
            detail.OPER_ID          = operID;
            detail.ITEM_NO          = count;
            detail.ITEM_CLASS       = val.PRICE_CLASS;
            detail.PRICE_CLASS_NAME = val.PRICE_CLASS_NAME;
            detail.ANES_ITEM_NAME   = val.ANES_ITEM_NAME;
            detail.ITEM_CODE        = val.PRICE_CODE;
            detail.ITEM_NAME        = val.PRICE_NAME;
            detail.ITEM_SPEC        = val.PRICE_SPEC;
            //detail.UNITS = val.UNITS;
            //detail.PRICE = val.PRICE;
            //detail.AMOUNT = val.AMOUNT.HasValue ? val.AMOUNT : 1;
            //detail.METHOD = val.METHOD;
            //detail.TECHNICIAN = val.TECHNICIAN;
            //detail.ORDERED_BY = val.ORDERED_BY;
            //detail.BILLING_DATE_TIME = val.BILLING_DATE_TIME;
            //if (string.IsNullOrEmpty(val.BILL_INDICATOR) || val.BILL_INDICATOR == "T")
            //{
            //    detail.COSTS = val.PRICE * val.AMOUNT;
            //    detail.CHARGES = detail.COSTS * (val.SPEC.HasValue ? val.SPEC : 1);
            //}
            //if (!string.IsNullOrEmpty(val.ITEM_CODE_ADD))
            //{
            //    IList<AddDetailCharge> chargsList = GetAddDetailCharge(val.ITEM_CODE_ADD);
            //    if (chargsList.Count > 0)
            //    {

            //    }
            //}
            detail.EXCHANGE_STATUS = 0;
            return(detail);
        }
Пример #4
0
 public RequestResult <int> DeleteBillDetail(MED_INP_BILL_DETAIL billDetailList)
 {
     return(Success(ChargeInfo.DeleteBillDetail(billDetailList)));
 }