Пример #1
0
        public BaseResponse <UnPlanEdipd> SaveUnPlanEdipd(UnPlanEdipd request)
        {
            #region 移除管路信息
            var keys = new[] { "001", "002", "003", "004", "005" };
            for (int i = 0; i < 5; i++)
            {
                ISocialWorkerManageService socialWorkerManageService = IOCContainer.Instance.Resolve <ISocialWorkerManageService>();
                socialWorkerManageService.RemovePipelineRec(Convert.ToInt32(request.FeeNo), keys[i], Convert.ToDateTime(request.InDate), "非计划入院自动移除");
            }
            #endregion

            unitOfWork.BeginTransaction();
            if (request.Id == 0)
            {
                request.OrgId = SecurityHelper.CurrentPrincipal.OrgId;
            }
            var health = new Health();
            health.ORGID         = SecurityHelper.CurrentPrincipal.OrgId;
            health.FEENO         = request.FeeNo ?? 0;
            health.NOTCOOKREASON = "001"; //住院
            health.STARTDATE     = request.InDate;
            health.ENDDATE       = request.OutDate;
            base.Save <LTC_REGHEALTH, Health>(health, (q) => q.FEENO == health.FEENO, new List <string> {
                "ORGID", "FEENO", "NOTCOOKREASON", "STARTDATE", "ENDDATE"
            });
            var response = base.Save <LTC_UNPLANEDIPD, UnPlanEdipd>(request, (q) => q.ID == request.Id);
            unitOfWork.Commit();
            return(response);
        }
        //新进住民环境适应及辅导记录 zhongyh
        private void NewRegEnvAdaptation(WordDocument doc, ReportRequest request)
        {
            ISocialWorkerManageService reportManageService = IOCContainer.Instance.Resolve <ISocialWorkerManageService>();
            var bd = reportManageService.GetNewRegEnvAdaptationById(request.id);

            var orginfo  = orgserver.GetOrg(bd.Data.ORGID);
            var p        = orgserver.GetEmployee(bd.Data.CREATEBY);
            var response = new BaseResponse <List <object> >(new List <object>());

            response.Data.Add
                (new
            {
                NAME            = request.feeName,
                INDATE          = bd.Data.INDATE,
                W1EVALDATE      = bd.Data.W1EVALDATE,
                INFORMFLAG      = (bd.Data.INFORMFLAG == 1) ? "是" : "否",
                COMMFLAG        = (bd.Data.COMMFLAG == 1) ? "是" : "否",
                INTERPERSONAL   = bd.Data.INTERPERSONAL,
                PARTICIPATION   = bd.Data.PARTICIPATION,
                COORDINATION    = bd.Data.COORDINATION,
                EMOTION         = bd.Data.EMOTION,
                RESISTANCE      = bd.Data.RESISTANCE,
                HELP            = bd.Data.HELP,
                PROCESSACTIVITY = bd.Data.PROCESSACTIVITY,
                TRACEREC2       = bd.Data.TRACEREC,
                WEEK            = bd.Data.WEEK,
                W2EVALDATE      = bd.Data.W2EVALDATE,
                W3EVALDATE      = bd.Data.W3EVALDATE,
                W4EVALDATE      = bd.Data.W4EVALDATE,
                W1EVALUATION    = bd.Data.EVALUATION,
                CREATEBY        = p.Data != null?p.Data.EmpName:"",
                ORG             = orginfo.Data.OrgName,
            });
            BindData(response.Data[0], doc);
        }
Пример #3
0
        /// <summary>
        /// 獲取當前壓瘡人數統計
        /// </summary>
        /// <returns></returns>
        private DataTable GetDashboardData_BedSore(string orgId)
        {
            ISocialWorkerManageService service = IOCContainer.Instance.Resolve <ISocialWorkerManageService>();

            DataTable dt = service.QueryBedSoreData(orgId);

            return(dt);
        }
Пример #4
0
        /// <summary>
        /// P14社工服务记录
        /// </summary>
        /// <param name="doc"></param>
        private void P14Operation(WordDocument doc)
        {
            long feeNo     = 7;
            int  careSvrId = 18;
            IResidentManageService     residentManageService     = IOCContainer.Instance.Resolve <IResidentManageService>();
            ISocialWorkerManageService socialWorkerManageService = IOCContainer.Instance.Resolve <ISocialWorkerManageService>();
            IOrganizationManageService organizationManageService = IOCContainer.Instance.Resolve <IOrganizationManageService>();
            IDictManageService         dictManageService         = IOCContainer.Instance.Resolve <IDictManageService>();
            ICarePlansManageService    carePlansManageService    = IOCContainer.Instance.Resolve <ICarePlansManageService>();
            var resident = residentManageService.GetResident(feeNo);

            if (resident.Data == null)
            {
                return;
            }
            var        person  = residentManageService.GetPerson(resident.Data.RegNo ?? 0);
            var        careSvr = socialWorkerManageService.GetCareSvrById(careSvrId);
            var        emp     = organizationManageService.GetEmployee(careSvr.Data.Carer);
            var        org     = organizationManageService.GetOrg(SecurityHelper.CurrentPrincipal.OrgId);
            var        diaPR   = carePlansManageService.GetDiaPR("001", careSvr.Data.QuestionLevel);
            CodeFilter request = new CodeFilter();

            request.ItemTypes = new string[] { "K00.017", "E00.215", "E00.216", "E00.217" };
            var dict = (List <CodeValue>)dictManageService.QueryCode(request).Data;

            doc.ReplaceText("Org", org.Data.OrgName);
            doc.ReplaceText("Name", person.Data.Name);
            doc.ReplaceText("FeeNo", feeNo.ToString());
            //doc.ReplaceText("Inday", resident.Data.InDate.HasValue ? resident.Data.InDate.Value.ToString("yyyy-MM-dd") : "");
            doc.ReplaceText("RoomNo", resident.Data.RoomNo);
            doc.ReplaceText("Area", resident.Data.Floor);
            doc.ReplaceText("RecDate", careSvr.Data.RecDate.HasValue ? careSvr.Data.RecDate.Value.ToString("yyyy-MM-dd") : "");
            doc.ReplaceText("Carer", emp.Data.EmpName);
            doc.ReplaceText("SvrAddress", dict.Find(it => it.ItemType == "K00.017" && it.ItemCode == careSvr.Data.SvrAddress).ItemName);
            doc.ReplaceText("SvrType", dict.Find(it => it.ItemType == "E00.215" && it.ItemCode == careSvr.Data.SvrType).ItemName);
            doc.ReplaceText("SvrPeople", careSvr.Data.SvrPeople);
            doc.ReplaceText("RelationType", dict.Find(it => it.ItemType == "E00.216" && it.ItemCode == careSvr.Data.RelationType).ItemName);
            doc.ReplaceText("EvalStatus", dict.Find(it => it.ItemType == "E00.217" && it.ItemCode == careSvr.Data.EvalStatus).ItemName);
            doc.ReplaceText("EvalShour", careSvr.Data.EvalMinutes.HasValue ? ((decimal)careSvr.Data.EvalMinutes.Value / 60).ToString("F2") : "");
            //doc.ReplaceText("H32_no", careSvrId.ToString());
            doc.ReplaceText("ProcessActivity", careSvr.Data.ProcessActivity);
            //doc.ReplaceText("QuestionLevel", careSvr.Data.QuestionLevel);
            doc.ReplaceText("QuestionFocus", diaPR.Data.Find(it => it.ItemCode == careSvr.Data.QuestionFocus).ItemName);
            doc.ReplaceText("QuestionDesc", careSvr.Data.QuestionDesc);
            doc.ReplaceText("TreatDesc", careSvr.Data.TreatDesc);
            doc.ReplaceText("EvalDesc", careSvr.Data.EvalDesc);
        }
        private void ActivityReport(WordDocument doc, ReportRequest request)
        {
            ISocialWorkerManageService reportManageService = IOCContainer.Instance.Resolve <ISocialWorkerManageService>();
            var bd             = reportManageService.GetActivityRequEval(request.id).Data;
            var directionsense = GetNameByCodeL00012(bd.Directionsense);

            directionsense += "( ";
            if (bd.Directman == 1)
            {
                directionsense += "人 ";
            }
            if (bd.Directtime == 1)
            {
                directionsense += "时 ";
            }
            if (bd.Directaddress == 1)
            {
                directionsense += "地 ";
            }
            directionsense   += ")";
            bd.Directionsense = directionsense;

            var memory = GetNameByCodeL00013(bd.Memory);

            memory += "( ";
            if (bd.Memoryflag == 1)
            {
                memory += "长期";
            }
            if (bd.Memoryflag == -1)
            {
                memory += "短期";
            }
            memory   += ")";
            bd.Memory = memory;

            if (bd.Talkedwilling != null)
            {
                if (bd.Talkedwilling.Trim().ToUpper() == "TRUE")
                {
                    bd.Talkedwilling = "有意愿及选择参与之活动内容";
                }
            }
            if (bd.Talkednowilling != null)
            {
                if (bd.Talkednowilling.Trim().ToUpper() == "TRUE")
                {
                    bd.Talkedwilling = "无意愿参与活动将安排资源介入或个别辅导";
                }
            }
            if (bd.Nottalked != null)
            {
                if (bd.Nottalked.Trim().ToUpper() == "TRUE")
                {
                    bd.Nottalked = "因生理/心理/认知等障碍由社工预计参与活动";
                }
                else
                {
                    bd.Nottalked = "";
                }
            }

            bd.Vision    = GetNameByCodeL00010(bd.Vision);
            bd.Smell     = GetNameByCodeL00010(bd.Smell);
            bd.Sensation = GetNameByCodeL00010(bd.Sensation);
            bd.Taste     = GetNameByCodeL00010(bd.Taste);
            bd.Hearing   = GetNameByCodeL00010(bd.Hearing);
            bd.Upperlimb = GetNameByCodeL00010(bd.Upperlimb);
            bd.Lowerlimb = GetNameByCodeL00010(bd.Lowerlimb);
            bd.Attention = GetNameByCodeL00011(bd.Attention);

            bd.Comprehension = GetNameByCodeL00013(bd.Comprehension);

            bd.Expression     = GetNameByCodeL00014(bd.Expression);
            bd.Artactivity    = GetWrapData(bd.Artactivity);
            bd.Aidsactivity   = GetWrapData(bd.Aidsactivity);
            bd.Severeactivity = GetWrapData(bd.Severeactivity);
            bd.FeeName        = request.feeName;



            BindData(bd, doc);
        }
        //新进住民环境介绍记录表 zhongyh
        private void LtcNewResideEntenvRecOperation(WordDocument doc, ReportRequest request)
        {
            ISocialWorkerManageService reportManageService = IOCContainer.Instance.Resolve <ISocialWorkerManageService>();
            var bd = reportManageService.GetNewResideEntenvRecById(request.id);

            var orginfo = orgserver.GetOrg(bd.Data.ORGID);

            var      response = new BaseResponse <List <object> >(new List <object>());
            DateTime t1       = DateTime.Now;
            DateTime t2       = Convert.ToDateTime(bd.Data.BIRTHDATE);


            response.Data.Add
                (new
            {
                age                 = t1.Year - t2.Year,
                ID                  = bd.Data.ID,
                RESIDENGNO          = bd.Data.RESIDENGNO,
                BEDNO               = bd.Data.BEDNO,
                SEX                 = (bd.Data.SEX == "M") ? "男" : "女",
                INDATE              = bd.Data.INDATE,
                RECORDDATE          = bd.Data.RECORDDATE,
                BIRTHDATE           = bd.Data.BIRTHDATE,
                FAMILYPARTICIPATION = (bd.Data.FAMILYPARTICIPATION == true) ? "是" : "否",
                CONTRACTFLAG        = ((bd.Data.CONTRACTFLAG == true) ? "01.契约内容说明" : "") + ((bd.Data.LIFEFLAG == true) ? "02.生活公约说明" : ""),

                STAFF1          = bd.Data.STAFF1,
                REGULARACTIVITY = ((bd.Data.REGULARACTIVITY == true) ? "01.定期活动说明" : "") + ((bd.Data.NOTREGULARACTIVITY == true) ? "02.不定期活动说明" : ""),

                STAFF2   = bd.Data.STAFF2,
                name     = request.feeName,
                BELLFLAG = ((bd.Data.BELLFLAG == true) ? "01.紧急铃" : "") +
                           " " + ((bd.Data.LAMPFLAG == true) ? "02.床头灯" : "") +
                           " " + ((bd.Data.TVFLAG == true) ? "03.电视" : "") +
                           " " + ((bd.Data.LIGHTSWITCH == true) ? "04.电灯开关" : "") +
                           " " + ((bd.Data.ESCAPEDEVICE == true) ? "05.逃生设备" : "") +
                           " " + ((bd.Data.ENVIRONMENT == true) ? "06.公共环境" : "") +
                           " " + ((bd.Data.COMMUNITYFACILITIES == true) ? "07.社区设施" : "") +
                           " " + ((bd.Data.POSTOFFICE == true) ? "邮局" : "") +
                           " " + ((bd.Data.SCHOOL == true) ? "学校" : "") +
                           " " + ((bd.Data.BANK == true) ? "银行" : "") +
                           " " + ((bd.Data.STATION == true) ? "车站" : "") +
                           " " + ((bd.Data.PARK == true) ? "公园" : "") +
                           " " + ((bd.Data.TEMPLE == true) ? "寺庙" : "") +
                           " " + ((bd.Data.HOSPITAL == true) ? "医疗院所" : "") +
                           " " + ((bd.Data.OTHERFACILITIES == true) ? "其他" : ""),

                CLEANLINESS = ((bd.Data.CLEANLINESS == true) ? "01.个人清洁" : "") +
                              " " + ((bd.Data.MEDICALCARE == true) ? "02.医保保健" : "") +
                              " " + ((bd.Data.MEALSERVICE == true) ? "03.膳食服务" : "") +
                              " " + ((bd.Data.WORKACTIVITIES == true) ? "04.社工拟定活动" : ""),

                STAFF3 = bd.Data.STAFF3,
                STAFF4 = bd.Data.STAFF4,


                PERSONINCHARGE = ((bd.Data.PERSONINCHARGE == true) ? "01.负责人 " : "") +
                                 " " + ((bd.Data.DIRECTOR == true) ? "02.主任" : "") +
                                 " " + ((bd.Data.NURSE == true) ? "03.护士" : "") +
                                 " " + ((bd.Data.NURSEAIDES == true) ? "04.照顾服务员" : "") +
                                 " " + ((bd.Data.RESIDENT == true) ? "05.住民" : "") +
                                 " " + ((bd.Data.DOCTOR == true) ? "06.医师" : "") +
                                 " " + ((bd.Data.SOCIALWORKER == true) ? "07.社工" : "") +
                                 " " + ((bd.Data.DIETITIAN == true) ? "08.营养师" : "") +
                                 " " + ((bd.Data.OTHERPEOPLE == true) ? "09.其他人员" : ""),

                STAFF5   = bd.Data.STAFF5,
                RECORDBY = bd.Data.RECORDBY,
                FEENO    = bd.Data.FEENO,
                REGNO    = bd.Data.REGNO,
                org      = orginfo.Data.OrgName
            });


            BindData(response.Data[0], doc);
        }
Пример #7
0
        public void DowdloadDLN1(string templateName, string startDateStr, string endDateStr, string feeNo, string floorId)
        {
            using (WordDocument doc = new WordDocument())
            {
                //加载模板
                doc.LoadModelDoc(templateName);

                var carelist = GetCarePlanList(startDateStr, endDateStr, feeNo, floorId);
                if (carelist != null && carelist.Count > 0)
                {
                    foreach (var item in carelist)
                    {
                        doc.NewPartDocument();

                        ISocialWorkerManageService reportManageService = IOCContainer.Instance.Resolve <ISocialWorkerManageService>();
                        var bd             = reportManageService.GetActivityRequEval(item.Id).Data;
                        var directionsense = GetNameByCodeL00012(bd.Directionsense);
                        directionsense += "( ";
                        if (bd.Directman == 1)
                        {
                            directionsense += "人 ";
                        }
                        if (bd.Directtime == 1)
                        {
                            directionsense += "时 ";
                        }
                        if (bd.Directaddress == 1)
                        {
                            directionsense += "地 ";
                        }
                        directionsense   += ")";
                        bd.Directionsense = directionsense;

                        var memory = GetNameByCodeL00013(bd.Memory);
                        memory += "( ";
                        if (bd.Memoryflag == 1)
                        {
                            memory += "长期";
                        }
                        if (bd.Memoryflag == -1)
                        {
                            memory += "短期";
                        }
                        memory   += ")";
                        bd.Memory = memory;

                        if (bd.Talkedwilling != null)
                        {
                            if (bd.Talkedwilling.Trim().ToUpper() == "TRUE")
                            {
                                bd.Talkedwilling = "有意愿及选择参与之活动内容";
                            }
                        }
                        if (bd.Talkednowilling != null)
                        {
                            if (bd.Talkednowilling.Trim().ToUpper() == "TRUE")
                            {
                                bd.Talkedwilling = "无意愿参与活动将安排资源介入或个别辅导";
                            }
                        }
                        if (bd.Nottalked != null)
                        {
                            if (bd.Nottalked.Trim().ToUpper() == "TRUE")
                            {
                                bd.Nottalked = "因生理/心理/认知等障碍由社工预计参与活动";
                            }
                            else
                            {
                                bd.Nottalked = "";
                            }
                        }

                        bd.Vision    = GetNameByCodeL00010(bd.Vision);
                        bd.Smell     = GetNameByCodeL00010(bd.Smell);
                        bd.Sensation = GetNameByCodeL00010(bd.Sensation);
                        bd.Taste     = GetNameByCodeL00010(bd.Taste);
                        bd.Hearing   = GetNameByCodeL00010(bd.Hearing);
                        bd.Upperlimb = GetNameByCodeL00010(bd.Upperlimb);
                        bd.Lowerlimb = GetNameByCodeL00010(bd.Lowerlimb);
                        bd.Attention = GetNameByCodeL00011(bd.Attention);

                        bd.Comprehension = GetNameByCodeL00013(bd.Comprehension);

                        bd.Expression     = GetNameByCodeL00014(bd.Expression);
                        bd.Artactivity    = GetWrapData(bd.Artactivity);
                        bd.Aidsactivity   = GetWrapData(bd.Aidsactivity);
                        bd.Severeactivity = GetWrapData(bd.Severeactivity);
                        bd.CarerName      = item.CarerName;
                        bd.FeeName        = item.FeeName;

                        ActivityRequEval ar = new ActivityRequEval();

                        ar.InDate          = bd.InDate.ToString();
                        ar.EvalDate        = bd.EvalDate.ToString();
                        ar.FeeName         = bd.FeeName;
                        ar.Carer           = bd.CarerName;
                        ar.Vision          = bd.Vision;
                        ar.Attention       = bd.Attention;
                        ar.Smell           = bd.Smell;
                        ar.Directionsense  = bd.Directionsense;
                        ar.Sensation       = bd.Sensation;
                        ar.Comprehension   = bd.Comprehension;
                        ar.Taste           = bd.Taste;
                        ar.Memory          = bd.Memory;
                        ar.Hearing         = bd.Hearing;
                        ar.Expression      = bd.Expression;
                        ar.Upperlimb       = bd.Upperlimb;
                        ar.Othernarrative  = bd.Othernarrative;
                        ar.Lowerlimb       = bd.Lowerlimb;
                        ar.Hallucination   = bd.Hallucination;
                        ar.Delusion        = bd.Delusion;
                        ar.Emotion         = bd.Emotion;
                        ar.Self            = bd.Self;
                        ar.Behaviorcontent = bd.Behaviorcontent;
                        ar.Behaviorfreq    = bd.Behaviorfreq;
                        ar.Activity        = bd.Activity;
                        ar.Talkedwilling   = bd.Talkedwilling;
                        ar.Nottalked       = bd.Nottalked;
                        ar.Artactivity     = bd.Artactivity;
                        ar.Aidsactivity    = bd.Aidsactivity;
                        ar.Severeactivity  = bd.Severeactivity;

                        doc.BindReportData(ar);
                        doc.AddPartDocument();
                    }
                }
                if (!doc.IsDocNull())
                {
                    Util.DownloadFile(doc.SaveDoc("个别化活动需求评估及计画"));
                }
            }
        }
Пример #8
0
        protected override void Operation(WordDocument doc)
        {
            int recordId = (int)ParamId;

            doc.ReplaceText("Org", GetOrgName(SecurityHelper.CurrentPrincipal.OrgId));
            ISocialWorkerManageService reportManageService       = IOCContainer.Instance.Resolve <ISocialWorkerManageService>();
            IResidentManageService     residentManageService     = IOCContainer.Instance.Resolve <IResidentManageService>();
            IOrganizationManageService organizationManageService = IOCContainer.Instance.Resolve <IOrganizationManageService>();
            IDictManageService         dictManageService         = IOCContainer.Instance.Resolve <IDictManageService>();
            var question = reportManageService.GetRegEvaluateById(recordId).Data;

            if (question == null || !question.FeeNo.HasValue)
            {
                InitData(typeof(RegEvaluateModel), doc);
                doc.ReplaceText("BedNo", "");
                doc.ReplaceText("Floor", "");
                doc.ReplaceText("Name", "");
                doc.ReplaceText("Age", "");
                doc.ReplaceText("IllCard", "");
                doc.ReplaceText("Service", "");
                doc.ReplaceText("NextDate", "");
                return;
            }
            var emp = organizationManageService.GetEmployee(question.EvaluateBy);

            doc.ReplaceText("EmpName", emp == null ? "" : emp.Data.EmpName);
            var request = new CodeFilter
            {
                ItemTypes = new[]
                {
                    "E00.014", "E00.005", "E00.008", "E00.009", "E00.015", "E00.016", "E00.017", "E00.018",
                    "E00.019", "E00.206", "E00.207", "E00.208", "E00.209", "E00.210", "E00.211"
                }
            };
            var dict = (List <CodeValue>)dictManageService.QueryCode(request).Data;

            if (question.MindState != null)
            {
                doc.ReplaceText("MindState", dict.Find(it => it.ItemType == "E00.005" && it.ItemCode == question.MindState).ItemName);
            }
            if (question.ExpressionState != null)
            {
                doc.ReplaceText("ExpressionState", dict.Find(it => it.ItemType == "E00.008" && it.ItemCode == question.ExpressionState).ItemName);
            }
            if (question.LanguageState != null)
            {
                doc.ReplaceText("LanguageState", dict.Find(it => it.ItemType == "E00.015" && it.ItemCode == question.LanguageState).ItemName);
            }
            if (question.NonexpressionState != null)
            {
                doc.ReplaceText("NonexpressionState", dict.Find(it => it.ItemType == "E00.009" && it.ItemCode == question.NonexpressionState).ItemName);
            }
            if (question.EmotionState != null)
            {
                doc.ReplaceText("EmotionState", dict.Find(it => it.ItemType == "E00.016" && it.ItemCode == question.EmotionState).ItemName);
            }

            if (question.Personality != null)
            {
                doc.ReplaceText("Personality", dict.Find(it => it.ItemType == "E00.017" && it.ItemCode == question.Personality).ItemName);
            }
            if (question.Attention != null)
            {
                doc.ReplaceText("Attention", dict.Find(it => it.ItemType == "E00.018" && it.ItemCode == question.Attention).ItemName);
            }
            if (question.Realisticsense != null)
            {
                doc.ReplaceText("Realisticsense", dict.Find(it => it.ItemType == "E00.019" && it.ItemCode == question.Realisticsense).ItemName);
            }
            if (question.SocialParticipation != null)
            {
                doc.ReplaceText("SocialParticipation", dict.Find(it => it.ItemType == "E00.206" && it.ItemCode == question.SocialParticipation).ItemName);
            }
            if (question.SocialAttitude != null)
            {
                doc.ReplaceText("SocialAttitude", dict.Find(it => it.ItemType == "E00.207" && it.ItemCode == question.SocialAttitude).ItemName);
            }

            if (question.SocialSkills != null)
            {
                doc.ReplaceText("SocialSkills", dict.Find(it => it.ItemType == "E00.208" && it.ItemCode == question.SocialSkills).ItemName);
            }
            if (question.CommSkills != null)
            {
                doc.ReplaceText("CommSkills", dict.Find(it => it.ItemType == "E00.209" && it.ItemCode == question.CommSkills).ItemName);
            }
            if (question.ResponseSkills != null)
            {
                doc.ReplaceText("ResponseSkills", dict.Find(it => it.ItemType == "E00.210" && it.ItemCode == question.ResponseSkills).ItemName);
            }
            if (question.FixissueSkills != null)
            {
                doc.ReplaceText("FixissueSkills", dict.Find(it => it.ItemType == "E00.211" && it.ItemCode == question.FixissueSkills).ItemName);
            }
            if (question.BookDegree != null)
            {
                doc.ReplaceText("BookDegree", dict.Find(it => it.ItemType == "E00.014" && it.ItemCode == question.BookDegree).ItemName);
            }
            doc.ReplaceText("IllCard", question.IllCardName ?? "");
            doc.ReplaceText("Service", question.ServiceName ?? "");
            doc.ReplaceText("NextDate", question.NextEvalDate == null ? "" : ((DateTime)question.NextEvalDate).ToString("yyyy-MM-dd"));
            BindData(question, doc);

            var resident = residentManageService.GetResident(question.FeeNo.Value);

            if (resident != null && resident.Data != null)
            {
                doc.ReplaceText("BedNo", resident.Data.BedNo);
                doc.ReplaceText("Floor", resident.Data.Floor);
            }
            else
            {
                doc.ReplaceText("BedNo", "");
                doc.ReplaceText("Floor", "");
            }

            var person = residentManageService.GetPerson(question.RegNo ?? 0);

            if (person != null && person.Data != null)
            {
                doc.ReplaceText("Name", person.Data.Name);
                doc.ReplaceText("Age", person.Data.Age.ToString());
            }
            else
            {
                doc.ReplaceText("Name", "");
                doc.ReplaceText("Age", "");
            }
        }
Пример #9
0
        protected override void Operation(WordDocument doc)
        {
            int careSvrId = (int)ParamId;

            doc.ReplaceText("Org", GetOrgName(SecurityHelper.CurrentPrincipal.OrgId));
            IResidentManageService     residentManageService     = IOCContainer.Instance.Resolve <IResidentManageService>();
            ISocialWorkerManageService socialWorkerManageService = IOCContainer.Instance.Resolve <ISocialWorkerManageService>();
            IOrganizationManageService organizationManageService = IOCContainer.Instance.Resolve <IOrganizationManageService>();
            IDictManageService         dictManageService         = IOCContainer.Instance.Resolve <IDictManageService>();
            ICarePlansManageService    carePlansManageService    = IOCContainer.Instance.Resolve <ICarePlansManageService>();
            var careSvr = socialWorkerManageService.GetCareSvrById(careSvrId);

            if (careSvr.Data == null || !careSvr.Data.FeeNo.HasValue)
            {
                InitData(typeof(CaresvrRecModel), doc);
                doc.ReplaceText("Name", "");
                doc.ReplaceText("Inday", "");
                doc.ReplaceText("Dormitory", "");
                return;
            }
            CodeFilter request = new CodeFilter {
                ItemTypes = new string[] { "K00.017", "E00.215", "E00.216", "E00.217" }
            };
            var dict = (List <CodeValue>)dictManageService.QueryCode(request).Data;

            if (careSvr.Data.SvrAddress != null)
            {
                careSvr.Data.SvrAddress = dict.Find(it => it.ItemType == "K00.017" && it.ItemCode == careSvr.Data.SvrAddress).ItemName;
            }
            if (careSvr.Data.SvrType != null)
            {
                careSvr.Data.SvrType = dict.Find(it => it.ItemType == "E00.215" && it.ItemCode == careSvr.Data.SvrType).ItemName;
            }
            if (careSvr.Data.RelationType != null)
            {
                careSvr.Data.RelationType = dict.Find(it => it.ItemType == "E00.216" && it.ItemCode == careSvr.Data.RelationType).ItemName;
            }
            if (careSvr.Data.EvalStatus != null)
            {
                careSvr.Data.EvalStatus = dict.Find(it => it.ItemType == "E00.217" && it.ItemCode == careSvr.Data.EvalStatus).ItemName;
            }
            if (careSvr.Data.QuestionFocus != null)
            {
                if (careSvr.Data.QuestionLevel != null)
                {
                    var diaPr = carePlansManageService.GetDiaPR("001", careSvr.Data.QuestionLevel);
                    if (diaPr != null && diaPr.Data != null)
                    {
                        careSvr.Data.QuestionFocus = diaPr.Data.Find(it => it.ItemCode == careSvr.Data.QuestionFocus).ItemName;
                    }
                }
            }

            if (careSvr.Data.Carer != null)
            {
                var emp = organizationManageService.GetEmployee(careSvr.Data.Carer);
                if (emp != null)
                {
                    careSvr.Data.Carer = emp.Data.EmpName;
                }
            }

            BindData(careSvr.Data, doc);
            var resident = residentManageService.GetResident(careSvr.Data.FeeNo.Value);

            if (resident != null && resident.Data != null)
            {
                doc.ReplaceText("Inday", resident.Data.InDate.HasValue ? resident.Data.InDate.Value.ToString("yyyy-MM-dd") : "");
                doc.ReplaceText("Dormitory", resident.Data.BedNo);
            }
            else
            {
                doc.ReplaceText("Inday", "");
                doc.ReplaceText("Dormitory", "");
            }

            var person = residentManageService.GetPerson(careSvr.Data.RegNo ?? 0);

            if (person != null && person.Data != null)
            {
                doc.ReplaceText("Name", person.Data.Name);
            }
            else
            {
                doc.ReplaceText("Name", "");
            }
            //doc.ReplaceText("FeeNo", feeNo.ToString());
            //doc.ReplaceText("EvalMinutes", careSvr.Data.EvalMinutes.HasValue ? ((decimal)careSvr.Data.EvalMinutes.Value / 60).ToString("F2") : "");
            //doc.ReplaceText("RecDate", careSvr.Data.RecDate.HasValue ? careSvr.Data.RecDate.Value.ToString("yyyy-MM-dd") : "");
            //doc.ReplaceText("SvrPeople", careSvr.Data.SvrPeople);
            //doc.ReplaceText("Id", careSvrId.ToString());
            //doc.ReplaceText("ProcessActivity", careSvr.Data.ProcessActivity);
            //doc.ReplaceText("QuestionLevel", careSvr.Data.QuestionLevel);
            //doc.ReplaceText("QuestionDesc", careSvr.Data.QuestionDesc);
            //doc.ReplaceText("TreatDesc", careSvr.Data.TreatDesc);
            //doc.ReplaceText("EvalDesc", careSvr.Data.EvalDesc);
        }
Пример #10
0
        /// <summary>
        /// P15个案日常生活记录
        /// </summary>
        /// <param name="doc"></param>
        private void P15Operation(WordDocument doc)
        {
            ISocialWorkerManageService     socialWorkerService       = IOCContainer.Instance.Resolve <ISocialWorkerManageService>();
            IOrganizationManageService     organizationManageService = IOCContainer.Instance.Resolve <IOrganizationManageService>();
            IDictManageService             dictManageService         = IOCContainer.Instance.Resolve <IDictManageService>();
            BaseRequest <LifeRecordFilter> lifeRecordFilter          = new BaseRequest <LifeRecordFilter>();

            lifeRecordFilter.CurrentPage = 1;
            lifeRecordFilter.PageSize    = 1000;
            var org      = organizationManageService.GetOrg(SecurityHelper.CurrentPrincipal.OrgId);
            var response = socialWorkerService.QueryLifeRecord(lifeRecordFilter);

            doc.ReplaceText("Org", org.Data.OrgName);

            CodeFilter codeFilter = new CodeFilter();

            codeFilter.ItemTypes = new string[] { "A00.400", "A00.401", "A00.402" };
            var dict = (List <CodeValue>)dictManageService.QueryCode(codeFilter).Data;

            DataTable dt = new DataTable();

            dt.Columns.Add("c1");
            dt.Columns.Add("c2");
            dt.Columns.Add("c3");
            dt.Columns.Add("c4");
            dt.Columns.Add("c5");
            dt.Columns.Add("c6");
            dt.Columns.Add("c7");
            dt.Columns.Add("c8");
            dt.Columns.Add("c9");
            dt.Columns.Add("c10");
            dt.Columns.Add("c11");
            dt.Columns.Add("c12");
            if (response.Data != null)
            {
                CodeValue findItem;
                foreach (var item in response.Data)
                {
                    var dr = dt.NewRow();
                    dr["c1"] = item.Name;
                    dr["c2"] = item.FeeNo;
                    dr["c3"] = item.Floor + " " + item.RoomNo;
                    if (item.RecordDate.HasValue)
                    {
                        var data = item.RecordDate.Value;
                        dr["c4"] = string.Format("{0}/{1}/{2}", data.Year, data.Month, data.Day);
                    }
                    dr["c5"]  = item.BodyTemp.HasValue ? item.BodyTemp.Value.ToString("N1") : "";
                    findItem  = dict.Find(it => it.ItemType == "A00.400" && it.ItemCode == item.AmActivity);
                    dr["c10"] = findItem != null ? findItem.ItemName : "";
                    findItem  = dict.Find(it => it.ItemType == "A00.401" && it.ItemCode == item.PmActivity);
                    dr["c11"] = findItem != null ? findItem.ItemName : "";
                    findItem  = dict.Find(it => it.ItemType == "A00.403" && it.ItemCode == item.Comments);
                    dr["c12"] = findItem != null ? findItem.ItemName : "";
                    //dr["c1"] = item.Name;RecordByName
                    dt.Rows.Add(dr);
                }
            }
            doc.FillTable(0, dt, "", "", 1);
            dt.Dispose();
        }
Пример #11
0
        protected override void Operation(WordDocument doc)
        {
            ISocialWorkerManageService     socialWorkerService       = IOCContainer.Instance.Resolve <ISocialWorkerManageService>();
            IOrganizationManageService     organizationManageService = IOCContainer.Instance.Resolve <IOrganizationManageService>();
            IDictManageService             dictManageService         = IOCContainer.Instance.Resolve <IDictManageService>();
            IReportManageService           reportManageService       = IOCContainer.Instance.Resolve <IReportManageService>();
            BaseRequest <LifeRecordFilter> lifeRecordFilter          = new BaseRequest <LifeRecordFilter>();

            lifeRecordFilter.CurrentPage    = 1;
            lifeRecordFilter.PageSize       = 1000;
            lifeRecordFilter.Data.FeeNo     = ParamId;
            lifeRecordFilter.Data.StartDate = StartDate;
            lifeRecordFilter.Data.EndDate   = EndDate.AddDays(1);
            var org      = organizationManageService.GetOrg(SecurityHelper.CurrentPrincipal.OrgId);
            var response = socialWorkerService.QueryLifeRecord(lifeRecordFilter);

            doc.ReplaceText("Org", org.Data.OrgName);

            CodeFilter codeFilter = new CodeFilter();

            codeFilter.ItemTypes = new string[] { "A00.400", "A00.401", "A00.402" };
            var dict = (List <CodeValue>)dictManageService.QueryCode(codeFilter).Data;

            DataTable dt = new DataTable();

            dt.Columns.Add("c1");
            dt.Columns.Add("c2");
            dt.Columns.Add("c3");
            dt.Columns.Add("c4");
            dt.Columns.Add("c5");
            dt.Columns.Add("c6");
            dt.Columns.Add("c7");
            dt.Columns.Add("c8");
            dt.Columns.Add("c9");
            dt.Columns.Add("c10");
            dt.Columns.Add("c11");
            dt.Columns.Add("c12");
            if (response.Data != null)
            {
                if (response.Data.Count == 0)
                {
                    response.Data.Add(new LifeRecordModel());
                }
                CodeValue findItem;

                foreach (var item in response.Data)
                {
                    var dr = dt.NewRow();
                    dr["c1"] = item.Name;
                    dr["c2"] = item.ResidentsNo;
                    //dr["c3"] = item.Floor + " " + item.RoomNo;
                    if (organizationManageService.GetOrgFloor(item.Floor).Data != null &&
                        organizationManageService.GetOrgRoom(item.RoomNo).Data != null)
                    {
                        dr["c3"] = organizationManageService.GetOrgFloor(item.Floor).Data.FloorName + " " + organizationManageService.GetOrgRoom(item.RoomNo).Data.RoomName;
                    }
                    if (item.RecordDate.HasValue)
                    {
                        var data = item.RecordDate.Value;
                        //dr["c4"] = string.Format("{0}/{1}/{2}", data.Year - 1911, data.Month, data.Day);
                        dr["c4"] = string.Format("{0}/{1}/{2}", data.Year, data.Month, data.Day);
                    }
                    dr["c5"] = item.BodyTemp.HasValue ? item.BodyTemp.Value.ToString("N1") : "";

                    dr["c10"] = string.IsNullOrEmpty(item.AmActivity) ? "" : item.AmActivity.ToString();
                    dr["c11"] = string.IsNullOrEmpty(item.PmActivity) ? "" : item.PmActivity.ToString();

                    findItem  = dict.Find(it => it.ItemType == "A00.402" && it.ItemCode == item.Comments);
                    dr["c12"] = findItem != null ? findItem.ItemName : "";
                    //dr["c1"] = item.Name;RecordByName
                    dt.Rows.Add(dr);
                }
            }
            doc.FillTable(0, dt, "", "", 1);
            dt.Dispose();
        }