diff --git a/src/Shentun.Peis.Application.Contracts/CustomerReports/GetPatientRegisterPositiveReportRequestDto.cs b/src/Shentun.Peis.Application.Contracts/CustomerReports/GetPatientRegisterPositiveReportRequestDto.cs index c064f67..b58090d 100644 --- a/src/Shentun.Peis.Application.Contracts/CustomerReports/GetPatientRegisterPositiveReportRequestDto.cs +++ b/src/Shentun.Peis.Application.Contracts/CustomerReports/GetPatientRegisterPositiveReportRequestDto.cs @@ -12,15 +12,5 @@ namespace Shentun.Peis.CustomerReports /// public List CustomerOrgs { get; set; } = new List(); - - /// - /// 检查状态(正式登记,部份已检,已总检) - /// - public char? CompleteFlag { get; set; } - - /// - /// 审核状态( Y N ) - /// - public char? IsAudit { get; set; } } } diff --git a/src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportExportWordDto.cs b/src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportExportWordDto.cs index 4c85ea7..d2d32ca 100644 --- a/src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportExportWordDto.cs +++ b/src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportExportWordDto.cs @@ -7,247 +7,8 @@ namespace Shentun.Peis.CustomerReports public class GetUnitPhysicalExaminationReportExportWordDto { /// - /// 体检年度 + /// 报告url 需拼接http前缀地址 /// - public string MedicalYear { get; set; } - - /// - /// 单位名称 - /// - public string CustomerOrgName { get; set; } - - /// - /// 体检次数 - /// - public int MedicalTimes { get; set; } - - /// - /// 体检开始月份 格式:2009年09月 - /// - public string MedicalStartDate { get; set; } - - /// - /// 体检结束月份 格式:2009年09月 - /// - public string MedicalEndDate { get; set; } - - /// - /// 制表日期 格式:2009年09月09日 - /// - public string TabulationDate { get; set; } - - - /// - /// 打印日期 格式:2009年09月09日 - /// - public string PrintDate { get; set; } - - - /// - /// 参加人员构成情况 第一部分 - /// - public GetUnitPhysicalExaminationReportExportWord_InspectionPersonnel InspectionPersonnel { get; set; } - - /// - /// 体检项目得参检情况 第二部分 - /// - public List MedicalItemExamineSituations { get; set; } - - /// - /// 全体员工体检结果汇总 第三部分 - /// - public List MedicalResultSummarys { get; set; } - - - - } - - /// - /// 参加人员构成情况 - /// - public class GetUnitPhysicalExaminationReportExportWord_InspectionPersonnel - { - /// - /// 男性登记人数 - /// - public int MaleRegisterNumber { get; set; } - - /// - /// 女性登记人数 - /// - public int FemaleRegisterNumber { get; set; } - - /// - /// 其他登记人数 - /// - public int OtherRegisterNumber { get; set; } - - /// - /// 合计登记人数 - /// - public int SumRegisterNumber { get; set; } - - /// - /// 登记明细 - /// - public InspectionPersonnel_Detail RegisterDetail { get; set; } - - /// - /// 实检明细 - /// - public InspectionPersonnel_Detail CheckedDetail { get; set; } - - /// - /// 未检明细 - /// - public InspectionPersonnel_Detail UnCheckedDetail { get; set; } - } - - /// - /// 检查明细 - /// - public class InspectionPersonnel_Detail - { - /// - /// 男性人数 - /// - public int MaleNumber { get; set; } - - /// - /// 女性人数 - /// - public int FemaleNumber { get; set; } - - /// - /// 其他人数 - /// - public int OtherNumber { get; set; } - - /// - /// 合计人数 - /// - public int TotalNumber { get; set; } - - /// - /// 男性比例 - /// - public string MaleRatio { get; set; } - - /// - /// 女性比例 - /// - public string FemaleRatio { get; set; } - - /// - /// 男性参检比例 - /// - public string MaleExamineRatio { get; set; } - - /// - /// 女性参检比例 - /// - public string FemaleExamineRatio { get; set; } - - - /// - /// 平均参检比例 - /// - public string AverageExamineRatio { get; set; } - } - - - /// - /// 体检项目得参检情况 - /// - public class GetUnitPhysicalExaminationReportExportWord_MedicalItemExamineSituation - { - /// - /// 科室 - /// - public string ItemTypeName { get; set; } - - /// - /// 组合项目名称 - /// - public string AsbitemName { get; set; } - - /// - /// 男性该项目参检人数 - /// - public int MaleAsbitemCheckNumber { get; set; } - - /// - /// 女性该项目参检人数 - /// - public int FemaleAsbitemCheckNumber { get; set; } - - /// - /// 合计该项目参检人数 - /// - public int TotalAsbitemCheckNumber { get; set; } - - /// - /// 男性总体参检人数 所有项目 - /// - public int MaleSumCheckNumber { get; set; } - - /// - /// 女性总体参检人数 所有项目 - /// - public int FemaleSumCheckNumber { get; set; } - - /// - /// 合计总体参检人数 所有项目 - /// - public int TotalSumCheckNumber { get; set; } - - - /// - /// 男性该项目参检比例 - /// - public int MaleAsbitemCheckRatio { get; set; } - - /// - /// 女性该项目参检比例 - /// - public int FemaleAsbitemCheckRatio { get; set; } - - /// - /// 合计该项目参检比例 - /// - public int TotalAsbitemCheckRatio { get; set; } - - - } - - /// - /// 全体员工体检结果汇总 统计已总检的名单 - /// - public class GetUnitPhysicalExaminationReportExportWord_MedicalResultSummary - { - /// - /// 档案号 - /// - public string PatientNo { get; set; } - - /// - /// 姓名 - /// - public string PatientName { get; set; } - - /// - /// 性别 - /// - public string SexName { get; set; } - - /// - /// 年龄 - /// - public string Age { get; set; } - - /// - /// 体检结果 - /// - public string MedicalResult { get; set; } + public string ReportUrl { get; set; } } } diff --git a/src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportReduceDto.cs b/src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportReduceDto.cs index 7219099..e7ccc67 100644 --- a/src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportReduceDto.cs +++ b/src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportReduceDto.cs @@ -6,6 +6,62 @@ namespace Shentun.Peis.CustomerReports { public class GetUnitPhysicalExaminationReportReduceDto { + /// + /// 标题 + /// + public string ReportTitle { get; set; } + + /// + /// 单位名称 + /// + public string CustomerOrgName { get; set; } + + /// + /// 体检次数 + /// + public int MedicalTimes { get; set; } + + /// + /// 开始月份 + /// + public string StartMonth { get; set; } + + + /// + /// 结束月份 + /// + public string EndMonth { get; set; } + + /// + /// 开始日期 + /// + public string StartDate { get; set; } + + /// + /// 结束日期 + /// + public string EndDate { get; set; } + + /// + /// 总共体检人数 + /// + public int SumMedicalNumber { get; set; } + + /// + /// 男性体检人数 + /// + public int MaleMedicalNumber { get; set; } + + /// + /// 女性体检人数 + /// + public int FemaleMedicalNumber { get; set; } + + /// + /// 其他体检人数 + /// + public int OtherMedicalNumber { get; set; } + /// /// 人员阳性结果清单 /// diff --git a/src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportStandardDto.cs b/src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportStandardDto.cs index 5cb7194..739b271 100644 --- a/src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportStandardDto.cs +++ b/src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportStandardDto.cs @@ -5,8 +5,68 @@ using System.Text; namespace Shentun.Peis.CustomerReports { + /// + /// 标准格式 + /// public class GetUnitPhysicalExaminationReportStandardDto { + + /// + /// 标题 + /// + public string ReportTitle { get; set; } + + /// + /// 单位名称 + /// + public string CustomerOrgName { get; set; } + + /// + /// 体检次数 + /// + public int MedicalTimes { get; set; } + + /// + /// 开始月份 + /// + public string StartMonth { get; set; } + + + /// + /// 结束月份 + /// + public string EndMonth { get; set; } + + /// + /// 开始日期 + /// + public string StartDate { get; set; } + + /// + /// 结束日期 + /// + public string EndDate { get; set; } + + /// + /// 总共体检人数 + /// + public int SumMedicalNumber { get; set; } + + /// + /// 男性体检人数 + /// + public int MaleMedicalNumber { get; set; } + + /// + /// 女性体检人数 + /// + public int FemaleMedicalNumber { get; set; } + + /// + /// 其他体检人数 + /// + public int OtherMedicalNumber { get; set; } + /// /// 人员阳性结果清单 /// diff --git a/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs b/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs index 9a28675..3214618 100644 --- a/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs +++ b/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs @@ -12,7 +12,7 @@ namespace Shentun.Peis.PeisReports /// /// 单位相关 /// - public List CustomerOrgs { get; set; } = new List (); + public List CustomerOrgs { get; set; } = new List(); /// @@ -95,17 +95,20 @@ namespace Shentun.Peis.PeisReports /// /// 日期类型(1、登记日期 2、体检日期 3、总检日期) /// - public char? DateType { get; set; } + [Required(ErrorMessage = "日期类型不能为空")] + public char DateType { get; set; } /// /// 开始日期 /// - public string? StartDate { get; set; } + [Required(ErrorMessage = "开始日期不能为空")] + public string StartDate { get; set; } /// /// 结束日期 /// - public string? EndDate { get; set; } + [Required(ErrorMessage = "结束日期不能为空")] + public string EndDate { get; set; } } } diff --git a/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs b/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs index 4b26405..a382ff0 100644 --- a/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs +++ b/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs @@ -2,19 +2,26 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Routing; using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Internal; +using NPOI.HPSF; using NPOI.POIFS.Storage; using NPOI.SS.Formula.Functions; +using NPOI.SS.UserModel; +using NPOI.XSSF.UserModel.Extensions; using Org.BouncyCastle.Crypto.Tls; using Shentun.Peis.CustomerOrgs; using Shentun.Peis.Enums; using Shentun.Peis.Models; using Shentun.Peis.PeisReports; +using Shentun.Peis.ReportTemplates; using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; +using TencentCloud.Ame.V20190916.Models; using TencentCloud.Scf.V20180416.Models; using TencentCloud.Ticm.V20181127.Models; using TencentCloud.Wedata.V20210820.Models; @@ -30,7 +37,7 @@ namespace Shentun.Peis.CustomerReports /// 客户报表 /// [ApiExplorerSettings(GroupName = "Work")] - [Authorize] + //[Authorize] public class CustomerReportAppService : ApplicationService { private readonly IRepository _patientRepository; @@ -46,11 +53,12 @@ namespace Shentun.Peis.CustomerReports private readonly IRepository _registerCheckSummaryRepository; private readonly IRepository _registerCheckItemRepository; private readonly IRepository _asbitemRepository; - private readonly IRepository _itemRepository; + private readonly IRepository _itemRepository; private readonly IRepository _itemTypeRepository; private readonly IRepository _sumSuggestionHeaderRepository; private readonly IRepository _sumSuggestionContentRepository; private readonly CustomerOrgManager _customerOrgManager; + private readonly CustomerOrgReportManager _customerOrgReportManager; public CustomerReportAppService( IRepository patientRepository, @@ -66,12 +74,12 @@ namespace Shentun.Peis.CustomerReports IRepository registerCheckSummaryRepository, IRepository registerCheckItemRepository, IRepository asbitemRepository, - IRepository itemRepository, + IRepository itemRepository, IRepository itemTypeRepository, IRepository sumSuggestionHeaderRepository, IRepository sumSuggestionContentRepository, - CustomerOrgManager customerOrgManager - ) + CustomerOrgManager customerOrgManager, + CustomerOrgReportManager customerOrgReportManager) { this._patientRepository = patientRepository; this._patientRegisterRepository = patientRegisterRepository; @@ -91,6 +99,7 @@ namespace Shentun.Peis.CustomerReports this._sumSuggestionContentRepository = sumSuggestionContentRepository; this._customerOrgManager = customerOrgManager; this._itemTypeRepository = itemTypeRepository; + _customerOrgReportManager = customerOrgReportManager; } @@ -200,15 +209,7 @@ namespace Shentun.Peis.CustomerReports - if (input.CompleteFlag != null) - { - sumquery = sumquery.Where(m => m.a.CompleteFlag == input.CompleteFlag); - } - if (input.IsAudit != null) - { - sumquery = sumquery.Where(m => m.a.IsAudit == input.IsAudit); - } var entlist = sumquery.GroupBy(g => g.c.PatientRegisterId).Select(s => new GetPatientRegisterPositiveReportDto @@ -409,7 +410,7 @@ namespace Shentun.Peis.CustomerReports var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item.CustomerOrgId.Value); sumquery_count = sumquery_count.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId)); } - if (item.DateType != null && !string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate)) + if (!string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate)) { if (item.DateType == '1') { @@ -449,7 +450,7 @@ namespace Shentun.Peis.CustomerReports var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item2.CustomerOrgId.Value); newquery = newquery.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId)); } - if (item2.DateType != null && !string.IsNullOrEmpty(item2.StartDate) && !string.IsNullOrEmpty(item2.EndDate)) + if (!string.IsNullOrEmpty(item2.StartDate) && !string.IsNullOrEmpty(item2.EndDate)) { if (item2.DateType == '1') { @@ -519,7 +520,7 @@ namespace Shentun.Peis.CustomerReports var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item.CustomerOrgId.Value); sumquery = sumquery.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId)); } - if (item.DateType != null && !string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate)) + if (!string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate)) { if (item.DateType == '1') { @@ -559,7 +560,7 @@ namespace Shentun.Peis.CustomerReports var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item2.CustomerOrgId.Value); newquery = newquery.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId)); } - if (item2.DateType != null && !string.IsNullOrEmpty(item2.StartDate) && !string.IsNullOrEmpty(item2.EndDate)) + if (!string.IsNullOrEmpty(item2.StartDate) && !string.IsNullOrEmpty(item2.EndDate)) { if (item2.DateType == '1') { @@ -649,7 +650,7 @@ namespace Shentun.Peis.CustomerReports var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item.CustomerOrgId.Value); sumquery_count = sumquery_count.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId)); } - if (item.DateType != null && !string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate)) + if (!string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate)) { if (item.DateType == '1') { @@ -689,7 +690,7 @@ namespace Shentun.Peis.CustomerReports var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item2.CustomerOrgId.Value); newquery = newquery.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId)); } - if (item2.DateType != null && !string.IsNullOrEmpty(item2.StartDate) && !string.IsNullOrEmpty(item2.EndDate)) + if (!string.IsNullOrEmpty(item2.StartDate) && !string.IsNullOrEmpty(item2.EndDate)) { if (item2.DateType == '1') { @@ -748,7 +749,7 @@ namespace Shentun.Peis.CustomerReports var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item.CustomerOrgId.Value); sumquery = sumquery.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId)); } - if (item.DateType != null && !string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate)) + if (!string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate)) { if (item.DateType == '1') { @@ -788,7 +789,7 @@ namespace Shentun.Peis.CustomerReports var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item2.CustomerOrgId.Value); newquery = newquery.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId)); } - if (item2.DateType != null && !string.IsNullOrEmpty(item2.StartDate) && !string.IsNullOrEmpty(item2.EndDate)) + if (!string.IsNullOrEmpty(item2.StartDate) && !string.IsNullOrEmpty(item2.EndDate)) { if (item2.DateType == '1') { @@ -841,6 +842,21 @@ namespace Shentun.Peis.CustomerReports [HttpPost("api/customerreport/getunitphysicalexaminationreportstandard")] public async Task GetUnitPhysicalExaminationReportStandardAsync(GetUnitPhysicalExaminationReportRequestDto input) { + if (input.CustomerOrgs.Count != 1) + { + throw new UserFriendlyException("必须选择并且只能选择一个单位"); + } + + if (input.CustomerOrgs.FirstOrDefault().CustomerOrgId == null || input.CustomerOrgs.FirstOrDefault().CustomerOrgId == GuidFlag.PersonCustomerOrgId) + { + throw new UserFriendlyException("单位不能为空"); + } + + if (input.CustomerOrgs.FirstOrDefault().CustomerOrgRegisterId == null || input.CustomerOrgs.FirstOrDefault().CustomerOrgRegisterId == GuidFlag.PersonCustomerOrgRegisterId) + { + throw new UserFriendlyException("单位体检次数不能为空"); + } + //人员阳性结果清单 var PatientRegisterPositiveReports = await GetPatientRegisterPositiveReportAsync(new GetPatientRegisterPositiveReportRequestDto { CustomerOrgs = input.CustomerOrgs }); @@ -886,6 +902,12 @@ namespace Shentun.Peis.CustomerReports [HttpPost("api/customerreport/getunitphysicalexaminationreportreduce")] public async Task GetUnitPhysicalExaminationReportReduceAsync(GetUnitPhysicalExaminationReportRequestDto input) { + if (input.CustomerOrgs.Count != 1) + { + throw new UserFriendlyException("必须选择并且只能选择一个单位"); + } + + //人员阳性结果清单 var PatientRegisterPositiveReports = await GetPatientRegisterPositiveReportAsync(new GetPatientRegisterPositiveReportRequestDto { CustomerOrgs = input.CustomerOrgs }); @@ -924,54 +946,189 @@ namespace Shentun.Peis.CustomerReports + ///// ///// 单位体检报表 导出word ///// - ///// - ///// - //[HttpPost("api/customerreport/getunitphysicalexaminationreportreduce")] - //public async Task GetUnitPhysicalExaminationReportExportWordAsync(GetUnitPhysicalExaminationReportExportWordRequestDto input) - //{ + /// + /// + [HttpPost("api/customerreport/getunitphysicalexaminationreportreduce")] + public async Task GetUnitPhysicalExaminationReportExportWordAsync(GetUnitPhysicalExaminationReportExportWordRequestDto input) + { + if (input.CustomerOrgs.Count != 1) + { + throw new UserFriendlyException("必须选择并且只能选择一个单位"); + } - // if (input.CustomerOrgs.Count != 1) - // { - // throw new UserFriendlyException("必须选择并且只能选择一个单位"); - // } - // //人员阳性结果清单 - // var PatientRegisterPositiveReports = await GetPatientRegisterPositiveReportAsync(new GetPatientRegisterPositiveReportRequestDto { CustomerOrgs = input.CustomerOrgs }); + var customerOrgs = input.CustomerOrgs.FirstOrDefault(); - // //阳性结果包含人员清单 精简模式 - // var PositivePatientRegisterReportReduces = await GetPositivePatientRegisterReportReduceAsync(new GetPositivePatientRegisterReportRequestDto { CustomerOrgs = input.CustomerOrgs }); + if (customerOrgs.CustomerOrgId == null || customerOrgs.CustomerOrgId == GuidFlag.PersonCustomerOrgId) + { + throw new UserFriendlyException("单位不能为空"); + } - // //疾病人数统计 - // var DiseaseCountStatisticsReports = await GetDiseaseCountStatisticsReportAsync(new GetDiseaseCountStatisticsReportRequestDto { CustomerOrgs = input.CustomerOrgs }); + if (customerOrgs.CustomerOrgRegisterId == null || customerOrgs.CustomerOrgRegisterId == GuidFlag.PersonCustomerOrgRegisterId) + { + throw new UserFriendlyException("单位体检次数不能为空"); + } - // var query = from a in await _customerOrgRegisterRepository.GetQueryableAsync() - // join b in await _customerOrgRepository.GetQueryableAsync() on a.CustomerOrgId equals b.Id into bb - // from ab in bb.DefaultIfEmpty() - // select new { a, ab }; + #region 请求参数 - // if (input.CustomerOrgs.Any()) - // { - // query = query.Where(m => input.CustomerOrgs.Where(m => m.CustomerOrgRegisterId != null && m.CustomerOrgRegisterId != Guid.Empty).Select(s => s.CustomerOrgRegisterId).Contains(m.a.Id)); - // } + var createInspectionPersonnelPara = new CreateInspectionPersonnelPara + { + CustomerOrgGroupId = customerOrgs.CustomerOrgGroupId, + CustomerOrgId = customerOrgs.CustomerOrgId.Value, + EndDate = customerOrgs.EndDate, + DateType = customerOrgs.DateType, + StartDate = customerOrgs.StartDate, + CustomerOrgRegisterId = customerOrgs.CustomerOrgRegisterId.Value + }; - // var entlist = new GetUnitPhysicalExaminationReportReduceDto - // { - // CustomerOrgs = query.Select(s => new GetUnitPhysicalExaminationStandardReport_CustomerOrg - // { - // BeginTime = s.a.BeginTime.ToString(), - // EndTime = s.a.EndTime != null ? s.a.EndTime.ToString() : "", - // CustomerOrgName = s.ab != null ? s.ab.DisplayName : "", - // MedicalTimes = s.a.MedicalTimes - // }).ToList(), - // DiseaseCountStatisticsReports = DiseaseCountStatisticsReports, - // PatientRegisterPositiveReports = PatientRegisterPositiveReports, - // PositivePatientRegisterReportReduces = PositivePatientRegisterReportReduces - // }; + #endregion - // return entlist; - //} + #region 封面参数 + var customerOrgRegisterEntity = (await _customerOrgRegisterRepository.GetQueryableAsync()) + .Include(x => x.CustomerOrg) + .FirstOrDefault(f => f.Id == customerOrgs.CustomerOrgRegisterId); + + var documentData = new UnitPhysicalExaminationReportExportWordData(); + + documentData.MedicalTitle = customerOrgRegisterEntity.BeginTime.Year.ToString() + "年度" + customerOrgRegisterEntity.CustomerOrg.DisplayName; + documentData.MedicalTimes = customerOrgRegisterEntity.MedicalTimes; + documentData.MedicalStartDate = customerOrgRegisterEntity.BeginTime.ToString("yyyy年MM月"); + documentData.MedicalEndDate = customerOrgRegisterEntity.EndTime != null ? customerOrgRegisterEntity.EndTime.Value.ToString("yyyy年MM月") : DateTime.Now.ToString("yyyy年MM月"); + documentData.TabulationDate = DateTime.Now.ToString("yyyy年MM月dd日"); + documentData.PrintDate = DateTime.Now.ToString("yyyy年MM月dd日"); + #endregion + + #region 参检人员 第一部分 + + await _customerOrgReportManager.CreateInspectionPersonnelData(documentData, createInspectionPersonnelPara); + + #endregion + + + #region 体检项目与体检项目的参检情况 第二部分 + + await _customerOrgReportManager.CreateMedicalItemExamineSituationData(documentData, createInspectionPersonnelPara); + + #endregion + + #region 全体员工体检结果汇总 第三部分 + + await _customerOrgReportManager.CreateMedicalResultSummarysData(documentData, createInspectionPersonnelPara); + + #endregion + + + #region 本次体检异常结果检出统计 第四部分 + + await _customerOrgReportManager.CreateMedicalAbnormalResultStatisticsData(documentData, createInspectionPersonnelPara); + + #endregion + + #region 本次体检前十大异常结果分析 第五部分 + + await _customerOrgReportManager.CreateMedicalTenAbnormalResultsData(documentData, createInspectionPersonnelPara); + + #endregion + + + #region 体检者未完成情况 第六部分 + + await _customerOrgReportManager.CreateMedicalUnCheckedStatisticsData(documentData, createInspectionPersonnelPara); + + #endregion + + + #region 判断是否存在模板 + string TemplateUrl = System.AppDomain.CurrentDomain.BaseDirectory + @"\ReportFile\CustomerOrgTemplate\单位体检报告模板.docx"; + if (!File.Exists(TemplateUrl)) + _customerOrgReportManager.CreateCustomerOrgPeisTemplate(); + #endregion + + string documentUrl = _customerOrgReportManager.CreateCustomerOrgPeisFromTemplate(documentData); + + return new GetUnitPhysicalExaminationReportExportWordDto + { + ReportUrl = documentUrl + }; + } + + + + /// + /// + /// + [HttpPost("api/customerreport/createtemplate")] + public void CreateTemplate() + { + + #region 判断是否存在模板 + string TemplateUrl = System.AppDomain.CurrentDomain.BaseDirectory + @"\ReportFile\CustomerOrgTemplate\单位体检报告模板.docx"; + if (!File.Exists(TemplateUrl)) + _customerOrgReportManager.CreateCustomerOrgPeisTemplate(); + #endregion + + + + + #region 生成报告 + + var documentData = new UnitPhysicalExaminationReportExportWordData + { + MedicalTitle = "2024年度长沙神豚", + MedicalTimes = 1, + MedicalStartDate = "2023年09月01日", + MedicalEndDate = "2024年04月09日", + TabulationDate = "2024年04月09日", + PrintDate = "2024年04月09日", + RegisterDetail = new InspectionPersonnel_Detail + { + AverageExamineRatio = "50%", + FemaleExamineRatio = "40%", + MaleExamineRatio = "40%", + FemaleNumber = 20, + FemaleRatio = "30%", + MaleNumber = 20, + MaleRatio = "30%", + OtherNumber = 20, + TotalNumber = 60 + }, + CheckedDetail = new InspectionPersonnel_Detail + { + AverageExamineRatio = "50%", + FemaleExamineRatio = "40%", + MaleExamineRatio = "40%", + FemaleNumber = 10, + FemaleRatio = "30%", + MaleNumber = 10, + MaleRatio = "30%", + OtherNumber = 10, + TotalNumber = 30 + }, + UnCheckedDetail = new InspectionPersonnel_Detail + { + AverageExamineRatio = "50%", + FemaleExamineRatio = "40%", + MaleExamineRatio = "40%", + FemaleNumber = 10, + FemaleRatio = "30%", + MaleNumber = 10, + MaleRatio = "30%", + OtherNumber = 10, + TotalNumber = 30 + }, + MedicalAbnormalResultStatistics = new List(), + MedicalItemExamineSituations = new List(), + MedicalResultSummarys = new List(), + MedicalTenAbnormalResults = new List(), + MedicalUnCheckedStatistics = new List() + }; + + _customerOrgReportManager.CreateCustomerOrgPeisFromTemplate(documentData); + #endregion + } ///// @@ -2133,6 +2290,8 @@ namespace Shentun.Peis.CustomerReports + + } diff --git a/src/Shentun.Peis.Domain/DataHelper.cs b/src/Shentun.Peis.Domain/DataHelper.cs index cde0886..c84455e 100644 --- a/src/Shentun.Peis.Domain/DataHelper.cs +++ b/src/Shentun.Peis.Domain/DataHelper.cs @@ -14,6 +14,60 @@ namespace Shentun.Peis { public static class DataHelper { + + /// + /// 生成历次综述医生小结 + /// + /// + /// + public static string SetSumSummarys(List SumSummaryHeaders) + { + StringBuilder msg = new StringBuilder(); + if (SumSummaryHeaders.Count > 0) + { + foreach (var item in SumSummaryHeaders) + { + msg.Append("* " + item.SummaryTitle + ":" + "
"); + if (item.SumSummaryContents.Count > 0) + { + var SumSummaryContents = item.SumSummaryContents.ToList(); + foreach (var item2 in SumSummaryContents) + { + msg.Append("(" + SumSummaryContents.IndexOf(item2) + 1 + ")" + item2.SummaryContent + "
"); + } + } + } + } + return msg.ToString(); + } + + + /// + /// 生成总诊建议 + /// + /// + /// + public static string SetSumSuggestion(List SumSuggestionHeaders) + { + StringBuilder msg = new StringBuilder(); + if (SumSuggestionHeaders.Count > 0) + { + foreach (var item in SumSuggestionHeaders) + { + msg.Append("* " + item.SumSuggestionContents + ":" + "
"); + if (item.SumSuggestionContents.Count > 0) + { + var SumSuggestionContents = item.SumSuggestionContents.ToList(); + foreach (var item2 in SumSuggestionContents) + { + msg.Append("(" + SumSuggestionContents.IndexOf(item2) + 1 + ")" + item2.SuggestionContent + "
"); + } + } + } + } + return msg.ToString(); + } + /// /// 验证是否为空或者空字符串 /// @@ -570,5 +624,7 @@ namespace Shentun.Peis #endregion + + } } diff --git a/src/Shentun.Peis.Domain/ReportTemplates/ChartData.cs b/src/Shentun.Peis.Domain/ReportTemplates/ChartData.cs new file mode 100644 index 0000000..27fbe29 --- /dev/null +++ b/src/Shentun.Peis.Domain/ReportTemplates/ChartData.cs @@ -0,0 +1,269 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Shentun.Peis.ReportTemplates +{ + public class Table4 + { + public string DeptName { get; set; } + + public string ProjectName { get; set; } + + public int ProManNum { get; set; } + public int ProWomanNum { get; set; } + public int ProTotalmanNum { get; set; } + + public int ManNum { get; set; } + + public int WomanNum { get; set; } + + public int TotalmanNum { get; set; } + + + public int ProManRate { get; set; } + public int ProWomanRate { get; set; } + public int ProTotalmanRate { get; set; } + + + } + + public class Table5 + { + public string PatientNo { get; set; } + + public string PatientName { get; set; } + + public string SexName { get; set; } + + public string Age { get; set; } + + public string Result { get; set; } + } + + public class Table6 + { + public string Conclusion { get; set; } + + public string Credit { get; set; } + + public int ManNum { get; set; } + + public int WomanNum { get; set; } + + public int TotalmanNum { get; set; } + + + public int ManRate { get; set; } + public int WomanRate { get; set; } + public int AvgRate { get; set; } + } + + + public class Table7 + { + public string IcdName { get; set; } + + public string Notes { get; set; } + } + public class Table8 + { + public string PatientNo { get; set; } + + public string PatientName { get; set; } + + public string SexName { get; set; } + + public string Age { get; set; } + + public string DeptName { get; set; } + } + + public class ChartData + { + public string Category + { + get; + set; + } + public double Expenses + { + get; + set; + } + + + + public static List CreateCanadaExpenses() + { + var canada = new List(); + canada.Add(new ChartData() { Category = "Food", Expenses = 100 }); + canada.Add(new ChartData() { Category = "Housing", Expenses = 120 }); + canada.Add(new ChartData() { Category = "Transportation", Expenses = 140 }); + canada.Add(new ChartData() { Category = "Health Care", Expenses = 150 }); + return canada; + } + + public static List CreateUSAExpenses() + { + var usa = new List(); + usa.Add(new ChartData() { Category = "Food", Expenses = 200 }); + usa.Add(new ChartData() { Category = "Housing", Expenses = 150 }); + usa.Add(new ChartData() { Category = "Transportation", Expenses = 110 }); + usa.Add(new ChartData() { Category = "Health Care", Expenses = 100 }); + return usa; + } + + public static List CreateBrazilExpenses() + { + var brazil = new List(); + brazil.Add(new ChartData() { Category = "Food", Expenses = 125 }); + brazil.Add(new ChartData() { Category = "Housing", Expenses = 80 }); + brazil.Add(new ChartData() { Category = "Transportation", Expenses = 110 }); + brazil.Add(new ChartData() { Category = "Health Care", Expenses = 60 }); + return brazil; + } + + public static List CreateReferenceRate() + { + var brazil = new List(); + brazil.Add(new ChartData() { Category = "未检", Expenses = 50 }); + brazil.Add(new ChartData() { Category = "已检", Expenses = 50 }); + return brazil; + } + + public static List CreateReferenceRateSex() + { + var brazil = new List(); + brazil.Add(new ChartData() { Category = "男性", Expenses = 50 }); + brazil.Add(new ChartData() { Category = "女性", Expenses = 40 }); + brazil.Add(new ChartData() { Category = "其他", Expenses = 10 }); + return brazil; + } + + public static List CreateDisease() + { + var brazil = new List(); + brazil.Add(new ChartData() { Category = "疾病1", Expenses = 1 }); + brazil.Add(new ChartData() { Category = "疾病2", Expenses = 22 }); + brazil.Add(new ChartData() { Category = "疾病3", Expenses = 3 }); + brazil.Add(new ChartData() { Category = "疾病4", Expenses = 4 }); + brazil.Add(new ChartData() { Category = "疾病5", Expenses = 5 }); + brazil.Add(new ChartData() { Category = "疾病6", Expenses = 6 }); + brazil.Add(new ChartData() { Category = "疾病7", Expenses = 7 }); + brazil.Add(new ChartData() { Category = "疾病8", Expenses = 8 }); + brazil.Add(new ChartData() { Category = "疾病9", Expenses = 9 }); + brazil.Add(new ChartData() { Category = "疾病10", Expenses = 10 }); + return brazil; + } + public static List CreateException() + { + var brazil = new List(); + brazil.Add(new ChartData() { Category = "疾病1", Expenses = 22 }); + brazil.Add(new ChartData() { Category = "疾病2", Expenses = 22 }); + brazil.Add(new ChartData() { Category = "疾病3", Expenses = 22 }); + brazil.Add(new ChartData() { Category = "疾病4", Expenses = 4 }); + brazil.Add(new ChartData() { Category = "疾病5", Expenses = 5 }); + brazil.Add(new ChartData() { Category = "疾病6", Expenses = 6 }); + brazil.Add(new ChartData() { Category = "疾病7", Expenses = 7 }); + brazil.Add(new ChartData() { Category = "疾病8", Expenses = 8 }); + brazil.Add(new ChartData() { Category = "疾病9", Expenses = 9 }); + brazil.Add(new ChartData() { Category = "疾病10", Expenses = 10 }); + return brazil; + } + + public static List CreateTable4() + { + var tb4 = new List(); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "血常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "便常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 }); + return tb4; + } + + public static List CreateTable5() + { + var tb5 = new List(); + tb5.Add(new Table5() { PatientNo = "2401091235293785", PatientName = "李四", SexName = "男性", Age = "40岁", Result = "正常" }); + tb5.Add(new Table5() { PatientNo = "2401091235293781", PatientName = "李四1", SexName = "男性", Age = "40岁", Result = "正常" }); + tb5.Add(new Table5() { PatientNo = "2401091235293782", PatientName = "李四2", SexName = "男性", Age = "40岁", Result = "正常" }); + tb5.Add(new Table5() { PatientNo = "2401091235293783", PatientName = "李四3", SexName = "男性", Age = "40岁", Result = "正常" }); + tb5.Add(new Table5() { PatientNo = "2401091235293784", PatientName = "李四4", SexName = "男性", Age = "40岁", Result = "正常" }); + tb5.Add(new Table5() { PatientNo = "2401091235293786", PatientName = "李四5", SexName = "男性", Age = "40岁", Result = "正常" }); + tb5.Add(new Table5() { PatientNo = "2401091235293787", PatientName = "李四6", SexName = "男性", Age = "40岁", Result = "正常" }); + tb5.Add(new Table5() { PatientNo = "2401091235293788", PatientName = "李四7", SexName = "男性", Age = "40岁", Result = "正常" }); + tb5.Add(new Table5() { PatientNo = "2401091235293789", PatientName = "李四8", SexName = "男性", Age = "40岁", Result = "正常" }); + tb5.Add(new Table5() { PatientNo = "2401091235293725", PatientName = "李四9", SexName = "男性", Age = "40岁", Result = "正常" }); + return tb5; + } + + public static List CreateTable6() + { + var tb6 = new List(); + tb6.Add(new Table6() { Conclusion = "结论1", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 }); + tb6.Add(new Table6() { Conclusion = "结论2", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 }); + tb6.Add(new Table6() { Conclusion = "结论3", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 }); + tb6.Add(new Table6() { Conclusion = "结论4", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 }); + tb6.Add(new Table6() { Conclusion = "结论5", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 }); + tb6.Add(new Table6() { Conclusion = "结论12", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 }); + tb6.Add(new Table6() { Conclusion = "结论6", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 }); + tb6.Add(new Table6() { Conclusion = "结论7", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 }); + tb6.Add(new Table6() { Conclusion = "结论8", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 }); + tb6.Add(new Table6() { Conclusion = "结论11", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 }); + return tb6; + } + + public static List CreateTable7() + { + var tb = new List(); + tb.Add(new Table7() { IcdName = "XXXXXX疾病1", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" }); + tb.Add(new Table7() { IcdName = "XXXXXX疾病2", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" }); + tb.Add(new Table7() { IcdName = "XXXXXX疾病3", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" }); + tb.Add(new Table7() { IcdName = "XXXXXX疾病4", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" }); + tb.Add(new Table7() { IcdName = "XXXXXX疾病5", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" }); + tb.Add(new Table7() { IcdName = "XXXXXX疾病6", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" }); + tb.Add(new Table7() { IcdName = "XXXXXX疾病7", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" }); + tb.Add(new Table7() { IcdName = "XXXXXX疾病8", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" }); + tb.Add(new Table7() { IcdName = "XXXXXX疾病9", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" }); + tb.Add(new Table7() { IcdName = "XXXXXX疾病10", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" }); + return tb; + } + + public static List CreateTable8() + { + var tb = new List(); + tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四", SexName = "男性", Age = "40岁", DeptName = "放射科" }); + tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四1", SexName = "男性", Age = "40岁", DeptName = "放射科" }); + tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四2", SexName = "男性", Age = "40岁", DeptName = "放射科" }); + tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四3", SexName = "男性", Age = "40岁", DeptName = "放射科" }); + tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四4", SexName = "男性", Age = "40岁", DeptName = "放射科" }); + tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四5", SexName = "男性", Age = "40岁", DeptName = "放射科" }); + tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四6", SexName = "男性", Age = "40岁", DeptName = "放射科" }); + tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四7", SexName = "男性", Age = "40岁", DeptName = "放射科" }); + tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四8", SexName = "男性", Age = "40岁", DeptName = "放射科" }); + return tb; + } + } + +} diff --git a/src/Shentun.Peis.Domain/ReportTemplates/CreateInspectionPersonnelPara.cs b/src/Shentun.Peis.Domain/ReportTemplates/CreateInspectionPersonnelPara.cs new file mode 100644 index 0000000..0f665bb --- /dev/null +++ b/src/Shentun.Peis.Domain/ReportTemplates/CreateInspectionPersonnelPara.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Shentun.Peis.ReportTemplates +{ + public class CreateInspectionPersonnelPara + { + /// + /// 单位ID 需要包含查出子级ID + /// + public Guid CustomerOrgId { get; set; } + + /// + /// 单位体检次数ID + /// + public Guid CustomerOrgRegisterId { get; set; } + + /// + /// + /// + public List CustomerOrgGroupId { get; set; } = new List(); + + /// + /// 日期类型(1、登记日期 2、体检日期 3、总检日期) + /// + public char DateType { get; set; } + + /// + /// 开始日期 + /// + public string StartDate { get; set; } + + + /// + /// 结束日期 + /// + public string EndDate { get; set; } + } +} diff --git a/src/Shentun.Peis.Domain/ReportTemplates/CustomerOrgReportManager.cs b/src/Shentun.Peis.Domain/ReportTemplates/CustomerOrgReportManager.cs new file mode 100644 index 0000000..4a111b5 --- /dev/null +++ b/src/Shentun.Peis.Domain/ReportTemplates/CustomerOrgReportManager.cs @@ -0,0 +1,2330 @@ +using Microsoft.EntityFrameworkCore; +using Shentun.Peis.CustomerOrgs; +using Shentun.Peis.Enums; +using Shentun.Peis.Models; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TencentCloud.Bda.V20200324.Models; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Domain.Services; +using Xceed.Document.NET; +using Xceed.Words.NET; + +namespace Shentun.Peis.ReportTemplates +{ + /// + /// 单位体检报告管理 + /// + public class CustomerOrgReportManager : DomainService + { + private readonly IRepository _patientRegisterRepository; + private readonly CustomerOrgManager _customerOrgManager; + private readonly IRepository _registerCheckRepository; + private readonly IRepository _registerAsbitemRepository; + private readonly IRepository _asbitemRepository; + private readonly IRepository _itemTypeRepository; + private readonly IRepository _sexRepository; + private readonly IRepository _sumSummaryHeaderRepository; + private readonly IRepository _sumDiagnosisRepository; + private readonly IRepository _sumSuggestionHeaderRepository; + private readonly IRepository _customerOrgRepository; + + private readonly string DirectoryName = System.AppDomain.CurrentDomain.BaseDirectory + @"\ReportFile"; + + public CustomerOrgReportManager( + IRepository patientRegisterRepository, + CustomerOrgManager customerOrgManager, + IRepository registerCheckRepository, + IRepository registerAsbitemRepository, + IRepository asbitemRepository, + IRepository itemTypeRepository, + IRepository sexRepository, + IRepository sumSummaryHeaderRepository, + IRepository sumDiagnosisRepository, + IRepository sumSuggestionHeaderRepository, + IRepository customerOrgRepository) + { + _patientRegisterRepository = patientRegisterRepository; + _customerOrgManager = customerOrgManager; + _registerCheckRepository = registerCheckRepository; + _registerAsbitemRepository = registerAsbitemRepository; + _asbitemRepository = asbitemRepository; + _itemTypeRepository = itemTypeRepository; + _sexRepository = sexRepository; + _sumSummaryHeaderRepository = sumSummaryHeaderRepository; + _sumDiagnosisRepository = sumDiagnosisRepository; + _sumSuggestionHeaderRepository = sumSuggestionHeaderRepository; + _customerOrgRepository = customerOrgRepository; + } + + //public void CreateCustomerOrgPeisTemplateBak() + //{ + // DocX document = DocX.Create(DirectoryName + @"\CustomerOrgTemplate\单位体检报告模板.docx"); + + + // //第一页 + // Table p1Titletable = document.AddTable(1, 2); + // p1Titletable.Design = TableDesign.TableNormal; + // p1Titletable.Alignment = Alignment.center; + // Border b = new Border(); + // b.Color = Color.FromArgb(51, 153, 102); + // b.Size = BorderSize.six; + // p1Titletable.SetBorder(TableBorderType.Bottom, b); + // List rows = p1Titletable.Rows; + + // Row row0 = rows[0]; + // row0.Height = 65f; + // row0.Cells[0].Width = 50f; + // Xceed.Document.NET.Image logo = document.AddImage(DirectoryName + @"\CustomerOrgTemplate\logo_template.jpg"); + // Formatting p1TitleFormatting = new Formatting(); + // p1TitleFormatting.FontFamily = new Xceed.Document.NET.Font("宋体"); + // p1TitleFormatting.FontColor = Color.FromArgb(0, 128, 0); + // row0.Cells[0].Paragraphs[0].AppendPicture(logo.CreatePicture()); + // row0.Cells[0].VerticalAlignment = VerticalAlignment.Center; + // row0.Cells[1].Width = document.PageWidth - document.MarginLeft - document.MarginRight - 30f; + // row0.Cells[1].Paragraphs[0].Append("团体体检健康检查统计报告", p1TitleFormatting).FontSize(22).Alignment = Alignment.center; + // row0.Cells[1].VerticalAlignment = VerticalAlignment.Center; + // var pTitle = document.InsertParagraph(); + // pTitle.InsertTableAfterSelf(p1Titletable); + + // var p1TitleSec = document.InsertParagraph(); + // Formatting p1TitleSecFormatting = new Formatting(); + // p1TitleSecFormatting.FontFamily = new Xceed.Document.NET.Font("楷体"); + // p1TitleSecFormatting.Size = 26; + // CustomProperty org_years = new CustomProperty("org_year", "{体检年度}", p1TitleSecFormatting); + // CustomProperty org_name = new CustomProperty("org_name", "{体检单位}", p1TitleSecFormatting); + // p1TitleSec.Alignment = Alignment.right; + // p1TitleSec.AppendDocProperty(org_years, f: p1TitleSecFormatting); + // p1TitleSec.Append("年度", p1TitleSecFormatting); + // p1TitleSec.AppendDocProperty(org_name, f: p1TitleSecFormatting); + // document.InsertParagraph(); + // var p1TitleSecExt = document.InsertParagraph(); + // p1TitleSecFormatting.FontFamily = new Xceed.Document.NET.Font("隶书"); + // p1TitleSecFormatting.Size = 26; + // p1TitleSecExt.Alignment = Alignment.right; + // p1TitleSecExt.Append("团检报告", p1TitleSecFormatting); + // document.InsertParagraph(); + // Xceed.Document.NET.Image titleImg = document.AddImage(DirectoryName + @"\CustomerOrgTemplate\Page1.jpg"); + // var p1TitleImg = document.InsertParagraph(); + // p1TitleImg.Alignment = Alignment.center; + // p1TitleImg.AppendPicture(titleImg.CreatePicture()); + + // Table p1Contenttable = document.AddTable(5, 4); + // p1Contenttable.Design = TableDesign.TableNormal; + // List rowsContent = p1Contenttable.Rows; + + // Row row0Content = rowsContent[0]; + // Formatting p1TableContentFormatting = new Formatting(); + // p1TableContentFormatting.FontFamily = new Xceed.Document.NET.Font("楷体"); + // Border bTableContent = new Border(); + // bTableContent.Color = Color.FromArgb(0, 128, 0); + // bTableContent.Size = BorderSize.four; + // Formatting p1TableColumn1ContentFormatting = new Formatting(); + // p1TableColumn1ContentFormatting.FontFamily = new Xceed.Document.NET.Font("楷体"); + // p1TableColumn1ContentFormatting.Size = 18; + // CustomProperty cell_times = new CustomProperty("times", "{体检次数}", p1TitleSecFormatting); + // CustomProperty cell_beginDt = new CustomProperty("beginDt", "{体检日期}", p1TitleSecFormatting); + // CustomProperty cell_endDt = new CustomProperty("endDt", "{结束月份}", p1TitleSecFormatting); + // CustomProperty cell_createDt = new CustomProperty("createDt", "{制表日期}", p1TitleSecFormatting); + // CustomProperty cell_printDt = new CustomProperty("printDt", "{打印日期}", p1TitleSecFormatting); + // row0Content.Cells[0].Width = 200f; + // row0Content.Cells[1].Width = 150f; + // row0Content.Cells[2].Width = 300f; + // row0Content.Cells[1].Paragraphs[0].Append("体检次数", p1TableContentFormatting).FontSize(18).Alignment = Alignment.right; + // row0Content.Cells[1].VerticalAlignment = VerticalAlignment.Center; + // row0Content.Cells[2].Paragraphs[0].AppendDocProperty(cell_times, f: p1TableColumn1ContentFormatting).Alignment = Alignment.left; + // row0Content.Cells[2].VerticalAlignment = VerticalAlignment.Center; + // row0Content.Cells[2].SetBorder(TableCellBorderType.Bottom, bTableContent); + + // Row row1Content = rowsContent[1]; + // row1Content.Cells[1].Paragraphs[0].Append("体检日期", p1TableContentFormatting).FontSize(18).Alignment = Alignment.right; + // row1Content.Cells[1].VerticalAlignment = VerticalAlignment.Center; + // row1Content.Cells[2].Paragraphs[0].AppendDocProperty(cell_beginDt, f: p1TableColumn1ContentFormatting).FontSize(18).Alignment = Alignment.left; + // row1Content.Cells[2].VerticalAlignment = VerticalAlignment.Center; + // row1Content.Cells[2].SetBorder(TableCellBorderType.Bottom, bTableContent); + + // Row row2Content = rowsContent[2]; + // row2Content.Cells[1].Paragraphs[0].Append("结束月份", p1TableContentFormatting).FontSize(18).Alignment = Alignment.right; + // row2Content.Cells[1].VerticalAlignment = VerticalAlignment.Center; + // row2Content.Cells[2].Paragraphs[0].AppendDocProperty(cell_endDt, f: p1TableColumn1ContentFormatting).Alignment = Alignment.left; + // row2Content.Cells[2].VerticalAlignment = VerticalAlignment.Center; + // row2Content.Cells[2].SetBorder(TableCellBorderType.Bottom, bTableContent); + + // Row row3Content = rowsContent[3]; + // row3Content.Cells[1].Paragraphs[0].Append("制表日期", p1TableContentFormatting).FontSize(18).Alignment = Alignment.right; + // row3Content.Cells[1].VerticalAlignment = VerticalAlignment.Center; + // row3Content.Cells[2].Paragraphs[0].AppendDocProperty(cell_createDt, f: p1TableColumn1ContentFormatting).Alignment = Alignment.left; + // row3Content.Cells[2].VerticalAlignment = VerticalAlignment.Center; + + // Row row4Content = rowsContent[4]; + // row4Content.Cells[1].Paragraphs[0].Append("打印日期", p1TableContentFormatting).FontSize(18).Alignment = Alignment.right; + // row4Content.Cells[1].VerticalAlignment = VerticalAlignment.Center; + // row4Content.Cells[2].Paragraphs[0].AppendDocProperty(cell_printDt, f: p1TableColumn1ContentFormatting).Alignment = Alignment.left; + // row4Content.Cells[2].VerticalAlignment = VerticalAlignment.Center; + + // var p1Content = document.InsertParagraph(); + // p1Content.InsertTableAfterSelf(p1Contenttable); + + // for (int i = 0; i <= 10; i++) document.InsertParagraph(); + + // Table p1FootTable = document.AddTable(1, 1); + // p1FootTable.Design = TableDesign.TableNormal; + // List rowsFootTable = p1FootTable.Rows; + + // Row row0Foot = rowsFootTable[0]; + // row0Foot.Cells[0].Paragraphs[0].Append("医院体检中心 编制", p1TableContentFormatting).FontSize(14).Alignment = Alignment.right; + // row0Foot.Cells[0].VerticalAlignment = VerticalAlignment.Center; + // row0Foot.Cells[0].SetBorder(TableCellBorderType.Bottom, bTableContent); + + // var p1Foot = document.InsertParagraph(); + // p1Foot.InsertTableAfterSelf(p1FootTable); + + // var p1Foot1 = document.InsertParagraph(); + // p1Foot1.Append("体检中心地址:", p1TableContentFormatting).FontSize(10).Alignment = Alignment.right; + + // //第二页 + // p1Foot1.InsertPageBreakAfterSelf(); + // Xceed.Document.NET.Font f = new Xceed.Document.NET.Font("宋体"); + // var p2_1 = document.InsertParagraph("前言").Font(f).FontSize(14); + // document.InsertParagraph(); + // document.InsertParagraph("这是一本针对贵单位员工体检结果的综合分析资料,希望透过本资料,让贵单位主管能够了解员工的健康状况及可以改善的方向。").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + // document.InsertParagraph(@"这份报告包括五大部份:基础资料、体检异常情况统计、员工健康问题分析及保健建议、女性员工健康问题分析及保健建议、男性员工健康问题分析及保健建议、全体员工体检结果汇总。我们在每个部份都会提供重要的健康与疾病相关知识,以及后续应该如何处理等信息。让非常关心员工健康的您,知道如何再进一步改善或提倡健康促进活动。").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + // document.InsertParagraph(@"第一部份:参检人员构成情况").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + // document.InsertParagraph(@"第二部份:体检项目与体检项目的参检情况").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + // document.InsertParagraph(@"第三部份:全体员工体检结果汇总").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + // document.InsertParagraph(@"第四部份:本次体检异常结果检出统计").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + // document.InsertParagraph(@"第五部份: 本次体检前十大异常结果分析").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + // document.InsertParagraph(@"第六部份: 体检者未完成情况").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + // document.InsertParagraph(@"第七部分:常见体检异常结果分析及健康指导").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + // document.InsertParagraph(); + // document.InsertParagraph(@"医院体检中心另提供完善的后续服务,包括护理咨询服务、特色医院导诊服务、营养咨询等。有任何需要,请电洽相关部门,或拨打咨询专线咨询相关事宜。").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + // document.InsertParagraph(); + // document.InsertParagraph(@"定期健康检查对于员工健康的重要性相信您已知道,然而,更重要的是完成健康检查后,改善健康活动的开始,也就是健康促进的一级预防医学(适当的运动、均衡的饮食、身心休闲),这才是健康检查最终的目标。").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + // document.InsertParagraph(); + // document.InsertParagraph(@"完全依赖治疗的时代已经过去了,应定期健康检查,并落实健康促进的一级预防医学,这将是未来人类健康的不二法门。").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + // //第三页 + // var p2_last = document.InsertParagraph(); + // p2_last.InsertPageBreakAfterSelf(); + // document.InsertParagraph(@"一、参检人员构成情况").Font(f).FontSize(16); + + // Table p3Contenttable = document.AddTable(5, 10); + // p3Contenttable.Design = TableDesign.TableGrid; + // List p3rowsContent = p3Contenttable.Rows; + // Row p3Row0 = p3rowsContent[0]; + + // p3Contenttable.MergeCellsInColumn(0, 0, 1); + // p3Row0.Cells[0].Paragraphs[0].Append("情况类型").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row0.Cells[0].FillColor = Color.FromArgb(209, 245, 203); + // p3Row0.MergeCells(1, 4); + // p3Row0.Cells[1].Paragraphs[0].Append("人数").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row0.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + // p3Row0.MergeCells(2, 3); + // p3Row0.Cells[2].Paragraphs[0].Append("构成比率").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row0.Cells[2].FillColor = Color.FromArgb(209, 245, 203); + // p3Row0.MergeCells(3, 5); + // p3Row0.Cells[3].Paragraphs[0].Append("参检比率").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row0.Cells[3].FillColor = Color.FromArgb(209, 245, 203); + + // p3Contenttable.SetColumnWidth(0, 35f); + + // Row p3Row1 = p3rowsContent[1]; + // p3Row1.Cells[1].Paragraphs[0].Append("男性").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row1.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + // p3Row1.Cells[2].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row1.Cells[2].FillColor = Color.FromArgb(209, 245, 203); + // p3Row1.Cells[3].Paragraphs[0].Append("其它").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row1.Cells[3].FillColor = Color.FromArgb(209, 245, 203); + // p3Row1.Cells[4].Paragraphs[0].Append("合计").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row1.Cells[4].FillColor = Color.FromArgb(209, 245, 203); + // p3Row1.Cells[5].Paragraphs[0].Append("男性").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row1.Cells[5].FillColor = Color.FromArgb(209, 245, 203); + // p3Row1.Cells[6].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row1.Cells[6].FillColor = Color.FromArgb(209, 245, 203); + // p3Row1.Cells[7].Paragraphs[0].Append("男性").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row1.Cells[7].FillColor = Color.FromArgb(209, 245, 203); + // p3Row1.Cells[8].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row1.Cells[8].FillColor = Color.FromArgb(209, 245, 203); + // p3Row1.Cells[9].Paragraphs[0].Append("平均").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row1.Cells[9].FillColor = Color.FromArgb(209, 245, 203); + + // Formatting p3TableFormatting = new Formatting(); + // p3TableFormatting.FontFamily = new Xceed.Document.NET.Font("宋体"); + // p3TableFormatting.Size = 10.5; + + // CustomProperty p3_tb_reg_man_num = new CustomProperty("regManNum", "{男性登记人数}"); + // CustomProperty p3_tb_reg_woman_num = new CustomProperty("regWomanNum", "{女性登记人数}"); + // CustomProperty p3_tb_reg_other_num = new CustomProperty("regOtherNum", "{其它登记人数}"); + // CustomProperty p3_tb_reg_total_num = new CustomProperty("regTotalNum", "{总登记人数}"); + // CustomProperty p3_tb_reg_man_rate = new CustomProperty("regManRate", "{男性登记人数占总登记人数百分比}"); + // CustomProperty p3_tb_reg_woman_rate = new CustomProperty("regWomanRate", "{女性登记人数占总登记人数百分比}"); + // CustomProperty p3_tb_real_man_num = new CustomProperty("realManNum", "{男性实检人数}"); + // CustomProperty p3_tb_real_woman_num = new CustomProperty("realWomanNum", "{女性实检人数}"); + // CustomProperty p3_tb_real_other_num = new CustomProperty("realOtherNum", "{其它实检人数}"); + // CustomProperty p3_tb_real_total_num = new CustomProperty("realTotalNum", "{总实检人数}"); + // CustomProperty p3_tb_real_man_rate = new CustomProperty("realManRate", "{男性实检人数占总实检人数百分比}"); + // CustomProperty p3_tb_real_woman_rate = new CustomProperty("realWomanRate", "{女性实检人数占总实检人数百分比}"); + // CustomProperty p3_tb_real_reg_man_rate = new CustomProperty("realRegManRate", "{男性实检人数占男性登记人数百分比}"); + // CustomProperty p3_tb_real_reg_woman_rate = new CustomProperty("realRegWomanRate", "{女性实检人数占女性登记人数百分比}"); + // CustomProperty p3_tb_real_reg_total_rate = new CustomProperty("realRegTotalRate", "{总实检人数占总登记人数百分比}"); + // CustomProperty p3_tb_notcheck_man_num = new CustomProperty("notcheckManNum", "{男性未检人数}"); + // CustomProperty p3_tb_notcheck_woman_num = new CustomProperty("notcheckWomanNum", "{女性未检人数}"); + // CustomProperty p3_tb_notcheck_other_num = new CustomProperty("notcheckOtherNum", "{其他未检人数}"); + // CustomProperty p3_tb_notcheck_total_num = new CustomProperty("notcheckTotalNum", "{总未检人数}"); + // CustomProperty p3_tb_notcheck_man_rate = new CustomProperty("notcheckManRate", "{男性未检人数占总未检人数百分比}"); + // CustomProperty p3_tb_notcheck_woman_rate = new CustomProperty("notcheckWoanRate", "{女性未检人数占总未检人数百分比}"); + // CustomProperty p3_tb_notcheck_reg_man_rate = new CustomProperty("notcheckRegManRate", "{男性未检人数占男性登记人数百分比}"); + // CustomProperty p3_tb_notcheck_reg_woman_rate = new CustomProperty("notcheckRegWomanRate", "{女性未检人数占女性登记人数百分比}"); + // CustomProperty p3_tb_notcheck_reg_total_rate = new CustomProperty("notcheckRegTotalRate", "{总未检人数占总登记人数百分比}"); + + // Row p3Row2 = p3rowsContent[2]; + // p3Row2.Cells[0].Paragraphs[0].Append("登记").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row2.Cells[1].Paragraphs[0].AppendDocProperty(p3_tb_reg_man_num).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row2.Cells[2].Paragraphs[0].AppendDocProperty(p3_tb_reg_woman_num).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row2.Cells[3].Paragraphs[0].AppendDocProperty(p3_tb_reg_other_num).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row2.Cells[4].Paragraphs[0].AppendDocProperty(p3_tb_reg_total_num).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row2.Cells[5].Paragraphs[0].AppendDocProperty(p3_tb_reg_man_rate).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row2.Cells[6].Paragraphs[0].AppendDocProperty(p3_tb_reg_woman_rate).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row2.Cells[7].Paragraphs[0].Append("100%").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row2.Cells[8].Paragraphs[0].Append("100%").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row2.Cells[9].Paragraphs[0].Append("100%").Font(f).FontSize(10.5).Alignment = Alignment.center; + + // Row p3Row3 = p3rowsContent[3]; + // p3Row3.Cells[0].Paragraphs[0].Append("实检").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row3.Cells[1].Paragraphs[0].AppendDocProperty(p3_tb_real_man_num).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row3.Cells[2].Paragraphs[0].AppendDocProperty(p3_tb_real_woman_num).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row3.Cells[3].Paragraphs[0].AppendDocProperty(p3_tb_real_other_num).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row3.Cells[4].Paragraphs[0].AppendDocProperty(p3_tb_real_total_num).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row3.Cells[5].Paragraphs[0].AppendDocProperty(p3_tb_real_man_rate).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row3.Cells[6].Paragraphs[0].AppendDocProperty(p3_tb_real_woman_rate).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row3.Cells[7].Paragraphs[0].AppendDocProperty(p3_tb_real_reg_man_rate).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row3.Cells[8].Paragraphs[0].AppendDocProperty(p3_tb_real_reg_woman_rate).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row3.Cells[9].Paragraphs[0].AppendDocProperty(p3_tb_real_reg_total_rate).Font(f).FontSize(10.5).Alignment = Alignment.center; + + // Row p3Row4 = p3rowsContent[4]; + // p3Row4.Cells[0].Paragraphs[0].Append("未检").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row4.Cells[1].Paragraphs[0].AppendDocProperty(p3_tb_notcheck_man_num).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row4.Cells[2].Paragraphs[0].AppendDocProperty(p3_tb_notcheck_woman_num).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row4.Cells[3].Paragraphs[0].AppendDocProperty(p3_tb_notcheck_other_num).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row4.Cells[4].Paragraphs[0].AppendDocProperty(p3_tb_notcheck_total_num).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row4.Cells[5].Paragraphs[0].AppendDocProperty(p3_tb_notcheck_man_rate).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row4.Cells[6].Paragraphs[0].AppendDocProperty(p3_tb_notcheck_woman_rate).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row4.Cells[7].Paragraphs[0].AppendDocProperty(p3_tb_notcheck_reg_man_rate).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row4.Cells[8].Paragraphs[0].AppendDocProperty(p3_tb_notcheck_reg_woman_rate).Font(f).FontSize(10.5).Alignment = Alignment.center; + // p3Row4.Cells[9].Paragraphs[0].AppendDocProperty(p3_tb_notcheck_reg_total_rate).Font(f).FontSize(10.5).Alignment = Alignment.center; + + // var p3Content = document.InsertParagraph(); + // p3Content.InsertTableAfterSelf(p3Contenttable); + + // document.InsertParagraph("参检百分比:").Font(f).FontSize(14).Alignment = Alignment.left; + // document.InsertParagraph().Alignment = Alignment.center; + // //var p3Chat1 = document.AddChart(); + // //p3Chat1.AddLegend(ChartLegendPosition.Right, true); + // //var p3ChatData1 = ChartData.CreateReferenceRate(); + + // //// 创建饼图并绑定数据 + // //var p3Chats1 = new Series("参检率"); + // //p3Chats1.Bind(p3ChatData1, "Category", "Expenses"); + // //p3Chat1.AddSeries(p3Chats1); + // //document.InsertChart(p3Chat1, 200f, 150f); + // //document.Paragraphs[document.Paragraphs.Count - 1].Alignment = Alignment.center; + + // document.InsertParagraph("参检性别百分比:").Font(f).FontSize(14).Alignment = Alignment.left; + // document.InsertParagraph().Alignment = Alignment.center; + // //var p3Chat2 = document.AddChart(); + // //p3Chat2.AddLegend(ChartLegendPosition.Right, true); + // //var p3ChatData2 = ChartData.CreateReferenceRateSex(); + + // //// 创建饼图并绑定数据 + // //var p3Chats2 = new Series("参检性别百分比"); + // //p3Chats2.Bind(p3ChatData2, "Category", "Expenses"); + // //p3Chat2.AddSeries(p3Chats2); + // //document.InsertChart(p3Chat2, 200f, 150f); + // //document.Paragraphs[document.Paragraphs.Count - 1].Alignment = Alignment.center; + // //var p3Paragraphs1 = document.Paragraphs.Where(p => p.Text.Equals("参检百分比:")).FirstOrDefault(); + // //第四页 + // document.Paragraphs[document.Paragraphs.Count - 1].InsertPageBreakAfterSelf(); + // document.InsertParagraph(@"二、体检项目与体检项目的参检情况").Font(f).FontSize(16); + // Table p4Contenttable = document.AddTable(3, 11); + // p4Contenttable.Design = TableDesign.TableGrid; + // List p4rowsContent = p4Contenttable.Rows; + + // p4Contenttable.SetColumnWidth(0, 55f); + // p4Contenttable.SetColumnWidth(1, 85f); + + // Row p4Row0 = p4rowsContent[0]; + // p4Row0.MergeCells(0, 1); + // p4Row0.Cells[0].Paragraphs[0].Append("体检项目").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p4Row0.Cells[0].FillColor = Color.FromArgb(209, 245, 203); + // p4Row0.MergeCells(1, 3); + // p4Row0.Cells[1].Paragraphs[0].Append("该项参检人数").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p4Row0.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + // p4Row0.MergeCells(2, 4); + // p4Row0.Cells[2].Paragraphs[0].Append("总体参检人数").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p4Row0.Cells[2].FillColor = Color.FromArgb(209, 245, 203); + // p4Row0.MergeCells(3, 5); + // p4Row0.Cells[3].Paragraphs[0].Append("该项参检百分比").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p4Row0.Cells[3].FillColor = Color.FromArgb(209, 245, 203); + + // Row p4Row1 = p4rowsContent[1]; + // p4Row1.Cells[0].Paragraphs[0].Append("检查科室").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p4Row1.Cells[0].FillColor = Color.FromArgb(209, 245, 203); + // p4Row1.Cells[1].Paragraphs[0].Append("项目名称").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p4Row1.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + // p4Row1.Cells[2].Paragraphs[0].Append("男性").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p4Row1.Cells[2].FillColor = Color.FromArgb(209, 245, 203); + // p4Row1.Cells[3].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p4Row1.Cells[3].FillColor = Color.FromArgb(209, 245, 203); + // p4Row1.Cells[4].Paragraphs[0].Append("合计").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p4Row1.Cells[4].FillColor = Color.FromArgb(209, 245, 203); + // p4Row1.Cells[5].Paragraphs[0].Append("男性").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p4Row1.Cells[5].FillColor = Color.FromArgb(209, 245, 203); + // p4Row1.Cells[6].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p4Row1.Cells[6].FillColor = Color.FromArgb(209, 245, 203); + // p4Row1.Cells[7].Paragraphs[0].Append("合计").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p4Row1.Cells[7].FillColor = Color.FromArgb(209, 245, 203); + // p4Row1.Cells[8].Paragraphs[0].Append("男性").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p4Row1.Cells[8].FillColor = Color.FromArgb(209, 245, 203); + // p4Row1.Cells[9].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p4Row1.Cells[9].FillColor = Color.FromArgb(209, 245, 203); + // p4Row1.Cells[10].Paragraphs[0].Append("合计").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p4Row1.Cells[10].FillColor = Color.FromArgb(209, 245, 203); + // var p4Content = document.InsertParagraph(); + // p4Content.InsertTableAfterSelf(p4Contenttable); + + // //第五页 + // document.InsertParagraph().InsertPageBreakAfterSelf(); + // document.InsertParagraph(@"三、全体员工体检结果汇总").Font(f).FontSize(16); + // var p5Content = document.InsertParagraph(@"个人隐私请保密,仅供贵单位领导参阅").Font(f).FontSize(10.5); + // Table p5Contenttable = document.AddTable(2, 5); + // p5Contenttable.Design = TableDesign.TableGrid; + + // p5Contenttable.SetColumnWidth(0, 110f); + // p5Contenttable.SetColumnWidth(1, 75f); + // p5Contenttable.SetColumnWidth(2, 35f); + // p5Contenttable.SetColumnWidth(3, 45f); + // p5Contenttable.SetColumnWidth(4, document.PageWidth - document.MarginLeft - document.MarginRight - 265f); + // List p5rowsContent = p5Contenttable.Rows; + + // Row p5Row0 = p5rowsContent[0]; + // p5Row0.Cells[0].Paragraphs[0].Append("档案号").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p5Row0.Cells[0].FillColor = Color.FromArgb(209, 245, 203); + // p5Row0.Cells[1].Paragraphs[0].Append("姓名").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p5Row0.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + // p5Row0.Cells[2].Paragraphs[0].Append("性别").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p5Row0.Cells[2].FillColor = Color.FromArgb(209, 245, 203); + // p5Row0.Cells[3].Paragraphs[0].Append("年龄").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p5Row0.Cells[3].FillColor = Color.FromArgb(209, 245, 203); + // p5Row0.Cells[4].Paragraphs[0].Append("体检结果").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p5Row0.Cells[4].FillColor = Color.FromArgb(209, 245, 203); + // p5Content.InsertTableAfterSelf(p5Contenttable); + // document.InsertParagraph("(注: 敬请保护个人隐私, 本档案仅供贵单位负责职工健康体检的人员查阅! 未经员工本人同意, 不得外泄资料, 否则, 造成不良影响由贵单位承担, 与本中心无关!)").Font(f).FontSize(10.5); + + // document.InsertParagraph(); + // document.InsertParagraph(@"四、本次体检异常结果检出统计").Font(f).FontSize(16); + // var p5Content1 = document.InsertParagraph(@"贵单位此次在我中心进行员工体检,内容包括[登记组合项目][实检组合项目],现将检出的按男女综合检出数量最高的部分异常情况进行统计分析,以反映出员工的健康状况。").Font(f).FontSize(10.5); + + // Table p5Contenttable2 = document.AddTable(3, 8); + // p5Contenttable2.Design = TableDesign.TableGrid; + // p5Contenttable2.SetColumnWidth(0, 95f); + // p5Contenttable2.SetColumnWidth(1, 130f); + // p5Contenttable2.SetColumnWidth(2, 40f); + // p5Contenttable2.SetColumnWidth(3, 40f); + // p5Contenttable2.SetColumnWidth(4, 40f); + // p5Contenttable2.SetColumnWidth(5, 40f); + // p5Contenttable2.SetColumnWidth(6, 40f); + // p5Contenttable2.SetColumnWidth(7, 40f); + // List p5rowsContent2 = p5Contenttable2.Rows; + + // Row p5Table2Row0 = p5rowsContent2[0]; + // p5Table2Row0.MergeCells(0, 1); + // p5Table2Row0.Cells[0].Paragraphs[0].Append("体检结论").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p5Table2Row0.Cells[0].FillColor = Color.FromArgb(209, 245, 203); + // p5Table2Row0.MergeCells(1, 3); + // p5Table2Row0.Cells[1].Paragraphs[0].Append("人数").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p5Table2Row0.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + // p5Table2Row0.MergeCells(2, 4); + // p5Table2Row0.Cells[2].Paragraphs[0].Append("百分比").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p5Table2Row0.Cells[2].FillColor = Color.FromArgb(209, 245, 203); + + // Row p5Table2Row1 = p5rowsContent2[1]; + // p5Table2Row1.Cells[0].Paragraphs[0].Append("结论").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p5Table2Row1.Cells[0].FillColor = Color.FromArgb(209, 245, 203); + // p5Table2Row1.Cells[1].Paragraphs[0].Append("人员名单").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p5Table2Row1.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + // p5Table2Row1.Cells[2].Paragraphs[0].Append("男性").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p5Table2Row1.Cells[2].FillColor = Color.FromArgb(209, 245, 203); + // p5Table2Row1.Cells[3].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p5Table2Row1.Cells[3].FillColor = Color.FromArgb(209, 245, 203); + // p5Table2Row1.Cells[4].Paragraphs[0].Append("合计").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p5Table2Row1.Cells[4].FillColor = Color.FromArgb(209, 245, 203); + // p5Table2Row1.Cells[5].Paragraphs[0].Append("男性").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p5Table2Row1.Cells[5].FillColor = Color.FromArgb(209, 245, 203); + // p5Table2Row1.Cells[6].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p5Table2Row1.Cells[6].FillColor = Color.FromArgb(209, 245, 203); + // p5Table2Row1.Cells[7].Paragraphs[0].Append("平均").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p5Table2Row1.Cells[7].FillColor = Color.FromArgb(209, 245, 203); + // p5Content1.InsertTableAfterSelf(p5Contenttable2); + + // //第六页 + // document.InsertParagraph().InsertPageBreakAfterSelf(); + // document.InsertParagraph(@"前十大异常结果柱状图:").Font(f).FontSize(16); + // document.InsertParagraph().Alignment = Alignment.center; + // //var p6Chat1 = document.AddChart(); + // //p6Chat1.AddLegend(ChartLegendPosition.Right, false); + // //p6Chat1.BarDirection = BarDirection.Column;//指示柱状图是横向的还是纵向的:Column纵向,Bar横向 + // //p6Chat1.BarGrouping = BarGrouping.Stacked;//这个不好解释,一个4个枚举值,你一一试一遍就知道了 + // //p6Chat1.GapWidth = 200;//柱状图表的宽度 + // //p6Chat1.GapWidth = 200; + // //var usa = ChartData.CreateDisease(); + // //var p6Chats1 = new Series("疾病人数"); + // //p6Chats1.Color = Color.FromArgb(79, 129, 189); + // //p6Chats1.Bind(usa, "Category", "Expenses"); + // //p6Chat1.AddSeries(p6Chats1); + // //document.InsertChart(p6Chat1); + // document.InsertParagraph(); + // document.InsertParagraph(@"前十大异常结果饼图:").Font(f).FontSize(16); + // document.InsertParagraph().Alignment = Alignment.center; + // //var p6Chat2 = document.AddChart(); + // //p6Chat2.AddLegend(ChartLegendPosition.Right, true); + // //var p6ChatData2 = ChartData.CreateException(); + + // //// 创建饼图并绑定数据 + // //var p6Chats2 = new Series("疾病人数百分比"); + // //p6Chats2.Bind(p6ChatData2, "Category", "Expenses"); + // //p6Chat2.AddSeries(p6Chats2); + // //document.InsertChart(p6Chat2); + + // //第七页 + // document.InsertParagraph().InsertPageBreakAfterSelf(); + // document.InsertParagraph(@"该部分针对贵单位员工在我中心体检时,所检出的各种异常情况提供相关的分析与医疗保健建议").Font(f).FontSize(10.5); + // var p7Content = document.InsertParagraph(@"五、本次体检前十大异常结果分析").Font(f).FontSize(16); + + // Table p7Contenttable = document.AddTable(2, 2); + // p7Contenttable.Design = TableDesign.TableGrid; + // p7Contenttable.SetColumnWidth(0, 130f); + // p7Contenttable.SetColumnWidth(1, document.PageWidth - document.MarginLeft - document.MarginRight - 130f); + // List p7rowsContent = p7Contenttable.Rows; + // Row p7TableRow0 = p7rowsContent[0]; + // p7TableRow0.Cells[0].Paragraphs[0].Append("疾病").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p7TableRow0.Cells[0].FillColor = Color.FromArgb(209, 245, 203); + // p7TableRow0.Cells[1].Paragraphs[0].Append("建议").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p7TableRow0.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + // p7Content.InsertTableAfterSelf(p7Contenttable); + // document.InsertParagraph(); + // var p7Content1 = document.InsertParagraph(@"六、体检者未完成情况").Font(f).FontSize(16); + + // Table p7Contenttable1 = document.AddTable(2, 5); + // p7Contenttable1.Design = TableDesign.TableGrid; + // p7Contenttable1.SetColumnWidth(0, 110f); + // p7Contenttable1.SetColumnWidth(1, 95f); + // p7Contenttable1.SetColumnWidth(2, 45f); + // p7Contenttable1.SetColumnWidth(3, 45f); + // p7Contenttable1.SetColumnWidth(4, document.PageWidth - document.MarginLeft - document.MarginRight - 295f); + // List p7rowsContent1 = p7Contenttable1.Rows; + // Row p7Table2Row0 = p7rowsContent1[0]; + // p7Table2Row0.Cells[0].Paragraphs[0].Append("体检号").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p7Table2Row0.Cells[0].FillColor = Color.FromArgb(209, 245, 203); + // p7Table2Row0.Cells[1].Paragraphs[0].Append("姓名").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p7Table2Row0.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + // p7Table2Row0.Cells[2].Paragraphs[0].Append("性别").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p7Table2Row0.Cells[2].FillColor = Color.FromArgb(209, 245, 203); + // p7Table2Row0.Cells[3].Paragraphs[0].Append("年龄").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p7Table2Row0.Cells[3].FillColor = Color.FromArgb(209, 245, 203); + // p7Table2Row0.Cells[4].Paragraphs[0].Append("部门").Font(f).FontSize(10.5).Alignment = Alignment.center; + // p7Table2Row0.Cells[4].FillColor = Color.FromArgb(209, 245, 203); + + // p7Content1.InsertTableAfterSelf(p7Contenttable1); + // /* + // var numberedList = document.AddList("First List Item.", 0, ListItemType.Numbered); + // //Add a numbered list starting at 2 + // document.AddListItem(numberedList, "Second List Item."); + // document.AddListItem(numberedList, "Third list item."); + // document.AddListItem(numberedList, "First sub list item", 1); + + // document.AddListItem(numberedList, "Nested item.", 3); + // document.AddListItem(numberedList, "Fourth nested item."); + + // var bulletedList = document.AddList("First Bulleted Item.", 0, ListItemType.Bulleted); + // document.AddListItem(bulletedList, "Second bullet item"); + // document.AddListItem(bulletedList, "Sub bullet item", 1); + // document.AddListItem(bulletedList, "Second sub bullet item", 2); + // document.AddListItem(bulletedList, "Third bullet item"); + // document.InsertList(numberedList); + // document.InsertList(bulletedList); + // */ + // document.InsertParagraph(); + // document.InsertParagraph(@"七、常见体检异常结果分析及健康指导").Font(f).FontSize(16).SpacingAfter(10d).SetLineSpacing(LineSpacingType.Line, 13.8f); + // document.InsertParagraph(@"◆ 颈椎疾病健康指导").Font(f).FontSize(14).SpacingAfter(10d).SetLineSpacing(LineSpacingType.Line, 13.8f); + // document.InsertParagraph(@"【健康指导】").Font(f).FontSize(14).SpacingAfter(10d).SetLineSpacing(LineSpacingType.Line, 13.8f); + // int index = document.Paragraphs.Count; + // Formatting p7Formatting = new Formatting(); + // p7Formatting.FontFamily = new Xceed.Document.NET.Font("宋体"); + // p7Formatting.Size = 14; + + + // ListOptions listOptions = new ListOptions(); + // listOptions.ListType = ListItemType.Numbered; + + // var numberedList = document.AddList(listOptions); + // numberedList.AddListItem("颈椎病是指由于各种原因所致的颈椎结构的改变,如椎间盘的变性、突出,颈椎体边缘骨质增生,黄韧带肥厚、钙化或后纵韧带钙化,颈椎曲度异 常、椎间不稳等,直接压迫、刺激或通过压迫影响血液循环,使脊髓颈段、神经根、椎动脉或交感神经的功能损害,进而 发生组织结构损害,出现一系列临床征象,又有颈椎综合征之称。概括起来就是颈椎的椎间盘突出、骨质增生等压迫颈椎周围的神经、血管等导致的各种不适表现。", 0); + // numberedList.AddListItem("哪些人易患颈椎病,从事文字、电脑工作人员及学生最易患颈椎病。颈椎病的发病,年青人主要是外因,即姿势式疲劳和损伤,主要以姿势 疲劳为主。长时间同一姿势伏案工作,颈肩部的肌肉一 下处于紧张强下状态,血液循环不畅,极易导致颈椎肌肉劳损。中学生的书包越来越重,导致姿势不适合人体正常的生理弯曲,久而久之易患颈椎病;喜欢玩电脑、打游戏机的中学生也因长时间颈部保持一个姿势而导致颈部肌肉痉挛、劳损而发生颈椎病;对于中老年人来说,颈椎病则是身体的退行性病变的表现。\n\t 家庭康复治疗法:", 3); + // numberedList.AddListItem("如果不幸得颈椎病也不要紧张,应该及时就医。俗话说“三分治疗七分养”, 养即保养、康复预防之意。对于颈椎病,不要寄托在医院检查一下,吃些药就可以痊愈,该病本身就是一个退变性且极易复发的疾病。不注意疗效的巩固,很快可以再发作,所以应加倍注意。家庭的治疗如下。", 3); + // numberedList.AddListItem("在急性期最好能够少活动。", 3); + // numberedList.AddListItem("家里可以做自我牵引,如购买牵引带,一般情况下取 4~6 千克重 量,20~30 分钟/次,1~2 次/天或再多一点。牵引治疗 2~3 天,颈部肌肉紧张多可得至缓解,疼痛减轻。 或自己双手托住头部做向上拨伸的动作,效果一 样。", 3); + // numberedList.AddListItem("头项部可以外敷中药膏药,必要时可以用中药水热敷,可以疏筋活络, 缓解疼痛, 口服消炎止痛药如扶他林、芬必得等。", 3); + // numberedList.AddListItem("同时可以配合理疗,如微波红外线、针炙等。", 3); + // numberedList.AddListItem("急性期疼痛明显,影响日常工作、生活甚至整夜难眠者,针剌或神经根封闭,不失 为 一种有效的治疗方法,但应选择正规专业医师操作,以免发生意外。", 3); + // numberedList.AddListItem("日常防范方法:“防患于末然”对任何疾病都是适合的,不管有没有出现颈椎病的症状,改变不良工作生活习惯都非常重要,千万别委屈了你的脖子。 别委屈脖子对于经常低头工作的办公室工作人员,正确的姿势是关键,首先在坐姿上尽可能保持 自然的端坐位,头部略微前倾,保持头、颈、胸的正常生理曲 线,切不可头部过度前屈、身体前趴。对于长期伏案工作者,应每隔1小时左右,让颈部向左右转动数次,转动时应轻柔、缓慢,以达到该方向的最大运动范围为准;生活习惯低枕位休息,维持正常颈曲。选择适合自己的卧具,以晨起头颈无不适为度;改正躺在床上或沙发上,用垫子或枕头抬高头部看电视、看书的不良习 惯。", 3); + // numberedList.AddListItem("避免有害的活动 对长时间下象棋、打麻将者,奉劝还是少一些“娱乐”,多一些运动,因此种“娱乐”逐渐导致颈椎病的非常多见。 颈椎保健操要防止颈椎病的发生,除了要纠正不良姿势,注意防潮、防冷外,还应积极加强锻炼, 经常活动颈部,多做伸颈运动。办公室人员没时间锻炼,最 简单的锻炼可以以颈部为笔,头部为笔尖,反复写“米”字。这种伸颈运动可以改善颈部肌肉韧带的供血,使血液循环加 快,使肌肉韧带更加强壮,预防骨质疏松,从而减少颈 椎病的发生。", 3); + // document.InsertList(numberedList); + // document.InsertParagraph(@"◆ 代谢性疾病健康指导").Font(f).FontSize(16); + // document.InsertParagraph(@" 代谢性疾病主要为生活方式病,包括超重、肥胖、血糖偏高、血压偏高、高血脂、脂 肪肝、高尿酸等。").Font(f).FontSize(14); + // document.InsertParagraph(@"【高血脂】").Font(f).FontSize(14); + // document.InsertParagraph(@" 形成原因:膳食结构不合理,食物中胆固醇和饱和脂肪酸摄入过多,总热量过高, 应酬较多;体力活动过少;就个体而言与遗传基因有关。因此防治高血脂和肥胖对减少 冠心病、脑卒中,糖尿病、脂肪肝、胆结石的患病率和心脑血管意外有重要意义。").Font(f).FontSize(14); + // document.InsertParagraph(@" 预防建议:").Font(f).FontSize(14); + + // var numberedList1 = document.AddList(listOptions); + // numberedList1.AddListItem("用低脂、低热、低糖饮食、限制动物性脂肪、肥肉、禽类皮、动物内脏、浓肉汤、鱿鱼、墨斗鱼、鱼籽和蟹黄,少吃蛋黄,甜食,多吃蔬菜、水果和富含纤维素食物,提倡吃八分饱;", 1); + // numberedList1.AddListItem("持之以恒,坚持有氧运动,有氧运动有利于降低血脂,减肥, 降血压,预防糖尿病和减少血栓形成。有氧运动以运动后心率达到最大心率的 50~70% 为宜(最大心率=220-年龄)。运动方式可选择:快走、慢跑、骑车、爬楼梯和游泳等各 种可坚持的运动,每周不少于五天,每天不少于 20-40 分钟。", 1); + // document.InsertList(numberedList1); + // document.InsertParagraph(@"【超重或肥胖】").Font(f).FontSize(14); + + + // var numberedList2 = document.AddList(listOptions); + // numberedList2.AddListItem("概念:体重超重或肥胖是指体内脂肪积聚过多和(或)分布异常、体重增加,是由于遗 传或环境因素共同作用的结果。1999年,世界卫生组织已正式宣布肥胖为一种疾病。", 0); + // numberedList2.AddListItem("危害:", 0); + // numberedList2.AddListItem("寿命缩短:男性肥胖者的死亡率是正常人的1.5倍,女性是1.47倍。", 1); + // numberedList2.AddListItem("危害心理健康:影响美观、生活不便,会产生自卑、焦虑和抑郁等问题。", 1); + // numberedList2.AddListItem("诱发疾病:肥胖是导致2型糖尿病、心血管疾病、高血压、胆结石和癌症、内分泌、 代谢紊乱的重要危险因素。也可以引起关节痛、浮肿、活动耐力降低等。此外,肥胖还易使皮肤脆性增加,易发生皮炎、摩擦伤、并容易合并化脓性或真菌感染。 肥胖严重威胁健康,医学界称肥胖、高血压、高血脂和高血糖为“死亡四重奏”。", 1); + // numberedList2.AddListItem("原因(发病危险因素):\r\tA、遗传因素:家族史。 B、不良生活方式:偏爱高脂肪、高热量饮食,睡前或夜间用餐,体力活动少等。 C、年龄因素:男性中年以后,女性绝经期后生理功能减退,代谢减低,体力活动减少,而饮食摄入量未相应减少,造成摄入量超过消耗量而致肥胖。 D、精神因素:精神过度紧张及心理障碍,可引起食欲亢进,导致肥胖。 E、其他因素:药物、疾病等引起。", 0); + // numberedList2.AddListItem("症状与表现: A、男性肥胖多表现为“苹果型”肥胖,即内脏型或向心型肥胖脂肪沉积在腹部、臀部和背部;女性肥胖多表现为“梨型”肥胖,脂肪主要沉积在臀部、大腿。 B、中度以上肥胖者可出现活动后心悸、气短、嗜睡等症状。重度肥胖者可出现呼吸困难、浮肿、发绀、阵发性睡眠呼吸暂停综合症等。 C、合并高血压、糖尿病、血脂异常、痛风者可出现相应症状。", 0); + // numberedList2.AddListItem("防治: 非药物治疗", 0); + // numberedList2.AddListItem("认识肥胖症的危害;认识到单纯性肥胖是一种生活方式疾病;认识治疗肥胖症是一个自我控制的过程。改变生活方式,矫正饮食、行为习惯。", 1); + // numberedList2.AddListItem("控制摄入量,低脂、低热量、低嘌呤、低盐饮食,戒烟限酒。", 1); + // numberedList2.AddListItem("运动治疗,增加体力活动,加强锻炼。", 1); + // document.InsertList(numberedList2); + // document.InsertParagraph(@"【血糖偏高】").Font(f).FontSize(14); + + // var numberedList3 = document.AddList(listOptions); + // numberedList3.AddListItem("糖尿病诊断标准:", 0); + // numberedList3.AddListItem("症状+随机血糖≥11.1mmol/L;", 1); + // numberedList3.AddListItem("空腹血糖(FPG)≥7.0mmol/L(非同日两次空腹血糖);", 1); + // numberedList3.AddListItem("糖耐量试验(OGTT)中2小时血浆葡萄糖(2HPG)≥11.1mmol/L。", 1); + // numberedList3.AddListItem("血糖增高预防建议:", 0); + // numberedList3.AddListItem("普及糖尿病知识,充分认识糖尿病正在我国已进入多数的严重形势和预防方法。", 1); + // numberedList3.AddListItem("合理膳食避免营养过剩,提倡用低脂,少糖,富含纤维的膳食;C 坚持有氧运动。", 1); + // numberedList3.AddListItem("避免使用影响糖代谢的药物。", 1); + // numberedList3.AddListItem("定期复查血糖。", 1); + // numberedList3.AddListItem("年龄大于40岁,有糖尿病家族史,血糖或尿糖曾经异常者,应查餐后两小时血糖。", 1); + // numberedList3.AddListItem("糖尿病综合治疗原则:", 0); + // numberedList3.AddListItem("糖尿病教育。", 1); + // numberedList3.AddListItem("合理的饮食治疗。", 1); + // numberedList3.AddListItem("坚持运动治疗。", 1); + // numberedList3.AddListItem("正规的 药物治疗。", 1); + // numberedList3.AddListItem("定期病情监测。", 1); + // document.InsertList(numberedList3); + // document.InsertParagraph(@"【高血压】").Font(f).FontSize(14); + + + // var numberedList4 = document.AddList(listOptions); + // numberedList4.AddListItem("诊断标准:1999 年 10 月中国高血压联盟推荐新高血压诊断标准,未服降压药的情况下:收缩压≥140mmHg 和(或)舒张压≥90mmHg,即诊断高血压。以非同日多次(二次或 以上)复测平均值为依据,偶然一次不能诊断高血压。", 0); + // numberedList4.AddListItem("危害:患了高血压病,如果不加以控制,可导致脑卒中或冠心病等,将严重影响生 活质量,甚至威胁到生命。", 0); + // numberedList4.AddListItem("高血压病存在患病率高、致残率高、死亡率高,知晓率低、治疗率低、控制率低的 现象,也就是人们通常所说的“三高”、“三低”。", 0); + // numberedList4.AddListItem("病因或发病危险因素:", 0); + // numberedList4.AddListItem("体重超重或肥胖:体重超重和体重增加过快,是高血压病的危险因素。尤其内脏型肥胖,同时也是糖尿病和血脂异常的危险因素。", 1); + // numberedList4.AddListItem("饮酒:长期饮白酒达 50ml/每天以上,也是高血压病发病的危险因素;少量饮些红 葡萄酒可有预防冠心病的作用。", 1); + // numberedList4.AddListItem("长期高盐、低镁、低钙、低动物蛋白质饮食;膳食钠盐的摄入量与血压水平有显著 的相关性。", 1); + // numberedList4.AddListItem("长期精神紧张或超负荷工作,也是高血压病的危险因素。", 1); + // numberedList4.AddListItem("高血压的防治:", 0); + // numberedList4.AddListItem("增强自我保健意识,学会自我保健知识。", 1); + // numberedList4.AddListItem("定期监测:35岁以上人群至少每年要检查一次血压,以利早期发现血压增高,降低 人群高血压的发病率和患病率。", 1); + // numberedList4.AddListItem("预防超重和肥胖,保持理想体重,其中饮食(低盐、高钾、高钙、高动物蛋白质饮 食如奶类、动制品、鱼类、菜果类)、运动疗法(保持规律有氧运动非常重要),运动降压效 果最直接。", 1); + // numberedList4.AddListItem("讲究精神卫生;E、不吸烟;F、药物治疗原则。", 1); + // document.InsertList(numberedList4); + // document.InsertParagraph(@"【脂肪肝】").Font(f).FontSize(14); + + // var numberedList5 = document.AddList(listOptions); + // numberedList5.AddListItem("病因:目前我国脂肪肝发病率有增高趋势,多数与肥胖、高脂血症(以甘油三脂增 高关系更密切)、糖尿病、肝炎病史及嗜酒有关。", 0); + // numberedList5.AddListItem("建议:脂肪肝可双向发展,有效控制或消除上述促发因素,脂肪肝可明改善,因此建议: A 用低脂膳食,治疗高血脂症;B 坚持有氧运动,控制体重; C 限酒; D 避免对肝脏有害的药物; E 药物治疗:目前尚无明显有效治疗脂肪肝的药物,若肝 功能明显异常可选用保肝药物。", 0); + // document.InsertList(numberedList5); + // document.InsertParagraph(@"【高尿酸】").Font(f).FontSize(14); + + // var numberedList6 = document.AddList(listOptions); + // numberedList6.AddListItem("何谓高尿酸血症:\r\t嘌呤代谢物为尿酸,男性每 100 毫升血液中尿酸值在 8.7 毫克以上,女性 8 毫克以 上时,则称为高尿酸血症。", 0); + // numberedList6.AddListItem("建议:", 0); + // numberedList6.AddListItem("每天至少 2000mI 液体,多摄取低嘌呤、碱性食物,例如蔬菜。", 1); + // numberedList6.AddListItem("避免高嘌呤食物。", 1); + // numberedList6.AddListItem("避免喝酒、油炸食物。", 1); + // numberedList6.AddListItem("避免摄取肉汤或高汤。", 1); + // numberedList6.AddListItem("食欲不佳时,须注意补充含糖液体,以避免身体组织快速分解,诱发痛风。", 1); + // numberedList6.AddListItem("避免暴饮暴食。", 1); + // numberedList6.AddListItem("避免饥饿,因为肌肉被分解,致尿酸排出。", 1); + // numberedList6.AddListItem("避免使用阿司匹林类药物,以免妨碍尿酸排出。", 1); + // numberedList6.AddListItem("急性期:应去医院看病,选择药物治疗。", 1); + // numberedList6.AddListItem("缓解期:促进身体活动,应酌量选择(表二)食物,平时可多选择表一食物,少用高嘌 呤食物(表三)。", 1); + // numberedList6.AddListItem("维持理想体重:理想体重(公斤)=22×身高 2 (平方公尺)。", 1); + // numberedList6.AddListItem("痛风石的部位应注意保护皮肤,维持完整性。", 1); + // document.InsertList(numberedList6); + // document.InsertParagraph(@"◆ 眼科疾病").Font(f).FontSize(14); + + // var numberedList7 = document.AddList(listOptions); + // numberedList7.AddListItem("眼病体检的目的:", 0); + // numberedList7.AddListItem("及早发现眼病隐患:如青光眼、糖尿病视网膜病变。", 1); + // numberedList7.AddListItem("眼病咨询:如白内障是否需手术?视力不好是否需配镜?", 1); + // numberedList7.AddListItem("对全身健康状况评估,眼底是全身情况的缩印,高血压、高血糖、高血脂造成器官损害之前,在眼底会有所表现。我们在眼病筛查中对每一个受检者都进行了解释。", 1); + // numberedList7.AddListItem("建议:", 0); + // numberedList7.AddListItem("结膜炎,请注意用眼卫生,如症状明显,可局部 治疗。", 1); + // numberedList7.AddListItem("眼底杯盘比,建议到专科医院,测眼压,查视 野等。", 1); + // numberedList7.AddListItem("视网膜动脉硬化,建议低盐、清淡饮食,并请关注 血压、血脂、血糖及动脉硬化的防治。", 1); + // numberedList7.AddListItem("青光眼或可疑青光眼,需到医院青光眼专科复查。", 1); + // numberedList7.AddListItem("白内障需,考虑手术治疗。", 1); + // numberedList7.AddListItem("糖尿病性视网膜病变,Ⅲ期以下者需要控制血糖并每半年或一年观察眼底,Ⅲ 期及以上者应尽快到医院就诊。", 1); + // numberedList7.AddListItem("视网膜病变,需要监测血压和血糖情况并做相应治疗。", 1); + // numberedList7.AddListItem("黄斑病变,视力小于 0.3 时到医院就诊(陈旧性者不必复诊)。", 1); + // numberedList7.AddListItem("视网膜血管病变,监测血压和血糖情况做相应处理,非陈旧性者需医院就诊。", 1); + // numberedList7.AddListItem("视神经病变(萎缩/缺血性),需要检测血压血糖,每年随诊观察。", 1); + // document.InsertList(numberedList7); + // document.InsertParagraph(@"◆ 耳鼻喉疾病").Font(f).FontSize(14); + + // var numberedList8 = document.AddList(listOptions); + // numberedList8.AddListItem("过敏性鼻炎:建议查找过敏原,并避免与其接触,必要时专科治疗,平时注意加强锻炼, 增强机体免疫力,预防感冒。", 0); + // numberedList8.AddListItem("慢性咽炎:若症状明显,请专科治疗,平时少吃辛辣食物,少作长谈,避免有害气体及 粉尘的刺激。", 0); + // numberedList8.AddListItem("慢性鼻炎:请专科治疗,平时注意增强体质,提高机体抵抗力,预防感冒,祛除诱因。", 0); + // numberedList8.AddListItem("慢性扁桃体炎:请注意锻炼身体,增强体质,防止感冒,如反复发作请专科进一步治疗。", 0); + // document.InsertList(numberedList8); + // document.InsertParagraph(@"◆ 肝胆疾病").Font(f).FontSize(14); + // document.InsertParagraph(@"【肝功异常】").Font(f).FontSize(14); + // document.InsertParagraph(@"转氨酶除在肝脏外,还可分布在心、肾、骨骼肌、胰等组织中,当这些组织有病时, 也会引起血清转氨酶活性升高。如心肌炎、急性心肌梗塞时,血清转氨酶活性均会升高,除此之外,如胆石症、甲状腺机能亢进、伤寒、疟疾、感冒、大量服用阿斯匹林等,都可使血 清转氨酶升高,甚至在某些生理条件下如剧烈运动等,也会使转氨酶升高。").Font(f).FontSize(14); + // document.InsertParagraph(@"因此我们绝对不能一看到转氨酶升高就诊断为肝炎,而必须结合病人具体情况如症状 体征及其他检查综合分析,做出诊断,应注意以下几个问题:").Font(f).FontSize(14); + + // var numberedList9 = document.AddList(listOptions); + // numberedList9.AddListItem("血清转氨酶升高,仍以病毒性肝炎最为常见,而且转氨酶升高的幅度大(在正常值4 倍以上),且持续时间很长(大于 1 个月)。", 0); + // numberedList9.AddListItem("肝病时,转氨酶升高,只表示肝细胞受损,不能区别肝病的性质。如病毒性肝炎、 药物性肝炎等,都能使转氨酶升高。", 0); + // numberedList9.AddListItem("在临床上如发现转氨酶(特别是 ALT)下降,而胆红素反升高,往往说明病人病情严重,预后不良。如急性或亚急性重症肝炎。", 0); + // numberedList9.AddListItem("某些慢性肝炎或肝炎恢复期,转氨酶可以正常。", 0); + // numberedList9.AddListItem("总之,不能单靠转氨酶来诊断或否定肝炎,必须结合其他化验结果和临床表现进行全方面分析,方能诊断。", 0); + // document.InsertList(numberedList9); + // document.InsertParagraph(@"【肝囊肿、肝血管瘤】").Font(f).FontSize(14); + // document.InsertParagraph(@"应该定期复查,动态观察变化,必要专科时治疗,平时注意不要受外力撞击,以免破裂").Font(f).FontSize(14); + // document.InsertParagraph(@"【胆囊结石】").Font(f).FontSize(14); + + // var numberedList10 = document.AddList(listOptions); + // numberedList10.AddListItem("预防肠道寄生虫和细菌感染;", 0); + // numberedList10.AddListItem("饮食控制,少吃动物内脏鱼籽,蛋黄等高胆固醇膳食,增加膳食中纤维素含量。", 0); + // numberedList10.AddListItem("控制体重;", 0); + // numberedList10.AddListItem("纠正久坐少动的生活习惯。", 0); + // numberedList10.AddListItem("治疗:无并发症的胆结石,可根据个体情况选择;", 0); + // numberedList10.AddListItem("利胆排石综合治疗。", 1); + // numberedList10.AddListItem("药物溶石。", 1); + // numberedList10.AddListItem("体外碎石。", 1); + // numberedList10.AddListItem("内窥镜取石。", 1); + // numberedList10.AddListItem("腹腔镜手术。", 1); + // numberedList10.AddListItem("外科胆囊切除术等治疗。", 1); + // document.InsertList(numberedList10); + // document.InsertParagraph(@"【胆囊息肉】").Font(f).FontSize(14); + // document.InsertParagraph(@"胆囊息肉主要由慢性炎症引起,如息肉进一步增大,和/或合并胆囊多发结石,考虑手术治 疗;一般情况定期复查。").Font(f).FontSize(14); + // document.InsertParagraph(@"◆ 心血管疾病").Font(f).FontSize(14); + + // var numberedList11 = document.AddList(listOptions); + // numberedList11.AddListItem("T 波、ST-T 改变引起 T 波、ST-T 段改变的原因很多,需结合有关临床资料,综合分析做出诊断。有冠心病危险因素的人(A、有冠心病家庭史;B、高胆固醇血症;C、高血 压;D、糖尿病;E 吸烟;F 肥胖)近期出现上述心电图改变,与心肌缺血有关,可疑者需 专科医院进一步检查。", 0); + // numberedList11.AddListItem( "完全性右束支传导阻滞 可见于有器质性心脏病(冠心病、高血压性心脏病)者,偶 见于正常人。应注意复查心电图,有症状及时专科诊治。", 0); + // numberedList11.AddListItem( "房室传导阻滞:是比较常见的心律失常,在正常人群中的检出率约为 2%-5%,在器质 性心脏病患者中约占 20%-30%。它是心脏传导阻滞中最常见,也是很重要的一种。应注意 复查心电图,有症状及时专科诊治。", 0); + // numberedList11.AddListItem( "心脏早搏:无心脏病背景者,多为生理性原因,可半年复查;如频发早搏,请及时就 医;有心脏病者伴有早搏,建议专科治疗。", 0); + // numberedList11.AddListItem( "房颤:是一种十分常见的心律失常。据统计,60 岁以上人群中,房颤发生率 1%,并 随年龄而增加。有症状请专科就诊。", 0); + // numberedList11.AddListItem( "由于人们饮食习惯、生活习惯的改变,造成高脂血症患者增加, 若血脂质过高不加以 控制,再加上高血压、抽烟等因素的影响,使脂质沉淀物沉积在血管壁上,越积越厚,以致 血管管腔狭小,血流不通,使组织缺氧与营养缺乏, 这种情形发生在心脏冠状动脉时,首 先,引起心绞痛。若不积极治疗最后会造成心肌梗塞。", 0); + // numberedList11.AddListItem( "所以一旦出了问题应及早治疗並纠正不良饮食习惯,防止病情恶化,即使进行药物治 疗或医疗手术改善病情,仍然要配合饮食控制才能减少再复发的机会。", 0); + // numberedList11.AddListItem( "心血管疾病饮食原则:", 0); + // numberedList11.AddListItem( "维持理想体重。", 1); + // numberedList11.AddListItem( "控制脂质总摄入量。烹调时应注意用油量,宜多采用清蒸、 水煮、凉拌、燉、滷 等方式,禁用油炸的烹调方式,並少吃肥肉、鸡皮等油脂含量高的食物。", 1); + // numberedList11.AddListItem( "炒菜用油宜选用单元不饱和脂肪酸高者(如:橄榄油、菜籽 油、花生油);少用 饱和脂肪酸高者(如:猪油)。少吃胆固醇含量高的食物,如内脏类、蝦卵、鱼卵等,蛋可以吃但每周不超过二 到三个蛋黄为原则。", 1); + // numberedList11.AddListItem( "避免富含精制糖的食物(如蛋糕、甜食)。(见附表:富含 精制糖的食物)。", 1); + // numberedList11.AddListItem( "攝取富含 W-3 脂肪酸的鱼类(秋刀鱼、鲑鱼、鳗鱼等)。", 1); + // numberedList11.AddListItem( "减少钠量攝取。罐头、醃制食品及各种加工食品含钠量高, 应忌食。宜选择新鲜 食物自行制作,烹调时减少食盐的用量,其它含钠量高的调味品(味精、酱油、乌醋等)应 减少或避免使用。", 1); + // numberedList11.AddListItem( "多摄取含纤维质的食物(全穀类、蔬菜类、水果)。", 1); + // numberedList11.AddListItem( "避免烟、酒、含咖啡因饮料及其他刺激性食品。", 1); + // numberedList11.AddListItem( "有服用抗凝血剂的病患,要减少含维生素 K 多的食物,如绿色蔬菜(菠菜、甘蓝菜、萵苣、绿花椰菜)、肝脏。", 1); + // document.InsertList(numberedList11); + // document.InsertParagraph(@"◆ 肾脏疾病").Font(f).FontSize(14); + + // var numberedList12 = document.AddList(listOptions); + // numberedList12.AddListItem("肾结石\n建议平时多饮水,少吃高草酸食物,可做蹦跳运动,避免感染,请定期复查,必要时排石治疗。", 0); + // numberedList12.AddListItem( "肾囊肿", 0); + // numberedList12.AddListItem( "请定期复查,观察变化,若有症状专科治疗。", 1); + // numberedList12.AddListItem( "肾功能异常:建议控制膳食中蛋白质比例,近期复查,必要时专科诊治。如有肾脏病史,请及时肾内科诊治。", 1); + // numberedList12.AddListItem( "肾错构瘤\n属良性肿瘤,请定期复查,如有症状专科治疗", 0); + // numberedList12.AddListItem( "肾萎缩、肾盂增大\n建议专科进一步诊治", 0); + // document.InsertList(numberedList12); + // for (int i = index; i < document.Paragraphs.Count; i++) + // { + // document.Paragraphs[i].SpacingAfter(10d).SetLineSpacing(LineSpacingType.Line, 13.8f); + // ///document.Paragraphs[i].Alignment = Alignment.both; + // } + // //结束语页 + // document.InsertParagraph().InsertPageBreakAfterSelf(); + // document.InsertParagraph(@"结束语").Font(f).FontSize(14).Bold(true); + // document.InsertParagraph(); + // document.InsertParagraph(@"影响健康的因素很多,包括遗传基因、日常生活习惯、社会环境、医疗资源等等,其中,与一般民众息息相关的医疗资源,仅占影响健康因素的10%,最大的影响因素还是日常生活习惯及社会环境。根据世界卫生组织(WHO)的估计,75%的癌症是已知的环境因素所引起,而这些因素都是可以预防的,例如抽烟、酗酒。").Font(f).FontSize(10.5).IndentationFirstLine = 32.0f; + // document.InsertParagraph(); + // document.InsertParagraph(@"世界卫生组织(WHO)指出:“二十一世纪的医学不应该继续以疾病为主要研究对象,而应该以人类健康作为医学研究的主要方向。” 这个精神旨在宣告预防医学和健康保健将成为医学的主导。").Font(f).FontSize(10.5).IndentationFirstLine = 32f; + // document.InsertParagraph(); + // document.InsertParagraph(@"我中心愿以卓越的服务、优质的技术继续为贵单位提供医疗保健服务,从体检中发现健康问题,从保健中解决健康问题。").Font(f).FontSize(10.5).IndentationFirstLine = 32f; + // document.InsertParagraph(); + // document.InsertParagraph(@"最后,感谢您对国宾的支持,别忘了定期为员工安排健康检查。您的任何意见,都是我们成长的来源!敬请不吝指教。").Font(f).FontSize(10.5).IndentationFirstLine = 32f; + // document.InsertParagraph().InsertPageBreakAfterSelf(); + // //检后服务 + // Xceed.Document.NET.Font f1 = new Xceed.Document.NET.Font("黑体"); + // Xceed.Document.NET.Font f2 = new Xceed.Document.NET.Font("楷体"); + // Formatting pBottomFirstFormatting = new Formatting(); + // pBottomFirstFormatting.FontFamily = new Xceed.Document.NET.Font("黑体"); + // pBottomFirstFormatting.Size = 14; + // Formatting pBottomLastFormatting = new Formatting(); + // pBottomLastFormatting.FontFamily = new Xceed.Document.NET.Font("黑体"); + // pBottomLastFormatting.Size = 10.5; + // document.InsertParagraph(@"检后服务").Font(f1).FontSize(18); + // document.InsertParagraph(@"健康体检后,您需要健康维护和管理:").Font(f1).FontSize(10.5); + // var svr1 = document.InsertParagraph().Font(f1).FontSize(10.5); + // svr1.InsertText("1.", false, pBottomLastFormatting); + // svr1.InsertText("检后就诊", false, pBottomFirstFormatting); + // svr1.InsertText("--体检中发现的疾病由国内著名、省内著名的专家为您对接就诊,真正起到早发现、早诊断、早治疗。", false, pBottomLastFormatting); + // var svr2 = document.InsertParagraph().Font(f1).FontSize(10.5); + // svr2.InsertText("2.", false, pBottomLastFormatting); + // svr2.InsertText("常见病、疑难病预约就诊服务", false, pBottomFirstFormatting); + // svr2.InsertText("--请拨打健康服务热线。我们可以帮您用最短的时间预约上最合适您病情的专家,他们为国内著名、省内著名的专家在您需要时我们还可以通过绿色通道帮您预约外省外院著名专家。", false, pBottomLastFormatting); + // document.InsertParagraph("3.体检报告电话咨询服务。").Font(f1).FontSize(10.5); + // document.InsertParagraph("4.特殊检查预约服务(CT、MR等大型检查设备)。").Font(f1).FontSize(10.5); + // document.InsertParagraph("5.住院预约服务。").Font(f1).FontSize(10.5); + // document.InsertParagraph("6.外院就诊指导。").Font(f1).FontSize(10.5); + // document.InsertParagraph("您 健 康 的 管 家").Font(f1).FontSize(18).Italic(true).Alignment = Alignment.center; + // document.InsertParagraph("人生中偶然的病痛--有我们的关怀").Font(f2).FontSize(18).Bold(true).Italic(true).Alignment = Alignment.center; + // document.InsertParagraph("健康体检中心").Font(f).FontSize(16).Alignment = Alignment.center; + // document.InsertParagraph("团体体检汇总报告").Font(f).FontSize(16).Alignment = Alignment.center; + // document.InsertParagraph("企业员工健康检查统计报告").Font(f1).FontSize(22).Alignment = Alignment.center; + // document.InsertParagraph("【版权所有,翻印必究】").Font(f).FontSize(10.5).Alignment = Alignment.center; + // document.Save(); + //} + + + + /// + /// 根据模板创建报告 + /// + /// + public string CreateCustomerOrgPeisFromTemplate(UnitPhysicalExaminationReportExportWordData documentData) + { + DocX template = DocX.Load(DirectoryName + @"\CustomerOrgTemplate\单位体检报告模板.docx"); + template.DifferentFirstPage = true; + template.AddHeaders(); + Header header = template.Headers.Odd; + // Insert Paragraph in header + Paragraph paragraph = header.InsertParagraph(); + Xceed.Document.NET.Image logo = template.AddImage(DirectoryName + @"\CustomerOrgTemplate\header.jpg"); + var pic = logo.CreatePicture(); + pic.Width = 41.59f; + pic.Height = 30.3f; + paragraph.AppendPicture(pic); + paragraph.Append("\t\t\t\t健康体检中心"); + + template.AddFooters(); + Footer footer = template.Footers.Odd; + // Insert Paragraph in header + Paragraph paragraph1 = footer.InsertParagraph(); + paragraph1.Append("File Format Develoer Guide"); + #region 封面 + + template.ReplaceText(new StringReplaceTextOptions + { + SearchValue = "{MedicalTitle}", + NewValue = documentData.MedicalTitle + }); + + template.ReplaceText(new StringReplaceTextOptions + { + SearchValue = "{MedicalTimes}", + NewValue = documentData.MedicalTimes.ToString() + }); + + template.ReplaceText(new StringReplaceTextOptions + { + SearchValue = "{MedicalStartDate}", + NewValue = documentData.MedicalStartDate + }); + + template.ReplaceText(new StringReplaceTextOptions + { + SearchValue = "{MedicalEndDate}", + NewValue = documentData.MedicalEndDate + }); + + template.ReplaceText(new StringReplaceTextOptions + { + SearchValue = "{TabulationDate}", + NewValue = documentData.TabulationDate + }); + + template.ReplaceText(new StringReplaceTextOptions + { + SearchValue = "{PrintDate}", + NewValue = documentData.PrintDate + }); + + + #endregion + + + #region 参检人员构成情况 + + template.AddCustomProperty(new CustomProperty("Register_MaleNumber", documentData.RegisterDetail.MaleNumber)); + template.AddCustomProperty(new CustomProperty("Register_FemaleNumber", documentData.RegisterDetail.FemaleNumber)); + template.AddCustomProperty(new CustomProperty("Register_OtherNumber", documentData.RegisterDetail.OtherNumber)); + template.AddCustomProperty(new CustomProperty("Register_TotalNumber", documentData.RegisterDetail.TotalNumber)); + template.AddCustomProperty(new CustomProperty("Register_MaleRatio", documentData.RegisterDetail.MaleRatio)); + template.AddCustomProperty(new CustomProperty("Register_FemaleRatio", documentData.RegisterDetail.FemaleRatio)); + + template.AddCustomProperty(new CustomProperty("Checked_MaleNumber", documentData.CheckedDetail.MaleNumber)); + template.AddCustomProperty(new CustomProperty("Checked_FemaleNumber", documentData.CheckedDetail.FemaleNumber)); + template.AddCustomProperty(new CustomProperty("Checked_OtherNumber", documentData.CheckedDetail.OtherNumber)); + template.AddCustomProperty(new CustomProperty("Checked_TotalNumber", documentData.CheckedDetail.TotalNumber)); + template.AddCustomProperty(new CustomProperty("Checked_MaleRatio", documentData.CheckedDetail.MaleRatio)); + template.AddCustomProperty(new CustomProperty("Checked_FemaleRatio", documentData.CheckedDetail.FemaleRatio)); + template.AddCustomProperty(new CustomProperty("Checked_MaleExamineRatio", documentData.CheckedDetail.MaleExamineRatio)); + template.AddCustomProperty(new CustomProperty("Checked_FemaleExamineRatio", documentData.CheckedDetail.FemaleExamineRatio)); + template.AddCustomProperty(new CustomProperty("Checked_AverageExamineRatio", documentData.CheckedDetail.AverageExamineRatio)); + + template.AddCustomProperty(new CustomProperty("UnCheck_MaleNumber", documentData.UnCheckedDetail.MaleNumber)); + template.AddCustomProperty(new CustomProperty("UnCheck_FemaleNumber", documentData.UnCheckedDetail.FemaleNumber)); + template.AddCustomProperty(new CustomProperty("UnCheck_OtherNumber", documentData.UnCheckedDetail.OtherNumber)); + template.AddCustomProperty(new CustomProperty("UnCheck_TotalNumber", documentData.UnCheckedDetail.TotalNumber)); + template.AddCustomProperty(new CustomProperty("UnCheck_MaleRatio", documentData.UnCheckedDetail.MaleRatio)); + template.AddCustomProperty(new CustomProperty("UnCheck_FemaleRatio", documentData.UnCheckedDetail.FemaleRatio)); + template.AddCustomProperty(new CustomProperty("UnCheck_MaleExamineRatio", documentData.UnCheckedDetail.MaleExamineRatio)); + template.AddCustomProperty(new CustomProperty("UnCheck_FemaleExamineRatio", documentData.UnCheckedDetail.FemaleExamineRatio)); + template.AddCustomProperty(new CustomProperty("UnCheck_AverageExamineRatio", documentData.UnCheckedDetail.AverageExamineRatio)); + + #endregion + + #region 参检百分比 + var p3Paragraphs1 = template.Paragraphs.Where(p => p.Text.Equals("参检百分比:")).FirstOrDefault(); + var p3Chat1 = template.AddChart(); + p3Chat1.AddLegend(ChartLegendPosition.Right, true); + var p3ChatData1 = new List(); + p3ChatData1.Add(new ChartData() { Category = "未检", Expenses = documentData.UnCheckedDetail.TotalNumber }); + p3ChatData1.Add(new ChartData() { Category = "已检", Expenses = documentData.CheckedDetail.TotalNumber }); + + + // 创建饼图并绑定数据 + var p3Chats1 = new Series("参检百分比"); + p3Chats1.Bind(p3ChatData1, "Category", "Expenses"); + p3Chat1.AddSeries(p3Chats1); + template.InsertChartAfterParagraph(p3Chat1, p3Paragraphs1.NextParagraph, 200f, 150f); + #endregion + + #region 参检性别百分比 + var p3Paragraphs2 = template.Paragraphs.Where(p => p.Text.Equals("参检性别百分比:")).FirstOrDefault(); + var p3Chat2 = template.AddChart(); + p3Chat2.AddLegend(ChartLegendPosition.Right, true); + var p3ChatData2 = new List(); + p3ChatData2.Add(new ChartData() { Category = "男性", Expenses = documentData.CheckedDetail.MaleNumber }); + p3ChatData2.Add(new ChartData() { Category = "女性", Expenses = documentData.CheckedDetail.FemaleNumber }); + p3ChatData2.Add(new ChartData() { Category = "其他", Expenses = documentData.CheckedDetail.OtherNumber }); + + // 创建饼图并绑定数据 + var p3Chats2 = new Series("参检性别百分比"); + p3Chats2.Bind(p3ChatData2, "Category", "Expenses"); + p3Chat2.AddSeries(p3Chats2); + template.InsertChartAfterParagraph(p3Chat2, p3Paragraphs2.NextParagraph, 200f, 150f); + #endregion + + + #region 第二部分 体检项目得参检情况 + var table4 = template.Tables[4]; + var table4Data = documentData.MedicalItemExamineSituations; + int rowIndex = 2; + if (table4Data.Any()) + { + foreach (var item in table4Data) + { + table4.Rows[rowIndex].Cells[0].Paragraphs[0].Append(item.ItemTypeName); + table4.Rows[rowIndex].Cells[1].Paragraphs[0].Append(item.AsbitemName); + table4.Rows[rowIndex].Cells[2].Paragraphs[0].Append(item.MaleAsbitemCheckNumber.ToString()); + table4.Rows[rowIndex].Cells[3].Paragraphs[0].Append(item.FemaleAsbitemCheckNumber.ToString()); + table4.Rows[rowIndex].Cells[4].Paragraphs[0].Append(item.TotalAsbitemCheckNumber.ToString()); + table4.Rows[rowIndex].Cells[5].Paragraphs[0].Append(item.MaleSumCheckNumber.ToString()); + table4.Rows[rowIndex].Cells[6].Paragraphs[0].Append(item.FemaleSumCheckNumber.ToString()); + table4.Rows[rowIndex].Cells[7].Paragraphs[0].Append(item.TotalSumCheckNumber.ToString()); + table4.Rows[rowIndex].Cells[8].Paragraphs[0].Append(item.MaleAsbitemCheckRatio.ToString()); + table4.Rows[rowIndex].Cells[9].Paragraphs[0].Append(item.FemaleAsbitemCheckRatio.ToString()); + table4.Rows[rowIndex].Cells[10].Paragraphs[0].Append(item.TotalAsbitemCheckRatio.ToString()); + rowIndex++; + if (rowIndex - 2 < table4Data.Count) table4.InsertRow(); + + } + } + #endregion + + + #region 第三部分 全体员工体检结果汇总 + + var table5 = template.Tables[5]; + var table5Data = documentData.MedicalResultSummarys; + rowIndex = 1; + if (table5Data.Any()) + { + foreach (var item in table5Data) + { + table5.Rows[rowIndex].Cells[0].Paragraphs[0].Append(item.PatientNo); + table5.Rows[rowIndex].Cells[1].Paragraphs[0].Append(item.PatientName); + table5.Rows[rowIndex].Cells[2].Paragraphs[0].Append(item.SexName); + table5.Rows[rowIndex].Cells[3].Paragraphs[0].Append(item.Age); + table5.Rows[rowIndex].Cells[4].Paragraphs[0].Append(item.MedicalResult); + rowIndex++; + if (rowIndex - 1 < table5Data.Count) table5.InsertRow(); + } + } + + #endregion + + + #region 第四部分 体检异常结果检出统计 + + var table6 = template.Tables[6]; + var table6Data = documentData.MedicalAbnormalResultStatistics; + rowIndex = 2; + if (table6Data.Any()) + { + foreach (var item in table6Data) + { + table6.Rows[rowIndex].Cells[0].Paragraphs[0].Append(item.DiagnosisName); + table6.Rows[rowIndex].Cells[1].Paragraphs[0].Append(item.PatientDetail); + table6.Rows[rowIndex].Cells[2].Paragraphs[0].Append(item.MaleNumber.ToString()); + table6.Rows[rowIndex].Cells[3].Paragraphs[0].Append(item.FemaleNumber.ToString()); + table6.Rows[rowIndex].Cells[4].Paragraphs[0].Append(item.TotalNumber.ToString()); + table6.Rows[rowIndex].Cells[5].Paragraphs[0].Append(item.MaleRatio); + table6.Rows[rowIndex].Cells[6].Paragraphs[0].Append(item.FemaleRatio); + table6.Rows[rowIndex].Cells[7].Paragraphs[0].Append(item.AverageRatio); + rowIndex++; + if (rowIndex - 2 < table6Data.Count) table6.InsertRow(); + } + } + + #endregion + + + #region 十大异常柱状图 + var p3Paragraphs3 = template.Paragraphs.Where(p => p.Text.Equals("前十大异常结果柱状图:")).FirstOrDefault(); + var p6Chat1 = template.AddChart(); + p6Chat1.AddLegend(ChartLegendPosition.Right, false); + p6Chat1.BarDirection = BarDirection.Column;//指示柱状图是横向的还是纵向的:Column纵向,Bar横向 + p6Chat1.BarGrouping = BarGrouping.Stacked;//这个不好解释,一个4个枚举值,你一一试一遍就知道了 + p6Chat1.GapWidth = 200;//柱状图表的宽度 + p6Chat1.GapWidth = 200; + var p6ChatData = new List(); + if (documentData.MedicalAbnormalResultStatistics.Any()) + { + var medicalAbnormalResultStatisticsTop10 = documentData.MedicalAbnormalResultStatistics.Take(10); + foreach (var item in medicalAbnormalResultStatisticsTop10) + { + p6ChatData.Add(new ChartData() { Category = item.DiagnosisName, Expenses = item.TotalNumber }); + } + } + + var p6Chats1 = new Series("疾病人数"); + p6Chats1.Color = Color.FromArgb(79, 129, 189); + p6Chats1.Bind(p6ChatData, "Category", "Expenses"); + p6Chat1.AddSeries(p6Chats1); + template.InsertChartAfterParagraph(p6Chat1, p3Paragraphs3.NextParagraph); + #endregion + + #region 十大异常饼状图 + var p3Paragraphs4 = template.Paragraphs.Where(p => p.Text.Equals("前十大异常结果饼图:")).FirstOrDefault(); + var p6Chat2 = template.AddChart(); + p6Chat2.AddLegend(ChartLegendPosition.Right, true); + //var p6ChatData2 = new List(); + //p6ChatData2.Add(new ChartData() { Category = "疾病1", Expenses = 22 }); + //p6ChatData2.Add(new ChartData() { Category = "疾病2", Expenses = 22 }); + //p6ChatData2.Add(new ChartData() { Category = "疾病3", Expenses = 22 }); + //p6ChatData2.Add(new ChartData() { Category = "疾病4", Expenses = 4 }); + //p6ChatData2.Add(new ChartData() { Category = "疾病5", Expenses = 5 }); + //p6ChatData2.Add(new ChartData() { Category = "疾病6", Expenses = 6 }); + //p6ChatData2.Add(new ChartData() { Category = "疾病7", Expenses = 7 }); + //p6ChatData2.Add(new ChartData() { Category = "疾病8", Expenses = 8 }); + //p6ChatData2.Add(new ChartData() { Category = "疾病9", Expenses = 9 }); + //p6ChatData2.Add(new ChartData() { Category = "疾病10", Expenses = 10 }); + // 创建饼图并绑定数据 + var p6Chats2 = new Series("疾病人数百分比"); + p6Chats2.Bind(p6ChatData, "Category", "Expenses"); + p6Chat2.AddSeries(p6Chats2); + template.InsertChartAfterParagraph(p6Chat2, p3Paragraphs4.NextParagraph); + + #endregion + + + #region 第五部分 十大异常结果分析 + var table7 = template.Tables[7]; + var table7Data = documentData.MedicalTenAbnormalResults; + rowIndex = 1; + if (table7Data.Any()) + { + foreach (var item in table7Data) + { + table7.Rows[rowIndex].Cells[0].Paragraphs[0].Append(item.DiagnosisName); + table7.Rows[rowIndex].Cells[1].Paragraphs[0].Append(item.DiagnosisSuggestion); + rowIndex++; + if (rowIndex - 1 < table7Data.Count) table7.InsertRow(); + } + } + #endregion + + + #region 第六部分 体检者未完成情况 + var table8 = template.Tables[8]; + var table8Data = documentData.MedicalUnCheckedStatistics; + rowIndex = 1; + if (table8Data.Any()) + { + foreach (var item in table8Data) + { + table8.Rows[rowIndex].Cells[0].Paragraphs[0].Append(item.PatientNo); + table8.Rows[rowIndex].Cells[1].Paragraphs[0].Append(item.PatientName); + table8.Rows[rowIndex].Cells[2].Paragraphs[0].Append(item.SexName); + table8.Rows[rowIndex].Cells[3].Paragraphs[0].Append(item.Age); + table8.Rows[rowIndex].Cells[4].Paragraphs[0].Append(item.DepartmentName); + rowIndex++; + if (rowIndex - 1 < table8Data.Count) table8.InsertRow(); + } + } + #endregion + + + string documentName = $"{documentData.MedicalTitle}单位体检报告{DateTime.Now.ToString("yyyy_MM_dd_HH_mm")}.docx"; + + template.SaveAs(DirectoryName + $@"\CustomerOrgTemplate\docs\{documentName}"); + + return $"/ReportFile/CustomerOrgTemplate/docs/{documentName}"; + } + + + /// + /// 创建模板 + /// + public void CreateCustomerOrgPeisTemplate() + { + DocX document = DocX.Create(DirectoryName + @"\CustomerOrgTemplate\单位体检报告模板.docx"); + + + //第一页 + Table p1Titletable = document.AddTable(1, 2); + p1Titletable.Design = TableDesign.TableNormal; + p1Titletable.Alignment = Alignment.center; + Border b = new Border(); + b.Color = Color.FromArgb(51, 153, 102); + b.Size = BorderSize.six; + p1Titletable.SetBorder(TableBorderType.Bottom, b); + List rows = p1Titletable.Rows; + + Row row0 = rows[0]; + row0.Height = 65f; + row0.Cells[0].Width = 50f; + Xceed.Document.NET.Image logo = document.AddImage(DirectoryName + @"\CustomerOrgTemplate\logo_template.jpg"); + Formatting p1TitleFormatting = new Formatting(); + p1TitleFormatting.FontFamily = new Xceed.Document.NET.Font("宋体"); + p1TitleFormatting.FontColor = Color.FromArgb(0, 128, 0); + row0.Cells[0].Paragraphs[0].AppendPicture(logo.CreatePicture()); + row0.Cells[0].VerticalAlignment = VerticalAlignment.Center; + row0.Cells[1].Width = document.PageWidth - document.MarginLeft - document.MarginRight - 30f; + row0.Cells[1].Paragraphs[0].Append("团体体检健康检查统计报告", p1TitleFormatting).FontSize(22).Alignment = Alignment.center; + row0.Cells[1].VerticalAlignment = VerticalAlignment.Center; + var pTitle = document.InsertParagraph(); + pTitle.InsertTableAfterSelf(p1Titletable); + + + Formatting p1TitleSecFormatting = new Formatting(); + p1TitleSecFormatting.FontFamily = new Xceed.Document.NET.Font("楷体"); + p1TitleSecFormatting.Size = 26; + var p1TitleSec = document.InsertParagraph(); + p1TitleSec.Alignment = Alignment.right; + p1TitleSec.Append("{MedicalTitle}", p1TitleSecFormatting); + + + var p1TitleSecExt = document.InsertParagraph(); + p1TitleSecFormatting.FontFamily = new Xceed.Document.NET.Font("隶书"); + p1TitleSecFormatting.Size = 26; + p1TitleSecExt.Alignment = Alignment.right; + p1TitleSecExt.Append("团检报告", p1TitleSecFormatting); + document.InsertParagraph(); + Xceed.Document.NET.Image titleImg = document.AddImage(DirectoryName + @"\CustomerOrgTemplate\Page1.jpg"); + var p1TitleImg = document.InsertParagraph(); + p1TitleImg.Alignment = Alignment.center; + p1TitleImg.AppendPicture(titleImg.CreatePicture()); + + Table p1Contenttable = document.AddTable(5, 4); + p1Contenttable.Design = TableDesign.TableNormal; + List rowsContent = p1Contenttable.Rows; + + Row row0Content = rowsContent[0]; + Formatting p1TableContentFormatting = new Formatting(); + p1TableContentFormatting.FontFamily = new Xceed.Document.NET.Font("楷体"); + Border bTableContent = new Border(); + bTableContent.Color = Color.FromArgb(0, 128, 0); + bTableContent.Size = BorderSize.four; + Formatting p1TableColumn1ContentFormatting = new Formatting(); + p1TableColumn1ContentFormatting.FontFamily = new Xceed.Document.NET.Font("楷体"); + p1TableColumn1ContentFormatting.Size = 18; + + row0Content.Cells[0].Width = 200f; + row0Content.Cells[1].Width = 150f; + row0Content.Cells[2].Width = 300f; + row0Content.Cells[1].Paragraphs[0].Append("体检次数", p1TableContentFormatting).FontSize(18).Alignment = Alignment.right; + row0Content.Cells[1].VerticalAlignment = VerticalAlignment.Center; + row0Content.Cells[2].Paragraphs[0].Append("{MedicalTimes}", p1TableColumn1ContentFormatting).Alignment = Alignment.left; + row0Content.Cells[2].VerticalAlignment = VerticalAlignment.Center; + row0Content.Cells[2].SetBorder(TableCellBorderType.Bottom, bTableContent); + + Row row1Content = rowsContent[1]; + row1Content.Cells[1].Paragraphs[0].Append("体检日期", p1TableContentFormatting).FontSize(18).Alignment = Alignment.right; + row1Content.Cells[1].VerticalAlignment = VerticalAlignment.Center; + row1Content.Cells[2].Paragraphs[0].Append("{MedicalStartDate}", p1TableColumn1ContentFormatting).FontSize(18).Alignment = Alignment.left; + row1Content.Cells[2].VerticalAlignment = VerticalAlignment.Center; + row1Content.Cells[2].SetBorder(TableCellBorderType.Bottom, bTableContent); + + Row row2Content = rowsContent[2]; + row2Content.Cells[1].Paragraphs[0].Append("结束月份", p1TableContentFormatting).FontSize(18).Alignment = Alignment.right; + row2Content.Cells[1].VerticalAlignment = VerticalAlignment.Center; + row2Content.Cells[2].Paragraphs[0].Append("{MedicalEndDate}", p1TableColumn1ContentFormatting).Alignment = Alignment.left; + row2Content.Cells[2].VerticalAlignment = VerticalAlignment.Center; + row2Content.Cells[2].SetBorder(TableCellBorderType.Bottom, bTableContent); + + Row row3Content = rowsContent[3]; + row3Content.Cells[1].Paragraphs[0].Append("制表日期", p1TableContentFormatting).FontSize(18).Alignment = Alignment.right; + row3Content.Cells[1].VerticalAlignment = VerticalAlignment.Center; + row3Content.Cells[2].Paragraphs[0].Append("{TabulationDate}", p1TableColumn1ContentFormatting).Alignment = Alignment.left; + row3Content.Cells[2].VerticalAlignment = VerticalAlignment.Center; + + Row row4Content = rowsContent[4]; + row4Content.Cells[1].Paragraphs[0].Append("打印日期", p1TableContentFormatting).FontSize(18).Alignment = Alignment.right; + row4Content.Cells[1].VerticalAlignment = VerticalAlignment.Center; + row4Content.Cells[2].Paragraphs[0].Append("{PrintDate}", p1TableColumn1ContentFormatting).Alignment = Alignment.left; + row4Content.Cells[2].VerticalAlignment = VerticalAlignment.Center; + + var p1Content = document.InsertParagraph(); + p1Content.InsertTableAfterSelf(p1Contenttable); + + for (int i = 0; i <= 10; i++) document.InsertParagraph(); + + Table p1FootTable = document.AddTable(1, 1); + p1FootTable.Design = TableDesign.TableNormal; + List rowsFootTable = p1FootTable.Rows; + + Row row0Foot = rowsFootTable[0]; + row0Foot.Cells[0].Paragraphs[0].Append("医院体检中心 编制", p1TableContentFormatting).FontSize(14).Alignment = Alignment.right; + row0Foot.Cells[0].VerticalAlignment = VerticalAlignment.Center; + row0Foot.Cells[0].SetBorder(TableCellBorderType.Bottom, bTableContent); + + var p1Foot = document.InsertParagraph(); + p1Foot.InsertTableAfterSelf(p1FootTable); + + var p1Foot1 = document.InsertParagraph(); + p1Foot1.Append("体检中心地址:", p1TableContentFormatting).FontSize(10).Alignment = Alignment.right; + + //第二页 + p1Foot1.InsertPageBreakAfterSelf(); + Xceed.Document.NET.Font f = new Xceed.Document.NET.Font("宋体"); + var p2_1 = document.InsertParagraph("前言").Font(f).FontSize(14); + document.InsertParagraph(); + document.InsertParagraph("这是一本针对贵单位员工体检结果的综合分析资料,希望透过本资料,让贵单位主管能够了解员工的健康状况及可以改善的方向。").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + document.InsertParagraph(@"这份报告包括五大部份:基础资料、体检异常情况统计、员工健康问题分析及保健建议、女性员工健康问题分析及保健建议、男性员工健康问题分析及保健建议、全体员工体检结果汇总。我们在每个部份都会提供重要的健康与疾病相关知识,以及后续应该如何处理等信息。让非常关心员工健康的您,知道如何再进一步改善或提倡健康促进活动。").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + document.InsertParagraph(@"第一部份:参检人员构成情况").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + document.InsertParagraph(@"第二部份:体检项目与体检项目的参检情况").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + document.InsertParagraph(@"第三部份:全体员工体检结果汇总").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + document.InsertParagraph(@"第四部份:本次体检异常结果检出统计").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + document.InsertParagraph(@"第五部份: 本次体检前十大异常结果分析").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + document.InsertParagraph(@"第六部份: 体检者未完成情况").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + document.InsertParagraph(@"第七部分:常见体检异常结果分析及健康指导").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + document.InsertParagraph(); + document.InsertParagraph(@"医院体检中心另提供完善的后续服务,包括护理咨询服务、特色医院导诊服务、营养咨询等。有任何需要,请电洽相关部门,或拨打咨询专线咨询相关事宜。").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + document.InsertParagraph(); + document.InsertParagraph(@"定期健康检查对于员工健康的重要性相信您已知道,然而,更重要的是完成健康检查后,改善健康活动的开始,也就是健康促进的一级预防医学(适当的运动、均衡的饮食、身心休闲),这才是健康检查最终的目标。").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + document.InsertParagraph(); + document.InsertParagraph(@"完全依赖治疗的时代已经过去了,应定期健康检查,并落实健康促进的一级预防医学,这将是未来人类健康的不二法门。").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + //第三页 + var p2_last = document.InsertParagraph(); + p2_last.InsertPageBreakAfterSelf(); + document.InsertParagraph(@"一、参检人员构成情况").Font(f).FontSize(16); + + Table p3Contenttable = document.AddTable(5, 10); + p3Contenttable.Design = TableDesign.TableGrid; + List p3rowsContent = p3Contenttable.Rows; + Row p3Row0 = p3rowsContent[0]; + + p3Contenttable.MergeCellsInColumn(0, 0, 1); + p3Row0.Cells[0].Paragraphs[0].Append("情况类型").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row0.Cells[0].FillColor = Color.FromArgb(209, 245, 203); + p3Row0.MergeCells(1, 4); + p3Row0.Cells[1].Paragraphs[0].Append("人数").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row0.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + p3Row0.MergeCells(2, 3); + p3Row0.Cells[2].Paragraphs[0].Append("构成比率").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row0.Cells[2].FillColor = Color.FromArgb(209, 245, 203); + p3Row0.MergeCells(3, 5); + p3Row0.Cells[3].Paragraphs[0].Append("参检比率").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row0.Cells[3].FillColor = Color.FromArgb(209, 245, 203); + + p3Contenttable.SetColumnWidth(0, 35f); + + Row p3Row1 = p3rowsContent[1]; + p3Row1.Cells[1].Paragraphs[0].Append("男性").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row1.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + p3Row1.Cells[2].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row1.Cells[2].FillColor = Color.FromArgb(209, 245, 203); + p3Row1.Cells[3].Paragraphs[0].Append("其它").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row1.Cells[3].FillColor = Color.FromArgb(209, 245, 203); + p3Row1.Cells[4].Paragraphs[0].Append("合计").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row1.Cells[4].FillColor = Color.FromArgb(209, 245, 203); + p3Row1.Cells[5].Paragraphs[0].Append("男性").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row1.Cells[5].FillColor = Color.FromArgb(209, 245, 203); + p3Row1.Cells[6].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row1.Cells[6].FillColor = Color.FromArgb(209, 245, 203); + p3Row1.Cells[7].Paragraphs[0].Append("男性").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row1.Cells[7].FillColor = Color.FromArgb(209, 245, 203); + p3Row1.Cells[8].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row1.Cells[8].FillColor = Color.FromArgb(209, 245, 203); + p3Row1.Cells[9].Paragraphs[0].Append("平均").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row1.Cells[9].FillColor = Color.FromArgb(209, 245, 203); + + Formatting p3TableFormatting = new Formatting(); + p3TableFormatting.FontFamily = new Xceed.Document.NET.Font("宋体"); + p3TableFormatting.Size = 10.5; + + CustomProperty p3_Register_MaleNumber = new CustomProperty("Register_MaleNumber", "{男性登记人数}"); + CustomProperty p3_Register_FemaleNumber = new CustomProperty("Register_FemaleNumber", "{女性登记人数}"); + CustomProperty p3_Register_OtherNumber = new CustomProperty("Register_OtherNumber", "{其它登记人数}"); + CustomProperty p3_Register_TotalNumber = new CustomProperty("Register_TotalNumber", "{总登记人数}"); + CustomProperty p3_Register_MaleRatio = new CustomProperty("Register_MaleRatio", "{男性登记人数占总登记人数百分比}"); + CustomProperty p3_Register_FemaleRatio = new CustomProperty("Register_FemaleRatio", "{女性登记人数占总登记人数百分比}"); + + CustomProperty p3_Checked_MaleNumber = new CustomProperty("Checked_MaleNumber", "{男性实检人数}"); + CustomProperty p3_Checked_FemaleNumber = new CustomProperty("Checked_FemaleNumber", "{女性实检人数}"); + CustomProperty p3_Checked_OtherNumber = new CustomProperty("Checked_OtherNumber", "{其它实检人数}"); + CustomProperty p3_Checked_TotalNumber = new CustomProperty("Checked_TotalNumber", "{总实检人数}"); + CustomProperty p3_Checked_MaleRatio = new CustomProperty("Checked_MaleRatio", "{男性实检人数占总实检人数百分比}"); + CustomProperty p3_Checked_FemaleRatio = new CustomProperty("Checked_FemaleRatio", "{女性实检人数占总实检人数百分比}"); + CustomProperty p3_Checked_MaleExamineRatio = new CustomProperty("Checked_MaleExamineRatio", "{男性实检人数占男性登记人数百分比}"); + CustomProperty p3_Checked_FemaleExamineRatio = new CustomProperty("Checked_FemaleExamineRatio", "{女性实检人数占女性登记人数百分比}"); + CustomProperty p3_Checked_AverageExamineRatio = new CustomProperty("Checked_AverageExamineRatio", "{总实检人数占总登记人数百分比}"); + + + CustomProperty p3_UnCheck_MaleNumber = new CustomProperty("UnCheck_MaleNumber", "{男性未检人数}"); + CustomProperty p3_UnCheck_FemaleNumber = new CustomProperty("UnCheck_FemaleNumber", "{女性未检人数}"); + CustomProperty p3_UnCheck_OtherNumber = new CustomProperty("UnCheck_OtherNumber", "{其他未检人数}"); + CustomProperty p3_UnCheck_TotalNumber = new CustomProperty("UnCheck_TotalNumber", "{总未检人数}"); + CustomProperty p3_UnCheck_MaleRatio = new CustomProperty("UnCheck_MaleRatio", "{男性未检人数占总未检人数百分比}"); + CustomProperty p3_UnCheck_FemaleRatio = new CustomProperty("UnCheck_FemaleRatio", "{女性未检人数占总未检人数百分比}"); + CustomProperty p3_UnCheck_MaleExamineRatio = new CustomProperty("UnCheck_MaleExamineRatio", "{男性未检人数占男性登记人数百分比}"); + CustomProperty p3_UnCheck_FemaleExamineRatio = new CustomProperty("UnCheck_FemaleExamineRatio", "{女性未检人数占女性登记人数百分比}"); + CustomProperty p3_UnCheck_AverageExamineRatio = new CustomProperty("UnCheck_AverageExamineRatio", "{总未检人数占总登记人数百分比}"); + + + Row p3Row2 = p3rowsContent[2]; + p3Row2.Cells[0].Paragraphs[0].Append("登记").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row2.Cells[1].Paragraphs[0].AppendDocProperty(p3_Register_MaleNumber).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row2.Cells[2].Paragraphs[0].AppendDocProperty(p3_Register_FemaleNumber).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row2.Cells[3].Paragraphs[0].AppendDocProperty(p3_Register_OtherNumber).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row2.Cells[4].Paragraphs[0].AppendDocProperty(p3_Register_TotalNumber).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row2.Cells[5].Paragraphs[0].AppendDocProperty(p3_Register_MaleRatio).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row2.Cells[6].Paragraphs[0].AppendDocProperty(p3_Register_FemaleRatio).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row2.Cells[7].Paragraphs[0].Append("100%").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row2.Cells[8].Paragraphs[0].Append("100%").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row2.Cells[9].Paragraphs[0].Append("100%").Font(f).FontSize(10.5).Alignment = Alignment.center; + + Row p3Row3 = p3rowsContent[3]; + p3Row3.Cells[0].Paragraphs[0].Append("实检").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row3.Cells[1].Paragraphs[0].AppendDocProperty(p3_Checked_MaleNumber).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row3.Cells[2].Paragraphs[0].AppendDocProperty(p3_Checked_FemaleNumber).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row3.Cells[3].Paragraphs[0].AppendDocProperty(p3_Checked_OtherNumber).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row3.Cells[4].Paragraphs[0].AppendDocProperty(p3_Checked_TotalNumber).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row3.Cells[5].Paragraphs[0].AppendDocProperty(p3_Checked_MaleRatio).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row3.Cells[6].Paragraphs[0].AppendDocProperty(p3_Checked_FemaleRatio).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row3.Cells[7].Paragraphs[0].AppendDocProperty(p3_Checked_MaleExamineRatio).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row3.Cells[8].Paragraphs[0].AppendDocProperty(p3_Checked_FemaleExamineRatio).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row3.Cells[9].Paragraphs[0].AppendDocProperty(p3_Checked_AverageExamineRatio).Font(f).FontSize(10.5).Alignment = Alignment.center; + + + Row p3Row4 = p3rowsContent[4]; + p3Row4.Cells[0].Paragraphs[0].Append("未检").Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row4.Cells[1].Paragraphs[0].AppendDocProperty(p3_UnCheck_MaleNumber).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row4.Cells[2].Paragraphs[0].AppendDocProperty(p3_UnCheck_FemaleNumber).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row4.Cells[3].Paragraphs[0].AppendDocProperty(p3_UnCheck_OtherNumber).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row4.Cells[4].Paragraphs[0].AppendDocProperty(p3_UnCheck_TotalNumber).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row4.Cells[5].Paragraphs[0].AppendDocProperty(p3_UnCheck_MaleRatio).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row4.Cells[6].Paragraphs[0].AppendDocProperty(p3_UnCheck_FemaleRatio).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row4.Cells[7].Paragraphs[0].AppendDocProperty(p3_UnCheck_MaleExamineRatio).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row4.Cells[8].Paragraphs[0].AppendDocProperty(p3_UnCheck_FemaleExamineRatio).Font(f).FontSize(10.5).Alignment = Alignment.center; + p3Row4.Cells[9].Paragraphs[0].AppendDocProperty(p3_UnCheck_AverageExamineRatio).Font(f).FontSize(10.5).Alignment = Alignment.center; + + var p3Content = document.InsertParagraph(); + p3Content.InsertTableAfterSelf(p3Contenttable); + + document.InsertParagraph("参检百分比:").Font(f).FontSize(14).Alignment = Alignment.left; + document.InsertParagraph().Alignment = Alignment.center; + //var p3Chat1 = document.AddChart(); + //p3Chat1.AddLegend(ChartLegendPosition.Right, true); + //var p3ChatData1 = ChartData.CreateReferenceRate(); + + //// 创建饼图并绑定数据 + //var p3Chats1 = new Series("参检率"); + //p3Chats1.Bind(p3ChatData1, "Category", "Expenses"); + //p3Chat1.AddSeries(p3Chats1); + //document.InsertChart(p3Chat1, 200f, 150f); + //document.Paragraphs[document.Paragraphs.Count - 1].Alignment = Alignment.center; + + document.InsertParagraph("参检性别百分比:").Font(f).FontSize(14).Alignment = Alignment.left; + document.InsertParagraph().Alignment = Alignment.center; + //var p3Chat2 = document.AddChart(); + //p3Chat2.AddLegend(ChartLegendPosition.Right, true); + //var p3ChatData2 = ChartData.CreateReferenceRateSex(); + + //// 创建饼图并绑定数据 + //var p3Chats2 = new Series("参检性别百分比"); + //p3Chats2.Bind(p3ChatData2, "Category", "Expenses"); + //p3Chat2.AddSeries(p3Chats2); + //document.InsertChart(p3Chat2, 200f, 150f); + //document.Paragraphs[document.Paragraphs.Count - 1].Alignment = Alignment.center; + //var p3Paragraphs1 = document.Paragraphs.Where(p => p.Text.Equals("参检百分比:")).FirstOrDefault(); + //第四页 + document.Paragraphs[document.Paragraphs.Count - 1].InsertPageBreakAfterSelf(); + document.InsertParagraph(@"二、体检项目与体检项目的参检情况").Font(f).FontSize(16); + Table p4Contenttable = document.AddTable(3, 11); + p4Contenttable.Design = TableDesign.TableGrid; + List p4rowsContent = p4Contenttable.Rows; + + p4Contenttable.SetColumnWidth(0, 55f); + p4Contenttable.SetColumnWidth(1, 85f); + + Row p4Row0 = p4rowsContent[0]; + p4Row0.MergeCells(0, 1); + p4Row0.Cells[0].Paragraphs[0].Append("体检项目").Font(f).FontSize(10.5).Alignment = Alignment.center; + p4Row0.Cells[0].FillColor = Color.FromArgb(209, 245, 203); + p4Row0.MergeCells(1, 3); + p4Row0.Cells[1].Paragraphs[0].Append("该项参检人数").Font(f).FontSize(10.5).Alignment = Alignment.center; + p4Row0.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + p4Row0.MergeCells(2, 4); + p4Row0.Cells[2].Paragraphs[0].Append("总体参检人数").Font(f).FontSize(10.5).Alignment = Alignment.center; + p4Row0.Cells[2].FillColor = Color.FromArgb(209, 245, 203); + p4Row0.MergeCells(3, 5); + p4Row0.Cells[3].Paragraphs[0].Append("该项参检百分比").Font(f).FontSize(10.5).Alignment = Alignment.center; + p4Row0.Cells[3].FillColor = Color.FromArgb(209, 245, 203); + + Row p4Row1 = p4rowsContent[1]; + p4Row1.Cells[0].Paragraphs[0].Append("检查科室").Font(f).FontSize(10.5).Alignment = Alignment.center; + p4Row1.Cells[0].FillColor = Color.FromArgb(209, 245, 203); + p4Row1.Cells[1].Paragraphs[0].Append("项目名称").Font(f).FontSize(10.5).Alignment = Alignment.center; + p4Row1.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + p4Row1.Cells[2].Paragraphs[0].Append("男性").Font(f).FontSize(10.5).Alignment = Alignment.center; + p4Row1.Cells[2].FillColor = Color.FromArgb(209, 245, 203); + p4Row1.Cells[3].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; + p4Row1.Cells[3].FillColor = Color.FromArgb(209, 245, 203); + p4Row1.Cells[4].Paragraphs[0].Append("合计").Font(f).FontSize(10.5).Alignment = Alignment.center; + p4Row1.Cells[4].FillColor = Color.FromArgb(209, 245, 203); + p4Row1.Cells[5].Paragraphs[0].Append("男性").Font(f).FontSize(10.5).Alignment = Alignment.center; + p4Row1.Cells[5].FillColor = Color.FromArgb(209, 245, 203); + p4Row1.Cells[6].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; + p4Row1.Cells[6].FillColor = Color.FromArgb(209, 245, 203); + p4Row1.Cells[7].Paragraphs[0].Append("合计").Font(f).FontSize(10.5).Alignment = Alignment.center; + p4Row1.Cells[7].FillColor = Color.FromArgb(209, 245, 203); + p4Row1.Cells[8].Paragraphs[0].Append("男性").Font(f).FontSize(10.5).Alignment = Alignment.center; + p4Row1.Cells[8].FillColor = Color.FromArgb(209, 245, 203); + p4Row1.Cells[9].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; + p4Row1.Cells[9].FillColor = Color.FromArgb(209, 245, 203); + p4Row1.Cells[10].Paragraphs[0].Append("合计").Font(f).FontSize(10.5).Alignment = Alignment.center; + p4Row1.Cells[10].FillColor = Color.FromArgb(209, 245, 203); + var p4Content = document.InsertParagraph(); + p4Content.InsertTableAfterSelf(p4Contenttable); + + //第五页 + document.InsertParagraph().InsertPageBreakAfterSelf(); + document.InsertParagraph(@"三、全体员工体检结果汇总").Font(f).FontSize(16); + var p5Content = document.InsertParagraph(@"个人隐私请保密,仅供贵单位领导参阅").Font(f).FontSize(10.5); + Table p5Contenttable = document.AddTable(2, 5); + p5Contenttable.Design = TableDesign.TableGrid; + + p5Contenttable.SetColumnWidth(0, 110f); + p5Contenttable.SetColumnWidth(1, 75f); + p5Contenttable.SetColumnWidth(2, 35f); + p5Contenttable.SetColumnWidth(3, 45f); + p5Contenttable.SetColumnWidth(4, document.PageWidth - document.MarginLeft - document.MarginRight - 265f); + List p5rowsContent = p5Contenttable.Rows; + + Row p5Row0 = p5rowsContent[0]; + p5Row0.Cells[0].Paragraphs[0].Append("档案号").Font(f).FontSize(10.5).Alignment = Alignment.center; + p5Row0.Cells[0].FillColor = Color.FromArgb(209, 245, 203); + p5Row0.Cells[1].Paragraphs[0].Append("姓名").Font(f).FontSize(10.5).Alignment = Alignment.center; + p5Row0.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + p5Row0.Cells[2].Paragraphs[0].Append("性别").Font(f).FontSize(10.5).Alignment = Alignment.center; + p5Row0.Cells[2].FillColor = Color.FromArgb(209, 245, 203); + p5Row0.Cells[3].Paragraphs[0].Append("年龄").Font(f).FontSize(10.5).Alignment = Alignment.center; + p5Row0.Cells[3].FillColor = Color.FromArgb(209, 245, 203); + p5Row0.Cells[4].Paragraphs[0].Append("体检结果").Font(f).FontSize(10.5).Alignment = Alignment.center; + p5Row0.Cells[4].FillColor = Color.FromArgb(209, 245, 203); + p5Content.InsertTableAfterSelf(p5Contenttable); + document.InsertParagraph("(注: 敬请保护个人隐私, 本档案仅供贵单位负责职工健康体检的人员查阅! 未经员工本人同意, 不得外泄资料, 否则, 造成不良影响由贵单位承担, 与本中心无关!)").Font(f).FontSize(10.5); + + document.InsertParagraph(); + document.InsertParagraph(@"四、本次体检异常结果检出统计").Font(f).FontSize(16); + var p5Content1 = document.InsertParagraph(@"贵单位此次在我中心进行员工体检,内容包括[登记组合项目][实检组合项目],现将检出的按男女综合检出数量最高的部分异常情况进行统计分析,以反映出员工的健康状况。").Font(f).FontSize(10.5); + + Table p5Contenttable2 = document.AddTable(3, 8); + p5Contenttable2.Design = TableDesign.TableGrid; + p5Contenttable2.SetColumnWidth(0, 95f); + p5Contenttable2.SetColumnWidth(1, 130f); + p5Contenttable2.SetColumnWidth(2, 40f); + p5Contenttable2.SetColumnWidth(3, 40f); + p5Contenttable2.SetColumnWidth(4, 40f); + p5Contenttable2.SetColumnWidth(5, 40f); + p5Contenttable2.SetColumnWidth(6, 40f); + p5Contenttable2.SetColumnWidth(7, 40f); + List p5rowsContent2 = p5Contenttable2.Rows; + + Row p5Table2Row0 = p5rowsContent2[0]; + p5Table2Row0.MergeCells(0, 1); + p5Table2Row0.Cells[0].Paragraphs[0].Append("体检结论").Font(f).FontSize(10.5).Alignment = Alignment.center; + p5Table2Row0.Cells[0].FillColor = Color.FromArgb(209, 245, 203); + p5Table2Row0.MergeCells(1, 3); + p5Table2Row0.Cells[1].Paragraphs[0].Append("人数").Font(f).FontSize(10.5).Alignment = Alignment.center; + p5Table2Row0.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + p5Table2Row0.MergeCells(2, 4); + p5Table2Row0.Cells[2].Paragraphs[0].Append("百分比").Font(f).FontSize(10.5).Alignment = Alignment.center; + p5Table2Row0.Cells[2].FillColor = Color.FromArgb(209, 245, 203); + + Row p5Table2Row1 = p5rowsContent2[1]; + p5Table2Row1.Cells[0].Paragraphs[0].Append("结论").Font(f).FontSize(10.5).Alignment = Alignment.center; + p5Table2Row1.Cells[0].FillColor = Color.FromArgb(209, 245, 203); + p5Table2Row1.Cells[1].Paragraphs[0].Append("人员名单").Font(f).FontSize(10.5).Alignment = Alignment.center; + p5Table2Row1.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + p5Table2Row1.Cells[2].Paragraphs[0].Append("男性").Font(f).FontSize(10.5).Alignment = Alignment.center; + p5Table2Row1.Cells[2].FillColor = Color.FromArgb(209, 245, 203); + p5Table2Row1.Cells[3].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; + p5Table2Row1.Cells[3].FillColor = Color.FromArgb(209, 245, 203); + p5Table2Row1.Cells[4].Paragraphs[0].Append("合计").Font(f).FontSize(10.5).Alignment = Alignment.center; + p5Table2Row1.Cells[4].FillColor = Color.FromArgb(209, 245, 203); + p5Table2Row1.Cells[5].Paragraphs[0].Append("男性").Font(f).FontSize(10.5).Alignment = Alignment.center; + p5Table2Row1.Cells[5].FillColor = Color.FromArgb(209, 245, 203); + p5Table2Row1.Cells[6].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; + p5Table2Row1.Cells[6].FillColor = Color.FromArgb(209, 245, 203); + p5Table2Row1.Cells[7].Paragraphs[0].Append("平均").Font(f).FontSize(10.5).Alignment = Alignment.center; + p5Table2Row1.Cells[7].FillColor = Color.FromArgb(209, 245, 203); + p5Content1.InsertTableAfterSelf(p5Contenttable2); + + //第六页 + document.InsertParagraph().InsertPageBreakAfterSelf(); + document.InsertParagraph(@"前十大异常结果柱状图:").Font(f).FontSize(16); + document.InsertParagraph().Alignment = Alignment.center; + //var p6Chat1 = document.AddChart(); + //p6Chat1.AddLegend(ChartLegendPosition.Right, false); + //p6Chat1.BarDirection = BarDirection.Column;//指示柱状图是横向的还是纵向的:Column纵向,Bar横向 + //p6Chat1.BarGrouping = BarGrouping.Stacked;//这个不好解释,一个4个枚举值,你一一试一遍就知道了 + //p6Chat1.GapWidth = 200;//柱状图表的宽度 + //p6Chat1.GapWidth = 200; + //var usa = ChartData.CreateDisease(); + //var p6Chats1 = new Series("疾病人数"); + //p6Chats1.Color = Color.FromArgb(79, 129, 189); + //p6Chats1.Bind(usa, "Category", "Expenses"); + //p6Chat1.AddSeries(p6Chats1); + //document.InsertChart(p6Chat1); + document.InsertParagraph(); + document.InsertParagraph(@"前十大异常结果饼图:").Font(f).FontSize(16); + document.InsertParagraph().Alignment = Alignment.center; + //var p6Chat2 = document.AddChart(); + //p6Chat2.AddLegend(ChartLegendPosition.Right, true); + //var p6ChatData2 = ChartData.CreateException(); + + //// 创建饼图并绑定数据 + //var p6Chats2 = new Series("疾病人数百分比"); + //p6Chats2.Bind(p6ChatData2, "Category", "Expenses"); + //p6Chat2.AddSeries(p6Chats2); + //document.InsertChart(p6Chat2); + + //第七页 + document.InsertParagraph().InsertPageBreakAfterSelf(); + document.InsertParagraph(@"该部分针对贵单位员工在我中心体检时,所检出的各种异常情况提供相关的分析与医疗保健建议").Font(f).FontSize(10.5); + var p7Content = document.InsertParagraph(@"五、本次体检前十大异常结果分析").Font(f).FontSize(16); + + Table p7Contenttable = document.AddTable(2, 2); + p7Contenttable.Design = TableDesign.TableGrid; + p7Contenttable.SetColumnWidth(0, 130f); + p7Contenttable.SetColumnWidth(1, document.PageWidth - document.MarginLeft - document.MarginRight - 130f); + List p7rowsContent = p7Contenttable.Rows; + Row p7TableRow0 = p7rowsContent[0]; + p7TableRow0.Cells[0].Paragraphs[0].Append("疾病").Font(f).FontSize(10.5).Alignment = Alignment.center; + p7TableRow0.Cells[0].FillColor = Color.FromArgb(209, 245, 203); + p7TableRow0.Cells[1].Paragraphs[0].Append("建议").Font(f).FontSize(10.5).Alignment = Alignment.center; + p7TableRow0.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + p7Content.InsertTableAfterSelf(p7Contenttable); + document.InsertParagraph(); + var p7Content1 = document.InsertParagraph(@"六、体检者未完成情况").Font(f).FontSize(16); + + Table p7Contenttable1 = document.AddTable(2, 5); + p7Contenttable1.Design = TableDesign.TableGrid; + p7Contenttable1.SetColumnWidth(0, 110f); + p7Contenttable1.SetColumnWidth(1, 95f); + p7Contenttable1.SetColumnWidth(2, 45f); + p7Contenttable1.SetColumnWidth(3, 45f); + p7Contenttable1.SetColumnWidth(4, document.PageWidth - document.MarginLeft - document.MarginRight - 295f); + List p7rowsContent1 = p7Contenttable1.Rows; + Row p7Table2Row0 = p7rowsContent1[0]; + p7Table2Row0.Cells[0].Paragraphs[0].Append("体检号").Font(f).FontSize(10.5).Alignment = Alignment.center; + p7Table2Row0.Cells[0].FillColor = Color.FromArgb(209, 245, 203); + p7Table2Row0.Cells[1].Paragraphs[0].Append("姓名").Font(f).FontSize(10.5).Alignment = Alignment.center; + p7Table2Row0.Cells[1].FillColor = Color.FromArgb(209, 245, 203); + p7Table2Row0.Cells[2].Paragraphs[0].Append("性别").Font(f).FontSize(10.5).Alignment = Alignment.center; + p7Table2Row0.Cells[2].FillColor = Color.FromArgb(209, 245, 203); + p7Table2Row0.Cells[3].Paragraphs[0].Append("年龄").Font(f).FontSize(10.5).Alignment = Alignment.center; + p7Table2Row0.Cells[3].FillColor = Color.FromArgb(209, 245, 203); + p7Table2Row0.Cells[4].Paragraphs[0].Append("部门").Font(f).FontSize(10.5).Alignment = Alignment.center; + p7Table2Row0.Cells[4].FillColor = Color.FromArgb(209, 245, 203); + + p7Content1.InsertTableAfterSelf(p7Contenttable1); + /* + var numberedList = document.AddList("First List Item.", 0, ListItemType.Numbered); + //Add a numbered list starting at 2 + document.AddListItem(numberedList, "Second List Item."); + document.AddListItem(numberedList, "Third list item."); + document.AddListItem(numberedList, "First sub list item", 1); + + document.AddListItem(numberedList, "Nested item.", 3); + document.AddListItem(numberedList, "Fourth nested item."); + + var bulletedList = document.AddList("First Bulleted Item.", 0, ListItemType.Bulleted); + document.AddListItem(bulletedList, "Second bullet item"); + document.AddListItem(bulletedList, "Sub bullet item", 1); + document.AddListItem(bulletedList, "Second sub bullet item", 2); + document.AddListItem(bulletedList, "Third bullet item"); + document.InsertList(numberedList); + document.InsertList(bulletedList); + */ + document.InsertParagraph(); + document.InsertParagraph(@"七、常见体检异常结果分析及健康指导").Font(f).FontSize(16).SpacingAfter(10d).SetLineSpacing(LineSpacingType.Line, 13.8f); + document.InsertParagraph(@"◆ 颈椎疾病健康指导").Font(f).FontSize(14).SpacingAfter(10d).SetLineSpacing(LineSpacingType.Line, 13.8f); + document.InsertParagraph(@"【健康指导】").Font(f).FontSize(14).SpacingAfter(10d).SetLineSpacing(LineSpacingType.Line, 13.8f); + int index = document.Paragraphs.Count; + Formatting p7Formatting = new Formatting(); + p7Formatting.FontFamily = new Xceed.Document.NET.Font("宋体"); + p7Formatting.Size = 14; + + + var numberedList = document.AddList("颈椎病是指由于各种原因所致的颈椎结构的改变,如椎间盘的变性、突出,颈椎体边缘骨质增生,黄韧带肥厚、钙化或后纵韧带钙化,颈椎曲度异 常、椎间不稳等,直接压迫、刺激或通过压迫影响血液循环,使脊髓颈段、神经根、椎动脉或交感神经的功能损害,进而 发生组织结构损害,出现一系列临床征象,又有颈椎综合征之称。概括起来就是颈椎的椎间盘突出、骨质增生等压迫颈椎周围的神经、血管等导致的各种不适表现。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList, "哪些人易患颈椎病,从事文字、电脑工作人员及学生最易患颈椎病。颈椎病的发病,年青人主要是外因,即姿势式疲劳和损伤,主要以姿势 疲劳为主。长时间同一姿势伏案工作,颈肩部的肌肉一 下处于紧张强下状态,血液循环不畅,极易导致颈椎肌肉劳损。中学生的书包越来越重,导致姿势不适合人体正常的生理弯曲,久而久之易患颈椎病;喜欢玩电脑、打游戏机的中学生也因长时间颈部保持一个姿势而导致颈部肌肉痉挛、劳损而发生颈椎病;对于中老年人来说,颈椎病则是身体的退行性病变的表现。\n\t 家庭康复治疗法:", 0, ListItemType.Numbered, null, false, false, p7Formatting); + numberedList = document.AddListItem(numberedList, "如果不幸得颈椎病也不要紧张,应该及时就医。俗话说“三分治疗七分养”, 养即保养、康复预防之意。对于颈椎病,不要寄托在医院检查一下,吃些药就可以痊愈,该病本身就是一个退变性且极易复发的疾病。不注意疗效的巩固,很快可以再发作,所以应加倍注意。家庭的治疗如下。", 3, ListItemType.Numbered, null, false, false, p7Formatting); + numberedList = document.AddListItem(numberedList, "在急性期最好能够少活动。", 3, ListItemType.Numbered, null, false, false, p7Formatting); + numberedList = document.AddListItem(numberedList, "家里可以做自我牵引,如购买牵引带,一般情况下取 4~6 千克重 量,20~30 分钟/次,1~2 次/天或再多一点。牵引治疗 2~3 天,颈部肌肉紧张多可得至缓解,疼痛减轻。 或自己双手托住头部做向上拨伸的动作,效果一 样。", 3, ListItemType.Numbered, null, false, false, p7Formatting); + numberedList = document.AddListItem(numberedList, "头项部可以外敷中药膏药,必要时可以用中药水热敷,可以疏筋活络, 缓解疼痛, 口服消炎止痛药如扶他林、芬必得等。", 3, ListItemType.Numbered, null, false, false, p7Formatting); + numberedList = document.AddListItem(numberedList, "同时可以配合理疗,如微波红外线、针炙等。", 3, ListItemType.Numbered, null, false, false, p7Formatting); + numberedList = document.AddListItem(numberedList, "急性期疼痛明显,影响日常工作、生活甚至整夜难眠者,针剌或神经根封闭,不失 为 一种有效的治疗方法,但应选择正规专业医师操作,以免发生意外。", 3, ListItemType.Numbered, null, false, false, p7Formatting); + numberedList = document.AddListItem(numberedList, "日常防范方法:“防患于末然”对任何疾病都是适合的,不管有没有出现颈椎病的症状,改变不良工作生活习惯都非常重要,千万别委屈了你的脖子。 别委屈脖子对于经常低头工作的办公室工作人员,正确的姿势是关键,首先在坐姿上尽可能保持 自然的端坐位,头部略微前倾,保持头、颈、胸的正常生理曲 线,切不可头部过度前屈、身体前趴。对于长期伏案工作者,应每隔1小时左右,让颈部向左右转动数次,转动时应轻柔、缓慢,以达到该方向的最大运动范围为准;生活习惯低枕位休息,维持正常颈曲。选择适合自己的卧具,以晨起头颈无不适为度;改正躺在床上或沙发上,用垫子或枕头抬高头部看电视、看书的不良习 惯。", 3, ListItemType.Numbered, null, false, false, p7Formatting); + numberedList = document.AddListItem(numberedList, "避免有害的活动 对长时间下象棋、打麻将者,奉劝还是少一些“娱乐”,多一些运动,因此种“娱乐”逐渐导致颈椎病的非常多见。 颈椎保健操要防止颈椎病的发生,除了要纠正不良姿势,注意防潮、防冷外,还应积极加强锻炼, 经常活动颈部,多做伸颈运动。办公室人员没时间锻炼,最 简单的锻炼可以以颈部为笔,头部为笔尖,反复写“米”字。这种伸颈运动可以改善颈部肌肉韧带的供血,使血液循环加 快,使肌肉韧带更加强壮,预防骨质疏松,从而减少颈 椎病的发生。", 3, ListItemType.Numbered, null, false, false, p7Formatting); + document.InsertList(numberedList); + document.InsertParagraph(@"◆ 代谢性疾病健康指导").Font(f).FontSize(16); + document.InsertParagraph(@" 代谢性疾病主要为生活方式病,包括超重、肥胖、血糖偏高、血压偏高、高血脂、脂 肪肝、高尿酸等。").Font(f).FontSize(14); + document.InsertParagraph(@"【高血脂】").Font(f).FontSize(14); + document.InsertParagraph(@" 形成原因:膳食结构不合理,食物中胆固醇和饱和脂肪酸摄入过多,总热量过高, 应酬较多;体力活动过少;就个体而言与遗传基因有关。因此防治高血脂和肥胖对减少 冠心病、脑卒中,糖尿病、脂肪肝、胆结石的患病率和心脑血管意外有重要意义。").Font(f).FontSize(14); + document.InsertParagraph(@" 预防建议:").Font(f).FontSize(14); + var numberedList1 = document.AddList("用低脂、低热、低糖饮食、限制动物性脂肪、肥肉、禽类皮、动物内脏、浓肉汤、鱿鱼、墨斗鱼、鱼籽和蟹黄,少吃蛋黄,甜食,多吃蔬菜、水果和富含纤维素食物,提倡吃八分饱;", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList1, "持之以恒,坚持有氧运动,有氧运动有利于降低血脂,减肥, 降血压,预防糖尿病和减少血栓形成。有氧运动以运动后心率达到最大心率的 50~70% 为宜(最大心率=220-年龄)。运动方式可选择:快走、慢跑、骑车、爬楼梯和游泳等各 种可坚持的运动,每周不少于五天,每天不少于 20-40 分钟。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.InsertList(numberedList1); + document.InsertParagraph(@"【超重或肥胖】").Font(f).FontSize(14); + var numberedList2 = document.AddList("概念:体重超重或肥胖是指体内脂肪积聚过多和(或)分布异常、体重增加,是由于遗 传或环境因素共同作用的结果。1999年,世界卫生组织已正式宣布肥胖为一种疾病。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList2, "危害:", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList2, "寿命缩短:男性肥胖者的死亡率是正常人的1.5倍,女性是1.47倍。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList2, "危害心理健康:影响美观、生活不便,会产生自卑、焦虑和抑郁等问题。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList2, "诱发疾病:肥胖是导致2型糖尿病、心血管疾病、高血压、胆结石和癌症、内分泌、 代谢紊乱的重要危险因素。也可以引起关节痛、浮肿、活动耐力降低等。此外,肥胖还易使皮肤脆性增加,易发生皮炎、摩擦伤、并容易合并化脓性或真菌感染。 肥胖严重威胁健康,医学界称肥胖、高血压、高血脂和高血糖为“死亡四重奏”。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList2, "原因(发病危险因素):\r\tA、遗传因素:家族史。 B、不良生活方式:偏爱高脂肪、高热量饮食,睡前或夜间用餐,体力活动少等。 C、年龄因素:男性中年以后,女性绝经期后生理功能减退,代谢减低,体力活动减少,而饮食摄入量未相应减少,造成摄入量超过消耗量而致肥胖。 D、精神因素:精神过度紧张及心理障碍,可引起食欲亢进,导致肥胖。 E、其他因素:药物、疾病等引起。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList2, "症状与表现: A、男性肥胖多表现为“苹果型”肥胖,即内脏型或向心型肥胖脂肪沉积在腹部、臀部和背部;女性肥胖多表现为“梨型”肥胖,脂肪主要沉积在臀部、大腿。 B、中度以上肥胖者可出现活动后心悸、气短、嗜睡等症状。重度肥胖者可出现呼吸困难、浮肿、发绀、阵发性睡眠呼吸暂停综合症等。 C、合并高血压、糖尿病、血脂异常、痛风者可出现相应症状。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList2, "防治: 非药物治疗", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList2, "认识肥胖症的危害;认识到单纯性肥胖是一种生活方式疾病;认识治疗肥胖症是一个自我控制的过程。改变生活方式,矫正饮食、行为习惯。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList2, "控制摄入量,低脂、低热量、低嘌呤、低盐饮食,戒烟限酒。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList2, "运动治疗,增加体力活动,加强锻炼。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.InsertList(numberedList2); + document.InsertParagraph(@"【血糖偏高】").Font(f).FontSize(14); + var numberedList3 = document.AddList("糖尿病诊断标准:", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList3, "症状+随机血糖≥11.1mmol/L;", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList3, "空腹血糖(FPG)≥7.0mmol/L(非同日两次空腹血糖);", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList3, "糖耐量试验(OGTT)中2小时血浆葡萄糖(2HPG)≥11.1mmol/L。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList3, "血糖增高预防建议:", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList3, "普及糖尿病知识,充分认识糖尿病正在我国已进入多数的严重形势和预防方法。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList3, "合理膳食避免营养过剩,提倡用低脂,少糖,富含纤维的膳食;C 坚持有氧运动。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList3, "避免使用影响糖代谢的药物。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList3, "定期复查血糖。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList3, "年龄大于40岁,有糖尿病家族史,血糖或尿糖曾经异常者,应查餐后两小时血糖。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList3, "糖尿病综合治疗原则:", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList3, "糖尿病教育。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList3, "合理的饮食治疗。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList3, "坚持运动治疗。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList3, "正规的 药物治疗。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList3, "定期病情监测。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.InsertList(numberedList3); + document.InsertParagraph(@"【高血压】").Font(f).FontSize(14); + var numberedList4 = document.AddList("诊断标准:1999 年 10 月中国高血压联盟推荐新高血压诊断标准,未服降压药的情况下:收缩压≥140mmHg 和(或)舒张压≥90mmHg,即诊断高血压。以非同日多次(二次或 以上)复测平均值为依据,偶然一次不能诊断高血压。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList4, "危害:患了高血压病,如果不加以控制,可导致脑卒中或冠心病等,将严重影响生 活质量,甚至威胁到生命。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList4, "高血压病存在患病率高、致残率高、死亡率高,知晓率低、治疗率低、控制率低的 现象,也就是人们通常所说的“三高”、“三低”。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList4, "病因或发病危险因素:", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList4, "体重超重或肥胖:体重超重和体重增加过快,是高血压病的危险因素。尤其内脏型肥胖,同时也是糖尿病和血脂异常的危险因素。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList4, "饮酒:长期饮白酒达 50ml/每天以上,也是高血压病发病的危险因素;少量饮些红 葡萄酒可有预防冠心病的作用。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList4, "长期高盐、低镁、低钙、低动物蛋白质饮食;膳食钠盐的摄入量与血压水平有显著 的相关性。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList4, "长期精神紧张或超负荷工作,也是高血压病的危险因素。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList4, "高血压的防治:", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList4, "增强自我保健意识,学会自我保健知识。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList4, "定期监测:35岁以上人群至少每年要检查一次血压,以利早期发现血压增高,降低 人群高血压的发病率和患病率。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList4, "预防超重和肥胖,保持理想体重,其中饮食(低盐、高钾、高钙、高动物蛋白质饮 食如奶类、动制品、鱼类、菜果类)、运动疗法(保持规律有氧运动非常重要),运动降压效 果最直接。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList4, "讲究精神卫生;E、不吸烟;F、药物治疗原则。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.InsertList(numberedList4); + document.InsertParagraph(@"【脂肪肝】").Font(f).FontSize(14); + var numberedList5 = document.AddList("病因:目前我国脂肪肝发病率有增高趋势,多数与肥胖、高脂血症(以甘油三脂增 高关系更密切)、糖尿病、肝炎病史及嗜酒有关。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList5, "建议:脂肪肝可双向发展,有效控制或消除上述促发因素,脂肪肝可明改善,因此建议: A 用低脂膳食,治疗高血脂症;B 坚持有氧运动,控制体重; C 限酒; D 避免对肝脏有害的药物; E 药物治疗:目前尚无明显有效治疗脂肪肝的药物,若肝 功能明显异常可选用保肝药物。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.InsertList(numberedList5); + document.InsertParagraph(@"【高尿酸】").Font(f).FontSize(14); + var numberedList6 = document.AddList("何谓高尿酸血症:\r\t嘌呤代谢物为尿酸,男性每 100 毫升血液中尿酸值在 8.7 毫克以上,女性 8 毫克以 上时,则称为高尿酸血症。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList6, "建议:", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList6, "每天至少 2000mI 液体,多摄取低嘌呤、碱性食物,例如蔬菜。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList6, "避免高嘌呤食物。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList6, "避免喝酒、油炸食物。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList6, "避免摄取肉汤或高汤。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList6, "食欲不佳时,须注意补充含糖液体,以避免身体组织快速分解,诱发痛风。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList6, "避免暴饮暴食。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList6, "避免饥饿,因为肌肉被分解,致尿酸排出。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList6, "避免使用阿司匹林类药物,以免妨碍尿酸排出。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList6, "急性期:应去医院看病,选择药物治疗。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList6, "缓解期:促进身体活动,应酌量选择(表二)食物,平时可多选择表一食物,少用高嘌 呤食物(表三)。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList6, "维持理想体重:理想体重(公斤)=22×身高 2 (平方公尺)。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList6, "痛风石的部位应注意保护皮肤,维持完整性。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.InsertList(numberedList6); + document.InsertParagraph(@"◆ 眼科疾病").Font(f).FontSize(14); + var numberedList7 = document.AddList("眼病体检的目的:", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList7, "及早发现眼病隐患:如青光眼、糖尿病视网膜病变。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList7, "眼病咨询:如白内障是否需手术?视力不好是否需配镜?", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList7, "对全身健康状况评估,眼底是全身情况的缩印,高血压、高血糖、高血脂造成器官损害之前,在眼底会有所表现。我们在眼病筛查中对每一个受检者都进行了解释。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList7, "建议:", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList7, "结膜炎,请注意用眼卫生,如症状明显,可局部 治疗。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList7, "眼底杯盘比,建议到专科医院,测眼压,查视 野等。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList7, "视网膜动脉硬化,建议低盐、清淡饮食,并请关注 血压、血脂、血糖及动脉硬化的防治。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList7, "青光眼或可疑青光眼,需到医院青光眼专科复查。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList7, "白内障需,考虑手术治疗。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList7, "糖尿病性视网膜病变,Ⅲ期以下者需要控制血糖并每半年或一年观察眼底,Ⅲ 期及以上者应尽快到医院就诊。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList7, "视网膜病变,需要监测血压和血糖情况并做相应治疗。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList7, "黄斑病变,视力小于 0.3 时到医院就诊(陈旧性者不必复诊)。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList7, "视网膜血管病变,监测血压和血糖情况做相应处理,非陈旧性者需医院就诊。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList7, "视神经病变(萎缩/缺血性),需要检测血压血糖,每年随诊观察。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.InsertList(numberedList7); + document.InsertParagraph(@"◆ 耳鼻喉疾病").Font(f).FontSize(14); + var numberedList8 = document.AddList("过敏性鼻炎:建议查找过敏原,并避免与其接触,必要时专科治疗,平时注意加强锻炼, 增强机体免疫力,预防感冒。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList8, "慢性咽炎:若症状明显,请专科治疗,平时少吃辛辣食物,少作长谈,避免有害气体及 粉尘的刺激。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList8, "慢性鼻炎:请专科治疗,平时注意增强体质,提高机体抵抗力,预防感冒,祛除诱因。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList8, "慢性扁桃体炎:请注意锻炼身体,增强体质,防止感冒,如反复发作请专科进一步治疗。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.InsertList(numberedList8); + document.InsertParagraph(@"◆ 肝胆疾病").Font(f).FontSize(14); + document.InsertParagraph(@"【肝功异常】").Font(f).FontSize(14); + document.InsertParagraph(@"转氨酶除在肝脏外,还可分布在心、肾、骨骼肌、胰等组织中,当这些组织有病时, 也会引起血清转氨酶活性升高。如心肌炎、急性心肌梗塞时,血清转氨酶活性均会升高,除此之外,如胆石症、甲状腺机能亢进、伤寒、疟疾、感冒、大量服用阿斯匹林等,都可使血 清转氨酶升高,甚至在某些生理条件下如剧烈运动等,也会使转氨酶升高。").Font(f).FontSize(14); + document.InsertParagraph(@"因此我们绝对不能一看到转氨酶升高就诊断为肝炎,而必须结合病人具体情况如症状 体征及其他检查综合分析,做出诊断,应注意以下几个问题:").Font(f).FontSize(14); + var numberedList9 = document.AddList("血清转氨酶升高,仍以病毒性肝炎最为常见,而且转氨酶升高的幅度大(在正常值4 倍以上),且持续时间很长(大于 1 个月)。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList9, "肝病时,转氨酶升高,只表示肝细胞受损,不能区别肝病的性质。如病毒性肝炎、 药物性肝炎等,都能使转氨酶升高。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList9, "在临床上如发现转氨酶(特别是 ALT)下降,而胆红素反升高,往往说明病人病情严重,预后不良。如急性或亚急性重症肝炎。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList9, "某些慢性肝炎或肝炎恢复期,转氨酶可以正常。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList9, "总之,不能单靠转氨酶来诊断或否定肝炎,必须结合其他化验结果和临床表现进行全方面分析,方能诊断。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.InsertList(numberedList9); + document.InsertParagraph(@"【肝囊肿、肝血管瘤】").Font(f).FontSize(14); + document.InsertParagraph(@"应该定期复查,动态观察变化,必要专科时治疗,平时注意不要受外力撞击,以免破裂").Font(f).FontSize(14); + document.InsertParagraph(@"【胆囊结石】").Font(f).FontSize(14); + var numberedList10 = document.AddList("预防肠道寄生虫和细菌感染;", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList10, "饮食控制,少吃动物内脏鱼籽,蛋黄等高胆固醇膳食,增加膳食中纤维素含量。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList10, "控制体重;", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList10, "纠正久坐少动的生活习惯。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList10, "治疗:无并发症的胆结石,可根据个体情况选择;", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList10, "利胆排石综合治疗。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList10, "药物溶石。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList10, "体外碎石。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList10, "内窥镜取石。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList10, "腹腔镜手术。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList10, "外科胆囊切除术等治疗。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.InsertList(numberedList10); + document.InsertParagraph(@"【胆囊息肉】").Font(f).FontSize(14); + document.InsertParagraph(@"胆囊息肉主要由慢性炎症引起,如息肉进一步增大,和/或合并胆囊多发结石,考虑手术治 疗;一般情况定期复查。").Font(f).FontSize(14); + document.InsertParagraph(@"◆ 心血管疾病").Font(f).FontSize(14); + var numberedList11 = document.AddList("T 波、ST-T 改变引起 T 波、ST-T 段改变的原因很多,需结合有关临床资料,综合分析做出诊断。有冠心病危险因素的人(A、有冠心病家庭史;B、高胆固醇血症;C、高血 压;D、糖尿病;E 吸烟;F 肥胖)近期出现上述心电图改变,与心肌缺血有关,可疑者需 专科医院进一步检查。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList11, "完全性右束支传导阻滞 可见于有器质性心脏病(冠心病、高血压性心脏病)者,偶 见于正常人。应注意复查心电图,有症状及时专科诊治。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList11, "房室传导阻滞:是比较常见的心律失常,在正常人群中的检出率约为 2%-5%,在器质 性心脏病患者中约占 20%-30%。它是心脏传导阻滞中最常见,也是很重要的一种。应注意 复查心电图,有症状及时专科诊治。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList11, "心脏早搏:无心脏病背景者,多为生理性原因,可半年复查;如频发早搏,请及时就 医;有心脏病者伴有早搏,建议专科治疗。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList11, "房颤:是一种十分常见的心律失常。据统计,60 岁以上人群中,房颤发生率 1%,并 随年龄而增加。有症状请专科就诊。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList11, "由于人们饮食习惯、生活习惯的改变,造成高脂血症患者增加, 若血脂质过高不加以 控制,再加上高血压、抽烟等因素的影响,使脂质沉淀物沉积在血管壁上,越积越厚,以致 血管管腔狭小,血流不通,使组织缺氧与营养缺乏, 这种情形发生在心脏冠状动脉时,首 先,引起心绞痛。若不积极治疗最后会造成心肌梗塞。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList11, "所以一旦出了问题应及早治疗並纠正不良饮食习惯,防止病情恶化,即使进行药物治 疗或医疗手术改善病情,仍然要配合饮食控制才能减少再复发的机会。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList11, "心血管疾病饮食原则:", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList11, "维持理想体重。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList11, "控制脂质总摄入量。烹调时应注意用油量,宜多采用清蒸、 水煮、凉拌、燉、滷 等方式,禁用油炸的烹调方式,並少吃肥肉、鸡皮等油脂含量高的食物。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList11, "炒菜用油宜选用单元不饱和脂肪酸高者(如:橄榄油、菜籽 油、花生油);少用 饱和脂肪酸高者(如:猪油)。少吃胆固醇含量高的食物,如内脏类、蝦卵、鱼卵等,蛋可以吃但每周不超过二 到三个蛋黄为原则。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList11, "避免富含精制糖的食物(如蛋糕、甜食)。(见附表:富含 精制糖的食物)。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList11, "攝取富含 W-3 脂肪酸的鱼类(秋刀鱼、鲑鱼、鳗鱼等)。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList11, "减少钠量攝取。罐头、醃制食品及各种加工食品含钠量高, 应忌食。宜选择新鲜 食物自行制作,烹调时减少食盐的用量,其它含钠量高的调味品(味精、酱油、乌醋等)应 减少或避免使用。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList11, "多摄取含纤维质的食物(全穀类、蔬菜类、水果)。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList11, "避免烟、酒、含咖啡因饮料及其他刺激性食品。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList11, "有服用抗凝血剂的病患,要减少含维生素 K 多的食物,如绿色蔬菜(菠菜、甘蓝菜、萵苣、绿花椰菜)、肝脏。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.InsertList(numberedList11); + document.InsertParagraph(@"◆ 肾脏疾病").Font(f).FontSize(14); + var numberedList12 = document.AddList("肾结石\n建议平时多饮水,少吃高草酸食物,可做蹦跳运动,避免感染,请定期复查,必要时排石治疗。", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList12, "肾囊肿", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList12, "请定期复查,观察变化,若有症状专科治疗。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList12, "肾功能异常:建议控制膳食中蛋白质比例,近期复查,必要时专科诊治。如有肾脏病史,请及时肾内科诊治。", 1, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList12, "肾错构瘤\n属良性肿瘤,请定期复查,如有症状专科治疗", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.AddListItem(numberedList12, "肾萎缩、肾盂增大\n建议专科进一步诊治", 0, ListItemType.Numbered, null, false, false, p7Formatting); + document.InsertList(numberedList12); + for (int i = index; i < document.Paragraphs.Count; i++) + { + document.Paragraphs[i].SpacingAfter(10d).SetLineSpacing(LineSpacingType.Line, 13.8f); + ///document.Paragraphs[i].Alignment = Alignment.both; + } + //结束语页 + document.InsertParagraph().InsertPageBreakAfterSelf(); + document.InsertParagraph(@"结束语").Font(f).FontSize(14).Bold(true); + document.InsertParagraph(); + document.InsertParagraph(@"影响健康的因素很多,包括遗传基因、日常生活习惯、社会环境、医疗资源等等,其中,与一般民众息息相关的医疗资源,仅占影响健康因素的10%,最大的影响因素还是日常生活习惯及社会环境。根据世界卫生组织(WHO)的估计,75%的癌症是已知的环境因素所引起,而这些因素都是可以预防的,例如抽烟、酗酒。").Font(f).FontSize(10.5).IndentationFirstLine = 32.0f; + document.InsertParagraph(); + document.InsertParagraph(@"世界卫生组织(WHO)指出:“二十一世纪的医学不应该继续以疾病为主要研究对象,而应该以人类健康作为医学研究的主要方向。” 这个精神旨在宣告预防医学和健康保健将成为医学的主导。").Font(f).FontSize(10.5).IndentationFirstLine = 32f; + document.InsertParagraph(); + document.InsertParagraph(@"我中心愿以卓越的服务、优质的技术继续为贵单位提供医疗保健服务,从体检中发现健康问题,从保健中解决健康问题。").Font(f).FontSize(10.5).IndentationFirstLine = 32f; + document.InsertParagraph(); + document.InsertParagraph(@"最后,感谢您对国宾的支持,别忘了定期为员工安排健康检查。您的任何意见,都是我们成长的来源!敬请不吝指教。").Font(f).FontSize(10.5).IndentationFirstLine = 32f; + document.InsertParagraph().InsertPageBreakAfterSelf(); + //检后服务 + Xceed.Document.NET.Font f1 = new Xceed.Document.NET.Font("黑体"); + Xceed.Document.NET.Font f2 = new Xceed.Document.NET.Font("楷体"); + Formatting pBottomFirstFormatting = new Formatting(); + pBottomFirstFormatting.FontFamily = new Xceed.Document.NET.Font("黑体"); + pBottomFirstFormatting.Size = 14; + Formatting pBottomLastFormatting = new Formatting(); + pBottomLastFormatting.FontFamily = new Xceed.Document.NET.Font("黑体"); + pBottomLastFormatting.Size = 10.5; + document.InsertParagraph(@"检后服务").Font(f1).FontSize(18); + document.InsertParagraph(@"健康体检后,您需要健康维护和管理:").Font(f1).FontSize(10.5); + var svr1 = document.InsertParagraph().Font(f1).FontSize(10.5); + svr1.InsertText("1.", false, pBottomLastFormatting); + svr1.InsertText("检后就诊", false, pBottomFirstFormatting); + svr1.InsertText("--体检中发现的疾病由国内著名、省内著名的专家为您对接就诊,真正起到早发现、早诊断、早治疗。", false, pBottomLastFormatting); + var svr2 = document.InsertParagraph().Font(f1).FontSize(10.5); + svr2.InsertText("2.", false, pBottomLastFormatting); + svr2.InsertText("常见病、疑难病预约就诊服务", false, pBottomFirstFormatting); + svr2.InsertText("--请拨打健康服务热线。我们可以帮您用最短的时间预约上最合适您病情的专家,他们为国内著名、省内著名的专家在您需要时我们还可以通过绿色通道帮您预约外省外院著名专家。", false, pBottomLastFormatting); + document.InsertParagraph("3.体检报告电话咨询服务。").Font(f1).FontSize(10.5); + document.InsertParagraph("4.特殊检查预约服务(CT、MR等大型检查设备)。").Font(f1).FontSize(10.5); + document.InsertParagraph("5.住院预约服务。").Font(f1).FontSize(10.5); + document.InsertParagraph("6.外院就诊指导。").Font(f1).FontSize(10.5); + document.InsertParagraph("您 健 康 的 管 家").Font(f1).FontSize(18).Italic(true).Alignment = Alignment.center; + document.InsertParagraph("人生中偶然的病痛--有我们的关怀").Font(f2).FontSize(18).Bold(true).Italic(true).Alignment = Alignment.center; + document.InsertParagraph("健康体检中心").Font(f).FontSize(16).Alignment = Alignment.center; + document.InsertParagraph("团体体检汇总报告").Font(f).FontSize(16).Alignment = Alignment.center; + document.InsertParagraph("企业员工健康检查统计报告").Font(f1).FontSize(22).Alignment = Alignment.center; + document.InsertParagraph("【版权所有,翻印必究】").Font(f).FontSize(10.5).Alignment = Alignment.center; + document.Save(); + } + + + /// + /// 生成参检人员构成情况数据 1 + /// + public async Task CreateInspectionPersonnelData(UnitPhysicalExaminationReportExportWordData documentData, CreateInspectionPersonnelPara customerOrgs) + { + + var query = await _patientRegisterRepository.GetQueryableAsync(); + + if (customerOrgs.CustomerOrgGroupId.Any()) + { + query = query.Where(m => m.CustomerOrgGroupId != null && customerOrgs.CustomerOrgGroupId.Contains(m.CustomerOrgGroupId.Value)); + } + if (customerOrgs.CustomerOrgRegisterId != GuidFlag.PersonCustomerOrgRegisterId) + { + query = query.Where(m => m.CustomerOrgRegisterId == customerOrgs.CustomerOrgRegisterId); + } + + var customerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(customerOrgs.CustomerOrgId); + query = query.Where(m => customerOrgIds.Contains(m.CustomerOrgId)); + + + if (customerOrgs.DateType == '1') + { + query = query.Where(m => m.CreationTime >= Convert.ToDateTime(customerOrgs.StartDate) && + m.CreationTime < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + else if (customerOrgs.DateType == '2') + { + query = query.Where(m => m.MedicalStartDate != null && m.MedicalStartDate.Value.ToDateTime(TimeOnly.MinValue) >= Convert.ToDateTime(customerOrgs.StartDate) && + m.MedicalStartDate.Value.ToDateTime(TimeOnly.MinValue) < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + else if (customerOrgs.DateType == '3') + { + query = query.Where(m => m.SummaryDate != null && m.SummaryDate.Value.ToDateTime(TimeOnly.MinValue) >= Convert.ToDateTime(customerOrgs.StartDate) && + m.SummaryDate.Value.ToDateTime(TimeOnly.MinValue) < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + + + var queryList = query.ToList(); + + #region 登记 + + int Register_MaleNumber = queryList.Where(m => m.SexId == SexFlag.Male).Count(); + int Register_FemaleNumber = queryList.Where(m => m.SexId == SexFlag.Female).Count(); + int Register_OtherNumber = queryList.Where(m => m.SexId == SexFlag.UnKnown).Count(); + int Register_TotalNumber = Register_MaleNumber + Register_FemaleNumber + Register_OtherNumber; + string Register_MaleRatio = Register_TotalNumber != 0 ? Math.Round(Register_MaleNumber * 100M / Register_TotalNumber, 2).ToString() + "%" : "0%"; + string Register_FemaleRatio = Register_TotalNumber != 0 ? Math.Round(Register_FemaleNumber * 100M / Register_TotalNumber, 2).ToString() + "%" : "0%"; + string Register_MaleExamineRatio = "100%"; + string Register_FemaleExamineRatio = "100%"; + string Register_AverageExamineRatio = "100%"; + + + documentData.RegisterDetail = new InspectionPersonnel_Detail + { + MaleNumber = Register_MaleNumber, + FemaleNumber = Register_FemaleNumber, + OtherNumber = Register_OtherNumber, + TotalNumber = Register_TotalNumber, + MaleRatio = Register_MaleRatio, + FemaleRatio = Register_FemaleRatio, + MaleExamineRatio = Register_MaleExamineRatio, + FemaleExamineRatio = Register_FemaleExamineRatio, + AverageExamineRatio = Register_AverageExamineRatio + }; + #endregion + + #region 实检 + + int Checked_MaleNumber = queryList.Where(m => (m.CompleteFlag == PatientRegisterCompleteFlag.PartInspected || m.CompleteFlag == PatientRegisterCompleteFlag.GeneralInspected) + && m.SexId == SexFlag.Male).Count(); + int Checked_FemaleNumber = queryList.Where(m => (m.CompleteFlag == PatientRegisterCompleteFlag.PartInspected || m.CompleteFlag == PatientRegisterCompleteFlag.GeneralInspected) + && m.SexId == SexFlag.Female).Count(); + int Checked_OtherNumber = queryList.Where(m => (m.CompleteFlag == PatientRegisterCompleteFlag.PartInspected || m.CompleteFlag == PatientRegisterCompleteFlag.GeneralInspected) + && m.SexId == SexFlag.UnKnown).Count(); + int Checked_TotalNumber = Checked_MaleNumber + Checked_FemaleNumber + Checked_OtherNumber; + string Checked_MaleRatio = Checked_TotalNumber != 0 ? Math.Round(Checked_MaleNumber * 100M / Checked_TotalNumber, 2).ToString() + "%" : "0%"; + string Checked_FemaleRatio = Checked_TotalNumber != 0 ? Math.Round(Checked_FemaleNumber * 100M / Checked_TotalNumber, 2).ToString() + "%" : "0%"; + string Checked_MaleExamineRatio = Register_MaleNumber != 0 ? Math.Round(Checked_MaleNumber * 100M / Register_MaleNumber, 2).ToString() + "%" : "0%"; + string Checked_FemaleExamineRatio = Register_FemaleNumber != 0 ? Math.Round(Checked_FemaleNumber * 100M / Register_FemaleNumber, 2).ToString() + "%" : "0%"; + string Checked_AverageExamineRatio = Math.Round( + (Register_MaleNumber != 0 ? Math.Round(Checked_MaleNumber * 100M / Register_MaleNumber, 2) : 0 + + Register_FemaleNumber != 0 ? Math.Round(Checked_FemaleNumber * 100M / Register_FemaleNumber, 2) : 0) / 2, 2 + ).ToString() + "%"; + + documentData.CheckedDetail = new InspectionPersonnel_Detail + { + MaleNumber = Checked_MaleNumber, + FemaleNumber = Checked_FemaleNumber, + OtherNumber = Checked_OtherNumber, + TotalNumber = Checked_TotalNumber, + MaleRatio = Checked_MaleRatio, + FemaleRatio = Checked_FemaleRatio, + MaleExamineRatio = Checked_MaleExamineRatio, + FemaleExamineRatio = Checked_FemaleExamineRatio, + AverageExamineRatio = Checked_AverageExamineRatio + }; + #endregion + + #region 未检 + + int UnChecked_MaleNumber = queryList.Where(m => (m.CompleteFlag == PatientRegisterCompleteFlag.PartInspected || m.CompleteFlag == PatientRegisterCompleteFlag.GeneralInspected) + && m.SexId == SexFlag.Male).Count(); + int UnChecked_FemaleNumber = queryList.Where(m => (m.CompleteFlag == PatientRegisterCompleteFlag.PartInspected || m.CompleteFlag == PatientRegisterCompleteFlag.GeneralInspected) + && m.SexId == SexFlag.Female).Count(); + int UnChecked_OtherNumber = queryList.Where(m => (m.CompleteFlag == PatientRegisterCompleteFlag.PartInspected || m.CompleteFlag == PatientRegisterCompleteFlag.GeneralInspected) + && m.SexId == SexFlag.UnKnown).Count(); + int UnChecked_TotalNumber = UnChecked_MaleNumber + UnChecked_FemaleNumber + UnChecked_OtherNumber; + string UnChecked_MaleRatio = UnChecked_TotalNumber != 0 ? Math.Round(UnChecked_MaleNumber * 100M / UnChecked_TotalNumber, 2).ToString() + "%" : "0%"; + string UnChecked_FemaleRatio = UnChecked_TotalNumber != 0 ? Math.Round(UnChecked_FemaleNumber * 100M / UnChecked_TotalNumber, 2).ToString() + "%" : "0%"; + string UnChecked_MaleExamineRatio = Register_MaleNumber != 0 ? Math.Round(UnChecked_MaleNumber * 100M / Register_MaleNumber, 2).ToString() + "%" : "0%"; + string UnChecked_FemaleExamineRatio = Register_FemaleNumber != 0 ? Math.Round(UnChecked_FemaleNumber * 100M / Register_FemaleNumber, 2).ToString() + "%" : "0%"; + string UnChecked_AverageExamineRatio = Math.Round( + (Register_MaleNumber != 0 ? Math.Round(UnChecked_MaleNumber * 100M / Register_MaleNumber, 2) : 0 + + Register_FemaleNumber != 0 ? Math.Round(UnChecked_FemaleNumber * 100M / Register_FemaleNumber, 2) : 0) / 2, 2).ToString() + "%"; + + documentData.UnCheckedDetail = new InspectionPersonnel_Detail + { + MaleNumber = UnChecked_MaleNumber, + FemaleNumber = UnChecked_FemaleNumber, + OtherNumber = UnChecked_OtherNumber, + TotalNumber = UnChecked_TotalNumber, + MaleRatio = UnChecked_MaleRatio, + FemaleRatio = UnChecked_FemaleRatio, + MaleExamineRatio = UnChecked_MaleExamineRatio, + FemaleExamineRatio = UnChecked_FemaleExamineRatio, + AverageExamineRatio = UnChecked_AverageExamineRatio + }; + #endregion + } + + /// + /// 生成体检项目的参检情况数据 2 + /// + /// + /// + /// + public async Task CreateMedicalItemExamineSituationData(UnitPhysicalExaminationReportExportWordData documentData, CreateInspectionPersonnelPara customerOrgs) + { + var query = from a in await _patientRegisterRepository.GetQueryableAsync() + join b in await _registerCheckRepository.GetQueryableAsync() on a.Id equals b.PatientRegisterId + join c in await _registerAsbitemRepository.GetQueryableAsync() on b.Id equals c.RegisterCheckId + join d in await _asbitemRepository.GetQueryableAsync() on c.AsbitemId equals d.Id + join e in await _itemTypeRepository.GetQueryableAsync() on d.ItemTypeId equals e.Id into ee + from ae in ee.DefaultIfEmpty() + join f in await _sexRepository.GetQueryableAsync() on a.SexId equals f.Id into ff + from af in ff.DefaultIfEmpty() + select new + { + CustomerOrgGroupId = a.CustomerOrgGroupId, + CustomerOrgRegisterId = a.CustomerOrgRegisterId, + CustomerOrgId = a.CustomerOrgId, + PatientRegisterId = a.Id, + CreationTime = a.CreationTime, + MedicalStartDate = a.MedicalStartDate, + SummaryDate = a.SummaryDate, + SexId = a.SexId, + SexName = af != null ? af.DisplayName : "", + ItemTypeName = ae != null ? ae.DisplayName : "", + AsbitemName = d.DisplayName, + c + }; + + + if (customerOrgs.CustomerOrgGroupId.Any()) + { + query = query.Where(m => m.CustomerOrgGroupId != null && customerOrgs.CustomerOrgGroupId.Contains(m.CustomerOrgGroupId.Value)); + } + if (customerOrgs.CustomerOrgRegisterId != GuidFlag.PersonCustomerOrgRegisterId) + { + query = query.Where(m => m.CustomerOrgRegisterId == customerOrgs.CustomerOrgRegisterId); + } + + var customerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(customerOrgs.CustomerOrgId); + query = query.Where(m => customerOrgIds.Contains(m.CustomerOrgId)); + if (customerOrgs.DateType == '1') + { + query = query.Where(m => m.CreationTime >= Convert.ToDateTime(customerOrgs.StartDate) && + m.CreationTime < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + else if (customerOrgs.DateType == '2') + { + query = query.Where(m => m.MedicalStartDate != null && m.MedicalStartDate.Value.ToDateTime(TimeOnly.MinValue) >= Convert.ToDateTime(customerOrgs.StartDate) && + m.MedicalStartDate.Value.ToDateTime(TimeOnly.MinValue) < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + else if (customerOrgs.DateType == '3') + { + query = query.Where(m => m.SummaryDate != null && m.SummaryDate.Value.ToDateTime(TimeOnly.MinValue) >= Convert.ToDateTime(customerOrgs.StartDate) && + m.SummaryDate.Value.ToDateTime(TimeOnly.MinValue) < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + + var medicalItemExamineSituations = query.GroupBy(g => g.PatientRegisterId).Select(s => new UnitPhysicalExaminationReportExportWordData_MedicalItemExamineSituation + { + AsbitemName = s.FirstOrDefault().AsbitemName, + ItemTypeName = s.FirstOrDefault().ItemTypeName, + MaleAsbitemCheckNumber = s.Where(m => m.SexId == SexFlag.Male).Count(), + FemaleAsbitemCheckNumber = s.Where(m => m.SexId == SexFlag.Female).Count(), + TotalAsbitemCheckNumber = s.Where(m => m.SexId == SexFlag.Male || m.SexId == SexFlag.Female).Count(), + MaleSumCheckNumber = documentData.CheckedDetail.MaleNumber, + FemaleSumCheckNumber = documentData.CheckedDetail.FemaleNumber, + TotalSumCheckNumber = documentData.CheckedDetail.MaleNumber + documentData.CheckedDetail.FemaleNumber, + MaleAsbitemCheckRatio = documentData.CheckedDetail.MaleNumber != 0 ? + Math.Round(s.Where(m => m.SexId == SexFlag.Male).Count() * 100M / documentData.CheckedDetail.MaleNumber, 2) + "%" : "0%", + FemaleAsbitemCheckRatio = documentData.CheckedDetail.FemaleNumber != 0 ? + Math.Round(s.Where(m => m.SexId == SexFlag.Female).Count() * 100M / documentData.CheckedDetail.FemaleNumber, 2) + "%" : "0%", + TotalAsbitemCheckRatio = Math.Round((Math.Round(s.Where(m => m.SexId == SexFlag.Male).Count() * 100M / documentData.CheckedDetail.MaleNumber, 2) + Math.Round(s.Where(m => m.SexId == SexFlag.Female).Count() * 100M / documentData.CheckedDetail.FemaleNumber, 2)) / 2, 2) + "%" + }); + + documentData.MedicalItemExamineSituations = medicalItemExamineSituations.ToList(); + } + + + /// + /// 生成全体员工体检结果汇总数据 3 + /// + /// 数据 + /// 参数 + /// + public async Task CreateMedicalResultSummarysData(UnitPhysicalExaminationReportExportWordData documentData, CreateInspectionPersonnelPara customerOrgs) + { + #region 查询 + var query = from a in (await _patientRegisterRepository.GetQueryableAsync()).Include(x => x.Patient) + join b in (await _sumSummaryHeaderRepository.GetQueryableAsync()).Include(x => x.SumSummaryContents) on a.Id equals b.PatientRegisterId + join c in await _sexRepository.GetQueryableAsync() on a.SexId equals c.Id into cc + from ac in cc.DefaultIfEmpty() + where a.CompleteFlag == PatientRegisterCompleteFlag.GeneralInspected + select new + { + CustomerOrgGroupId = a.CustomerOrgGroupId, + CustomerOrgRegisterId = a.CustomerOrgRegisterId, + CustomerOrgId = a.CustomerOrgId, + PatientRegisterId = a.Id, + CreationTime = a.CreationTime, + MedicalStartDate = a.MedicalStartDate, + SummaryDate = a.SummaryDate, + SexName = ac != null ? ac.DisplayName : "", + Age = a.Age, + PatientName = a.PatientName, + PatientNo = a.Patient != null ? a.Patient.PatientNo : "", + b + }; + + + if (customerOrgs.CustomerOrgGroupId.Any()) + { + query = query.Where(m => m.CustomerOrgGroupId != null && customerOrgs.CustomerOrgGroupId.Contains(m.CustomerOrgGroupId.Value)); + } + if (customerOrgs.CustomerOrgRegisterId != GuidFlag.PersonCustomerOrgRegisterId) + { + query = query.Where(m => m.CustomerOrgRegisterId == customerOrgs.CustomerOrgRegisterId); + } + + var customerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(customerOrgs.CustomerOrgId); + query = query.Where(m => customerOrgIds.Contains(m.CustomerOrgId)); + if (customerOrgs.DateType == '1') + { + query = query.Where(m => m.CreationTime >= Convert.ToDateTime(customerOrgs.StartDate) && + m.CreationTime < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + else if (customerOrgs.DateType == '2') + { + query = query.Where(m => m.MedicalStartDate != null && m.MedicalStartDate.Value.ToDateTime(TimeOnly.MinValue) >= Convert.ToDateTime(customerOrgs.StartDate) && + m.MedicalStartDate.Value.ToDateTime(TimeOnly.MinValue) < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + else if (customerOrgs.DateType == '3') + { + query = query.Where(m => m.SummaryDate != null && m.SummaryDate.Value.ToDateTime(TimeOnly.MinValue) >= Convert.ToDateTime(customerOrgs.StartDate) && + m.SummaryDate.Value.ToDateTime(TimeOnly.MinValue) < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + #endregion + + var medicalResultSummarys = query.GroupBy(g => g.PatientRegisterId).Select(s => new UnitPhysicalExaminationReportExportWordData_MedicalResultSummary + { + Age = s.FirstOrDefault().Age != null ? s.FirstOrDefault().Age.ToString() : "", + PatientName = s.FirstOrDefault().PatientName, + PatientNo = s.FirstOrDefault().PatientNo, + SexName = s.FirstOrDefault().SexName, + MedicalResult = DataHelper.SetSumSummarys(s.Select(ss => ss.b).ToList()) + }); + + documentData.MedicalResultSummarys = medicalResultSummarys.ToList(); + } + + + + /// + /// 生成本次体检异常结果检出统计数据 4 + /// + /// 数据 + /// 参数 + /// + public async Task CreateMedicalAbnormalResultStatisticsData(UnitPhysicalExaminationReportExportWordData documentData, CreateInspectionPersonnelPara customerOrgs) + { + #region 查询 + var query = from a in (await _sumDiagnosisRepository.GetQueryableAsync()).Include(x => x.Diagnosis) + join b in await _patientRegisterRepository.GetQueryableAsync() on a.PatientRegisterId equals b.Id + where b.CompleteFlag == PatientRegisterCompleteFlag.GeneralInspected + select new + { + CustomerOrgGroupId = b.CustomerOrgGroupId, + CustomerOrgRegisterId = b.CustomerOrgRegisterId, + CustomerOrgId = b.CustomerOrgId, + CreationTime = b.CreationTime, + MedicalStartDate = b.MedicalStartDate, + SummaryDate = b.SummaryDate, + PatientName = b.PatientName, + DiagnosisId = a.DiagnosisId, + SexId = b.SexId, + DiagnosisName = a.Diagnosis != null ? a.Diagnosis.DisplayName : "" + }; + + + if (customerOrgs.CustomerOrgGroupId.Any()) + { + query = query.Where(m => m.CustomerOrgGroupId != null && customerOrgs.CustomerOrgGroupId.Contains(m.CustomerOrgGroupId.Value)); + } + if (customerOrgs.CustomerOrgRegisterId != GuidFlag.PersonCustomerOrgRegisterId) + { + query = query.Where(m => m.CustomerOrgRegisterId == customerOrgs.CustomerOrgRegisterId); + } + + var customerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(customerOrgs.CustomerOrgId); + query = query.Where(m => customerOrgIds.Contains(m.CustomerOrgId)); + if (customerOrgs.DateType == '1') + { + query = query.Where(m => m.CreationTime >= Convert.ToDateTime(customerOrgs.StartDate) && + m.CreationTime < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + else if (customerOrgs.DateType == '2') + { + query = query.Where(m => m.MedicalStartDate != null && m.MedicalStartDate.Value.ToDateTime(TimeOnly.MinValue) >= Convert.ToDateTime(customerOrgs.StartDate) && + m.MedicalStartDate.Value.ToDateTime(TimeOnly.MinValue) < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + else if (customerOrgs.DateType == '3') + { + query = query.Where(m => m.SummaryDate != null && m.SummaryDate.Value.ToDateTime(TimeOnly.MinValue) >= Convert.ToDateTime(customerOrgs.StartDate) && + m.SummaryDate.Value.ToDateTime(TimeOnly.MinValue) < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + #endregion + + var medicalAbnormalResultStatistics = query.GroupBy(g => g.DiagnosisId).Select(s => new UnitPhysicalExaminationReportExportWordData_MedicalAbnormalResultStatistics + { + DiagnosisName = s.FirstOrDefault().DiagnosisName, + PatientDetail = string.Join("、", s.Select(ss => ss.PatientName)), + MaleNumber = s.Where(m => m.SexId == SexFlag.Male).Count(), + FemaleNumber = s.Where(m => m.SexId == SexFlag.Female).Count(), + TotalNumber = s.Where(m => m.SexId == SexFlag.Male || m.SexId == SexFlag.Female).Count(), + MaleRatio = s.Where(m => m.SexId == SexFlag.Male || m.SexId == SexFlag.Female).Count() != 0 ? + Math.Round(s.Where(m => m.SexId == SexFlag.Male).Count() * 100M / s.Where(m => m.SexId == SexFlag.Male || m.SexId == SexFlag.Female).Count(), 2).ToString() + "%" : "0%", + FemaleRatio = s.Where(m => m.SexId == SexFlag.Male || m.SexId == SexFlag.Female).Count() != 0 ? + Math.Round(s.Where(m => m.SexId == SexFlag.Female).Count() * 100M / s.Where(m => m.SexId == SexFlag.Male || m.SexId == SexFlag.Female).Count(), 2).ToString() + "%" : "0%", + AverageRatio = s.Where(m => m.SexId == SexFlag.Male || m.SexId == SexFlag.Female).Count() != 0 ? + Math.Round((Math.Round(s.Where(m => m.SexId == SexFlag.Male).Count() * 100M / s.Where(m => m.SexId == SexFlag.Male || m.SexId == SexFlag.Female).Count(), 2) + + Math.Round(s.Where(m => m.SexId == SexFlag.Female).Count() * 100M / s.Where(m => m.SexId == SexFlag.Male || m.SexId == SexFlag.Female).Count(), 2)) / 2, 2).ToString() : "0%" + }).OrderByDescending(o => o.TotalNumber); + + documentData.MedicalAbnormalResultStatistics = medicalAbnormalResultStatistics.ToList(); + } + + + + /// + /// 生成本次体检异常结果检出统计数据 5 + /// + /// 数据 + /// 参数 + /// + public async Task CreateMedicalTenAbnormalResultsData(UnitPhysicalExaminationReportExportWordData documentData, CreateInspectionPersonnelPara customerOrgs) + { + #region 查询 + var query = from a in (await _sumDiagnosisRepository.GetQueryableAsync()).Include(x => x.Diagnosis) + join b in await _patientRegisterRepository.GetQueryableAsync() on a.PatientRegisterId equals b.Id + join c in (await _sumSuggestionHeaderRepository.GetQueryableAsync()).Include(x => x.SumSuggestionContents) on a.SumSuggestionHeaderId equals c.Id into cc + from ac in cc.DefaultIfEmpty() + where b.CompleteFlag == PatientRegisterCompleteFlag.GeneralInspected + select new + { + CustomerOrgGroupId = b.CustomerOrgGroupId, + CustomerOrgRegisterId = b.CustomerOrgRegisterId, + CustomerOrgId = b.CustomerOrgId, + CreationTime = b.CreationTime, + MedicalStartDate = b.MedicalStartDate, + SummaryDate = b.SummaryDate, + DiagnosisId = a.DiagnosisId, + DiagnosisName = a.Diagnosis != null ? a.Diagnosis.DisplayName : "", + ac + }; + + + if (customerOrgs.CustomerOrgGroupId.Any()) + { + query = query.Where(m => m.CustomerOrgGroupId != null && customerOrgs.CustomerOrgGroupId.Contains(m.CustomerOrgGroupId.Value)); + } + if (customerOrgs.CustomerOrgRegisterId != GuidFlag.PersonCustomerOrgRegisterId) + { + query = query.Where(m => m.CustomerOrgRegisterId == customerOrgs.CustomerOrgRegisterId); + } + + var customerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(customerOrgs.CustomerOrgId); + query = query.Where(m => customerOrgIds.Contains(m.CustomerOrgId)); + if (customerOrgs.DateType == '1') + { + query = query.Where(m => m.CreationTime >= Convert.ToDateTime(customerOrgs.StartDate) && + m.CreationTime < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + else if (customerOrgs.DateType == '2') + { + query = query.Where(m => m.MedicalStartDate != null && m.MedicalStartDate.Value.ToDateTime(TimeOnly.MinValue) >= Convert.ToDateTime(customerOrgs.StartDate) && + m.MedicalStartDate.Value.ToDateTime(TimeOnly.MinValue) < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + else if (customerOrgs.DateType == '3') + { + query = query.Where(m => m.SummaryDate != null && m.SummaryDate.Value.ToDateTime(TimeOnly.MinValue) >= Convert.ToDateTime(customerOrgs.StartDate) && + m.SummaryDate.Value.ToDateTime(TimeOnly.MinValue) < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + #endregion + + var medicalTenAbnormalResults = query.GroupBy(g => g.DiagnosisId).Select(s => new UnitPhysicalExaminationReportExportWordData_MedicalTenAbnormalResult + { + DiagnosisName = s.FirstOrDefault().DiagnosisName, + DiagnosisSuggestion = DataHelper.SetSumSuggestion(s.Select(ss => ss.ac).ToList()) + }); + + documentData.MedicalTenAbnormalResults = medicalTenAbnormalResults.ToList(); + } + + + + + /// + /// 生成体检者未完成情况数据 6 + /// + /// 数据 + /// 参数 + /// + public async Task CreateMedicalUnCheckedStatisticsData(UnitPhysicalExaminationReportExportWordData documentData, CreateInspectionPersonnelPara customerOrgs) + { + #region 查询 + var query = from a in (await _patientRegisterRepository.GetQueryableAsync()).Include(x => x.Patient) + join b in await _customerOrgRepository.GetQueryableAsync() on a.CustomerOrgId equals b.Id + join c in await _sexRepository.GetQueryableAsync() on a.SexId equals c.Id into cc + from ac in cc.DefaultIfEmpty() + where a.CompleteFlag != PatientRegisterCompleteFlag.GeneralInspected + select new + { + CustomerOrgGroupId = a.CustomerOrgGroupId, + CustomerOrgRegisterId = a.CustomerOrgRegisterId, + CustomerOrgId = a.CustomerOrgId, + CreationTime = a.CreationTime, + MedicalStartDate = a.MedicalStartDate, + SummaryDate = a.SummaryDate, + PatientNo = a.Patient != null ? a.Patient.PatientNo : "", + PatientName = a.PatientName, + SexName = ac != null ? ac.DisplayName : "", + Age = a.Age, + DepartmentName = b.DisplayName + }; + + + if (customerOrgs.CustomerOrgGroupId.Any()) + { + query = query.Where(m => m.CustomerOrgGroupId != null && customerOrgs.CustomerOrgGroupId.Contains(m.CustomerOrgGroupId.Value)); + } + if (customerOrgs.CustomerOrgRegisterId != GuidFlag.PersonCustomerOrgRegisterId) + { + query = query.Where(m => m.CustomerOrgRegisterId == customerOrgs.CustomerOrgRegisterId); + } + + var customerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(customerOrgs.CustomerOrgId); + query = query.Where(m => customerOrgIds.Contains(m.CustomerOrgId)); + if (customerOrgs.DateType == '1') + { + query = query.Where(m => m.CreationTime >= Convert.ToDateTime(customerOrgs.StartDate) && + m.CreationTime < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + else if (customerOrgs.DateType == '2') + { + query = query.Where(m => m.MedicalStartDate != null && m.MedicalStartDate.Value.ToDateTime(TimeOnly.MinValue) >= Convert.ToDateTime(customerOrgs.StartDate) && + m.MedicalStartDate.Value.ToDateTime(TimeOnly.MinValue) < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + else if (customerOrgs.DateType == '3') + { + query = query.Where(m => m.SummaryDate != null && m.SummaryDate.Value.ToDateTime(TimeOnly.MinValue) >= Convert.ToDateTime(customerOrgs.StartDate) && + m.SummaryDate.Value.ToDateTime(TimeOnly.MinValue) < Convert.ToDateTime(customerOrgs.EndDate).AddDays(1)); + } + #endregion + + var medicalUnCheckedStatistics = query.Select(s => new UnitPhysicalExaminationReportExportWordData_MedicalUnCheckedStatistics + { + Age = s.Age != null ? s.Age.ToString() : "", + DepartmentName = s.DepartmentName, + PatientName = s.PatientName, + PatientNo = s.PatientNo, + SexName = s.SexName + }); + + documentData.MedicalUnCheckedStatistics = medicalUnCheckedStatistics.ToList(); + } + + + } +} diff --git a/src/Shentun.Peis.Domain/ReportTemplates/UnitPhysicalExaminationReportExportWordData.cs b/src/Shentun.Peis.Domain/ReportTemplates/UnitPhysicalExaminationReportExportWordData.cs new file mode 100644 index 0000000..a03fae6 --- /dev/null +++ b/src/Shentun.Peis.Domain/ReportTemplates/UnitPhysicalExaminationReportExportWordData.cs @@ -0,0 +1,339 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Shentun.Peis.ReportTemplates +{ + public class UnitPhysicalExaminationReportExportWordData + { + /// + /// 体检年度标题 + /// + public string MedicalTitle { get; set; } + + /// + /// 体检次数 + /// + public int MedicalTimes { get; set; } + + /// + /// 体检开始月份 格式:2009年09月 + /// + public string MedicalStartDate { get; set; } + + /// + /// 体检结束月份 格式:2009年09月 + /// + public string MedicalEndDate { get; set; } + + /// + /// 制表日期 格式:2009年09月09日 + /// + public string TabulationDate { get; set; } + + + /// + /// 打印日期 格式:2009年09月09日 + /// + public string PrintDate { get; set; } + + + + /// + /// 登记明细 参加人员构成情况 第一部分 + /// + public InspectionPersonnel_Detail RegisterDetail { get; set; } + + /// + /// 实检明细 参加人员构成情况 第一部分 + /// + public InspectionPersonnel_Detail CheckedDetail { get; set; } + + /// + /// 未检明细 参加人员构成情况 第一部分 + /// + public InspectionPersonnel_Detail UnCheckedDetail { get; set; } + + + + /// + /// 体检项目得参检情况 第二部分 + /// + public List MedicalItemExamineSituations { get; set; } = new List(); + + /// + /// 全体员工体检结果汇总 第三部分 + /// + public List MedicalResultSummarys { get; set; } = new List(); + + /// + /// 体检异常结果检出统计 第四部分 + /// + public List MedicalAbnormalResultStatistics { get; set; } = new List(); + + /// + /// 十大异常结果分析 第五部分 + /// + public List MedicalTenAbnormalResults { get; set; } = new List(); + + + /// + /// 体检者未完成情况 第六部分 + /// + public List MedicalUnCheckedStatistics { get; set; } = new List(); + } + + + + /// + /// 检查明细 1 + /// + public class InspectionPersonnel_Detail + { + /// + /// 男性人数 + /// + public int MaleNumber { get; set; } + + /// + /// 女性人数 + /// + public int FemaleNumber { get; set; } + + /// + /// 其他人数 + /// + public int OtherNumber { get; set; } + + /// + /// 合计人数 + /// + public int TotalNumber { get; set; } + + /// + /// 男性比例 + /// + public string MaleRatio { get; set; } + + /// + /// 女性比例 + /// + public string FemaleRatio { get; set; } + + /// + /// 男性参检比例 + /// + public string MaleExamineRatio { get; set; } + + /// + /// 女性参检比例 + /// + public string FemaleExamineRatio { get; set; } + + + /// + /// 平均参检比例 + /// + public string AverageExamineRatio { get; set; } + } + + + /// + /// 体检项目得参检情况 2 + /// + public class UnitPhysicalExaminationReportExportWordData_MedicalItemExamineSituation + { + /// + /// 科室 + /// + public string ItemTypeName { get; set; } + + /// + /// 组合项目名称 + /// + public string AsbitemName { get; set; } + + /// + /// 男性该项目参检人数 + /// + public int MaleAsbitemCheckNumber { get; set; } + + /// + /// 女性该项目参检人数 + /// + public int FemaleAsbitemCheckNumber { get; set; } + + /// + /// 合计该项目参检人数 + /// + public int TotalAsbitemCheckNumber { get; set; } + + /// + /// 男性总体参检人数 所有项目 + /// + public int MaleSumCheckNumber { get; set; } + + /// + /// 女性总体参检人数 所有项目 + /// + public int FemaleSumCheckNumber { get; set; } + + /// + /// 合计总体参检人数 所有项目 + /// + public int TotalSumCheckNumber { get; set; } + + + /// + /// 男性该项目参检比例 + /// + public string MaleAsbitemCheckRatio { get; set; } + + /// + /// 女性该项目参检比例 + /// + public string FemaleAsbitemCheckRatio { get; set; } + + /// + /// 合计该项目参检比例 + /// + public string TotalAsbitemCheckRatio { get; set; } + + + } + + /// + /// 全体员工体检结果汇总 统计已总检的名单 3 + /// + public class UnitPhysicalExaminationReportExportWordData_MedicalResultSummary + { + /// + /// 档案号 + /// + public string PatientNo { get; set; } + + /// + /// 姓名 + /// + public string PatientName { get; set; } + + /// + /// 性别 + /// + public string SexName { get; set; } + + /// + /// 年龄 + /// + public string Age { get; set; } + + /// + /// 体检结果 + /// + public string MedicalResult { get; set; } + } + + /// + /// 体检异常结果检出统计 4 + /// + public class UnitPhysicalExaminationReportExportWordData_MedicalAbnormalResultStatistics + { + /// + /// 诊断名称 + /// + public string DiagnosisName { get; set; } + + /// + /// 人员名单 多个、组合到一起 + /// + public string PatientDetail { get; set; } + + /// + /// 男性人数 + /// + public int MaleNumber { get; set; } + + /// + /// 女性人数 + /// + public int FemaleNumber { get; set; } + + /// + /// 合计人数 + /// + public int TotalNumber { get; set; } + + /// + /// 男性比例 + /// + public string MaleRatio { get; set; } + + /// + /// 女性比例 + /// + public string FemaleRatio { get; set; } + + /// + /// 平均比例 + /// + public string AverageRatio { get; set; } + } + + + /// + /// 十大异常结果分析 5 + /// + public class UnitPhysicalExaminationReportExportWordData_MedicalTenAbnormalResult + { + /// + /// 诊断名称 + /// + public string DiagnosisName { get; set; } + + /// + /// 诊断建议 + /// + public string DiagnosisSuggestion { get; set; } + + } + + + + /// + /// 体检者未完成情况 6 + /// + public class UnitPhysicalExaminationReportExportWordData_MedicalUnCheckedStatistics + { + /// + /// 档案号 + /// + public string PatientNo { get; set; } + + /// + /// 姓名 + /// + public string PatientName { get; set; } + + + /// + /// 性别 + /// + public string SexName { get; set; } + + /// + /// 年龄 + /// + public string Age { get; set; } + + /// + /// 部门名称 + /// + public string DepartmentName { get; set; } + + } + + +} diff --git a/src/Shentun.Peis.Domain/Shentun.Peis.Domain.csproj b/src/Shentun.Peis.Domain/Shentun.Peis.Domain.csproj index 317f166..7794466 100644 --- a/src/Shentun.Peis.Domain/Shentun.Peis.Domain.csproj +++ b/src/Shentun.Peis.Domain/Shentun.Peis.Domain.csproj @@ -13,8 +13,10 @@ + + diff --git a/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs b/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs index 8a6f340..4a698ce 100644 --- a/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs +++ b/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs @@ -87,7 +87,7 @@ public class PeisHttpApiHostModule : AbpModule builder.SetAccessTokenLifetime(TimeSpan.FromDays(30)).SetRefreshTokenLifetime(TimeSpan.FromDays(60)); }); - + } public override void ConfigureServices(ServiceConfigurationContext context) @@ -175,7 +175,7 @@ public class PeisHttpApiHostModule : AbpModule }); }); */ - + } private void ConfigureAuthentication(ServiceConfigurationContext context) @@ -425,13 +425,19 @@ public class PeisHttpApiHostModule : AbpModule app.UseStaticFiles(); + app.UseStaticFiles(new StaticFileOptions + { + FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "ReportFile")), + RequestPath = "/ReportFile" + }); + app.UseStaticFiles(new StaticFileOptions { FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "UpLoad")), RequestPath = "/UpLoad" }); - + //虚拟目录 app.UseStaticFiles(new StaticFileOptions diff --git a/src/Shentun.Peis.HttpApi.Host/ReportFile/CustomerOrgTemplate/Page1.jpg b/src/Shentun.Peis.HttpApi.Host/ReportFile/CustomerOrgTemplate/Page1.jpg new file mode 100644 index 0000000..c92b262 Binary files /dev/null and b/src/Shentun.Peis.HttpApi.Host/ReportFile/CustomerOrgTemplate/Page1.jpg differ diff --git a/src/Shentun.Peis.HttpApi.Host/ReportFile/CustomerOrgTemplate/logo_template.jpg b/src/Shentun.Peis.HttpApi.Host/ReportFile/CustomerOrgTemplate/logo_template.jpg new file mode 100644 index 0000000..527f68b Binary files /dev/null and b/src/Shentun.Peis.HttpApi.Host/ReportFile/CustomerOrgTemplate/logo_template.jpg differ