示例#1
0
        /// <summary>
        /// 处方明细信息转化为接口明细
        /// </summary>
        /// <param name="dt">处方信息</param>
        /// <returns></returns>
        public static FeeDetail[] ConvertFeeDetail(DataTable dt)
        {
            try
            {
                ZY_PresOrder zypo = new ZY_PresOrder();

                List <FeeDetail> fees = new List <FeeDetail>();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    FeeDetail feeDetail = new FeeDetail();
                    feeDetail.his_billno = dt.Rows[i]["CostMasterID"].ToString();//结算ID
                    feeDetail.item_sn    = dt.Rows[i]["PRESORDERID"].ToString();
                    feeDetail.item_code  = dt.Rows[i]["ITEMID"].ToString();

                    feeDetail.item_class       = Convert.ToInt32(dt.Rows[i]["PRESTYPE"].ToString().Trim()) >= 4 ? "2" : "1";
                    feeDetail.item_equal       = "0";
                    feeDetail.item_name        = dt.Rows[i]["ITEMNAME"].ToString();
                    feeDetail.item_use_time    = DateTime.Now.ToString("yyyy-MM-dd");
                    feeDetail.amount           = Convert.ToDouble(dt.Rows[i]["TOLAL_FEE"]) / Convert.ToDouble(dt.Rows[i]["SELL_PRICE"]);//Convert.ToDouble(dt.Rows[i]["AMOUNT"]);
                    feeDetail.drugform         = "";
                    feeDetail.doctorTitle      = dt.Rows[i]["PresDocCode"].ToString();
                    feeDetail.doctor           = dt.Rows[i]["DocName"].ToString();
                    feeDetail.money            = Convert.ToDouble(dt.Rows[i]["TOLAL_FEE"]);
                    feeDetail.price            = Convert.ToDouble(dt.Rows[i]["SELL_PRICE"]);
                    feeDetail.center_item_code = dt.Rows[i]["NCMS_CODE"].ToString();
                    feeDetail.comp_ratio       = Convert.ToDouble(dt.Rows[i]["Comp_Money"]) / 100;
                    feeDetail.specs            = dt.Rows[i]["STANDARD"].ToString();
                    feeDetail.unit             = dt.Rows[i]["PACKUNIT"].ToString();
                    feeDetail.nccm_comp_status = "0";
                    feeDetail.feeType          = zypo.GetFPXM_Code(dt.Rows[i]["ITEMTYPE"].ToString());//费用类型
                    feeDetail.reverse_sn       = dt.Rows[i]["OLDID"].ToString() == "0" ? "" : dt.Rows[i]["OLDID"].ToString();
                    feeDetail.reverse_status   = feeDetail.reverse_sn == "" ? "0" : "2";
                    feeDetail.reverse_date     = DateTime.Now.ToString("yyyy-MM-dd");

                    fees.Add(feeDetail);
                }
                return(fees.ToArray());
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }