public void TestSaveVitalsign() { CodeFilter request = new CodeFilter(); request.ItemType = "A00.001"; var response = dictManageService.QueryCode(request); response = dictManageService.QueryCode(request); Assert.AreEqual(response.ResultCode, 0); }
/// <summary> /// P18个护理记录 /// </summary> /// <param name="doc"></param> private void P18Operation(WordDocument doc) { long feeNo = 8; IReportManageService reportManageService = IOCContainer.Instance.Resolve <IReportManageService>(); INursingWorkstationService nursingWorkstationService = IOCContainer.Instance.Resolve <INursingWorkstationService>(); IDictManageService dictManageService = IOCContainer.Instance.Resolve <IDictManageService>(); var residentInfo = reportManageService.GetResidentInfo(feeNo); BaseRequest <NursingRecFilter> nursingRecFilter = new BaseRequest <NursingRecFilter>(); nursingRecFilter.CurrentPage = 1; nursingRecFilter.PageSize = 1000; nursingRecFilter.Data.FeeNo = feeNo; var response = nursingWorkstationService.QueryNursingRec(nursingRecFilter); doc.ReplaceText("Org", residentInfo.Org); doc.ReplaceText("Name", residentInfo.Name); doc.ReplaceText("Sex", residentInfo.Sex); doc.ReplaceText("Age", residentInfo.Age.ToString()); doc.ReplaceText("FeeNo", residentInfo.FeeNo.ToString()); doc.ReplaceText("Floor", residentInfo.Floor); doc.ReplaceText("RoomNo", residentInfo.RoomNo); CodeFilter codeFilter = new CodeFilter(); codeFilter.ItemTypes = new string[] { "J00.005" }; 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"); if (response.Data != null) { foreach (var item in response.Data) { var dr = dt.NewRow(); var findItem = dict.Find(it => it.ItemType == "J00.005" && it.ItemCode == item.ClassType); dr["c1"] = item.RecordDate.HasValue ? Util.ToTwDate(item.RecordDate.Value) : ""; dr["c2"] = string.Format("{0} {1}{2}", item.RecordDate.HasValue ? item.RecordDate.Value.ToString("HH:mm") : "", item.ClassType, findItem != null ? findItem.ItemName : ""); dr["c3"] = item.Content; dr["c4"] = item.RecordNameBy; dt.Rows.Add(dr); } } doc.FillTable(0, dt, "", "", 2); dt.Dispose(); }
/// <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); }
public IHttpActionResult GetBSDType() { IDictManageService codeService = IOCContainer.Instance.Resolve <IDictManageService>(); BaseResponse <Dictionary <string, string> > response = new BaseResponse <Dictionary <string, string> >(); response.Data = new Dictionary <string, string>(); CodeFilter request = new CodeFilter(); request.ItemType = "F00.001"; var codeList = codeService.QueryCode(request); foreach (var code in codeList.Data) { response.Data.Add("S006" + code.ItemCode, code.ItemName); } return(Ok(response)); }
public IHttpActionResult Query(CodeFilter request) { BaseResponse <Dictionary <string, List <CodeValue> > > response = new BaseResponse <Dictionary <string, List <CodeValue> > >(); if (request != null) { if (request.ItemType != null) { var itemTypes = request.ItemType.Split(','); if (itemTypes.Length > 1) { request.ItemType = string.Empty; request.ItemTypes = itemTypes; } } var codeList = codeService.QueryCode(request); response.Data = request.ItemTypes.ToDictionary(itemType => itemType, no => codeList.Data.Where(o => o.ItemType == no).ToList()); } else { response.Data = new Dictionary <string, List <CodeValue> >(); } return(Ok(response)); }
protected override void Operation(Infrastructure.Word.WordDocument doc) { int recordId = (int)ParamId; doc.ReplaceText("Org", GetOrgName(SecurityHelper.CurrentPrincipal.OrgId)); IResidentManageService ResidentManageService = IOCContainer.Instance.Resolve <IResidentManageService>(); IDictManageService dictManageService = IOCContainer.Instance.Resolve <IDictManageService>(); var Person = ResidentManageService.GetPersonExtend(recordId); if (Person == null) { return; } if (Person.Data.ImgUrl != null) { string mapPath = string.Format("{0}\\{1}", AppDomain.CurrentDomain.BaseDirectory, Person.Data.ImgUrl.Replace("/", @"\")); if (File.Exists(mapPath)) { doc.InsertImage("photo", mapPath, 150, 200); } else { doc.ReplaceText("photo", ""); } } else { doc.ReplaceText("photo", ""); } if (Person.Data.Genogram != null) { string mapPath = string.Format("{0}\\{1}", AppDomain.CurrentDomain.BaseDirectory, Person.Data.Genogram.Replace("/", @"\")); if (File.Exists(mapPath)) { doc.InsertImage("Genogram", mapPath, 150, 200); } else { doc.ReplaceText("Genogram", ""); } } else { doc.ReplaceText("photo", ""); } CodeFilter codeFilter = new CodeFilter(); codeFilter.ItemTypes = new string[] { "A00.030", "A00.032", "A00.035", "A00.001", "A00.007", "A00.008" , "A00.011", "A00.002", "A00.016", "A00.020", "A00.021", "A00.022", "A00.038", "A00.043", "A00.031" }; var dict = (List <CodeValue>)dictManageService.QueryCode(codeFilter).Data; CodeValue findItem; Person.Data.Sex = dict.Find(it => it.ItemType == "A00.001" && it.ItemCode == Person.Data.Sex) != null? dict.Find(it => it.ItemType == "A00.001" && it.ItemCode == Person.Data.Sex).ItemName : ""; Person.Data.servicetype = dict.Find(it => it.ItemType == "A00.002" && it.ItemCode == Person.Data.servicetype) != null? dict.Find(it => it.ItemType == "A00.002" && it.ItemCode == Person.Data.servicetype).ItemName : ""; Person.Data.Education = dict.Find(it => it.ItemType == "A00.007" && it.ItemCode == Person.Data.Education) != null? dict.Find(it => it.ItemType == "A00.007" && it.ItemCode == Person.Data.Education).ItemName : ""; Person.Data.ReligionCode = dict.Find(it => it.ItemType == "A00.008" && it.ItemCode == Person.Data.ReligionCode) != null? dict.Find(it => it.ItemType == "A00.008" && it.ItemCode == Person.Data.ReligionCode).ItemName : ""; Person.Data.MerryFlag = dict.Find(it => it.ItemType == "A00.011" && it.ItemCode == Person.Data.MerryFlag) != null? dict.Find(it => it.ItemType == "A00.011" && it.ItemCode == Person.Data.MerryFlag).ItemName : ""; Person.Data.EATHABITS = dict.Find(it => it.ItemType == "A00.038" && it.ItemCode == Person.Data.EATHABITS) != null? dict.Find(it => it.ItemType == "A00.038" && it.ItemCode == Person.Data.EATHABITS).ItemName : ""; Person.Data.SOURCETYPE = dict.Find(it => it.ItemType == "A00.016" && it.ItemCode == Person.Data.SOURCETYPE) != null? dict.Find(it => it.ItemType == "A00.016" && it.ItemCode == Person.Data.SOURCETYPE).ItemName : ""; Person.Data.ECONOMYFLAG = dict.Find(it => it.ItemType == "A00.020" && it.ItemCode == Person.Data.ECONOMYFLAG) != null? dict.Find(it => it.ItemType == "A00.020" && it.ItemCode == Person.Data.ECONOMYFLAG).ItemName : ""; Person.Data.CASETYPE = dict.Find(it => it.ItemType == "A00.021" && it.ItemCode == Person.Data.CASETYPE) != null? dict.Find(it => it.ItemType == "A00.021" && it.ItemCode == Person.Data.CASETYPE).ItemName : ""; Person.Data.DISABDEGREE = dict.Find(it => it.ItemType == "A00.022" && it.ItemCode == Person.Data.DISABDEGREE) != null? dict.Find(it => it.ItemType == "A00.022" && it.ItemCode == Person.Data.DISABDEGREE).ItemName : ""; Person.Data.SubsidyUnit = dict.Find(it => it.ItemType == "A00.043" && it.ItemCode == Person.Data.SubsidyUnit) != null? dict.Find(it => it.ItemType == "A00.043" && it.ItemCode == Person.Data.SubsidyUnit).ItemName : ""; Person.Data.CAddress1 = Person.Data.City2 + "" + Person.Data.Address2 + "" + Person.Data.Address2dtl; Person.Data.CAddress2 = Person.Data.City1 + "" + Person.Data.Address1 + "" + Person.Data.Address1dtl; Person.Data.EffectiveTime = Person.Data.BOOKISSUEDATE + "-" + Person.Data.BOOKEXPDATE; Person.Data.Living = Person.Data.FloorName + "/" + Person.Data.RoomName; Person.Data.ISIdentificationText = Person.Data.ISREEVAL == null ? "是" : (!Person.Data.ISREEVAL.Value ? "是" : "否"); string[] str = new string[] { "第一类 神经系统构造及精神、心智功能", "第二类 眼,耳及相关机构与感官功能及疼痛", "第三类 涉及声音与言语构造及其功能", "第四类 循环、造血、免疫与呼吸系统构造及其功能", "第五类 消化、新陈代谢与内分泌系统相关构造及其功能", "第六类 泌尿与生殖系统相关构造及其功能", "第七类 神经、肌肉、骨骼之移动相关构造及其功能", "第八类 皮肤与相关构造及其功能" }; var Barrier_2 = ""; if (Person.Data.DISABILITYCATE1 != null) { Barrier_2 += Person.Data.DISABILITYCATE1.Value? str[0]:""; } if (Person.Data.DISABILITYCATE2 != null) { Barrier_2 += "," + (Person.Data.DISABILITYCATE2.Value ? str[1] : ""); } if (Person.Data.DISABILITYCATE3 != null) { Barrier_2 += "," + (Person.Data.DISABILITYCATE3.Value ? str[2] : ""); } if (Person.Data.DISABILITYCATE4 != null) { Barrier_2 += "," + (Person.Data.DISABILITYCATE4.Value ? str[3] : ""); } if (Person.Data.DISABILITYCATE5 != null) { Barrier_2 += "," + (Person.Data.DISABILITYCATE5.Value ? str[4] : ""); } if (Person.Data.DISABILITYCATE6 != null) { Barrier_2 += "," + (Person.Data.DISABILITYCATE6.Value ? str[5] : ""); } if (Person.Data.DISABILITYCATE7 != null) { Barrier_2 += "," + (Person.Data.DISABILITYCATE7.Value ? str[6] : ""); } if (Person.Data.DISABILITYCATE8 != null) { Barrier_2 += "," + (Person.Data.DISABILITYCATE8.Value ? str[7] : ""); } Person.Data.Barrier_2 = Barrier_2; BindData(Person.Data, doc); 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"); if (Person.Data.RelationDtl != null) { if (Person.Data.RelationDtl.Count > 0) { foreach (var item in Person.Data.RelationDtl) { var dr = dt.NewRow(); dr["c1"] = item.Name; findItem = dict.Find(it => it.ItemType == "A00.030" && it.ItemCode == item.Contrel); dr["c2"] = findItem != null ? findItem.ItemName : ""; findItem = dict.Find(it => it.ItemType == "A00.031" && it.ItemCode == item.Kinship); dr["c3"] = findItem != null ? findItem.ItemName : ""; findItem = dict.Find(it => it.ItemType == "A00.001" && it.ItemCode == item.Sex); dr["c4"] = findItem != null ? findItem.ItemName : ""; dr["c5"] = item.Phone; dr["c6"] = item.Address2; findItem = dict.Find(it => it.ItemType == "A00.035" && it.ItemCode == item.WorkCode); dr["c7"] = findItem != null ? findItem.ItemName : ""; dt.Rows.Add(dr); } } else { var dr = dt.NewRow(); dr["c1"] = ""; dr["c2"] = ""; dr["c3"] = ""; dr["c4"] = ""; dr["c5"] = ""; dr["c6"] = ""; dt.Rows.Add(dr); } } else { var dr = dt.NewRow(); dr["c1"] = ""; dr["c2"] = ""; dr["c3"] = ""; dr["c4"] = ""; dr["c5"] = ""; dr["c6"] = ""; dt.Rows.Add(dr); } doc.FillTable(0, dt, "", "", 23); dt.Dispose(); }
public ActionResult ResidentExport() { string templateName = Request["templateName"]; string startDateStr = Request["startDate"]; string endDateStr = Request["endDate"]; string floorId = Request["floorId"] ?? ""; int feeNo = 0; if (Request["feeNo"] != null) { feeNo = int.Parse(Request["feeNo"]); } if (floorId != "") { feeNo = 0; } ResidentFilter.Data.FeeNo = feeNo; ResidentFilter.Data.FloorId = floorId; list = residentService.QueryResidentExtend(ResidentFilter); #region 新近住民环境及辅导记录 if (templateName == "LTC_NEWEnvironmentTutor") { using (WordDocument doc = new WordDocument()) { doc.LoadModelDoc(templateName); foreach (Resident r in list.Data) { BaseRequest BaseRequest = new BaseRequest(); BaseRequest <NewResideEntenvRecFilter> request = new BaseRequest <NewResideEntenvRecFilter>(); request.Data.FEENO = r.FeeNo; var NewRegEnvAdaptation = reportManageService.QueryNewRegEnvAdaptation(request); for (var i = 0; i < NewRegEnvAdaptation.Data.Count; i++) { //实例化一个模板 doc.NewPartDocument(); var orginfo = orgserver.GetOrg(NewRegEnvAdaptation.Data[i].ORGID); var p = orgserver.GetEmployee(NewRegEnvAdaptation.Data[i].CREATEBY); var response = new BaseResponse <List <object> >(new List <object>()); response.Data.Add (new { NAME = r.Name, INDATE = NewRegEnvAdaptation.Data[i].INDATE, W1EVALDATE = NewRegEnvAdaptation.Data[i].W1EVALDATE, INFORMFLAG = (NewRegEnvAdaptation.Data[i].INFORMFLAG == 1) ? "是" : "否", COMMFLAG = (NewRegEnvAdaptation.Data[i].COMMFLAG == 1) ? "是" : "否", INTERPERSONAL = NewRegEnvAdaptation.Data[i].INTERPERSONAL, PARTICIPATION = NewRegEnvAdaptation.Data[i].PARTICIPATION, COORDINATION = NewRegEnvAdaptation.Data[i].COORDINATION, EMOTION = NewRegEnvAdaptation.Data[i].EMOTION, RESISTANCE = NewRegEnvAdaptation.Data[i].RESISTANCE, HELP = NewRegEnvAdaptation.Data[i].HELP, PROCESSACTIVITY = NewRegEnvAdaptation.Data[i].PROCESSACTIVITY, TRACEREC2 = NewRegEnvAdaptation.Data[i].TRACEREC, WEEK = NewRegEnvAdaptation.Data[i].WEEK, W2EVALDATE = NewRegEnvAdaptation.Data[i].W2EVALDATE, W3EVALDATE = NewRegEnvAdaptation.Data[i].W3EVALDATE, W4EVALDATE = NewRegEnvAdaptation.Data[i].W4EVALDATE, W1EVALUATION = NewRegEnvAdaptation.Data[i].EVALUATION, CREATEBY = NewRegEnvAdaptation.Data[i].CREATEBY, ORG = orginfo.Data.OrgName, }); MultiBindData(response.Data[0], doc); //添加一个模板 doc.AddPartDocument(); } } //导出一个模板 //Util.DownloadFile(doc.SaveDoc()); if (!doc.IsDocNull()) { Util.DownloadFile(doc.SaveMarkDoc(templateName)); } } } #endregion #region 新近住民环境介绍记录表 else if (templateName == "LTC_NEWEnvironmentRec") { using (WordDocument doc = new WordDocument()) { doc.LoadModelDoc(templateName); foreach (Resident r in list.Data) { BaseRequest <NewResideEntenvRecFilter> request = new BaseRequest <NewResideEntenvRecFilter>(); request.Data.FEENO = r.FeeNo; var NewResideEntenvRec = reportManageService.QueryNewResideEntenvRec(request); for (var i = 0; i < NewResideEntenvRec.Data.Count; i++) { //实例化一个模板 doc.NewPartDocument(); var orginfo = orgserver.GetOrg(NewResideEntenvRec.Data[i].ORGID); DateTime t1 = DateTime.Now; DateTime t2 = Convert.ToDateTime(NewResideEntenvRec.Data[i].BIRTHDATE); var response = new BaseResponse <List <object> >(new List <object>()); response.Data.Add (new { age = t1.Year - t2.Year, ID = NewResideEntenvRec.Data[i].ID, RESIDENGNO = NewResideEntenvRec.Data[i].RESIDENGNO, BEDNO = NewResideEntenvRec.Data[i].BEDNO, SEX = (NewResideEntenvRec.Data[i].SEX == "M") ? "男" : "女", INDATE = NewResideEntenvRec.Data[i].INDATE, RECORDDATE = NewResideEntenvRec.Data[i].RECORDDATE, BIRTHDATE = NewResideEntenvRec.Data[i].BIRTHDATE, FAMILYPARTICIPATION = (NewResideEntenvRec.Data[i].FAMILYPARTICIPATION == true) ? "是" : "否", CONTRACTFLAG = ((NewResideEntenvRec.Data[i].CONTRACTFLAG == true) ? "01.契约内容说明" : "") + ((NewResideEntenvRec.Data[i].LIFEFLAG == true) ? "02.生活公约说明" : ""), STAFF1 = NewResideEntenvRec.Data[i].STAFF1, REGULARACTIVITY = ((NewResideEntenvRec.Data[i].REGULARACTIVITY == true) ? "01.定期活动说明" : "") + ((NewResideEntenvRec.Data[i].NOTREGULARACTIVITY == true) ? "02.不定期活动说明" : ""), STAFF2 = NewResideEntenvRec.Data[i].STAFF2, name = r.Name, BELLFLAG = ((NewResideEntenvRec.Data[i].BELLFLAG == true) ? "01.紧急铃" : "") + " " + ((NewResideEntenvRec.Data[i].LAMPFLAG == true) ? "02.床头灯" : "") + " " + ((NewResideEntenvRec.Data[i].TVFLAG == true) ? "03.电视" : "") + " " + ((NewResideEntenvRec.Data[i].LIGHTSWITCH == true) ? "04.电灯开关" : "") + " " + ((NewResideEntenvRec.Data[i].ESCAPEDEVICE == true) ? "05.逃生设备" : "") + " " + ((NewResideEntenvRec.Data[i].ENVIRONMENT == true) ? "06.公共环境" : "") + " " + ((NewResideEntenvRec.Data[i].COMMUNITYFACILITIES == true) ? "07.社区设施" : "") + " " + ((NewResideEntenvRec.Data[i].POSTOFFICE == true) ? "邮局" : "") + " " + ((NewResideEntenvRec.Data[i].SCHOOL == true) ? "学校" : "") + " " + ((NewResideEntenvRec.Data[i].BANK == true) ? "银行" : "") + " " + ((NewResideEntenvRec.Data[i].STATION == true) ? "车站" : "") + " " + ((NewResideEntenvRec.Data[i].PARK == true) ? "公园" : "") + " " + ((NewResideEntenvRec.Data[i].TEMPLE == true) ? "寺庙" : "") + " " + ((NewResideEntenvRec.Data[i].HOSPITAL == true) ? "医疗院所" : "") + " " + ((NewResideEntenvRec.Data[i].OTHERFACILITIES == true) ? "其他" : ""), CLEANLINESS = ((NewResideEntenvRec.Data[i].CLEANLINESS == true) ? "01.个人清洁" : "") + " " + ((NewResideEntenvRec.Data[i].MEDICALCARE == true) ? "02.医保保健" : "") + " " + ((NewResideEntenvRec.Data[i].MEALSERVICE == true) ? "03.膳食服务" : "") + " " + ((NewResideEntenvRec.Data[i].WORKACTIVITIES == true) ? "04.社工拟定活动" : ""), STAFF3 = NewResideEntenvRec.Data[i].STAFF3, STAFF4 = NewResideEntenvRec.Data[i].STAFF4, PERSONINCHARGE = ((NewResideEntenvRec.Data[i].PERSONINCHARGE == true) ? "01.负责人 " : "") + " " + ((NewResideEntenvRec.Data[i].DIRECTOR == true) ? "02.主任" : "") + " " + ((NewResideEntenvRec.Data[i].NURSE == true) ? "03.护士" : "") + " " + ((NewResideEntenvRec.Data[i].NURSEAIDES == true) ? "04.照顾服务员" : "") + " " + ((NewResideEntenvRec.Data[i].RESIDENT == true) ? "05.住民" : "") + " " + ((NewResideEntenvRec.Data[i].DOCTOR == true) ? "06.医师" : "") + " " + ((NewResideEntenvRec.Data[i].SOCIALWORKER == true) ? "07.社工" : "") + " " + ((NewResideEntenvRec.Data[i].DIETITIAN == true) ? "08.营养师" : "") + " " + ((NewResideEntenvRec.Data[i].OTHERPEOPLE == true) ? "09.其他人员" : ""), STAFF5 = NewResideEntenvRec.Data[i].STAFF5, RECORDBY = NewResideEntenvRec.Data[i].RECORDBY, FEENO = NewResideEntenvRec.Data[i].FEENO, REGNO = NewResideEntenvRec.Data[i].REGNO, org = orginfo.Data.OrgName }); MultiBindData(response.Data[0], doc); //添加一个模板 doc.AddPartDocument(); } } //导出一个模板 //Util.DownloadFile(doc.SaveDoc()); if (!doc.IsDocNull()) { Util.DownloadFile(doc.SaveMarkDoc(templateName)); } } } #endregion #region 个案基本资料 else if (templateName == "PA001") { using (WordDocument doc = new WordDocument()) { doc.LoadModelDoc(templateName); foreach (Resident r in list.Data) { doc.NewPartDocument(); BaseRequest BaseRequest = new BaseRequest(); BaseRequest <NewResideEntenvRecFilter> request = new BaseRequest <NewResideEntenvRecFilter>(); request.Data.REGNO = r.RegNo; var Person = residentService.GetPersonExtend(r.RegNo.Value); if (Person.Data.ImgUrl != null) { string mapPath = string.Format("{0}\\{1}", AppDomain.CurrentDomain.BaseDirectory, Person.Data.ImgUrl.Replace("/", @"\")); if (System.IO.File.Exists(mapPath)) { doc.InsertImage("photo", mapPath, 150, 200); } } CodeFilter codeFilter = new CodeFilter(); codeFilter.ItemTypes = new string[] { "A00.030", "A00.032", "A00.035", "A00.001", "A00.007", "A00.008", "A00.011" }; var dict = (List <CodeValue>)dictManageService.QueryCode(codeFilter).Data; CodeValue findItem; Person.Data.Sex = dict.Find(it => it.ItemType == "A00.001" && it.ItemCode == Person.Data.Sex) != null? dict.Find(it => it.ItemType == "A00.001" && it.ItemCode == Person.Data.Sex).ItemName : ""; Person.Data.Education = dict.Find(it => it.ItemType == "A00.007" && it.ItemCode == Person.Data.Education) != null? dict.Find(it => it.ItemType == "A00.007" && it.ItemCode == Person.Data.Education).ItemName : ""; Person.Data.ReligionCode = dict.Find(it => it.ItemType == "A00.008" && it.ItemCode == Person.Data.ReligionCode) != null? dict.Find(it => it.ItemType == "A00.008" && it.ItemCode == Person.Data.ReligionCode).ItemName : ""; Person.Data.MerryFlag = dict.Find(it => it.ItemType == "A00.011" && it.ItemCode == Person.Data.MerryFlag) != null? dict.Find(it => it.ItemType == "A00.011" && it.ItemCode == Person.Data.MerryFlag).ItemName : ""; MultiBindData(Person.Data, doc); 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"); if (Person.Data.RelationDtl != null) { foreach (var item in Person.Data.RelationDtl) { var dr = dt.NewRow(); dr["c1"] = item.Name; findItem = dict.Find(it => it.ItemType == "A00.030" && it.ItemCode == item.Contrel); dr["c2"] = findItem != null ? findItem.ItemName : ""; findItem = dict.Find(it => it.ItemType == "A00.032" && it.ItemCode == item.RelationType); dr["c3"] = findItem != null ? findItem.ItemName : ""; dr["c4"] = item.Phone; dr["c5"] = item.Address; findItem = dict.Find(it => it.ItemType == "A00.035" && it.ItemCode == item.WorkCode); dr["c6"] = findItem != null ? findItem.ItemName : ""; dt.Rows.Add(dr); } } doc.MultiFillTable(0, dt, "", "", 32); doc.AddPartDocument(); dt.Dispose(); } //导出一个模板 Util.DownloadFile(doc.SaveDoc()); } } #endregion return(View("ResidentExport")); }
/// <summary> /// 护理记录 /// </summary> /// <param name="templateName"></param> /// <param name="startDateStr"></param> /// <param name="endDateStr"></param> /// <param name="feeNo"></param> /// <param name="classType"></param> public void DowdloadP18(string templateName, string startDateStr, string endDateStr, string feeNo, string classType, string floorId, string printOrder) { using (WordDocument doc = new WordDocument()) { //加载模板 doc.LoadModelDoc(templateName); var carelist = GetCareP18(startDateStr, endDateStr, feeNo, classType, floorId); if (carelist != null && carelist.Count > 0) { List <string> list = new List <string>(); foreach (var item in carelist) { list.Add(item.FEENO.ToString()); } var feenolist = list.Distinct().ToList(); if (feenolist != null && feenolist.Count > 0) { foreach (var item in feenolist) { doc.NewPartDocument(); IReportManageService reportManageService = IOCContainer.Instance.Resolve <IReportManageService>(); INursingWorkstationService nursingWorkstationService = IOCContainer.Instance.Resolve <INursingWorkstationService>(); IDictManageService dictManageService = IOCContainer.Instance.Resolve <IDictManageService>(); var residentInfo = carePlanservice.GetExportResidentInfo(Convert.ToInt64(item)); if (residentInfo != null) { doc.ReplacePartText("Org", residentInfo.Org ?? ""); doc.ReplacePartText("Name", residentInfo.Name ?? ""); doc.ReplacePartText("Sex", residentInfo.Sex ?? "未填"); doc.ReplacePartText("Age", residentInfo.Age.HasValue ? residentInfo.Age.ToString() : ""); doc.ReplacePartText("FeeNo", residentInfo.ResidentNo); doc.ReplacePartText("Floor", residentInfo.Floor ?? ""); doc.ReplacePartText("RoomNo", residentInfo.RoomNo ?? ""); } else { doc.ReplacePartText("Org", ""); doc.ReplacePartText("Name", ""); doc.ReplacePartText("Sex", "未填"); doc.ReplacePartText("Age", ""); doc.ReplacePartText("FeeNo", ""); doc.ReplacePartText("Floor", ""); doc.ReplacePartText("RoomNo", ""); } BaseRequest <NursingRecFilter> nursingRecFilter = new BaseRequest <NursingRecFilter>(); nursingRecFilter.CurrentPage = 1; nursingRecFilter.PageSize = 1000; nursingRecFilter.Data.PrintFlag = true; nursingRecFilter.Data.FeeNo = (Convert.ToInt64(item)); nursingRecFilter.Data.Order = printOrder; var response = nursingWorkstationService.QueryNursingRec(nursingRecFilter); response.Data = response.Data.Where(o => o.ClassType == classType).ToList(); DateTime?startDate = null; DateTime?endDate = null; if (startDateStr != "") { startDate = Convert.ToDateTime(startDateStr); } if (endDateStr != "") { endDate = Convert.ToDateTime(endDateStr).AddDays(1).AddMilliseconds(-1); } if (startDate.HasValue && response.Data != null) { response.Data = response.Data.Where(m => m.RecordDate >= startDate.Value).ToList(); } if (endDate.HasValue && response.Data != null) { response.Data = response.Data.Where(m => m.RecordDate <= endDate.Value).ToList(); } CodeFilter codeFilter = new CodeFilter { ItemTypes = new string[] { "J00.005" } }; 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"); if (response.Data != null) { foreach (var careitem in response.Data) { var dr = dt.NewRow(); var findItem = dict.Find(it => it.ItemType == "J00.005" && it.ItemCode == careitem.ClassType); dr["c1"] = careitem.RecordDate.HasValue ?Convert.ToDateTime(careitem.RecordDate.Value).ToString("yyyy-MM-dd") : ""; dr["c2"] = string.Format("{0} {1}{2}", careitem.RecordDate.HasValue ? careitem.RecordDate.Value.ToString("HH:mm") : "", careitem.ClassType, findItem != null ? findItem.ItemName : ""); dr["c3"] = careitem.Content; dr["c4"] = careitem.RecordNameBy; dt.Rows.Add(dr); } } doc.MultiFillTable(0, dt, "", "", 1); doc.AddPartDocument(); dt.Dispose(); } if (!doc.IsDocNull()) { Util.DownloadFile(doc.SaveMarkDoc("护理记录")); } } } } }
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", ""); } }
protected override void Operation(WordDocument doc) { long Id = ParamId; IReportManageService reportManageService = IOCContainer.Instance.Resolve <IReportManageService>(); INursingWorkstationService nursingWorkstationService = IOCContainer.Instance.Resolve <INursingWorkstationService>(); IDictManageService dictManageService = IOCContainer.Instance.Resolve <IDictManageService>(); ICarePlanReportService carePlanservice = IOCContainer.Instance.Resolve <ICarePlanReportService>(); BaseRequest <NursingRecFilter> nursingRecFilter = new BaseRequest <NursingRecFilter>(); nursingRecFilter.CurrentPage = 1; nursingRecFilter.PageSize = 1000; // nursingRecFilter.Data.PrintFlag = true; nursingRecFilter.Data.Id = Id; var response = nursingWorkstationService.QueryNursingRec(nursingRecFilter); var residentInfo = carePlanservice.GetExportResidentInfo(response.Data[0].FeeNo.Value); if (residentInfo != null) { doc.ReplaceText("Org", residentInfo.Org ?? ""); doc.ReplaceText("Name", residentInfo.Name ?? ""); doc.ReplaceText("Sex", residentInfo.Sex ?? "未填"); doc.ReplaceText("Age", residentInfo.Age.HasValue ? residentInfo.Age.ToString() : ""); doc.ReplaceText("FeeNo", residentInfo.ResidentNo); doc.ReplaceText("Floor", residentInfo.Floor ?? ""); doc.ReplaceText("RoomNo", residentInfo.RoomNo ?? ""); } else { doc.ReplaceText("Org", ""); doc.ReplaceText("Name", ""); doc.ReplaceText("Sex", "未填"); doc.ReplaceText("Age", ""); doc.ReplaceText("FeeNo", ""); doc.ReplaceText("Floor", ""); doc.ReplaceText("RoomNo", ""); } CodeFilter codeFilter = new CodeFilter { ItemTypes = new string[] { "J00.005" } }; 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"); if (response.Data != null) { foreach (var item in response.Data) { var dr = dt.NewRow(); var findItem = dict.Find(it => it.ItemType == "J00.005" && it.ItemCode == item.ClassType); dr["c1"] = item.RecordDate.HasValue ? item.RecordDate.Value.ToString("yyyy-MM-dd") : ""; dr["c2"] = string.Format("{0} {1}{2}", item.RecordDate.HasValue ? item.RecordDate.Value.ToString("HH:mm") : "", item.ClassType, findItem != null ? findItem.ItemName : ""); dr["c3"] = item.Content; dr["c4"] = item.RecordNameBy; dt.Rows.Add(dr); } } doc.FillTable(0, dt, "", "", 1); dt.Dispose(); }
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); }
protected async System.Threading.Tasks.Task Operation(WordDocument doc, string date, long?nSMonFeeID) { IBillV2Service service = IOCContainer.Instance.Resolve <IBillV2Service>(); List <PrintMonthFee> list = new List <PrintMonthFee>(); if (nSMonFeeID.HasValue) { var result = await HttpClientHelper.LtcHttpClient.GetAsync("/api/MonthFee/GetResMonthData?NSMonFeeID=" + nSMonFeeID.Value + "¤tPage=1&pageSize=1000"); var res = result.Content.ReadAsAsync <BaseResponse <IList <ResidentMonFeeModel> > >().Result; list = service.GetPrintData(res); } else { BaseRequest <MonthFeeFilter> request = new BaseRequest <MonthFeeFilter>() { CurrentPage = 1, PageSize = 1000, Data = { date = date } }; list = service.GetPrintData(request); } DateTime sDate, eDate; CalculateMonStartEndTime(date, out sDate, out eDate); doc.ReplaceText("sDate", sDate.ToString("yyyy年MM月dd日")); doc.ReplaceText("eDate", eDate.ToString("yyyy年MM月dd日")); doc.ReplaceText("Year", eDate.ToString("yyyy")); IDictManageService dictManageService = IOCContainer.Instance.Resolve <IDictManageService>(); CodeFilter codeFilter = new CodeFilter(); codeFilter.ItemTypes = new string[] { "A00.001", "A00.052" }; var dict = (List <CodeValue>)dictManageService.QueryCode(codeFilter).Data; doc.ReplaceText("Org", GetOrgName(SecurityHelper.CurrentPrincipal.OrgId)); 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"); dt.Columns.Add("c13"); dt.Columns.Add("c14"); dt.Columns.Add("c15"); int i = 1; foreach (PrintMonthFee monFee in list) { var dr = dt.NewRow(); dr["c1"] = i++; dr["c2"] = monFee.Name; dr["c3"] = dict.Find(it => it.ItemType == "A00.001" && it.ItemCode == monFee.Sex) != null? dict.Find(it => it.ItemType == "A00.001" && it.ItemCode == monFee.Sex).ItemName : ""; dr["c4"] = monFee.ResidentSSId; dr["c5"] = monFee.BrithPlace; dr["c6"] = dict.Find(it => it.ItemType == "A00.052" && it.ItemCode == monFee.RsStatus) != null? dict.Find(it => it.ItemType == "A00.052" && it.ItemCode == monFee.RsStatus).ItemName : ""; dr["c7"] = monFee.DiseaseDiag; dr["c8"] = monFee.CareTypeId.Replace("1", "专护").Replace("2", "专护").Replace("3", "机构护理"); dr["c9"] = monFee.CertStartTime == null ? null : monFee.CertStartTime.Value.ToString("yyyy-MM-dd"); dr["c10"] = monFee.InDate == null ? null : monFee.InDate.Value.ToString("yyyy-MM-dd"); dr["c11"] = monFee.OutDate == null ? null : monFee.OutDate.Value.ToString("yyyy-MM-dd"); dr["c12"] = monFee.HospDay; dr["c13"] = monFee.TotalAmount; dr["c14"] = monFee.NCIPayLevel; dr["c15"] = monFee.NCIPay; dt.Rows.Add(dr); } doc.FillTable(0, dt, "", "", 1); }
public object GetResMonthData(BaseRequest request, string sDate, string eDate, string nsno) { var response = new BaseResponse <IList <TreatmentAccount> >(); IDictManageService dictManageService = IOCContainer.Instance.Resolve <IDictManageService>(); CodeFilter codeFilter = new CodeFilter(); codeFilter.ItemTypes = new string[] { "A002", "A003" }; var dict = (List <CodeValue>)dictManageService.QueryCode(codeFilter).Data; var nsMonFeeIdList = unitOfWork.GetRepository <NCIP_NSMONFEE>().dbSet.Where(w => w.NSNO == nsno && w.ISDELETE == false && string.Compare(w.YEARMONTH, sDate) >= 0 && string.Compare(w.YEARMONTH, eDate) <= 0). Select(s => new { nsmonfeeid = (long?)s.NSMONFEEID, yearMonth = s.YEARMONTH }).ToList(); var nsMonFeeIdarr = nsMonFeeIdList.Select(s => s.nsmonfeeid); if (nsMonFeeIdList.Count <= 0) { return(response); } var q = from r1 in unitOfWork.GetRepository <NCIP_RESIDENTMONFEE>().dbSet where nsMonFeeIdarr.Contains(r1.NSMONFEEID) && r1.ISDELETE == false join r2 in unitOfWork.GetRepository <NCIA_APPLICANT>().dbSet on r1.RESIDENTSSID equals r2.IDNO where r2.ISDELETE == false join r3 in unitOfWork.GetRepository <NCIA_APPCERT>().dbSet on r1.RESIDENTSSID equals r3.IDNO where r3.STATUS == (int)EnumAppCertStatus.审核通过 group new { r1.NCIPAY, r1.TOTALAMOUNT, r1.HOSPDAY, r1.NCIPAYLEVEL, r1.FEENO, r1.RESIDENTSSID, r2.NAME, r2.GENDER, r2.MCTYPE, r2.RESIDENCE, r2.DISEASE, r3.AGENCYAPPROVEDCARETYPE, r3.EVALUATIONTIME, r1.NSMONFEEID, } by new { r1.NCIPAYLEVEL, r1.FEENO, r1.RESIDENTSSID, r2.NAME, r2.GENDER, r2.MCTYPE, r2.RESIDENCE, r2.DISEASE, r3.AGENCYAPPROVEDCARETYPE, r3.EVALUATIONTIME, r1.NSMONFEEID, } into g select new TreatmentAccount { Ncipay = g.Sum(m => m.NCIPAY), Totalamount = g.Sum(m => m.TOTALAMOUNT), Hospday = g.Sum(m => m.HOSPDAY), Ncipaylevel = g.Key.NCIPAYLEVEL, NSMONFEEID = g.Key.NSMONFEEID, Name = g.Key.NAME, FeeNo = g.Key.FEENO, Residentssid = g.Key.RESIDENTSSID, McType = g.Key.MCTYPE, Gender = g.Key.GENDER, Residence = g.Key.RESIDENCE, Disease = g.Key.DISEASE, AgencyApprovedCareType = g.Key.AGENCYAPPROVEDCARETYPE, EvaluationTime = g.Key.EVALUATIONTIME, }; var list = q.ToList().Select(s => new TreatmentAccount { Ncipay = s.Ncipay, Totalamount = s.Totalamount, Hospday = s.Hospday, Ncipaylevel = s.Ncipaylevel, yearMonthArr = nsMonFeeIdList.Where(w => w.nsmonfeeid == s.NSMONFEEID).Select(c => c.yearMonth).FirstOrDefault(), Name = s.Name, FeeNo = s.FeeNo, Residentssid = s.Residentssid, McType = s.McType, Gender = s.Gender, Residence = s.Residence, Disease = s.Disease, AgencyApprovedCareType = s.AgencyApprovedCareType, EvaluationTime = s.EvaluationTime, }).GroupBy(g => new { g.Ncipaylevel, g.Name, g.FeeNo, g.Residentssid, g.Gender, g.McType, g.Residence, g.Disease, g.AgencyApprovedCareType, g.EvaluationTime, }).Select(k => new TreatmentAccount { Ncipay = k.Sum(u => u.Ncipay), Totalamount = k.Sum(u => u.Totalamount), Hospday = k.Sum(u => u.Hospday), Ncipaylevel = k.Key.Ncipaylevel, yearMonthArr = string.Join(",", k.Select(p => p.yearMonthArr)), Name = k.Key.Name, FeeNo = k.Key.FeeNo, Residentssid = k.Key.Residentssid, McTypeName = dict.Find(it => it.ItemType == "A002" && it.ItemCode == k.Key.McType.ToString()) != null ? dict.Find(it => it.ItemType == "A002" && it.ItemCode == k.Key.McType.ToString()).ItemName : "", Gender = k.Key.Gender, Residence = k.Key.Residence, Disease = dict.Find(it => it.ItemType == "A003" && it.ItemCode == k.Key.Disease.Split(',')[0]) != null ? dict.Find(it => it.ItemType == "A003" && it.ItemCode == k.Key.Disease.Split(',')[0]).ItemName : "", NsappcareTypeName = k.Key.AgencyApprovedCareType.ToString().Replace("1", "专护").Replace("2", "机构护理"), EvaluationTime = k.Key.EvaluationTime, }).OrderByDescending(o => o.Name); response.RecordsCount = list.Count(); if (request != null && request.PageSize > 0) { response.Data = list.Skip((request.CurrentPage - 1) * request.PageSize).Take(request.PageSize).ToList(); response.PagesCount = GetPagesCount(request.PageSize, response.RecordsCount); } else { response.Data = list.ToList(); } return(response); }
/// <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(); }
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(); }
protected override void Operation(Infrastructure.Word.WordDocument doc) { int recordId = (int)ParamId; doc.ReplaceText("Org", GetOrgName(SecurityHelper.CurrentPrincipal.OrgId)); IResidentManageService ResidentManageService = IOCContainer.Instance.Resolve <IResidentManageService>(); IDictManageService dictManageService = IOCContainer.Instance.Resolve <IDictManageService>(); var Person = ResidentManageService.GetPersonExtend(recordId); if (Person == null) { return; } if (Person.Data.ImgUrl != null) { string mapPath = string.Format("{0}\\{1}", AppDomain.CurrentDomain.BaseDirectory, Person.Data.ImgUrl.Replace("/", @"\")); if (File.Exists(mapPath)) { doc.InsertImage("photo", mapPath, 150, 200); } else { doc.ReplaceText("photo", ""); } } else { doc.ReplaceText("photo", ""); } CodeFilter codeFilter = new CodeFilter(); codeFilter.ItemTypes = new string[] { "A00.030", "A00.032", "A00.035", "A00.001", "A00.007", "A00.008", "A00.011", "A00.002" }; var dict = (List <CodeValue>)dictManageService.QueryCode(codeFilter).Data; CodeValue findItem; Person.Data.Sex = dict.Find(it => it.ItemType == "A00.001" && it.ItemCode == Person.Data.Sex) != null? dict.Find(it => it.ItemType == "A00.001" && it.ItemCode == Person.Data.Sex).ItemName : ""; Person.Data.servicetype = dict.Find(it => it.ItemType == "A00.002" && it.ItemCode == Person.Data.servicetype) != null? dict.Find(it => it.ItemType == "A00.002" && it.ItemCode == Person.Data.servicetype).ItemName : ""; Person.Data.Education = dict.Find(it => it.ItemType == "A00.007" && it.ItemCode == Person.Data.Education) != null? dict.Find(it => it.ItemType == "A00.007" && it.ItemCode == Person.Data.Education).ItemName : ""; Person.Data.ReligionCode = dict.Find(it => it.ItemType == "A00.008" && it.ItemCode == Person.Data.ReligionCode) != null? dict.Find(it => it.ItemType == "A00.008" && it.ItemCode == Person.Data.ReligionCode).ItemName : ""; Person.Data.MerryFlag = dict.Find(it => it.ItemType == "A00.011" && it.ItemCode == Person.Data.MerryFlag) != null? dict.Find(it => it.ItemType == "A00.011" && it.ItemCode == Person.Data.MerryFlag).ItemName : ""; Person.Data.CAddress1 = Person.Data.City2 + "" + Person.Data.Address2 + "" + Person.Data.Address2dtl; Person.Data.CAddress2 = Person.Data.City1 + "" + Person.Data.Address1 + "" + Person.Data.Address1dtl; BindData(Person.Data, doc); 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"); if (Person.Data.RelationDtl != null) { if (Person.Data.RelationDtl.Count > 0) { foreach (var item in Person.Data.RelationDtl) { var dr = dt.NewRow(); dr["c1"] = item.Name; findItem = dict.Find(it => it.ItemType == "A00.030" && it.ItemCode == item.Contrel); dr["c2"] = findItem != null ? findItem.ItemName : ""; findItem = dict.Find(it => it.ItemType == "A00.032" && it.ItemCode == item.RelationType); dr["c3"] = findItem != null ? findItem.ItemName : ""; dr["c4"] = item.Phone; dr["c5"] = item.Address; findItem = dict.Find(it => it.ItemType == "A00.035" && it.ItemCode == item.WorkCode); dr["c6"] = findItem != null ? findItem.ItemName : ""; dt.Rows.Add(dr); } } else { var dr = dt.NewRow(); dr["c1"] = ""; dr["c2"] = ""; dr["c3"] = ""; dr["c4"] = ""; dr["c5"] = ""; dr["c6"] = ""; dt.Rows.Add(dr); } } else { var dr = dt.NewRow(); dr["c1"] = ""; dr["c2"] = ""; dr["c3"] = ""; dr["c4"] = ""; dr["c5"] = ""; dr["c6"] = ""; dt.Rows.Add(dr); } doc.FillTable(0, dt, "", "", 32); dt.Dispose(); }