Exemple #1
0
        /// <summary>
        /// 计算费用项目执行科室
        /// </summary>
        /// <param name="newDrug"></param>
        protected void CalculateFeeDeptMp(CiOrdFeeSrvDTO newDrug)
        {
            #region 计算执行科室

            {
                //执行科室
                OrWfDeptInfoDTO wf = new ciorder.viewmodel.impext.GetDeptMpImp().GetDept_mp_ids(
                    this.ent4BannerDTO.Code_entp,
                    this.ent4BannerDTO.Id_entp,
                    newDrug.Sd_srvtp,
                    newDrug.Id_srvca,
                    newDrug.Id_srv,
                    newDrug.Id_route,
                    "",
                    this.ent4BannerDTO.Id_dep_nur,
                    this.ent4BannerDTO.Id_dep_phy,
                    GetOrdDeptMp(newDrug.Id_or));
                if (wf != null)
                {
                    newDrug.Id_dep   = wf.Firstid_mp_dept;
                    newDrug.Name_dep = wf.Firstname_mp_dept;
                    newDrug.setAttrVal("str_id_mp_deps", wf.Id_mp_depts);
                }
            }

            #endregion
        }
Exemple #2
0
        /// <summary>
        /// 将医嘱数据和医疗单数据整合成一组费用清单数据
        /// </summary>
        /// <param name="ord"></param>
        /// <param name="ems"></param>
        /// <returns></returns>
        private CiOrdFeeSrvDTO[] OrdFeeBillListFrom(CiOrderDO ord, CiEmsDTO ems, FMap blsrvFMap)
        {
            List <CiOrdFeeSrvDTO> OrdFeeBillList = new List <CiOrdFeeSrvDTO>();

            ems.Emssrvs.Cast <CiEmsSrvDTO>().OrderBy(p => p.Sortno).Where(srvdto => (!String.IsNullOrEmpty(srvdto.Code_srv) && !String.IsNullOrEmpty(srvdto.Name_srv)) && srvdto.Fg_bl != null && srvdto.Fg_bl.Value).ToList().ForEach(srvdto =>
            {
                CiOrdFeeSrvDTO ordFeeBill = new CiOrdFeeSrvDTO();
                ordFeeBill.deSerializeJson(srvdto.serializeJson());

                ordFeeBill.Content_or = ord.Content_or;
                ordFeeBill.Dt_effe    = ord.Dt_effe;
                ordFeeBill.setAttrVal("Ord_colligate", ord.Ord_colligate);
                ordFeeBill.Code_or = ord.Code_or;


                if (String.IsNullOrEmpty(ordFeeBill.Id_unit_sale))
                {
                    ordFeeBill.Id_unit_sale   = ordFeeBill.Id_unit_med;
                    ordFeeBill.Name_unit_sale = ordFeeBill.Name_unit_med;
                }

                if (ordFeeBill.Price == null)
                {
                    ordFeeBill.Price = FDouble.ZERO_DBL;
                }

                // 物品标志
                if (ordFeeBill.Fg_mm != null && ordFeeBill.Fg_mm.Value)
                {
                    ordFeeBill.Amt_total = ordFeeBill.Price * (ordFeeBill.Quan_cur == null ? 0 : ordFeeBill.Quan_cur);
                    //且非草药时
                    if (ordFeeBill.Sd_srvtp != null && !ordFeeBill.Sd_srvtp.StartsWith(BdSrvDictCodeConst.SD_SRVTP_HERBDRUG) && ordFeeBill.Name_mm != null)
                    {
                        ordFeeBill.Name_srv = ordFeeBill.Name_srv + "(" + ordFeeBill.Name_mm + ")";
                    }
                }
                else
                {
                    ordFeeBill.Amt_total = ordFeeBill.Price * (ordFeeBill.Quan_total_medu == null ? 0 : ordFeeBill.Quan_total_medu);
                }

                {
                    //执行科室
                    OrWfDeptInfoDTO wf = new ciorder.viewmodel.impext.GetDeptMpImp().GetDept_mp_ids(
                        this.ent4BannerDTO.Code_entp,
                        this.ent4BannerDTO.Id_entp,
                        ordFeeBill.Sd_srvtp,
                        ordFeeBill.Id_srvca,
                        ordFeeBill.Id_srv,
                        ordFeeBill.Id_route,
                        "",
                        this.ent4BannerDTO.Id_dep_nur,
                        this.ent4BannerDTO.Id_dep_phy,
                        GetOrdDeptMp(ordFeeBill.Id_or));
                    if (wf != null)
                    {
                        ordFeeBill.setAttrVal("str_id_mp_deps", wf.Id_mp_depts);
                    }
                    if (blsrvFMap.Keys.Contains(ordFeeBill.Id_srv))
                    {
                        ordFeeBill.Des_srv = (blsrvFMap[ordFeeBill.Id_srv] as MedSrvDO).Des;
                    }
                }
                ordFeeBill.Name_hp = ordFeeBill.Name_hpsrvtp;
                OrdFeeBillList.Add(ordFeeBill);
            });

            // 处理医保类型
            String[] szId_srv = OrdFeeBillList.Select(p => p.Id_srv).ToArray();
            String[] szId_mm  = OrdFeeBillList.Select(p => p.Id_mm).ToArray();

            bl.hp.bdhpindicationdto.d.BdHpIndicationDTO[] szHpIndication = HpJudgeUtil.getInstance().getBdHpIndicationDTO(szId_srv, szId_mm, this.ent4BannerDTO);
            if (null != szHpIndication)
            {
                OrdFeeBillList.ForEach(p => {
                    bl.hp.bdhpindicationdto.d.BdHpIndicationDTO dto = null;
                    if (p.Fg_mm != null && p.Fg_mm == true)
                    {
                        if ((dto = szHpIndication.FirstOrDefault(item => item.Id_mm.Equals(p.Id_mm) && item.Id_srv.Equals(p.Id_srv))) != null)
                        {
                            p.Name_hp = idHpSrvtpFromSdHpSrvtp(dto.Sd_hpsrvtp);
                        }
                    }
                    else
                    {
                        if ((dto = szHpIndication.FirstOrDefault(item => item.Id_srv.Equals(p.Id_srv))) != null)
                        {
                            p.Name_hp = idHpSrvtpFromSdHpSrvtp(dto.Sd_hpsrvtp);
                        }
                    }
                });
            }

            return(OrdFeeBillList.ToArray());
        }