Exemple #1
0
        //public String GetStr

        /// <summary>
        /// 保存诊断明细数据
        /// </summary>
        /// <param name="isSigned"></param>
        /// <param name="patientsDTO"></param>
        public void save(Ent4BannerDTO patientsDTO)
        {
            string des = "";
            string xy  = "";
            string zy  = "";

            this.SaveResult = null;

            List <DIDTO> listDto   = new List <DIDTO>();
            string       ditp_code = this.HeadDiDiagDO.Sd_ditp;

            if (this.xyCidiList != null && this.xyCidiList.Count > 0)
            {   // 西医集合
                xy   = "西医诊断\n";
                des += collectDidtoListFromxyList(ditp_code, patientsDTO, listDto, this.xyCidiList, xy);
            }

            if (this.zyCidiList != null && this.zyCidiList.Count > 0)
            {    //中医集合
                zy   = "\n中医诊断\n";
                des += collectDidtoListFromzyList(ditp_code, patientsDTO, listDto, this.zyCidiList, zy);
            }
            try
            {
                CiEnContextDTO ciEnContextDto = CiEnContextUtil.GetCiEnContext(patientsDTO);
                SaveResult = mainService.SaveCiDiDtos(listDto.ToArray(), des, ciEnContextDto);
            }
            catch (XapServiceException xapex)
            {
                if (xapex != null)
                {
                    this.ShowMessage(xapex.Message);
                }
                else
                {
                    this.ShowMessage("后台服务异常!");
                }
            }
            catch
            {
            }
        }
Exemple #2
0
        /// <summary>
        /// 保存诊断信息
        /// </summary>
        /// <param name="id_ent">就诊id</param>
        /// <param name="itemDOList">界面选取的诊断集合</param>
        public DIDTO[] SaveCiDiagItemDOs(Ent4BannerDTO bannerDTO, List <CiDiagItemDO> itemDOList)
        {
            DIDTO[]      didtos  = null;
            List <DIDTO> listDto = this.GetDIDTOList(bannerDTO, itemDOList);

            if (listDto != null && listDto.Count > 0)
            {
                CiEnContextDTO ciEnContextDto = CiEnContextUtil.GetCiEnContext(bannerDTO, this.context);
                didtos = mainService.SaveCiDiDtos(listDto.ToArray(), "", ciEnContextDto);
            }
            return(didtos);
        }
Exemple #3
0
        // type :false 保存,true 是签署
        //ditp_code  是 诊断类型 补充诊断没有主诊断
        //
        public void save(bool type, string ditp_code, bool IsAdd, Ent4BannerDTO patientsDTO, string id_di, XapDataList <Cidixy> list, XapDataList <Cididtozy> listzy)
        {
            // 判断新增 还是 修改
            string id_di_temp = null;
            string des        = "";
            string xy         = "";
            string zy         = "";

            if (IsAdd)
            {
                id_di_temp = null;
            }
            else
            {
                id_di_temp = id_di;
            }
            List <DIDTO> listDto = new List <DIDTO>();

            if (list != null && list.Count > 0 && listzy != null && listzy.Count > 0)
            {
                xy = "西医诊断\n";
                zy = "\n中医诊断\n";
            }

            if (list != null && list.Count > 0)
            {   // 西医集合
                des += getxyList(type, ditp_code, patientsDTO, id_di_temp, listDto, list, xy);
            }

            if (listzy != null && listzy.Count > 0)
            {    //中医集合
                des += getzyList(type, ditp_code, patientsDTO, id_di_temp, listDto, listzy, zy);
            }
            // CiEnContextDTO ciEnContextDto = null;
            CiEnContextDTO ciEnContextDto = CiEnContextUtil.GetCiEnContext(patientsDTO);

            mainService.SaveCiDiDtos(listDto.ToArray(), des, ciEnContextDto);
        }
        /// <summary>
        /// 诊断保存
        /// </summary>
        /// <param name="didtos">新增的诊断</param>
        /// <returns>保存成功的DIDTO集合</returns>
        private List <DIDTO> SaveDIDTOs(List <DIDTO> didtoList)
        {
            // 疾病诊断id集合
            List <string> savedidefIdList = new List <string>();
            // 本次需要保存诊断集合(包含以保存的,和本次待保存的诊断)
            List <DIDTO> saveList = new List <DIDTO>();

            // 获取已保存的诊断集合
            List <DIDTO> savedDidtoList = this.GetSavedDIDTOs(this.ent4BannerDTO.Id_ent);

            // 添加已经保存的诊断集合
            if (savedDidtoList != null || savedDidtoList.Count > 0)
            {
                foreach (DIDTO didto in savedDidtoList)
                {
                    didto.Id_di    = null;
                    didto.Id_diitm = null;
                    savedidefIdList.Add(didto.Id_didef);
                    // 添加已保存的DIDTO集合
                    saveList.Add(didto);
                }
            }



            // 如果当前不存在待保存的诊断,不需要对已有诊断在重新保存,直接返回已有的结果
            if (didtoList == null || didtoList.Count == 0)
            {
                return(saveList);
            }

            // 如果待保存诊断中不存在主诊断,将待保存第一项做为主诊断
            bool Fg_majdi = FBoolean.False;

            foreach (DIDTO didto in didtoList)
            {
                didto.Id_di    = null;
                didto.Id_diitm = null;
                if (saveList.Count == 0) // 如果不存在已经保存的诊断,将本次选择的诊断全部添加到待保存的诊断集合中,并且保证只有一条主诊断
                {
                    if (didto.Fg_majdi == FBoolean.True)
                    {
                        if (Fg_majdi)
                        {
                            didto.Fg_majdi = FBoolean.False;
                        }
                        else
                        {
                            Fg_majdi = FBoolean.True;
                        }
                    }
                    saveList.Add(didto);
                }
                else
                {
                    // 添加未保存过的诊断
                    if (!savedidefIdList.Contains(didto.Id_didef))
                    {
                        Fg_majdi       = FBoolean.True;
                        didto.Fg_majdi = FBoolean.False;
                        saveList.Add(didto);
                    }
                }
            }

            if (Fg_majdi == FBoolean.False)
            {
                didtoList[0].Fg_majdi = FBoolean.True;
            }

            // 保存所有的诊断(已保存、待保存)
            //CiEnContextDTO ciEnContextDto = null;
            CiEnContextDTO ciEnContextDto = CiEnContextUtil.GetCiEnContext(this.ent4BannerDTO);

            DIDTO[] didtos = mainService.SaveCiDiDtos(saveList.ToArray(), "", ciEnContextDto);

            return(new List <DIDTO>(didtos));
        }