From de63d5c4f9094d296a624ffe4ad2722ceb63a31d Mon Sep 17 00:00:00 2001 From: lxd <1004405501@qq.com> Date: Fri, 27 Dec 2024 17:21:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A7=A3=E6=9E=90=E6=8E=A5?= =?UTF-8?q?=E5=8F=97=E5=88=B0=E7=9A=84=E6=95=B0=E6=8D=AE=E9=80=BB=E8=BE=91?= =?UTF-8?q?=20=E5=92=8C=E5=AE=9E=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1200Gxml心电图绘制/Form3.cs | 264 ++++++++++++------------- 1200Gxml心电图绘制/leadDataModel.cs | 27 +-- 1200Gxml心电图绘制/服务/PatientInfo.cs | 4 +- 1200Gxml心电图绘制/服务/print.cs | 24 +-- 4 files changed, 161 insertions(+), 158 deletions(-) diff --git a/1200Gxml心电图绘制/Form3.cs b/1200Gxml心电图绘制/Form3.cs index f84e5cb..e4c7fa6 100644 --- a/1200Gxml心电图绘制/Form3.cs +++ b/1200Gxml心电图绘制/Form3.cs @@ -244,154 +244,154 @@ namespace _1200Gxml心电图绘制 /// public void GetEcgViewDataImage(Image img, string addr) { - _ecgDataDicAfterFilter.Clear(); - string ecgDataJsonStr = File.ReadAllText(Application.StartupPath + @"\60心拍心电图数据JSON.txt"); - leadDataModel LDM = JsonConvert.DeserializeObject(ecgDataJsonStr); - float[] LEAD_I = valueConvert(Array.ConvertAll(LDM.LEAD_I.Split(' '), float.Parse)); - _ecgDataDicAfterFilter.Add(0, LEAD_I.ToList()); - float[] LEAD_II = valueConvert(Array.ConvertAll(LDM.LEAD_II.Split(' '), float.Parse)); - _ecgDataDicAfterFilter.Add(1, LEAD_II.ToList()); - float[] LEAD_III = valueConvert(Array.ConvertAll(LDM.LEAD_III.Split(' '), float.Parse)); - _ecgDataDicAfterFilter.Add(2, LEAD_III.ToList()); - float[] LEAD_AVR = valueConvert(Array.ConvertAll(LDM.LEAD_AVR.Split(' '), float.Parse)); - _ecgDataDicAfterFilter.Add(3, LEAD_AVR.ToList()); - float[] LEAD_AVL = valueConvert(Array.ConvertAll(LDM.LEAD_AVL.Split(' '), float.Parse)); - _ecgDataDicAfterFilter.Add(4, LEAD_AVL.ToList()); - float[] LEAD_AVF = valueConvert(Array.ConvertAll(LDM.LEAD_AVF.Split(' '), float.Parse)); - _ecgDataDicAfterFilter.Add(5, LEAD_AVF.ToList()); - float[] LEAD_V1 = valueConvert(Array.ConvertAll(LDM.LEAD_V1.Split(' '), float.Parse)); - _ecgDataDicAfterFilter.Add(6, LEAD_V1.ToList()); - float[] LEAD_V2 = valueConvert(Array.ConvertAll(LDM.LEAD_V2.Split(' '), float.Parse)); - _ecgDataDicAfterFilter.Add(7, LEAD_V2.ToList()); - float[] LEAD_V3 = valueConvert(Array.ConvertAll(LDM.LEAD_V3.Split(' '), float.Parse)); - _ecgDataDicAfterFilter.Add(8, LEAD_V3.ToList()); - float[] LEAD_V4 = valueConvert(Array.ConvertAll(LDM.LEAD_V4.Split(' '), float.Parse)); - _ecgDataDicAfterFilter.Add(9, LEAD_V4.ToList()); - float[] LEAD_V5 = valueConvert(Array.ConvertAll(LDM.LEAD_V5.Split(' '), float.Parse)); - _ecgDataDicAfterFilter.Add(10, LEAD_V5.ToList()); - float[] LEAD_V6 = valueConvert(Array.ConvertAll(LDM.LEAD_V6.Split(' '), float.Parse)); - _ecgDataDicAfterFilter.Add(11, LEAD_V6.ToList()); + //_ecgDataDicAfterFilter.Clear(); + //string ecgDataJsonStr = File.ReadAllText(Application.StartupPath + @"\60心拍心电图数据JSON.txt"); + //leadDataModel LDM = JsonConvert.DeserializeObject(ecgDataJsonStr); + //float[] LEAD_I = valueConvert(Array.ConvertAll(LDM.LEAD_I.Split(' '), float.Parse)); + //_ecgDataDicAfterFilter.Add(0, LEAD_I.ToList()); + //float[] LEAD_II = valueConvert(Array.ConvertAll(LDM.LEAD_II.Split(' '), float.Parse)); + //_ecgDataDicAfterFilter.Add(1, LEAD_II.ToList()); + //float[] LEAD_III = valueConvert(Array.ConvertAll(LDM.LEAD_III.Split(' '), float.Parse)); + //_ecgDataDicAfterFilter.Add(2, LEAD_III.ToList()); + //float[] LEAD_AVR = valueConvert(Array.ConvertAll(LDM.LEAD_AVR.Split(' '), float.Parse)); + //_ecgDataDicAfterFilter.Add(3, LEAD_AVR.ToList()); + //float[] LEAD_AVL = valueConvert(Array.ConvertAll(LDM.LEAD_AVL.Split(' '), float.Parse)); + //_ecgDataDicAfterFilter.Add(4, LEAD_AVL.ToList()); + //float[] LEAD_AVF = valueConvert(Array.ConvertAll(LDM.LEAD_AVF.Split(' '), float.Parse)); + //_ecgDataDicAfterFilter.Add(5, LEAD_AVF.ToList()); + //float[] LEAD_V1 = valueConvert(Array.ConvertAll(LDM.LEAD_V1.Split(' '), float.Parse)); + //_ecgDataDicAfterFilter.Add(6, LEAD_V1.ToList()); + //float[] LEAD_V2 = valueConvert(Array.ConvertAll(LDM.LEAD_V2.Split(' '), float.Parse)); + //_ecgDataDicAfterFilter.Add(7, LEAD_V2.ToList()); + //float[] LEAD_V3 = valueConvert(Array.ConvertAll(LDM.LEAD_V3.Split(' '), float.Parse)); + //_ecgDataDicAfterFilter.Add(8, LEAD_V3.ToList()); + //float[] LEAD_V4 = valueConvert(Array.ConvertAll(LDM.LEAD_V4.Split(' '), float.Parse)); + //_ecgDataDicAfterFilter.Add(9, LEAD_V4.ToList()); + //float[] LEAD_V5 = valueConvert(Array.ConvertAll(LDM.LEAD_V5.Split(' '), float.Parse)); + //_ecgDataDicAfterFilter.Add(10, LEAD_V5.ToList()); + //float[] LEAD_V6 = valueConvert(Array.ConvertAll(LDM.LEAD_V6.Split(' '), float.Parse)); + //_ecgDataDicAfterFilter.Add(11, LEAD_V6.ToList()); - _reportTitleContent = "十二导联静态心电图报告"; - _idStr = "5566778899"; - collectTime = "2024-12-20 13:28:51"; - //长两导的模式下 默认添加 第一导 和 第二导联 为 长显示两导联 - _longLeadInfo.Add(0); - _longLeadInfo.Add(1); - //长三导的模式下 默认添加 第一导 和 第二导联和第三导联 为 长显示三导联 - _longLeadInfo3.Add(0); - _longLeadInfo3.Add(1); - _longLeadInfo3.Add(2); - var cpew = new CommonPrintEcgWave(); - var filter = _printFilter; - _ecgBitMap = new Bitmap(1090 * _printDpi / Dpi, 760 * _printDpi / Dpi); - _ecgBitMap.SetResolution(_printDpi, _printDpi); - cpew.InitEcgParameter(_ecgBitMap, _ecgDataDicAfterFilter, _isQiBo, _paperSpeed, _amplitude); + //_reportTitleContent = "十二导联静态心电图报告"; + //_idStr = "5566778899"; + //collectTime = "2024-12-20 13:28:51"; + ////长两导的模式下 默认添加 第一导 和 第二导联 为 长显示两导联 + //_longLeadInfo.Add(0); + //_longLeadInfo.Add(1); + ////长三导的模式下 默认添加 第一导 和 第二导联和第三导联 为 长显示三导联 + //_longLeadInfo3.Add(0); + //_longLeadInfo3.Add(1); + //_longLeadInfo3.Add(2); + //var cpew = new CommonPrintEcgWave(); + //var filter = _printFilter; + //_ecgBitMap = new Bitmap(1090 * _printDpi / Dpi, 760 * _printDpi / Dpi); + //_ecgBitMap.SetResolution(_printDpi, _printDpi); + //cpew.InitEcgParameter(_ecgBitMap, _ecgDataDicAfterFilter, _isQiBo, _paperSpeed, _amplitude); - //************************************************************************ - var ecgInfoList = new string[13]; - ecgInfoList[0] = "张三"; - ecgInfoList[1] = "女"; - ecgInfoList[2] = "28"; - ecgInfoList[3] = "RV5+SV1"; - ecgInfoList[4] = "PR间期"; - ecgInfoList[5] = "QRS间期"; - ecgInfoList[6] = "QT/QTC"; - ecgInfoList[7] = "QRS电轴"; - ecgInfoList[8] = "RV5/SV1"; - ecgInfoList[9] = "心率"; - ecgInfoList[10] = "病室"; - ecgInfoList[11] = "床号"; - ecgInfoList[12] = "住院号"; - SetAandP(); //设置增益和走速 + ////************************************************************************ + //var ecgInfoList = new string[13]; + //ecgInfoList[0] = "张三"; + //ecgInfoList[1] = "女"; + //ecgInfoList[2] = "28"; + //ecgInfoList[3] = "RV5+SV1"; + //ecgInfoList[4] = "PR间期"; + //ecgInfoList[5] = "QRS间期"; + //ecgInfoList[6] = "QT/QTC"; + //ecgInfoList[7] = "QRS电轴"; + //ecgInfoList[8] = "RV5/SV1"; + //ecgInfoList[9] = "心率"; + //ecgInfoList[10] = "病室"; + //ecgInfoList[11] = "床号"; + //ecgInfoList[12] = "住院号"; + //SetAandP(); //设置增益和走速 - var diagContent = "这里是心电图的诊断结论"; - var diagArray = diagContent.Split('\n'); - diagContent = string.Empty; - for (var i = 0; i < diagArray.Length; i++) diagContent += diagArray[i].Trim(); + //var diagContent = "这里是心电图的诊断结论"; + //var diagArray = diagContent.Split('\n'); + //diagContent = string.Empty; + //for (var i = 0; i < diagArray.Length; i++) diagContent += diagArray[i].Trim(); - if (_ecgDataDicAfterFilter.Count > 0) - _filterIndex = 0; - else - _filterIndex = 0; - // _leadindexdata = hScrollBar_Lead.Value * _filterIndex; - _leadindexdata = _filterIndex; + //if (_ecgDataDicAfterFilter.Count > 0) + // _filterIndex = 0; + //else + // _filterIndex = 0; + //// _leadindexdata = hScrollBar_Lead.Value * _filterIndex; + //_leadindexdata = _filterIndex; - if (combo_reportModel.Text == LeaderName15) filter += " 十五加一长导模式"; - if (combo_reportModel.Text == LeaderName18) filter += " 十八导模式"; - if (combo_reportModel.SelectedIndex == 2) - { - cpew.PrintBackGroundGrid(16, 196); - cpew.PrintLongReportHeadInfo(_reportTitleContent); - cpew.PrintLongEcgInfo(ecgInfoList, _idStr); - cpew.PrintLongDiagInfo(diagContent, "医生姓名", - "2024-12-20", filter, - collectTime, "心电图科", _amp, _ps, img, addr); - } - else - { - cpew.PrintBackGroundGrid(40, 196); //(197-42)*12=1860像素 - cpew.PrintReportHeadInfo(_reportTitleContent, "2024-12-20"); - cpew.PrintEcgInfo(ecgInfoList, _idStr); - cpew.PrintDiagInfo(diagContent, "医生姓名", filter, - collectTime, "心电图科", _amp, _ps, img, addr); - } + //if (combo_reportModel.Text == LeaderName15) filter += " 十五加一长导模式"; + //if (combo_reportModel.Text == LeaderName18) filter += " 十八导模式"; + //if (combo_reportModel.SelectedIndex == 2) + //{ + // cpew.PrintBackGroundGrid(16, 196); + // cpew.PrintLongReportHeadInfo(_reportTitleContent); + // cpew.PrintLongEcgInfo(ecgInfoList, _idStr); + // cpew.PrintLongDiagInfo(diagContent, "医生姓名", + // "2024-12-20", filter, + // collectTime, "心电图科", _amp, _ps, img, addr); + //} + //else + //{ + // cpew.PrintBackGroundGrid(40, 196); //(197-42)*12=1860像素 + // cpew.PrintReportHeadInfo(_reportTitleContent, "2024-12-20"); + // cpew.PrintEcgInfo(ecgInfoList, _idStr); + // cpew.PrintDiagInfo(diagContent, "医生姓名", filter, + // collectTime, "心电图科", _amp, _ps, img, addr); + //} - //6x2 - if (combo_reportModel.SelectedIndex == 0) - { - cpew.PrintEcgWave(8, 1, _leadindexdata); - cpew.PrintEcgLeadName(_calibrationVoltage * Coefficient); - } + ////6x2 + //if (combo_reportModel.SelectedIndex == 0) + //{ + // cpew.PrintEcgWave(8, 1, _leadindexdata); + // cpew.PrintEcgLeadName(_calibrationVoltage * Coefficient); + //} - //6x2+2 - if (combo_reportModel.SelectedIndex == 1) - { - cpew.PrintEcgWave(8, 1, _longLeadInfo, _leadindexdata, _leadindexdata); - cpew.PrintEcgLeadName(_calibrationVoltage * Coefficient, _longLeadInfo); - } + ////6x2+2 + //if (combo_reportModel.SelectedIndex == 1) + //{ + // cpew.PrintEcgWave(8, 1, _longLeadInfo, _leadindexdata, _leadindexdata); + // cpew.PrintEcgLeadName(_calibrationVoltage * Coefficient, _longLeadInfo); + //} - //十二长导 - if (combo_reportModel.SelectedIndex == 2) - { - cpew.PrintLongEcgWave(5, 1, _leadindexdata); - //cpew.PrintLongEcgWave(8, 1, _leadindexdata); - cpew.PrintLongEcgLeadName(_calibrationVoltage * Coefficient); - } + ////十二长导 + //if (combo_reportModel.SelectedIndex == 2) + //{ + // cpew.PrintLongEcgWave(5, 1, _leadindexdata); + // //cpew.PrintLongEcgWave(8, 1, _leadindexdata); + // cpew.PrintLongEcgLeadName(_calibrationVoltage * Coefficient); + //} - //4*3 II长导模式 - if (combo_reportModel.SelectedIndex == 3) - { - cpew.PrintEcgWaveFourOne(8, 1, _leadindexdata, _leadindexdata); - cpew.PrintLeadNameFourOne(_calibrationVoltage * Coefficient, _longLeadInfo); - } + ////4*3 II长导模式 + //if (combo_reportModel.SelectedIndex == 3) + //{ + // cpew.PrintEcgWaveFourOne(8, 1, _leadindexdata, _leadindexdata); + // cpew.PrintLeadNameFourOne(_calibrationVoltage * Coefficient, _longLeadInfo); + //} - //4*3+3 长导模式 - if (combo_reportModel.SelectedIndex == 4) - { - cpew.PrintEcgWaveFourThree(8, 1, _longLeadInfo3, _leadindexdata, _leadindexdata); - cpew.PrintLeadNameFourThree(_calibrationVoltage * Coefficient, _longLeadInfo3); - } + ////4*3+3 长导模式 + //if (combo_reportModel.SelectedIndex == 4) + //{ + // cpew.PrintEcgWaveFourThree(8, 1, _longLeadInfo3, _leadindexdata, _leadindexdata); + // cpew.PrintLeadNameFourThree(_calibrationVoltage * Coefficient, _longLeadInfo3); + //} - //15x1+1导 - if (combo_reportModel.Text.Trim() == LeaderName15) - { - cpew.PrintEcgWaveFifteen(8, 1, _leadindexdata); - cpew.PrintLeadNameFifteen(_calibrationVoltage * Coefficient, LeaderType); - } + ////15x1+1导 + //if (combo_reportModel.Text.Trim() == LeaderName15) + //{ + // cpew.PrintEcgWaveFifteen(8, 1, _leadindexdata); + // cpew.PrintLeadNameFifteen(_calibrationVoltage * Coefficient, LeaderType); + //} - //十八导 - if (combo_reportModel.Text.Trim() == LeaderName18) - { - cpew.PrintEcgWaveEighteen(8, 1, _leadindexdata); - cpew.PrintLeadNameEighteen(_calibrationVoltage * Coefficient); - } + ////十八导 + //if (combo_reportModel.Text.Trim() == LeaderName18) + //{ + // cpew.PrintEcgWaveEighteen(8, 1, _leadindexdata); + // cpew.PrintLeadNameEighteen(_calibrationVoltage * Coefficient); + //} - //_sourceCegBmp = _ecgBitMap; - _ecgBitMap.Save("1.jpg", ImageFormat.Jpeg); + ////_sourceCegBmp = _ecgBitMap; + //_ecgBitMap.Save("1.jpg", ImageFormat.Jpeg); } diff --git a/1200Gxml心电图绘制/leadDataModel.cs b/1200Gxml心电图绘制/leadDataModel.cs index 514ff20..1979dca 100644 --- a/1200Gxml心电图绘制/leadDataModel.cs +++ b/1200Gxml心电图绘制/leadDataModel.cs @@ -8,17 +8,20 @@ namespace 心电图绘制 { public class leadDataModel { - public string LEAD_I { get; set; }// I导联 - public string LEAD_II { get; set; }// II导联 - public string LEAD_III { get; set; }// III导联 - public string LEAD_AVR { get; set; }// AVR导联 - public string LEAD_AVL { get; set; }// AVL导联 - public string LEAD_AVF { get; set; }// AVF导联 - public string LEAD_V1 { get; set; }// V1导联 - public string LEAD_V2 { get; set; }// V2导联 - public string LEAD_V3 { get; set; }// V3导联 - public string LEAD_V4 { get; set; }// V4导联 - public string LEAD_V5 { get; set; }// V5导联 - public string LEAD_V6 { get; set; }// V6导联 + public string[] LEAD_I { get; set; }// I导联 + public string[] LEAD_II { get; set; }// II导联 + public string[] LEAD_III { get; set; }// III导联 + public string[] LEAD_AVR { get; set; }// AVR导联 + public string[] LEAD_AVL { get; set; }// AVL导联 + public string[] LEAD_AVF { get; set; }// AVF导联 + public string[] LEAD_V1 { get; set; }// V1导联 + public string[] LEAD_V2 { get; set; }// V2导联 + public string[] LEAD_V3 { get; set; }// V3导联 + public string[] LEAD_V4 { get; set; }// V4导联 + public string[] LEAD_V5 { get; set; }// V5导联 + public string[] LEAD_V6 { get; set; }// V6导联 + + + } } diff --git a/1200Gxml心电图绘制/服务/PatientInfo.cs b/1200Gxml心电图绘制/服务/PatientInfo.cs index e991878..d48cdb2 100644 --- a/1200Gxml心电图绘制/服务/PatientInfo.cs +++ b/1200Gxml心电图绘制/服务/PatientInfo.cs @@ -12,10 +12,10 @@ namespace 心电图绘制 public string examid { get; set; } public string name { get; set; } public string gender { get; set; } - public int age { get; set; } + public string age { get; set; } public string ward { get; set; } public string regid { get; set; } - public int hr { get; set; } + public string hr { get; set; } public double pr { get; set; } public string qrs { get; set; } public string qtqtc { get; set; } // QT/QTC 被转换为 qtqt diff --git a/1200Gxml心电图绘制/服务/print.cs b/1200Gxml心电图绘制/服务/print.cs index 1621a4c..9c6b078 100644 --- a/1200Gxml心电图绘制/服务/print.cs +++ b/1200Gxml心电图绘制/服务/print.cs @@ -85,29 +85,29 @@ namespace 心电图绘制 // string ecgDataJsonStr = File.ReadAllText(Application.StartupPath + @"\60心拍心电图数据JSON.txt"); string ecgDataJsonStr = json; leadDataModel LDM = JsonConvert.DeserializeObject(ecgDataJsonStr); - float[] LEAD_I = valueConvert(Array.ConvertAll(LDM.LEAD_I.Split(' '), float.Parse)); + float[] LEAD_I = valueConvert(Array.ConvertAll(LDM.LEAD_I, float.Parse)); _ecgDataDicAfterFilter.Add(0, LEAD_I.ToList()); - float[] LEAD_II = valueConvert(Array.ConvertAll(LDM.LEAD_II.Split(' '), float.Parse)); + float[] LEAD_II = valueConvert(Array.ConvertAll(LDM.LEAD_II, float.Parse)); _ecgDataDicAfterFilter.Add(1, LEAD_II.ToList()); - float[] LEAD_III = valueConvert(Array.ConvertAll(LDM.LEAD_III.Split(' '), float.Parse)); + float[] LEAD_III = valueConvert(Array.ConvertAll(LDM.LEAD_III, float.Parse)); _ecgDataDicAfterFilter.Add(2, LEAD_III.ToList()); - float[] LEAD_AVR = valueConvert(Array.ConvertAll(LDM.LEAD_AVR.Split(' '), float.Parse)); + float[] LEAD_AVR = valueConvert(Array.ConvertAll(LDM.LEAD_AVR, float.Parse)); _ecgDataDicAfterFilter.Add(3, LEAD_AVR.ToList()); - float[] LEAD_AVL = valueConvert(Array.ConvertAll(LDM.LEAD_AVL.Split(' '), float.Parse)); + float[] LEAD_AVL = valueConvert(Array.ConvertAll(LDM.LEAD_AVL, float.Parse)); _ecgDataDicAfterFilter.Add(4, LEAD_AVL.ToList()); - float[] LEAD_AVF = valueConvert(Array.ConvertAll(LDM.LEAD_AVF.Split(' '), float.Parse)); + float[] LEAD_AVF = valueConvert(Array.ConvertAll(LDM.LEAD_AVF, float.Parse)); _ecgDataDicAfterFilter.Add(5, LEAD_AVF.ToList()); - float[] LEAD_V1 = valueConvert(Array.ConvertAll(LDM.LEAD_V1.Split(' '), float.Parse)); + float[] LEAD_V1 = valueConvert(Array.ConvertAll(LDM.LEAD_V1, float.Parse)); _ecgDataDicAfterFilter.Add(6, LEAD_V1.ToList()); - float[] LEAD_V2 = valueConvert(Array.ConvertAll(LDM.LEAD_V2.Split(' '), float.Parse)); + float[] LEAD_V2 = valueConvert(Array.ConvertAll(LDM.LEAD_V2, float.Parse)); _ecgDataDicAfterFilter.Add(7, LEAD_V2.ToList()); - float[] LEAD_V3 = valueConvert(Array.ConvertAll(LDM.LEAD_V3.Split(' '), float.Parse)); + float[] LEAD_V3 = valueConvert(Array.ConvertAll(LDM.LEAD_V3, float.Parse)); _ecgDataDicAfterFilter.Add(8, LEAD_V3.ToList()); - float[] LEAD_V4 = valueConvert(Array.ConvertAll(LDM.LEAD_V4.Split(' '), float.Parse)); + float[] LEAD_V4 = valueConvert(Array.ConvertAll(LDM.LEAD_V4, float.Parse)); _ecgDataDicAfterFilter.Add(9, LEAD_V4.ToList()); - float[] LEAD_V5 = valueConvert(Array.ConvertAll(LDM.LEAD_V5.Split(' '), float.Parse)); + float[] LEAD_V5 = valueConvert(Array.ConvertAll(LDM.LEAD_V5, float.Parse)); _ecgDataDicAfterFilter.Add(10, LEAD_V5.ToList()); - float[] LEAD_V6 = valueConvert(Array.ConvertAll(LDM.LEAD_V6.Split(' '), float.Parse)); + float[] LEAD_V6 = valueConvert(Array.ConvertAll(LDM.LEAD_V6, float.Parse)); _ecgDataDicAfterFilter.Add(11, LEAD_V6.ToList()); if (!string.IsNullOrEmpty(info.orgname))