Exemplo n.º 1
0
        public BaseResponse <DC_MultiteamCarePlanRecModel> GetTransdisciplinaryPlanRec(long seqNo)
        {
            //加载子项目
            var response = new BaseResponse <DC_MultiteamCarePlanRecModel>();
            DC_MultiteamCarePlanRecModel     multiPlan         = new DC_MultiteamCarePlanRecModel();
            List <DC_MULTITEAMCAREPLAN>      carePlanList      = new List <DC_MULTITEAMCAREPLAN>();
            List <DC_MultiteamCarePlanModel> carePlanListModel = new List <DC_MultiteamCarePlanModel>();
            DC_MULTITEAMCAREPLANEVAL         careEval          = new DC_MULTITEAMCAREPLANEVAL();
            DC_MultiteaMcarePlanEvalModel    careEvalModel     = new DC_MultiteaMcarePlanEvalModel();


            DC_MULTITEAMCAREPLANREC model = unitOfWork.GetRepository <DC_MULTITEAMCAREPLANREC>().dbSet.Where(x => x.SEQNO == seqNo).FirstOrDefault();

            if (model != null)
            {
                carePlanList.AddRange(model.DC_MULTITEAMCAREPLAN);
                careEval = model.DC_MULTITEAMCAREPLANEVAL;

                Mapper.CreateMap <DC_MULTITEAMCAREPLANREC, DC_MultiteamCarePlanRecModel>();
                Mapper.Map(model, multiPlan);

                Mapper.CreateMap <DC_MULTITEAMCAREPLAN, DC_MultiteamCarePlanModel>();
                Mapper.Map(carePlanList, carePlanListModel);

                Mapper.CreateMap <DC_MULTITEAMCAREPLANEVAL, DC_MultiteaMcarePlanEvalModel>();
                Mapper.Map(careEval, careEvalModel);

                multiPlan.CarePlan = carePlanListModel;
                multiPlan.PlanEval = careEvalModel;
            }

            response.Data = multiPlan;

            return(response);
        }
Exemplo n.º 2
0
        private void TransdisciplinaryOperation(WordDocument doc, ReportRequest request)
        {
            IDC_TransdisciplinaryPlan    service = IOCContainer.Instance.Resolve <IDC_TransdisciplinaryPlan>();
            DC_MultiteamCarePlanRecModel model   = service.QueryMultiCarePlanRec(request.seqNo).Data;
            var basic = reportManageService.GetBasicInfoById(model.FEENO);
            var org   = organizationManageService.GetOrg(SecurityHelper.CurrentPrincipal.OrgId);

            if (basic != null)
            {
                doc.ReplaceText("OrgName", org.Data.OrgName);
                doc.ReplaceText("RegName", basic.Data.RegName);
                if (!string.IsNullOrEmpty(basic.Data.NurseAidesName))
                {
                    doc.ReplaceText("NurseAidesName", basic.Data.NurseAidesName);
                }
                else
                {
                    doc.ReplaceText("NurseAidesName", "");
                }
            }
            BindData(model.PlanEval, doc);

            string imgPath = model.PlanEval.ECOLOGICALMAP;

            if (!string.IsNullOrEmpty(imgPath))
            {
                string mapPath = Server.MapPath(VirtualPathUtility.GetDirectory("~")) + imgPath.Substring(1);
                try
                {
                    doc.InsertImage("InsertImage", mapPath, 300, 200);
                }
                catch (Exception ex)
                { doc.ReplaceText("InsertImage", ""); }
            }
            else
            {
                doc.ReplaceText("InsertImage", "");
            }

            if (model.CarePlan.Count > 0)
            {
                DataTable dt = new DataTable();
                dt.Columns.Add("MAJORTYPE");
                dt.Columns.Add("QUESTIONTYPE");
                dt.Columns.Add("ACTIVITY");
                dt.Columns.Add("TRACEDESC");
                foreach (DC_MultiteamCarePlanModel carePlan in model.CarePlan)
                {
                    var dr = dt.NewRow();
                    dr["MAJORTYPE"]    = carePlan.MAJORTYPE;
                    dr["QUESTIONTYPE"] = carePlan.QUESTIONTYPE;
                    dr["ACTIVITY"]     = carePlan.ACTIVITY;
                    dr["TRACEDESC"]    = carePlan.TRACEDESC;
                    dt.Rows.Add(dr);
                }
                doc.FillTable(1, dt, "", "", 1);//因调整打印模板,做对应修改
            }
        }
Exemplo n.º 3
0
        public BaseResponse <DC_MultiteamCarePlanRecModel> SaveTransdisciplinary(DC_MultiteamCarePlanRecModel carePlanRec)
        {
            BaseResponse <DC_MultiteamCarePlanRecModel> response = new BaseResponse <DC_MultiteamCarePlanRecModel>();
            DC_MULTITEAMCAREPLANREC          planRec             = new DC_MULTITEAMCAREPLANREC();
            List <DC_MULTITEAMCAREPLAN>      carePlan            = new List <DC_MULTITEAMCAREPLAN>();
            List <DC_MultiteamCarePlanModel> carePlanModel       = new List <DC_MultiteamCarePlanModel>();

            carePlanModel.AddRange(carePlanRec.CarePlan);
            DC_MULTITEAMCAREPLANEVAL      planEval      = new DC_MULTITEAMCAREPLANEVAL();
            DC_MultiteaMcarePlanEvalModel planEvalModel = new DC_MultiteaMcarePlanEvalModel();

            planEvalModel = carePlanRec.PlanEval;
            if (carePlanModel.Count > 0)
            {
                Mapper.CreateMap <DC_MultiteamCarePlanModel, DC_MULTITEAMCAREPLAN>();
                Mapper.Map(carePlanModel, carePlan);
            }
            if (planEvalModel != null)
            {
                planEvalModel.FEENO      = carePlanRec.FEENO;
                planEvalModel.REGNO      = carePlanRec.REGNO;
                planEvalModel.SEQNO      = carePlanRec.SEQNO;
                planEvalModel.EVALNUMBER = carePlanRec.EVALNUMBER;
                Mapper.CreateMap <DC_MultiteaMcarePlanEvalModel, DC_MULTITEAMCAREPLANEVAL>();
                Mapper.Map(planEvalModel, planEval);
            }

            Mapper.CreateMap <DC_MultiteamCarePlanRecModel, DC_MULTITEAMCAREPLANREC>();
            Mapper.Map(carePlanRec, planRec);
            planRec.DC_MULTITEAMCAREPLAN     = carePlan;
            planRec.DC_MULTITEAMCAREPLANEVAL = planEval;
            if (planRec.SEQNO > 0)
            {
                unitOfWork.GetRepository <DC_MULTITEAMCAREPLANREC>().Update(planRec);
                unitOfWork.GetRepository <DC_MULTITEAMCAREPLANEVAL>().Update(planRec.DC_MULTITEAMCAREPLANEVAL);
                if (planRec.DC_MULTITEAMCAREPLAN.Count > 0)
                {
                    planRec.DC_MULTITEAMCAREPLAN.ToList().ForEach(x => unitOfWork.GetRepository <DC_MULTITEAMCAREPLAN>().Update(x));
                }
            }
            else
            {
                planRec.CREATEDATE = DateTime.Now;
                planRec.CREATEBY   = SecurityHelper.CurrentPrincipal.EmpNo;
                unitOfWork.GetRepository <DC_MULTITEAMCAREPLANREC>().Insert(planRec);
            }
            unitOfWork.Save();
            carePlanRec.SEQNO = planRec.SEQNO;
            response.Data     = carePlanRec;
            return(response);
        }
Exemplo n.º 4
0
        //历史记录的编辑
        public BaseResponse <MultiteamCarePlanRec> QueryShowHis(int ID)
        {
            var response = new BaseResponse <MultiteamCarePlanRec>();

            MultiteamCarePlanRec responselist = new MultiteamCarePlanRec();



            DC_MULTITEAMCAREPLANREC      model  = new DC_MULTITEAMCAREPLANREC();
            DC_MultiteamCarePlanRecModel Tmodel = new DC_MultiteamCarePlanRecModel();


            model = unitOfWork.GetRepository <DC_MULTITEAMCAREPLANREC>().dbSet.Where(x => x.SEQNO == ID).FirstOrDefault();



            Mapper.CreateMap <DC_MULTITEAMCAREPLANREC, DC_MultiteamCarePlanRecModel>();

            Mapper.Map(model, Tmodel);


            List <DC_MultiteamCarePlanModel> TMultiteamList = new List <DC_MultiteamCarePlanModel>();

            if (model != null)
            {
                List <DC_MULTITEAMCAREPLAN> MultiteamList = new List <DC_MULTITEAMCAREPLAN>();

                MultiteamList = unitOfWork.GetRepository <DC_MULTITEAMCAREPLAN>().dbSet.Where(x => x.SEQNO == model.SEQNO).ToList();


                Mapper.CreateMap <DC_MULTITEAMCAREPLAN, DC_MultiteamCarePlanModel>();

                Mapper.Map(MultiteamList, TMultiteamList);
            }

            responselist.MultiteamCarePlanRe = Tmodel;
            responselist.MultiteamCar        = TMultiteamList;

            response.Data = responselist;

            return(response);
        }
Exemplo n.º 5
0
        public IHttpActionResult Post(DC_MultiteamCarePlanRecModel baseRequest)
        {
            var response = service.SaveTransdisciplinary(baseRequest);

            return(Ok(response));
        }
Exemplo n.º 6
0
        public BaseResponse <DC_MultiteamCarePlanRecModel> QueryTransdisciplinaryRef(long feeNo)
        {
            BaseResponse <DC_MultiteamCarePlanRecModel> response = new BaseResponse <DC_MultiteamCarePlanRecModel>();
            DC_MultiteamCarePlanRecModel     data     = new DC_MultiteamCarePlanRecModel();
            List <DC_MultiteamCarePlanModel> carePlan = new List <DC_MultiteamCarePlanModel>();
            int currentEvalNum = 1;
            var maxPlanRec     = unitOfWork.GetRepository <DC_MULTITEAMCAREPLANREC>().dbSet.Where(x => x.FEENO == feeNo).OrderByDescending(x => x.EVALNUMBER).FirstOrDefault();

            if (maxPlanRec != null)
            {
                currentEvalNum = maxPlanRec.EVALNUMBER.HasValue ? maxPlanRec.EVALNUMBER.Value + 1 : 1;
            }

            DC_MultiteamCarePlanRecModel basicInfo = (from ip in unitOfWork.GetRepository <DC_IPDREG>().dbSet.Where(x => x.FEENO == feeNo && x.IPDFLAG == "I")
                                                      join re in unitOfWork.GetRepository <DC_REGFILE>().dbSet on ip.REGNO equals re.REGNO
                                                      select new DC_MultiteamCarePlanRecModel {
                FEENO = ip.FEENO,
                REGNO = re.REGNO,
                NURSEAIDES = ip.NURSEAIDES,
                DISEASEINFO = re.DISEASEINFO,
                ECOLOGICALMAP = re.ECOLOGICALMAP
            }).FirstOrDefault();

            data            = basicInfo;
            data.EVALNUMBER = currentEvalNum;
            SwRegEvalPlan      swPlan      = GetSocialWokerPlan(feeNo);
            DC_NursingPlanEval nursingPlan = GetNursingPlan(feeNo);

            DC_MultiteaMcarePlanEvalModel evalModel = new DC_MultiteaMcarePlanEvalModel();

            Mapper.CreateMap <SwRegEvalPlan, DC_MultiteaMcarePlanEvalModel>();
            Mapper.Map(swPlan, evalModel);
            DateTime now = DateTime.Now;

            evalModel.DISEASEINFO   = data.DISEASEINFO;
            evalModel.ECOLOGICALMAP = data.ECOLOGICALMAP;
            evalModel.CHECKDATE     = now;
            evalModel.CHECKEDBY     = SecurityHelper.CurrentPrincipal.EmpNo;
            data.CHECKDATE          = now;
            data.CHECKEDBY          = SecurityHelper.CurrentPrincipal.EmpNo;
            if (nursingPlan.evalQuetion != null && nursingPlan.evalQuetion.Count > 0)
            {
                data.NurEvalDate = nursingPlan.EVALDATE.HasValue ? nursingPlan.EVALDATE.Value.ToShortDateString() : "";
                data.NurEvalNum  = nursingPlan.EVALNUMBER;
                for (int i = 0; i < nursingPlan.evalQuetion.Count; i++)
                {
                    if (nursingPlan.evalQuetion[i].QUESTIONCODE == "ADL")
                    {
                        evalModel.ADLSCORE = nursingPlan.evalQuetion[i].SCORE == null ? "" : nursingPlan.evalQuetion[i].SCORE.ToString();
                    }
                    else if (nursingPlan.evalQuetion[i].QUESTIONCODE == "GDS")
                    {
                        evalModel.GODSSCORE = nursingPlan.evalQuetion[i].SCORE == null ? "" : nursingPlan.evalQuetion[i].SCORE.ToString();
                    }
                    else if (nursingPlan.evalQuetion[i].QUESTIONCODE == "IADL")
                    {
                        evalModel.IADLSCORE = nursingPlan.evalQuetion[i].SCORE == null ? "" : nursingPlan.evalQuetion[i].SCORE.ToString();
                    }
                    else if (nursingPlan.evalQuetion[i].QUESTIONCODE == "MMSE")
                    {
                        evalModel.MMSESCORE = nursingPlan.evalQuetion[i].SCORE == null ? "" : nursingPlan.evalQuetion[i].SCORE.ToString();
                    }
                }
            }
            if (swPlan.TaskGoalsStrategyModel != null && swPlan.TaskGoalsStrategyModel.Count > 0)
            {
                data.SWEvalDate = swPlan.EVALDATE.HasValue ? swPlan.EVALDATE.Value.ToShortDateString() : "";
                data.SWEvalNum  = swPlan.EVALNUMBER;
                List <DC_MultiteamCarePlanModel> swCarePlan = (from task in swPlan.TaskGoalsStrategyModel.AsEnumerable()
                                                               select new DC_MultiteamCarePlanModel
                {
                    MAJORTYPE = "社工",
                    QUESTIONTYPE = task.QUESTIONTYPE,
                    ACTIVITY = task.PLANACTIVITY
                }).ToList();
                carePlan.AddRange(swCarePlan);
            }
            if (nursingPlan.regCpl != null && nursingPlan.regCpl.Count > 0)
            {
                List <DC_MultiteamCarePlanModel> nursingCarePlan = (from task in nursingPlan.regCpl.AsEnumerable()
                                                                    select new DC_MultiteamCarePlanModel
                {
                    MAJORTYPE = "护理",
                    QUESTIONTYPE = task.CPDIA,
                    ACTIVITY = task.NsCplActivity.Select(x => x.CplActivity).ToList().Join()
                }).ToList();
                carePlan.AddRange(nursingCarePlan);
            }



            data.PlanEval = evalModel;
            data.CarePlan = carePlan;
            response.Data = data;
            return(response);
        }