|
@@ -1,1013 +0,0 @@
|
|
|
-using System;
|
|
|
-using System.Collections.Generic;
|
|
|
-using System.Linq;
|
|
|
-using System.Text;
|
|
|
-using System.Threading.Tasks;
|
|
|
-using MSWord = Microsoft.Office.Interop.Word;
|
|
|
-using System.IO;
|
|
|
-using System.Reflection;
|
|
|
-
|
|
|
-namespace WpfTest1.Toolkits
|
|
|
-{
|
|
|
- class ReportGenerator_old
|
|
|
- {
|
|
|
- /*
|
|
|
- * generateReport:生成报告的方法
|
|
|
- * 参数:
|
|
|
- * patiment:病人对象
|
|
|
- * rcd: 报告对象
|
|
|
- * cfg 系统Config类
|
|
|
- * handFlag:0均没有,1左手,2右手,3双手
|
|
|
- * mw: 主界面引用
|
|
|
- * expressions:各参数值结果
|
|
|
- * rpRecord: RP环节的结果
|
|
|
- * generalExpressionResult: 用于自动评价风险的总表达式结果,double
|
|
|
- * */
|
|
|
- //
|
|
|
- public void generateReport(SQLite.Patient patient, SQLite.Record rcd, Config cfg, int handFlag,MainWindow mw, Dictionary<string,double> expressions, SQLite.doctor doct,RPCalculate rpRecord, string generalExpressionResult)
|
|
|
- {
|
|
|
- String path = Constants.reportPath;
|
|
|
- //String now = System.DateTime.Now.ToString("yyyyMMddHHmmss");
|
|
|
- /* String picName0 = path + "\\" + "0.jpg";
|
|
|
- String picName1 = path + "\\" + "1.jpg";
|
|
|
- String picName2 = path + "\\" + "2.jpg";
|
|
|
- String picName3 = path + "\\" + "3.jpg";
|
|
|
- String picName4 = path + "\\" + "4.jpg";
|
|
|
- */
|
|
|
- String fileName = path + "\\" + patient.p_record_id + "_" + patient.p_name + "_" + rcd.r_time.ToString("yyyyMMddHHmmss") + ".doc";
|
|
|
- String pdfFileName = path + "\\" + patient.p_record_id + "_" + patient.p_name + "_" + rcd.r_time.ToString("yyyyMMddHHmmss") + ".pdf";
|
|
|
- if (File.Exists(fileName))
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
- File.Delete(fileName);
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- ;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- FileStream fs = new FileStream(fileName, FileMode.CreateNew);
|
|
|
- fs.Close();
|
|
|
- int space = 12;
|
|
|
-
|
|
|
- Object oMissing = System.Reflection.Missing.Value;
|
|
|
- Microsoft.Office.Interop.Word._Application WordApp = new Microsoft.Office.Interop.Word.Application();
|
|
|
- object filename = fileName;
|
|
|
- Microsoft.Office.Interop.Word._Document WordDoc = null;
|
|
|
-
|
|
|
- try
|
|
|
- {
|
|
|
-
|
|
|
- WordDoc = WordApp.Documents.Open(ref filename, ref oMissing,
|
|
|
- ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
|
|
|
- ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
|
|
|
- WordApp.Visible = false;
|
|
|
-
|
|
|
- //页面设置
|
|
|
- WordDoc.PageSetup.PaperSize = MSWord.WdPaperSize.wdPaperA4;//设置纸张样式为A4纸
|
|
|
- WordDoc.PageSetup.Orientation = MSWord.WdOrientation.wdOrientPortrait;//排列方式为垂直方向
|
|
|
- WordDoc.PageSetup.TopMargin = 57.0f;
|
|
|
- WordDoc.PageSetup.BottomMargin = 10.0f;
|
|
|
- WordDoc.PageSetup.LeftMargin = 57.0f;
|
|
|
- WordDoc.PageSetup.RightMargin = 57.0f;
|
|
|
- WordDoc.PageSetup.HeaderDistance = 30.0f;//页眉位置
|
|
|
- WordDoc.PageSetup.FooterDistance = 15.0f;
|
|
|
-
|
|
|
- //设置页眉
|
|
|
- WordApp.ActiveWindow.View.Type = Microsoft.Office.Interop.Word.WdViewType.wdOutlineView;//视图样式
|
|
|
- WordApp.ActiveWindow.View.SeekView = Microsoft.Office.Interop.Word.WdSeekView.wdSeekPrimaryHeader;//进入页眉设置,其中页眉边距在页面设置中已完成
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphRight;
|
|
|
-
|
|
|
- //插入页眉图片(测试结果图片未插入成功)
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = MSWord.WdParagraphAlignment.wdAlignParagraphCenter;
|
|
|
- string headerfile = Constants.reportHeadPicPath;
|
|
|
- Console.WriteLine(headerfile);
|
|
|
- Microsoft.Office.Interop.Word.InlineShape shape1 = WordApp.ActiveWindow.ActivePane.Selection.InlineShapes.AddPicture(headerfile, ref oMissing, ref oMissing, ref oMissing);
|
|
|
- shape1.Height = 25;
|
|
|
- shape1.Width = 25;
|
|
|
-
|
|
|
- //页眉修改Test
|
|
|
- object unite = Microsoft.Office.Interop.Word.WdUnits.wdStory;
|
|
|
- object count = WordDoc.Paragraphs.Count;
|
|
|
- object WdLine = Microsoft.Office.Interop.Word.WdUnits.wdParagraph;
|
|
|
- string eyeContent = cfg.organization_name;
|
|
|
- //第一行
|
|
|
- WordApp.Selection.Font.Name = "黑体";
|
|
|
- WordApp.Selection.Font.Bold = 1;
|
|
|
- WordApp.Selection.Font.Color = MSWord.WdColor.wdColorRed;
|
|
|
- WordApp.Selection.Font.Size = 30;
|
|
|
- WordApp.Selection.Font.Spacing = 10;
|
|
|
-
|
|
|
-
|
|
|
- WordApp.ActiveWindow.ActivePane.Selection.InsertAfter(" " + eyeContent + "\n");
|
|
|
- WordApp.Selection.MoveDown(ref WdLine, ref count, ref oMissing);
|
|
|
- //第二行
|
|
|
- WordApp.Selection.Font.Name = "黑体";
|
|
|
- WordApp.Selection.Font.Bold = 1;
|
|
|
- WordApp.Selection.Font.Color = MSWord.WdColor.wdColorGray30;
|
|
|
- WordApp.Selection.Font.Size = 20;
|
|
|
- WordApp.Selection.Font.Spacing = 0;
|
|
|
- WordApp.ActiveWindow.ActivePane.Selection.InsertAfter("PIH检测报告单" + "\n");
|
|
|
- //第一行
|
|
|
- WordApp.Selection.MoveDown(ref WdLine, ref count, ref oMissing);
|
|
|
- WordApp.Selection.Font.Name = "黑体";
|
|
|
- WordApp.Selection.Font.Bold = 1;
|
|
|
- WordApp.Selection.Font.Color = MSWord.WdColor.wdColorGray30;
|
|
|
- WordApp.Selection.Font.Size = 10;
|
|
|
- string currentData = DateTime.Now.ToString("yy/MM/dd");
|
|
|
- WordApp.ActiveWindow.ActivePane.Selection.InsertAfter("病案编号:" + rcd.r_id + " " + "检查日期:" + currentData);
|
|
|
-
|
|
|
- //去掉页眉的横线
|
|
|
- //WordApp.ActiveWindow.ActivePane.Selection.ParagraphFormat.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleNone;
|
|
|
- //WordApp.ActiveWindow.ActivePane.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].Visible = false;
|
|
|
- WordApp.ActiveWindow.ActivePane.View.SeekView = Microsoft.Office.Interop.Word.WdSeekView.wdSeekMainDocument;//退出页眉设置
|
|
|
-
|
|
|
- //页脚
|
|
|
- WordApp.ActiveWindow.View.Type = Microsoft.Office.Interop.Word.WdViewType.wdOutlineView;
|
|
|
- WordApp.ActiveWindow.View.SeekView = Microsoft.Office.Interop.Word.WdSeekView.wdSeekPrimaryFooter;
|
|
|
- //移动光标文档末尾
|
|
|
- // object count = WordDoc.Paragraphs.Count;
|
|
|
- // object WdLine = Microsoft.Office.Interop.Word.WdUnits.wdParagraph;
|
|
|
- WordApp.Selection.MoveDown(ref WdLine, ref count, ref oMissing);//移动焦点
|
|
|
- // 去掉页脚的横线
|
|
|
- WordApp.ActiveWindow.ActivePane.Selection.ParagraphFormat.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle;
|
|
|
- WordApp.ActiveWindow.ActivePane.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].Visible = true;
|
|
|
-
|
|
|
- //为当前页添加页码
|
|
|
- Microsoft.Office.Interop.Word.PageNumbers pns = WordApp.Selection.Sections[1].Headers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterEvenPages].PageNumbers;//获取当前页的号码
|
|
|
- pns.NumberStyle = Microsoft.Office.Interop.Word.WdPageNumberStyle.wdPageNumberStyleNumberInDash;
|
|
|
- pns.HeadingLevelForChapter = 0;
|
|
|
- pns.IncludeChapterNumber = false;
|
|
|
- pns.RestartNumberingAtSection = false;
|
|
|
- pns.StartingNumber = 0;
|
|
|
- object pagenmbetal = Microsoft.Office.Interop.Word.WdPageNumberAlignment.wdAlignPageNumberCenter;//将号码设置在中间
|
|
|
- object first = true;
|
|
|
- WordApp.Selection.Sections[1].Footers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterEvenPages].PageNumbers.Add(ref pagenmbetal, ref first);
|
|
|
-
|
|
|
-
|
|
|
- WordApp.ActiveWindow.ActivePane.View.SeekView = Microsoft.Office.Interop.Word.WdSeekView.wdSeekMainDocument;//退出页眉设置
|
|
|
- //插入表格
|
|
|
- // WordApp.Selection.EndKey(ref WdLine, ref oMissing);
|
|
|
- //WordApp.Selection.ParagraphFormat.Alignment = MSWord.WdParagraphAlignment.wdAlignParagraphCenter;
|
|
|
- int tableRow = 6;
|
|
|
- int tableColumn = 6;
|
|
|
- //定义一个word中的表格对象
|
|
|
- MSWord.Table table = WordDoc.Tables.Add(WordApp.Selection.Range, tableRow, tableColumn, ref oMissing, ref oMissing);
|
|
|
- table.Range.Font.Size = 10;
|
|
|
- table.Range.Font.Bold = 0;
|
|
|
- table.Range.ParagraphFormat.Alignment = MSWord.WdParagraphAlignment.wdAlignParagraphCenter;
|
|
|
- //内线
|
|
|
- //table.Borders.InsideLineStyle = MSWord.WdLineStyle.wdLineStyleSingle;
|
|
|
- table.Columns[1].Width = 70;
|
|
|
- table.Columns[2].Width = 120;
|
|
|
- table.Columns[3].Width = 60;
|
|
|
- table.Columns[4].Width = 70;
|
|
|
- table.Columns[5].Width = 80;
|
|
|
- //table.Columns[6].Width = 40;
|
|
|
- for (int i = 1; i <= 6; i = i + 2)
|
|
|
- {
|
|
|
- for (int j = 1; j <= 6; j++)
|
|
|
- {
|
|
|
- table.Cell(j, i).Range.ParagraphFormat.Alignment = MSWord.WdParagraphAlignment.wdAlignParagraphLeft;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- table.Cell(1, 1).Range.Text = "身份证号:";
|
|
|
- table.Cell(1, 2).Range.Text = patient.p_record_id;
|
|
|
- table.Cell(1, 3).Range.Text = "性别:";
|
|
|
- table.Cell(1, 4).Range.Text = "女";
|
|
|
- table.Cell(1, 5).Range.Text = "病例号:";
|
|
|
- table.Cell(1, 6).Range.Text = patient.p_record_id.ToString();
|
|
|
- table.Cell(2, 1).Range.Text = "姓名:";
|
|
|
- table.Cell(2, 2).Range.Text = patient.p_name;
|
|
|
- table.Cell(2, 3).Range.Text = "年龄:";
|
|
|
- if (patient.p_record_id.Length == 18)
|
|
|
- {
|
|
|
- //假设身份证号合法
|
|
|
- string birthday = patient.p_record_id.Substring(6, 8);
|
|
|
- //MessageBox.Show(birthday);
|
|
|
- if (birthday.Substring(0, 2) == "19" || birthday.Substring(0, 2) == "20")
|
|
|
- {
|
|
|
- DateTime birthdayDate = new DateTime(Convert.ToInt32(birthday.Substring(0, 4)), Convert.ToInt32(birthday.Substring(4, 2)), Convert.ToInt32(birthday.Substring(6, 2)));
|
|
|
- int age = Toolkits.OtherSmallFunction.getAgeByBirthDay(birthdayDate);
|
|
|
- table.Cell(2, 4).Range.Text = age.ToString();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- table.Cell(2, 4).Range.Text = "--";
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- table.Cell(2, 4).Range.Text = "--";
|
|
|
- }
|
|
|
- table.Cell(2, 5).Range.Text = "床号:";
|
|
|
- table.Cell(2, 6).Range.Text = "--";
|
|
|
- table.Cell(3, 1).Range.Text = "身高:";
|
|
|
- table.Cell(3, 2).Range.Text = patient.p_height.ToString();
|
|
|
- table.Cell(3, 3).Range.Text = "科别:";
|
|
|
- table.Cell(3, 4).Range.Text = "产科";
|
|
|
- table.Cell(3, 5).Range.Text = "检查部位:";
|
|
|
- switch (handFlag)
|
|
|
- {
|
|
|
- case 0:
|
|
|
- table.Cell(3, 6).Range.Text = "□左手 □右手";
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- table.Cell(3, 6).Range.Text = "√左手 □右手";
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- table.Cell(3, 6).Range.Text = "□左手 √右手";
|
|
|
- break;
|
|
|
- default:
|
|
|
- table.Cell(3, 6).Range.Text = "√左手 √右手";
|
|
|
- break;
|
|
|
- }
|
|
|
- table.Cell(4, 1).Range.Text = "体重:";
|
|
|
- table.Cell(4, 2).Range.Text = patient.p_weight.ToString();
|
|
|
- table.Cell(4, 3).Range.Text = "孕周:";
|
|
|
- //table.Cell(4, 4).Range.Text = ((DateTime.Now - patient.pregnancy_date).Days / 7 + 1).ToString(); ;
|
|
|
- table.Cell(4, 5).Range.Text = "孕次:";
|
|
|
- //table.Cell(4, 6).Range.Text = patient.pregnancy_times.ToString();
|
|
|
- table.Cell(5, 1).Range.Text = "科室:";
|
|
|
- table.Cell(5, 2).Range.Text = "--";
|
|
|
- table.Cell(5, 3).Range.Text = "病床号:";
|
|
|
- table.Cell(5, 4).Range.Text = "----";
|
|
|
- table.Cell(5, 5).Range.Text = "单胎/多胎:";
|
|
|
- table.Cell(5, 6).Range.Text = "--";
|
|
|
- table.Cell(6, 1).Range.Text = "病区:";
|
|
|
- table.Cell(6, 2).Range.Text = "--";
|
|
|
- table.Cell(6, 3).Range.Text = "住院号:";
|
|
|
- table.Cell(6, 4).Range.Text = "--";
|
|
|
- table.Cell(6, 5).Range.Text = "设备型号:";
|
|
|
- table.Cell(6, 6).Range.Text = "HC2180-D";
|
|
|
-
|
|
|
- Microsoft.Office.Interop.Word.Paragraph oPara1 = WordDoc.Content.Paragraphs.Add(ref oMissing);
|
|
|
- oPara1.Range.Text = "____________________________________________________________________________________________";
|
|
|
- oPara1.Range.Font.Bold = 0;
|
|
|
- oPara1.Range.InsertParagraphAfter();
|
|
|
-
|
|
|
- //分栏测试
|
|
|
-
|
|
|
-
|
|
|
- //参数检测部分
|
|
|
- /*
|
|
|
- oPara1.Range.Text = "血液动力学参数检测";
|
|
|
- oPara1.Range.Font.Bold = 0;
|
|
|
- oPara1.Format.SpaceAfter = space;
|
|
|
- oPara1.Range.InsertParagraphAfter();
|
|
|
- */
|
|
|
- //插入表格
|
|
|
- //WordDoc.Content.InsertAfter("\n");
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- //WordApp.Selection.ParagraphFormat.Alignment = MSWord.WdParagraphAlignment.wdAlignParagraphCenter;
|
|
|
- //WordApp.Selection.MoveDown(ref WdLine, ref count, ref oMissing);
|
|
|
- int tableRow2 = 43;
|
|
|
- int tableColumn2 = 5;
|
|
|
- //定义一个word中的表格对象
|
|
|
- MSWord.Table table2 = WordDoc.Tables.Add(WordApp.Selection.Range, tableRow2, tableColumn2, ref oMissing, ref oMissing);
|
|
|
- table2.Range.Font.Size = 8;
|
|
|
- table2.Range.Font.Bold = 0;
|
|
|
- table2.Range.Rows.Height = 13;
|
|
|
- table2.Rows.HeightRule = MSWord.WdRowHeightRule.wdRowHeightExactly;
|
|
|
- table2.Range.ParagraphFormat.Alignment = MSWord.WdParagraphAlignment.wdAlignParagraphLeft;
|
|
|
- //内线
|
|
|
- //table2.Borders.InsideLineStyle = MSWord.WdLineStyle.wdLineStyleSingle;
|
|
|
- table2.Columns[1].Width = 95;
|
|
|
- table2.Columns[2].Width = 40;
|
|
|
- table2.Columns[3].Width = 15;
|
|
|
- table2.Columns[4].Width = 95;
|
|
|
- table2.Columns[5].Width = 250;
|
|
|
- //table2.Columns[6].Width = 40;
|
|
|
- //table2.Columns[7].Width = 15;
|
|
|
- //table2.Columns[8].Width = 95;
|
|
|
- /*for(int i=1;i<=22;i++)
|
|
|
- {
|
|
|
- table2.Rows[i].Height = 60;
|
|
|
- }*/
|
|
|
- //合并表格
|
|
|
- table2.Cell(1, 1).Merge(table2.Cell(1, 4));
|
|
|
- table2.Cell(2, 5).Merge(table2.Cell(43, 5));
|
|
|
-
|
|
|
- //表格文字
|
|
|
- table2.Cell(1, 1).Range.Text = "血液动力学参数检测结果";
|
|
|
- table2.Cell(2, 1).Range.Text = "收缩压SPB:";
|
|
|
- table2.Cell(2, 2).Range.Text = rpRecord.shousuoya.ToString();
|
|
|
- try
|
|
|
- {
|
|
|
- double hbp = rpRecord.shousuoya;
|
|
|
- if (hbp > 130)
|
|
|
- {
|
|
|
- table2.Cell(2, 3).Range.Text = "↑";
|
|
|
- }
|
|
|
- else if (hbp < 90)
|
|
|
- {
|
|
|
- table2.Cell(2, 3).Range.Text = "↓";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- table2.Cell(2, 4).Range.Text = "90-130mmHg";
|
|
|
-
|
|
|
- table2.Cell(3, 1).Range.Text = "舒张压DPB:";
|
|
|
- table2.Cell(3, 2).Range.Text = rpRecord.shuzhangya.ToString();
|
|
|
- try
|
|
|
- {
|
|
|
- double hbp = rpRecord.shuzhangya;
|
|
|
- if (hbp > 100)
|
|
|
- {
|
|
|
- table2.Cell(3, 3).Range.Text = "↑";
|
|
|
- }
|
|
|
- else if (hbp < 60)
|
|
|
- {
|
|
|
- table2.Cell(3, 3).Range.Text = "↓";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- table2.Cell(3, 4).Range.Text = "60-100mmHg";
|
|
|
-
|
|
|
- table2.Cell(4, 1).Range.Text = "脉压PP:";
|
|
|
- table2.Cell(4, 2).Range.Text = rpRecord.maiya.ToString();
|
|
|
- if(rpRecord.maiya > 50)
|
|
|
- {
|
|
|
- table2.Cell(4, 3).Range.Text = "↑";
|
|
|
- }
|
|
|
- else if(rpRecord.maiya < 35)
|
|
|
- {
|
|
|
- table2.Cell(4, 3).Range.Text = "↓";
|
|
|
- }
|
|
|
- table2.Cell(4, 4).Range.Text = "35-50mmHg";
|
|
|
-
|
|
|
- table2.Cell(5, 1).Range.Text = "平均动脉压MAP:";
|
|
|
- table2.Cell(5, 2).Range.Text = rpRecord.pingjundongmaiya.ToString();
|
|
|
- try
|
|
|
- {
|
|
|
- double hbp = rpRecord.pingjundongmaiya;
|
|
|
- if (hbp > 95)
|
|
|
- {
|
|
|
- table2.Cell(5, 3).Range.Text = "↑";
|
|
|
- }
|
|
|
- else if (hbp < 85)
|
|
|
- {
|
|
|
- table2.Cell(5, 3).Range.Text = "↓";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- table2.Cell(5, 4).Range.Text = "85-95mmHg";
|
|
|
-
|
|
|
- table2.Cell(6, 1).Range.Text = "血压指数BPI:";
|
|
|
- table2.Cell(6, 2).Range.Text = rpRecord.xueyazhishu.ToString();
|
|
|
- try
|
|
|
- {
|
|
|
- double hbp = rpRecord.xueyazhishu;
|
|
|
- if (hbp > 150)
|
|
|
- {
|
|
|
- table2.Cell(6, 3).Range.Text = "↓";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- }
|
|
|
- table2.Cell(6, 4).Range.Text = "<150";
|
|
|
-
|
|
|
- table2.Cell(7, 1).Range.Text = "体表面积TBA:";
|
|
|
- table2.Cell(7, 2).Range.Text = rpRecord.tibiaomianji.ToString();
|
|
|
- table2.Cell(7, 4).Range.Text = "m*m";
|
|
|
-
|
|
|
- table2.Cell(8, 1).Range.Text = "血总容量BV:"; //textBoxRPzongxuerongliangHistory
|
|
|
- table2.Cell(8, 2).Range.Text = rpRecord.zongxuerongliang.ToString();
|
|
|
- table2.Cell(8, 4).Range.Text = "(参考范围)";
|
|
|
-
|
|
|
- table2.Cell(9, 1).Range.Text = "波形系数K:";
|
|
|
- table2.Cell(9, 2).Range.Text = rpRecord.boxinxishu.ToString();
|
|
|
- try
|
|
|
- {
|
|
|
- double hbp = rpRecord.boxinxishu;
|
|
|
- if (hbp > 0.4)
|
|
|
- {
|
|
|
- table2.Cell(9, 3).Range.Text = "↑";
|
|
|
- }
|
|
|
- else if (hbp < 0.33)
|
|
|
- {
|
|
|
- table2.Cell(9, 3).Range.Text = "↓";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- table2.Cell(9, 4).Range.Text = "0.33-0.4";
|
|
|
-
|
|
|
- table2.Cell(10, 1).Range.Text = "体重指数WI:";
|
|
|
- table2.Cell(10, 2).Range.Text = rpRecord.tizhongzhishu.ToString();
|
|
|
- try
|
|
|
- {
|
|
|
- double hbp = rpRecord.tizhongzhishu;
|
|
|
- if (hbp > 0.24)
|
|
|
- {
|
|
|
- table2.Cell(10, 3).Range.Text = "↑";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- }
|
|
|
- table2.Cell(10, 4).Range.Text = "<0.24";
|
|
|
-
|
|
|
- table2.Cell(11, 1).Range.Text = "心输出量CO:";
|
|
|
- table2.Cell(11, 2).Range.Text = rpRecord.xinshuchuliang.ToString();
|
|
|
- try
|
|
|
- {
|
|
|
- double hbp = rpRecord.xinshuchuliang;
|
|
|
- if (hbp > 7)
|
|
|
- {
|
|
|
- table2.Cell(11, 3).Range.Text = "↑";
|
|
|
- }
|
|
|
- else if (hbp < 3)
|
|
|
- {
|
|
|
- table2.Cell(11, 3).Range.Text = "↓";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- }
|
|
|
- table2.Cell(11, 4).Range.Text = "3-7L/min";
|
|
|
-
|
|
|
- table2.Cell(12, 1).Range.Text = "外周阻力TPR:";
|
|
|
- table2.Cell(12, 2).Range.Text = rpRecord.waizhouzuli.ToString();
|
|
|
- try
|
|
|
- {
|
|
|
- double hbp = rpRecord.waizhouzuli;
|
|
|
- if (hbp > 1.4)
|
|
|
- {
|
|
|
- table2.Cell(12, 3).Range.Text = "↑";
|
|
|
- }
|
|
|
- else if (hbp < 0.9)
|
|
|
- {
|
|
|
- table2.Cell(12, 3).Range.Text = "↓";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- }
|
|
|
- table2.Cell(12, 4).Range.Text = "0.9-1.4PRU";
|
|
|
-
|
|
|
- table2.Cell(13, 1).Range.Text = "每搏量SV:";
|
|
|
- table2.Cell(13, 2).Range.Text = rpRecord.meiboliang.ToString();
|
|
|
- try
|
|
|
- {
|
|
|
- double hbp = rpRecord.meiboliang;
|
|
|
- if (hbp > 100)
|
|
|
- {
|
|
|
- table2.Cell(13, 3).Range.Text = "↑";
|
|
|
- }
|
|
|
- else if (hbp < 60)
|
|
|
- {
|
|
|
- table2.Cell(13, 3).Range.Text = "↓";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- }
|
|
|
- table2.Cell(13, 4).Range.Text = "60-100ml";
|
|
|
-
|
|
|
- table2.Cell(14, 1).Range.Text = "心脏指数CI:";
|
|
|
- table2.Cell(14, 2).Range.Text = rpRecord.xinzangzhishu.ToString();
|
|
|
- try
|
|
|
- {
|
|
|
- double hbp = rpRecord.xinzangzhishu;
|
|
|
- if (hbp > 4)
|
|
|
- {
|
|
|
- table2.Cell(14, 3).Range.Text = "↑";
|
|
|
- }
|
|
|
- else if (hbp < 2.5)
|
|
|
- {
|
|
|
- table2.Cell(14, 3).Range.Text = "↓";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- }
|
|
|
- table2.Cell(14, 4).Range.Text = "2.5-4";
|
|
|
-
|
|
|
- table2.Cell(15, 1).Range.Text = "心搏指数SI:";
|
|
|
- table2.Cell(15, 2).Range.Text = rpRecord.xinbozhishu.ToString();
|
|
|
- try
|
|
|
- {
|
|
|
- double hbp = rpRecord.xinbozhishu;
|
|
|
- if (hbp > 60)
|
|
|
- {
|
|
|
- table2.Cell(15, 3).Range.Text = "↑";
|
|
|
- }
|
|
|
- else if (hbp < 40)
|
|
|
- {
|
|
|
- table2.Cell(15, 3).Range.Text = "↓";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- }
|
|
|
- table2.Cell(15, 4).Range.Text = "40-60ml/m*m";
|
|
|
-
|
|
|
- table2.Cell(16, 1).Range.Text = "顺应性AC:";
|
|
|
- table2.Cell(16, 2).Range.Text = rpRecord.shunyinxing.ToString();
|
|
|
- try
|
|
|
- {
|
|
|
- double hbp = rpRecord.shunyinxing;
|
|
|
- if (hbp > 2)
|
|
|
- {
|
|
|
- table2.Cell(16, 3).Range.Text = "↑";
|
|
|
- }
|
|
|
- else if (hbp < 1.2)
|
|
|
- {
|
|
|
- table2.Cell(16, 3).Range.Text = "↓";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- }
|
|
|
- table2.Cell(16, 4).Range.Text = "1.2-2ml/mmHg";
|
|
|
-
|
|
|
- table2.Cell(17, 1).Range.Text = "心率HR:";
|
|
|
- table2.Cell(17, 2).Range.Text = "";
|
|
|
- table2.Cell(17, 4).Range.Text = "bpm";
|
|
|
-
|
|
|
- table2.Cell(18, 1).Range.Text = "中心血流量CBF:";
|
|
|
- table2.Cell(18, 2).Range.Text = rpRecord.zhongxinxueliuliang.ToString();
|
|
|
-
|
|
|
- table2.Cell(19, 1).Range.Text = "血液黏度V:";
|
|
|
- table2.Cell(19, 2).Range.Text = rpRecord.xueyeniandu.ToString();
|
|
|
- try
|
|
|
- {
|
|
|
- double hbp = rpRecord.xueyeniandu;
|
|
|
- if (hbp > 4.5)
|
|
|
- {
|
|
|
- table2.Cell(19, 3).Range.Text = "↑";
|
|
|
- }
|
|
|
- else if (hbp < 3.8)
|
|
|
- {
|
|
|
- table2.Cell(16, 3).Range.Text = "↓";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- }
|
|
|
- table2.Cell(19, 4).Range.Text = "3.8-4.5CP";
|
|
|
-
|
|
|
- table2.Cell(20, 1).Range.Text = "平均滞留时间T:";
|
|
|
- table2.Cell(20, 2).Range.Text = rpRecord.pingjunzhiliushijian.ToString();
|
|
|
- try
|
|
|
- {
|
|
|
- double hbp = rpRecord.pingjunzhiliushijian;
|
|
|
- if (hbp > 33)
|
|
|
- {
|
|
|
- table2.Cell(20, 3).Range.Text = "↑";
|
|
|
- }
|
|
|
- else if (hbp < 20)
|
|
|
- {
|
|
|
- table2.Cell(20, 3).Range.Text = "↓";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- }
|
|
|
- table2.Cell(20, 4).Range.Text = "20-33s";
|
|
|
- //21项开始自动生成
|
|
|
- int startIdx = 21;
|
|
|
- /*
|
|
|
- for (int i = 0; i < expressions.Count && i + startIdx < 41; ++i)
|
|
|
- {
|
|
|
- SQLite.Expression oneExpression = SQLite.SQLiteModel.getExpressionByContent(expressions.ElementAt(i).Key);
|
|
|
- table2.Cell(i + startIdx, 1).Range.Text = oneExpression.expression_description;
|
|
|
- if (expressions.ElementAt(i).Value == Double.MinValue)
|
|
|
- {
|
|
|
- table2.Cell(i + startIdx, 2).Range.Text = "--";
|
|
|
- continue;
|
|
|
- }
|
|
|
- table2.Cell(i + startIdx, 2).Range.Text = expressions.ElementAt(i).Value.ToString();
|
|
|
-
|
|
|
- if (expressions.ElementAt(i).Value > oneExpression.upBound)
|
|
|
- {
|
|
|
- table2.Cell(i + startIdx, 3).Range.Text = "↑";
|
|
|
- }
|
|
|
- else if (expressions.ElementAt(i).Value < (oneExpression.upBound))
|
|
|
- {
|
|
|
- table2.Cell(i + startIdx, 3).Range.Text = "↓";
|
|
|
- }
|
|
|
- table2.Cell(i + startIdx, 4).Range.Text = oneExpression.downBound.ToString() + "-" + oneExpression.upBound.ToString();
|
|
|
- }*/
|
|
|
-
|
|
|
- //诊断部分
|
|
|
- string pailiangRemark = "";
|
|
|
- string zuliRemark = "";
|
|
|
- if (rpRecord.xpl < 4)
|
|
|
- {
|
|
|
- pailiangRemark = "低排";
|
|
|
- }
|
|
|
- else if(rpRecord.xpl > 5)
|
|
|
- {
|
|
|
- pailiangRemark = "高排";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- pailiangRemark = "中排";
|
|
|
- }
|
|
|
- if (rpRecord.wzzl < 4)
|
|
|
- {
|
|
|
- zuliRemark = "低阻";
|
|
|
- }
|
|
|
- else if (rpRecord.wzzl > 5)
|
|
|
- {
|
|
|
- zuliRemark = "高阻";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- zuliRemark = "中阻";
|
|
|
- }
|
|
|
- table2.Cell(2, 5).Range.Text = "自动分析结果:\n"
|
|
|
- + "一、参考结果\n"
|
|
|
- + rpRecord.cankaojieguo + "\n"
|
|
|
- + "二、参考指数\n"
|
|
|
- + "排量:" + rpRecord.xpl.ToString() + "(" + pailiangRemark + ")\n阻力:" + rpRecord.wzzl.ToString() + "(" + zuliRemark + ")\n"
|
|
|
- + "三、脉搏波形\n" + rcd.r_type + "\n"
|
|
|
- + "四、医师建议" + "\n风险等级:" + generalExpressionResult + "\n";// + mw.textBoxDiagnosis.Text;
|
|
|
- table2.Cell(2, 5).Range.Font.Size = 15;
|
|
|
-
|
|
|
- //自动分析结果
|
|
|
- /*
|
|
|
- oPara1.Range.Text = "______________________________________________________________________________________________________________";
|
|
|
- oPara1.Range.Font.Bold = fontBold;
|
|
|
- oPara1.Range.InsertParagraphAfter();
|
|
|
- */
|
|
|
-
|
|
|
- //插入分页符
|
|
|
- object oPageBreak = Microsoft.Office.Interop.Word.WdBreakType.wdPageBreak;
|
|
|
-
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordDoc.ActiveWindow.Selection.InsertBreak(ref oPageBreak);
|
|
|
-
|
|
|
- //图片页
|
|
|
- //图片1
|
|
|
- WordApp.Selection.ParagraphFormat.FirstLineIndent = 80;
|
|
|
- oPara1.Range.Text = "\n桡动脉波形图:";
|
|
|
- oPara1.Range.Font.Bold = 0;
|
|
|
- oPara1.Range.Font.Size = 15;
|
|
|
- oPara1.Format.SpaceAfter = space;
|
|
|
- oPara1.Range.InsertParagraphAfter();
|
|
|
-
|
|
|
-
|
|
|
- //插图
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.FirstLineIndent = 0;
|
|
|
- string picture1 = Constants.tmpRPWave;
|
|
|
- //定义要向文档中插入图片的位置
|
|
|
- object range = WordDoc.Paragraphs.Last.Range;
|
|
|
- //定义该图片是否为外部链接
|
|
|
- object linkToFile = false;//默认
|
|
|
- //定义插入的图片是否随word一起保存
|
|
|
- object saveWithDocument = true;
|
|
|
- //向word中写入图片
|
|
|
- try
|
|
|
- {
|
|
|
- WordDoc.InlineShapes.AddPicture(picture1, ref oMissing, ref oMissing, ref oMissing);
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- Console.WriteLine("fail to load raodongmai.");
|
|
|
- }
|
|
|
-
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = MSWord.WdParagraphAlignment.wdAlignParagraphCenter;//居中显示图片
|
|
|
- WordDoc.InlineShapes[1].Height = 130;
|
|
|
- WordDoc.InlineShapes[1].Width = 490;
|
|
|
- //WordDoc.Content.InsertAfter("\n");
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
|
|
|
- WordApp.Selection.Font.Size = 10;//字体大小
|
|
|
- WordApp.Selection.TypeText("右侧桡动脉\n");
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- oPara1.Range.Text = "____________________________________________________________________________________________";
|
|
|
- oPara1.Range.Font.Bold = 0;
|
|
|
- oPara1.Range.Font.Size = 10;
|
|
|
- oPara1.Range.InsertParagraphAfter();
|
|
|
-
|
|
|
-
|
|
|
- //图片2.3
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphLeft;
|
|
|
- WordApp.Selection.ParagraphFormat.FirstLineIndent = 80;
|
|
|
- oPara1.Range.Text = cfg.report_figure_name + ":";
|
|
|
- oPara1.Range.Font.Bold = 0;
|
|
|
- oPara1.Range.Font.Size = 15;
|
|
|
- oPara1.Format.SpaceAfter = space;
|
|
|
- oPara1.Format.SpaceBefore = 0;
|
|
|
- oPara1.Range.InsertParagraphAfter();
|
|
|
-
|
|
|
-
|
|
|
- //插图
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.FirstLineIndent = 0;
|
|
|
- string picture2 = Constants.tmpPPGLeftInfraredWave;
|
|
|
- string picture3 = Constants.tmpPPGLeftRedWave;
|
|
|
- string picture4 = Constants.tmpPPGRightRedWave;
|
|
|
- string picture5 = Constants.tmpPPGRightInfraredWave;
|
|
|
- //向word中写入图片
|
|
|
- try
|
|
|
- {
|
|
|
- WordDoc.InlineShapes.AddPicture(picture2, ref oMissing, ref oMissing, ref oMissing);
|
|
|
- WordDoc.InlineShapes.AddPicture(picture3, ref oMissing, ref oMissing, ref oMissing);
|
|
|
- WordDoc.InlineShapes.AddPicture(picture4, ref oMissing, ref oMissing, ref oMissing);
|
|
|
- WordDoc.InlineShapes.AddPicture(picture5, ref oMissing, ref oMissing, ref oMissing);
|
|
|
-
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- Console.WriteLine("fail to load a image.");
|
|
|
- }
|
|
|
-
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = MSWord.WdParagraphAlignment.wdAlignParagraphCenter;//居中显示图片
|
|
|
- for(int i = 2; i < 6; ++i)
|
|
|
- {
|
|
|
- WordDoc.InlineShapes[i].Height = 80;
|
|
|
- WordDoc.InlineShapes[i].Width = 200;
|
|
|
- }
|
|
|
-
|
|
|
- //WordDoc.Content.InsertAfter("\n");
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
|
|
|
- WordApp.Selection.Font.Size = 10;//字体大小
|
|
|
- WordApp.Selection.TypeText("左手手指 红外光\n");
|
|
|
- //左手红光
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.FirstLineIndent = 0;
|
|
|
- /*
|
|
|
- try
|
|
|
- {
|
|
|
- WordDoc.InlineShapes.AddPicture(picture3, ref oMissing, ref oMissing, ref oMissing);
|
|
|
-
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- Console.WriteLine("fail to load ppg Left2.");
|
|
|
- }
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = MSWord.WdParagraphAlignment.wdAlignParagraphCenter;//居中显示图片
|
|
|
- WordDoc.InlineShapes[3].Height = 100;
|
|
|
- WordDoc.InlineShapes[3].Width = 245;
|
|
|
- //WordDoc.Content.InsertAfter("\n");
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
|
|
|
- WordApp.Selection.Font.Size = 10;//字体大小
|
|
|
- WordApp.Selection.TypeText("左手手指 红光\n");
|
|
|
- //右手红外光
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.FirstLineIndent = 0;
|
|
|
-
|
|
|
- //向word中写入图片
|
|
|
- try
|
|
|
- {
|
|
|
- WordDoc.InlineShapes.AddPicture(picture4, ref oMissing, ref oMissing, ref oMissing);
|
|
|
-
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- Console.WriteLine("fail to load ppg right1.");
|
|
|
- }
|
|
|
-
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = MSWord.WdParagraphAlignment.wdAlignParagraphCenter;//居中显示图片
|
|
|
- WordDoc.InlineShapes[4].Height = 130;
|
|
|
- WordDoc.InlineShapes[4].Width = 490;
|
|
|
- //WordDoc.Content.InsertAfter("\n");
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
|
|
|
- WordApp.Selection.Font.Size = 10;//字体大小
|
|
|
- WordApp.Selection.TypeText("右手手指 红外光\n");
|
|
|
- //右手红外光
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.FirstLineIndent = 0;
|
|
|
-
|
|
|
- //向word中写入图片
|
|
|
- try
|
|
|
- {
|
|
|
- WordDoc.InlineShapes.AddPicture(picture5, ref oMissing, ref oMissing, ref oMissing);
|
|
|
-
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- Console.WriteLine("fail to load ppg right1.");
|
|
|
- }
|
|
|
-
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = MSWord.WdParagraphAlignment.wdAlignParagraphCenter;//居中显示图片
|
|
|
- WordDoc.InlineShapes[5].Height = 130;
|
|
|
- WordDoc.InlineShapes[5].Width = 490;
|
|
|
- //WordDoc.Content.InsertAfter("\n");
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
|
|
|
- WordApp.Selection.Font.Size = 10;//字体大小
|
|
|
- WordApp.Selection.TypeText("右手手指 红光\n");
|
|
|
- */
|
|
|
- //插入分页符
|
|
|
- //object oPageBreak = Microsoft.Office.Interop.Word.WdBreakType.wdPageBreak;
|
|
|
- //WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- // WordDoc.ActiveWindow.Selection.InsertBreak(ref oPageBreak);
|
|
|
-
|
|
|
-
|
|
|
- //第三页
|
|
|
- /*
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphLeft;
|
|
|
- WordApp.Selection.ParagraphFormat.FirstLineIndent = 80;
|
|
|
- oPara1.Range.Text = "趋势图:";
|
|
|
- oPara1.Range.Font.Bold = 0;
|
|
|
- oPara1.Range.Font.Size = 15;
|
|
|
- oPara1.Format.SpaceBefore = space;
|
|
|
- oPara1.Format.SpaceAfter = space;
|
|
|
- oPara1.Range.InsertParagraphAfter();
|
|
|
-
|
|
|
-
|
|
|
- //插图
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.FirstLineIndent = 0;
|
|
|
- string picture4 = "c:\\picture\\raodongmai.png";
|
|
|
- //定义要向文档中插入图片的位置
|
|
|
- //向word中写入图片
|
|
|
- WordDoc.InlineShapes.AddPicture(picture4, ref oMissing, ref oMissing, ref oMissing);
|
|
|
-
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = MSWord.WdParagraphAlignment.wdAlignParagraphCenter;//居中显示图片
|
|
|
- WordDoc.InlineShapes[4].Height = 130;
|
|
|
- WordDoc.InlineShapes[4].Width = 490;
|
|
|
- //WordDoc.Content.InsertAfter("\n");
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
|
|
|
- WordApp.Selection.Font.Size = 10;//字体大小
|
|
|
- WordApp.Selection.TypeText("IPR 右侧桡动脉\n");
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- oPara1.Range.Text = "________________________________________________________________________________________________________________";
|
|
|
- oPara1.Range.Font.Bold = 0;
|
|
|
- oPara1.Range.Font.Size = 10;
|
|
|
- oPara1.Format.SpaceAfter = 0;
|
|
|
- oPara1.Range.InsertParagraphAfter();
|
|
|
-
|
|
|
-
|
|
|
- //图片2.3
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphLeft;
|
|
|
- WordApp.Selection.ParagraphFormat.FirstLineIndent = 80;
|
|
|
- oPara1.Range.Text = "趋势图:";
|
|
|
- oPara1.Range.Font.Bold = 0;
|
|
|
- oPara1.Range.Font.Size = 15;
|
|
|
- oPara1.Format.SpaceAfter = space;
|
|
|
- oPara1.Range.InsertParagraphAfter();
|
|
|
-
|
|
|
-
|
|
|
- //插图
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.FirstLineIndent = 0;
|
|
|
- string picture5 = "c:\\picture\\2.png";
|
|
|
- //向word中写入图片
|
|
|
- WordDoc.InlineShapes.AddPicture(picture5, ref oMissing, ref oMissing, ref oMissing);
|
|
|
-
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = MSWord.WdParagraphAlignment.wdAlignParagraphCenter;//居中显示图片
|
|
|
- WordDoc.InlineShapes[5].Height = 130;
|
|
|
- WordDoc.InlineShapes[5].Width = 490;
|
|
|
- //WordDoc.Content.InsertAfter("\n");
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
|
|
|
- WordApp.Selection.Font.Size = 10;//字体大小
|
|
|
- WordApp.Selection.TypeText("RI 左手手指 红外光\n");
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.FirstLineIndent = 0;
|
|
|
- string picture6 = "c:\\picture\\3.png";
|
|
|
- //向word中写入图片
|
|
|
- WordDoc.InlineShapes.AddPicture(picture6, ref oMissing, ref oMissing, ref oMissing);
|
|
|
-
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = MSWord.WdParagraphAlignment.wdAlignParagraphCenter;//居中显示图片
|
|
|
- WordDoc.InlineShapes[6].Height = 130;
|
|
|
- WordDoc.InlineShapes[6].Width = 490;
|
|
|
- //WordDoc.Content.InsertAfter("\n");
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
|
|
|
- WordApp.Selection.Font.Size = 10;//字体大小
|
|
|
- WordApp.Selection.TypeText("RI 右手手指 红外光\n");
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- //*/
|
|
|
- oPara1.Range.Text = "____________________________________________________________________________________________";
|
|
|
- oPara1.Range.Font.Bold = 0;
|
|
|
- oPara1.Range.Font.Size = 10;
|
|
|
- oPara1.Format.SpaceBefore = 0;
|
|
|
- oPara1.Format.SpaceAfter = 0;
|
|
|
- oPara1.Range.InsertParagraphAfter();
|
|
|
- //医师签名
|
|
|
- WordApp.Selection.EndKey(ref unite, ref oMissing);
|
|
|
- WordApp.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphLeft;
|
|
|
- WordApp.Selection.ParagraphFormat.FirstLineIndent = 150;
|
|
|
- oPara1.Range.Text = "检查医师:" + doct.name + " 医师签名:";
|
|
|
- oPara1.Range.Font.Bold = 0;
|
|
|
- oPara1.Range.Font.Size = 15;
|
|
|
- oPara1.Format.SpaceAfter = 0;
|
|
|
- oPara1.Format.SpaceBefore = 0;
|
|
|
- oPara1.Range.InsertParagraphAfter();
|
|
|
-
|
|
|
-
|
|
|
- // object LinkToFile = false;
|
|
|
- object SaveWithDocument = true;
|
|
|
- // object Anchor = WordDoc.Application.Selection.Range;
|
|
|
- /*
|
|
|
- WordApp.Selection.MoveDown(ref WdLine, ref count, ref oMissing);//移动焦点
|
|
|
- WordDoc.Application.ActiveDocument.InlineShapes.AddPicture(picName4, ref LinkToFile, ref SaveWithDocument, ref Anchor);
|
|
|
- WordApp.Selection.MoveDown(ref WdLine, ref count, ref oMissing);//移动焦点
|
|
|
- WordDoc.Application.ActiveDocument.InlineShapes.AddPicture(picName3, ref LinkToFile, ref SaveWithDocument, ref Anchor);
|
|
|
- WordApp.Selection.MoveDown(ref WdLine, ref count, ref oMissing);//移动焦点
|
|
|
- WordDoc.Application.ActiveDocument.InlineShapes.AddPicture(picName2, ref LinkToFile, ref SaveWithDocument, ref Anchor);
|
|
|
- WordApp.Selection.MoveDown(ref WdLine, ref count, ref oMissing);//移动焦点
|
|
|
- WordDoc.Application.ActiveDocument.InlineShapes.AddPicture(picName1, ref LinkToFile, ref SaveWithDocument, ref Anchor);
|
|
|
- WordApp.Selection.MoveDown(ref WdLine, ref count, ref oMissing);//移动焦点
|
|
|
- WordDoc.Application.ActiveDocument.InlineShapes.AddPicture(picName0, ref LinkToFile, ref SaveWithDocument, ref Anchor);
|
|
|
- */
|
|
|
- //保存
|
|
|
- WordDoc.Save();
|
|
|
- WordDoc.ExportAsFixedFormat(pdfFileName, Microsoft.Office.Interop.Word.WdExportFormat.wdExportFormatPDF, true);
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- Console.WriteLine(e.Message);
|
|
|
- Console.WriteLine(e.StackTrace);
|
|
|
-
|
|
|
- }
|
|
|
- finally
|
|
|
- {
|
|
|
- //try
|
|
|
- //{
|
|
|
- WordDoc.Close(ref oMissing, ref oMissing, ref oMissing);
|
|
|
- WordApp.Quit(ref oMissing, ref oMissing, ref oMissing);
|
|
|
- //}
|
|
|
- //catch (Exception)
|
|
|
- //{
|
|
|
-
|
|
|
- //}
|
|
|
-
|
|
|
- try
|
|
|
- {
|
|
|
- File.Delete(fileName);
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- ;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-}
|