Beispiel #1
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();
        }