using DevExpress.XtraCharts; using DevExpress.XtraEditors; using HL_FristAidPlatform_Public; using System; using System.Data; namespace HL_FristAidPlatform_Apoplexy { public partial class Form_Statistics : XtraForm { public Form_Statistics() { InitializeComponent(); } /// /// 窗体加载 /// /// /// private void Form_Statistics_Load(object sender, EventArgs e) { dateEdit_Start.TimeValue = DateTime.Now.AddDays(1 - DateTime.Now.Day).Date.ToShortDateString() + " 00:00:00"; dateEdit_End.TimeValue = DateTime.Now.AddDays(1 - DateTime.Now.Day).Date.AddMonths(1).AddDays(-1).ToShortDateString() + " 23:59:59"; comboBoxEdit_Type.SelectedIndex = 0; simpleButton_Search_Click(null, null); } /// /// 统计 /// /// /// private void simpleButton_Search_Click(object sender, EventArgs e) { switch (comboBoxEdit_Type.SelectedIndex) { //case 0: // NIHSSReport();//卒中患者急诊NIHSS评分比例 // break; case 0: IntravenousThrombolysisReport();//缺血性卒中患者在溶栓时间窗内接受静脉溶栓患者比例 break; case 1: MinutesIntravenousThrombolysisReport();//抵达医院60分钟内急性缺血性卒中患者接受静脉溶栓比例 DNT break; case 2: MinutesCTReport();//头颅CT小于25分钟的比例 break; case 3: InterventionalTherapyReport();//入院到开始血管内治疗的时间 break; case 4: StrokeDiagnosisReport();//静脉溶栓治疗36h内发生症状性颅内出血的患者比例 break; //血管内治疗的36h内发生明显颅内出血的患者比例 //卒中患者行去骨瓣减压、血肿清除术的比例及死亡率 //卒中患者行脑室外引流的比例及死亡率 case 13: BoneDiscDecompressionReport();//卒中患者行去骨瓣减压、血肿清除术的比例及死亡率 break; case 14: EVDReport();//卒中患者行脑室外引流的比例及死亡率 break; case 15: WarfarinReport();//与华法林治疗相关的颅内出血率 break; default: break; } } /// /// 卒中患者急诊NIHSS评分比例 /// public void NIHSSReport() { chartControl_Patient.Series.Clear(); chartControl_Patient.Titles.Clear(); DataTable DT = new DataTable(); DataTable DTHNISS = new DataTable(); //没有所有院区权限 只获取当前院区数据 if (!PublicHelp.IsHaveAllDistrictRight(Information.User.ID)) { DT = DBHelpClass.Get("api/service/T_Service_Patient/GetModelByReport?where=DeleteFlag=0 and HospitalGuid='" + Information.Hospital.GUID + "'"); DTHNISS = DBHelpClass.Get("api/service/T_Service_Apoplexy_EmergencyRoom/GetModelByReport?where=NIHSS is not null and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid='" + Information.Hospital.GUID + "')"); } else { DT = DBHelpClass.Get("api/service/T_Service_Patient/GetModelByReport?where=DeleteFlag=0"); DTHNISS = DBHelpClass.Get("api/service/T_Service_Apoplexy_EmergencyRoom/GetModelByReport?where=NIHSS is not null"); } Series series = new Series("NIHSS评分比例统计", ViewType.Pie3D); series.ValueDataMembers[0] = "Value"; series.ArgumentDataMember = "Name"; series.DataSource = CreateChartData("NIHSS未评分病人总数", "NIHSS已评分病人总数", DT == null ? 0 : DT.Rows.Count, DTHNISS == null ? 0 : DTHNISS.Rows.Count); chartControl_Patient.Series.Add(series); series.LegendTextPattern = "{A}:{V}"; series.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;//显示标注标签 ChartTitle chartTitle1 = new ChartTitle(); if (!string.IsNullOrEmpty(dateEdit_Start.TimeValue) && !string.IsNullOrEmpty(dateEdit_End.TimeValue)) { chartTitle1.Text = Convert.ToDateTime(dateEdit_Start.TimeValue).ToString("yyy/MM/dd") + "至" + Convert.ToDateTime(dateEdit_End.TimeValue).ToString("yyy/MM/dd") + "NIHSS评分比例"; } else { chartTitle1.Text = "NIHSS评分比例"; } chartControl_Patient.Titles.Add(chartTitle1); } /// ///缺血性卒中患者在溶栓时间窗内接受静脉溶栓患者比例 /// public void IntravenousThrombolysisReport() { chartControl_Patient.Series.Clear(); chartControl_Patient.Titles.Clear(); DataTable DT = new DataTable(); DataTable DTStrokeDiagnosis = new DataTable(); //没有所有院区权限 只获取当前院区数据 if (!PublicHelp.IsHaveAllDistrictRight(Information.User.ID)) { DT = DBHelpClass.Get("api/service/T_Service_Apoplexy_EmergencyRoom/GetModelByReport?where=DeleteFlag=0 and Diagnose='脑梗死' and ReportType=0 and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid='" + Information.Hospital.GUID + "')"); DTStrokeDiagnosis = DBHelpClass.Get("api/service/T_Service_EMR_Thrombolysis/GetModelByReport?where=DeleteFlag=0 and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid='" + Information.Hospital.GUID + "')"); } else { DT = DBHelpClass.Get("api/service/T_Service_Apoplexy_EmergencyRoom/GetModelByReport?where=DeleteFlag=0 and Diagnose='脑梗死' and ReportType=0"); DTStrokeDiagnosis = DBHelpClass.Get("api/service/T_Service_EMR_Thrombolysis/GetModelByReport?where=DeleteFlag=0"); } Series series = new Series("缺血性卒中静脉溶栓比例", ViewType.Pie3D); series.ValueDataMembers[0] = "Value"; series.ArgumentDataMember = "Name"; series.DataSource = CreateChartData("缺血性卒中未静脉溶栓病人总数", "缺血性卒中已静脉溶栓病人总数", DT == null ? 0 : DT.Rows.Count, DTStrokeDiagnosis == null ? 0 : DTStrokeDiagnosis.Rows.Count); chartControl_Patient.Series.Add(series); series.LegendTextPattern = "{A}:{V}"; series.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;//显示标注标签 ChartTitle chartTitle1 = new ChartTitle(); if (!string.IsNullOrEmpty(dateEdit_Start.TimeValue) && !string.IsNullOrEmpty(dateEdit_End.TimeValue)) { chartTitle1.Text = Convert.ToDateTime(dateEdit_Start.TimeValue).ToString("yyy/MM/dd") + "至" + Convert.ToDateTime(dateEdit_End.TimeValue).ToString("yyy/MM/dd") + "缺血性卒中静脉溶栓比例"; } else { chartTitle1.Text = "缺血性卒中静脉溶栓比例"; } chartControl_Patient.Titles.Add(chartTitle1); } /// ///抵达医院60分钟内急性缺血性卒中患者接受静脉溶栓比例 /// public void MinutesIntravenousThrombolysisReport() { chartControl_Patient.Series.Clear(); chartControl_Patient.Titles.Clear(); DataTable DT = new DataTable(); DataTable DTStrokeDiagnosis = new DataTable(); //没有所有院区权限 只获取当前院区数据 if (!PublicHelp.IsHaveAllDistrictRight(Information.User.ID)) { DT = DBHelpClass.Get("api/service/T_Service_Apoplexy_EmergencyRoom/GetModelByReport?where=DeleteFlag=0 and Diagnose='脑梗死' and ReportType=0 and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid = '" + Information.Hospital.GUID + "')"); DTStrokeDiagnosis = DBHelpClass.Get("api/service/T_Service_EMR_Thrombolysis/GetModelByReport?where=DeleteFlag=0 and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid = '" + Information.Hospital.GUID + "')"); } else { DT = DBHelpClass.Get("api/service/T_Service_Apoplexy_EmergencyRoom/GetModelByReport?where=DeleteFlag=0 and Diagnose='脑梗死' and ReportType=0"); DTStrokeDiagnosis = DBHelpClass.Get("api/service/T_Service_EMR_Thrombolysis/GetModelByReport?where=DeleteFlag=0"); } int thrombolysisCount = 0; int noThrombolysisCount = 0; if (DTStrokeDiagnosis != null) { for (int i = 0; i < DTStrokeDiagnosis.Rows.Count; i++) { if (!string.IsNullOrEmpty(DTStrokeDiagnosis.Rows[i]["DNT"] + "")) { if (Convert.ToInt32(DTStrokeDiagnosis.Rows[i]["DNT"].ToString()) <= 60) { thrombolysisCount += 1; } else { noThrombolysisCount += 1; } } } } Series series = new Series("60分钟静脉溶栓比例", ViewType.Pie3D); series.ValueDataMembers[0] = "Value"; series.ArgumentDataMember = "Name"; series.DataSource = CreateChartData("缺血性卒中60分钟已静脉溶栓病人总数", "缺血性卒中60分钟未静脉溶栓病人总数", DT == null ? 0 : DT.Rows.Count, noThrombolysisCount); chartControl_Patient.Series.Add(series); series.LegendTextPattern = "{A}:{V}"; series.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;//显示标注标签 ChartTitle chartTitle1 = new ChartTitle(); if (!string.IsNullOrEmpty(dateEdit_Start.TimeValue) && !string.IsNullOrEmpty(dateEdit_End.TimeValue)) { chartTitle1.Text = Convert.ToDateTime(dateEdit_Start.TimeValue).ToString("yyy/MM/dd") + "至" + Convert.ToDateTime(dateEdit_End.TimeValue).ToString("yyy/MM/dd") + "60分钟静脉溶栓比例"; } else { chartTitle1.Text = "60分钟静脉溶栓比例"; } chartControl_Patient.Titles.Add(chartTitle1); } /// ///到达急诊至完成头颅CT小于25分钟的比例 /// public void MinutesCTReport() { chartControl_Patient.Series.Clear(); chartControl_Patient.Titles.Clear(); DataTable DT = new DataTable(); DataTable DTStrokeDiagnosis = new DataTable(); //没有所有院区权限 只获取当前院区数据 if (!PublicHelp.IsHaveAllDistrictRight(Information.User.ID)) { DT = DBHelpClass.Get("api/service/T_Service_Apoplexy_PatientsTimeAxis/GetModelByReport?where=DeleteFlag=0 and TimeAxisID=" + PublicClassForDataBase.Config13 + " and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid = '" + Information.Hospital.GUID + "')"); DTStrokeDiagnosis = DBHelpClass.Get("api/service/T_Service_Apoplexy_PatientsTimeAxis/GetModelByReport?where=DeleteFlag=0 and TimeAxisID=" + PublicClassForDataBase.Config22 + " and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid = '" + Information.Hospital.GUID + "')"); } else { DT = DBHelpClass.Get("api/service/T_Service_Apoplexy_PatientsTimeAxis/GetModelByReport?where=DeleteFlag=0 and TimeAxisID=" + PublicClassForDataBase.Config13 + ""); DTStrokeDiagnosis = DBHelpClass.Get("api/service/T_Service_Apoplexy_PatientsTimeAxis/GetModelByReport?where=DeleteFlag=0 and TimeAxisID=" + PublicClassForDataBase.Config22 + ""); } TimeSpan timeSpan = new TimeSpan(); int thrombolysisCount = 0; int noThrombolysisCount = 0; if (DT != null) { for (int i = 0; i < DT.Rows.Count; i++) { if (!string.IsNullOrEmpty(DT.Rows[i]["RecordingTime"] + "") && !string.IsNullOrEmpty(DTStrokeDiagnosis.Rows[i]["RecordingTime"] + "")) { timeSpan = PublicClass.DiffMinutes(Convert.ToDateTime(DTStrokeDiagnosis.Rows[i]["RecordingTime"]), Convert.ToDateTime(DT.Rows[i]["RecordingTime"] + "")); if (Convert.ToInt32(double.Parse(timeSpan.TotalHours.ToString())) <= 25 && timeSpan.Days == 0) { thrombolysisCount += 1; } else { noThrombolysisCount += 1; } } } Series series = new Series("头颅CT小于25分钟的比例", ViewType.Pie3D); series.ValueDataMembers[0] = "Value"; series.ArgumentDataMember = "Name"; series.DataSource = CreateChartData("头颅CT小于25分钟病人总数", "头颅CT大于25分钟病人总数", DT.Rows.Count, noThrombolysisCount); chartControl_Patient.Series.Add(series); series.LegendTextPattern = "{A}:{V}"; series.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;//显示标注标签 } ChartTitle chartTitle1 = new ChartTitle(); if (!string.IsNullOrEmpty(dateEdit_Start.TimeValue) && !string.IsNullOrEmpty(dateEdit_End.TimeValue)) { chartTitle1.Text = Convert.ToDateTime(dateEdit_Start.TimeValue).ToString("yyy/MM/dd") + "至" + Convert.ToDateTime(dateEdit_End.TimeValue).ToString("yyy/MM/dd") + "60分钟静脉溶栓比例"; } else { chartTitle1.Text = "头颅CT小于25分钟的比例"; } chartControl_Patient.Titles.Add(chartTitle1); } /// /// 入院到开始血管内治疗的时间 /// public void InterventionalTherapyReport() { chartControl_Patient.Series.Clear(); chartControl_Patient.Titles.Clear(); DataTable DT = new DataTable(); DataTable DTStrokeDiagnosis = new DataTable(); //没有所有院区权限 只获取当前院区数据 if (!PublicHelp.IsHaveAllDistrictRight(Information.User.ID)) { DT = DBHelpClass.Get("api/service/T_Service_Apoplexy_PatientsTimeAxis/GetModelByReport?where=DeleteFlag=0 and TimeAxisID=" + PublicClassForDataBase.Config13 + " and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid = '" + Information.Hospital.GUID + "')"); DTStrokeDiagnosis = DBHelpClass.Get("api/service/T_Service_Apoplexy_PatientsTimeAxis/GetModelByReport?where=DeleteFlag=0 and TimeAxisID=" + PublicClassForDataBase.Config33 + " and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid = '" + Information.Hospital.GUID + "')"); } else { DT = DBHelpClass.Get("api/service/T_Service_Apoplexy_PatientsTimeAxis/GetModelByReport?where=DeleteFlag=0 and TimeAxisID=" + PublicClassForDataBase.Config13 + ""); DTStrokeDiagnosis = DBHelpClass.Get("api/service/T_Service_Apoplexy_PatientsTimeAxis/GetModelByReport?where=DeleteFlag=0 and TimeAxisID=" + PublicClassForDataBase.Config33 + ""); } DataTable charData = new DataTable(); charData.Columns.Add("Name", typeof(string)); charData.Columns.Add("Value", typeof(int)); TimeSpan timeSpan = new TimeSpan(); double DNTTotalMinutes = 0; string patientName = ""; if (DT != null && DTStrokeDiagnosis != null) { if (DT.Rows.Count > 0 && DTStrokeDiagnosis.Rows.Count > 0) { for (int i = 0; i < DT.Rows.Count; i++) { if (!string.IsNullOrEmpty(DT.Rows[i]["RecordingTime"] + "") && !string.IsNullOrEmpty(DTStrokeDiagnosis.Rows[i]["RecordingTime"] + "")) { timeSpan = PublicClass.DiffMinutes(Convert.ToDateTime(DTStrokeDiagnosis.Rows[i]["RecordingTime"]), Convert.ToDateTime(DT.Rows[i]["RecordingTime"] + "")); DNTTotalMinutes = timeSpan.TotalMinutes; patientName = DBHelpClass.GetDataRow("api/service/T_Service_Patient/" + DT.Rows[i]["PatientGUID"] + "").Rows[0]["name"] + ""; //charData.Rows.Add(patientName, DNTTotalMinutes); charData.Rows.Add(DNTTotalMinutes.ToString("F1"), DNTTotalMinutes / (i + 1)); } } } } Series series = new Series("入院到开始血管内治疗的时间", ViewType.Line); series.ValueDataMembers[0] = "Value"; series.ArgumentDataMember = "Name"; series.DataSource = charData; chartControl_Patient.Series.Add(series); series.LegendTextPattern = "{A}:{V}"; series.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;//显示标注标签 ChartTitle chartTitle1 = new ChartTitle(); if (!string.IsNullOrEmpty(dateEdit_Start.TimeValue) && !string.IsNullOrEmpty(dateEdit_End.TimeValue)) { chartTitle1.Text = Convert.ToDateTime(dateEdit_Start.TimeValue).ToString("yyy/MM/dd") + "至" + Convert.ToDateTime(dateEdit_End.TimeValue).ToString("yyy/MM/dd") + "入院到开始血管内治疗的时间"; } else { chartTitle1.Text = "入院到开始血管内治疗的时间"; } chartControl_Patient.Titles.Add(chartTitle1); } /// /// 静脉溶栓治疗36h内发生症状性颅内出血的患者比例 /// public void StrokeDiagnosisReport() { chartControl_Patient.Series.Clear(); chartControl_Patient.Titles.Clear(); DataTable DT = new DataTable(); DataTable IntracranialHemorrhageDT = new DataTable(); //没有所有院区权限 只获取当前院区数据 if (!PublicHelp.IsHaveAllDistrictRight(Information.User.ID)) { DT = DBHelpClass.Get("api/service/T_Service_Patient/GetModelByReport?where=DeleteFlag=0 and HospitalGuid='" + Information.Hospital.GUID + "'"); //DataTable noIntracranialHemorrhageDT = new DataTable(); //noIntracranialHemorrhageDT = DBHelpClass.Get("api/service/T_Service_EMR_StrokeDiagnosis/GetModelByReport?where=DeleteFlag=0 and ComplicationsType!=1"); IntracranialHemorrhageDT = DBHelpClass.Get("api/service/T_Service_EMR_StrokeDiagnosis/GetModelByReport?where=DeleteFlag=0 and ThrombolyticComplications=0 and ComplicationsType=1 and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid = '" + Information.Hospital.GUID + "')"); } else { DT = DBHelpClass.Get("api/service/T_Service_Patient/GetModelByReport?where=DeleteFlag=0"); IntracranialHemorrhageDT = DBHelpClass.Get("api/service/T_Service_EMR_StrokeDiagnosis/GetModelByReport?where=DeleteFlag=0 and ThrombolyticComplications=0 and ComplicationsType=1"); } Series series = new Series(" 静脉溶栓治疗36h内发生症状性颅内出血的患者比例", ViewType.Pie3D); series.ValueDataMembers[0] = "Value"; series.ArgumentDataMember = "Name"; series.DataSource = CreateChartData(" 静脉溶栓治疗36h内未发生症状性颅内出血的患者", " 静脉溶栓治疗36h内发生症状性颅内出血的患者", DT == null ? 0 : DT.Rows.Count, IntracranialHemorrhageDT == null ? 0 : IntracranialHemorrhageDT.Rows.Count); chartControl_Patient.Series.Add(series); series.LegendTextPattern = "{A}:{V}"; series.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;//显示标注标签 ChartTitle chartTitle1 = new ChartTitle(); if (!string.IsNullOrEmpty(dateEdit_Start.TimeValue) && !string.IsNullOrEmpty(dateEdit_End.TimeValue)) { chartTitle1.Text = Convert.ToDateTime(dateEdit_Start.TimeValue).ToString("yyy/MM/dd") + "至" + Convert.ToDateTime(dateEdit_End.TimeValue).ToString("yyy/MM/dd") + " 静脉溶栓治疗36h内发生症状性颅内出血的患者比例"; } else { chartTitle1.Text = " 静脉溶栓治疗36h内发生症状性颅内出血的患者比例"; } chartControl_Patient.Titles.Add(chartTitle1); } /// /// 卒中患者行去骨瓣减压、血肿清除术的比例及死亡率 /// public void BoneDiscDecompressionReport() { chartControl_Patient.Series.Clear(); chartControl_Patient.Titles.Clear(); DataTable deathRateDT = new DataTable(); DataTable decompressiveCraniectomyDT = new DataTable(); DataTable evacuationHematomaDT = new DataTable(); DataTable DT = new DataTable(); //没有所有院区权限 只获取当前院区数据 if (!PublicHelp.IsHaveAllDistrictRight(Information.User.ID)) { deathRateDT = DBHelpClass.Get("api/service/T_Service_EMR_PatientOutcomeDB/GetModelByReport?table=left join T_Service_EMR_StrokeDiagnosis b on a.PatientID=b.PatientID &where= and EvacuationIntracranialHematomaType in (0,2) and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid = '" + Information.Hospital.GUID + "')"); DT = DBHelpClass.Get("api/service/T_Service_Patient/GetModelByReport?where=DeleteFlag=0 and HospitalGuid='" + Information.Hospital.GUID + "'"); decompressiveCraniectomyDT = DBHelpClass.Get("api/service/T_Service_EMR_StrokeDiagnosis/GetModelByReport?where=DeleteFlag=0 and EvacuationIntracranialHematomaType=0 and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid = '" + Information.Hospital.GUID + "')"); evacuationHematomaDT = DBHelpClass.Get("api/service/T_Service_EMR_StrokeDiagnosis/GetModelByReport?where=DeleteFlag=0 and EvacuationIntracranialHematomaType=2 and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid = '" + Information.Hospital.GUID + "')"); } else { deathRateDT = DBHelpClass.Get("api/service/T_Service_EMR_PatientOutcomeDB/GetModelByReport?table=left join T_Service_EMR_StrokeDiagnosis b on a.PatientID=b.PatientID &where= and EvacuationIntracranialHematomaType in (0,2)"); DT = DBHelpClass.Get("api/service/T_Service_Patient/GetModelByReport?where=DeleteFlag=0"); decompressiveCraniectomyDT = DBHelpClass.Get("api/service/T_Service_EMR_StrokeDiagnosis/GetModelByReport?where=DeleteFlag=0 and EvacuationIntracranialHematomaType=0"); evacuationHematomaDT = DBHelpClass.Get("api/service/T_Service_EMR_StrokeDiagnosis/GetModelByReport?where=DeleteFlag=0 and EvacuationIntracranialHematomaType=2"); } Series series = new Series(" 卒中患者行去骨瓣减压、血肿清除术的比例", ViewType.Pie3D); series.ValueDataMembers[0] = "Value"; series.ArgumentDataMember = "Name"; series.DataSource = CreateChartDataForMulti("未行去骨瓣减压和血肿清除术总人数", "去骨瓣减压人数", "血肿清除术人数", DT == null ? 0 : DT.Rows.Count, decompressiveCraniectomyDT == null ? 0 : decompressiveCraniectomyDT.Rows.Count, evacuationHematomaDT == null ? 0 : evacuationHematomaDT.Rows.Count); chartControl_Patient.Series.Add(series); series.LegendTextPattern = "{A}:{V}"; series.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;//显示标注标签 ChartTitle chartTitle1 = new ChartTitle(); if (!string.IsNullOrEmpty(dateEdit_Start.TimeValue) && !string.IsNullOrEmpty(dateEdit_End.TimeValue)) { chartTitle1.Text = Convert.ToDateTime(dateEdit_Start.TimeValue).ToString("yyy/MM/dd") + "至" + Convert.ToDateTime(dateEdit_End.TimeValue).ToString("yyy/MM/dd") + " 卒中患者行去骨瓣减压、血肿清除术的比例"; } else { chartTitle1.Text = " 卒中患者行去骨瓣减压、血肿清除术的比例"; } chartControl_Patient.Titles.Add(chartTitle1); Series seriesDeath = new Series("死亡率", ViewType.Pie3D); seriesDeath.ValueDataMembers[0] = "Value"; seriesDeath.ArgumentDataMember = "Name"; seriesDeath.DataSource = CreateChartData("未死亡人数", "死亡人数", DT == null ? 0 : DT.Rows.Count, deathRateDT == null ? 0 : deathRateDT.Rows.Count); chartControl_Patient.Series.Add(seriesDeath); seriesDeath.LegendTextPattern = "{A}:{V}"; seriesDeath.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;//显示标注标签 ChartTitle chartTitle1Death = new ChartTitle(); chartTitle1Death.Text = "死亡率"; chartControl_Patient.Titles.Add(chartTitle1Death); } /// /// 卒中患者行脑室外引流的比例及死亡率 /// public void EVDReport() { chartControl_Patient.Series.Clear(); chartControl_Patient.Titles.Clear(); DataTable deathRateDT = new DataTable(); DataTable DT = new DataTable(); DataTable decompressiveCraniectomyDT = new DataTable(); //没有所有院区权限 只获取当前院区数据 if (!PublicHelp.IsHaveAllDistrictRight(Information.User.ID)) { deathRateDT = DBHelpClass.Get("api/service/T_Service_EMR_PatientOutcomeDB/GetModelByReport?table=left join T_Service_EMR_StrokeDiagnosis b on a.PatientID=b.PatientID &where= and VentricularShunt in (0) and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid = '" + Information.Hospital.GUID + "')"); DT = DBHelpClass.Get("api/service/T_Service_Patient/GetModelByReport?where=DeleteFlag=0 and HospitalGuid='" + Information.Hospital.GUID + "'"); decompressiveCraniectomyDT = DBHelpClass.Get("api/service/T_Service_EMR_StrokeDiagnosis/GetModelByReport?where=DeleteFlag=0 and VentricularShunt=0 and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid = '" + Information.Hospital.GUID + "')"); } else { deathRateDT = DBHelpClass.Get("api/service/T_Service_EMR_PatientOutcomeDB/GetModelByReport?table=left join T_Service_EMR_StrokeDiagnosis b on a.PatientID=b.PatientID &where= and VentricularShunt in (0)"); DT = DBHelpClass.Get("api/service/T_Service_Patient/GetModelByReport?where=DeleteFlag=0"); decompressiveCraniectomyDT = DBHelpClass.Get("api/service/T_Service_EMR_StrokeDiagnosis/GetModelByReport?where=DeleteFlag=0 and VentricularShunt=0"); } Series series = new Series(" 脑室外引流的比例", ViewType.Pie3D); series.ValueDataMembers[0] = "Value"; series.ArgumentDataMember = "Name"; series.DataSource = CreateChartData("未行脑室外引流总人数", "行脑室外引流总人数", DT == null ? 0 : DT.Rows.Count, decompressiveCraniectomyDT == null ? 0 : decompressiveCraniectomyDT.Rows.Count); chartControl_Patient.Series.Add(series); series.LegendTextPattern = "{A}:{V}"; series.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;//显示标注标签 ChartTitle chartTitle1 = new ChartTitle(); if (!string.IsNullOrEmpty(dateEdit_Start.TimeValue) && !string.IsNullOrEmpty(dateEdit_End.TimeValue)) { chartTitle1.Text = Convert.ToDateTime(dateEdit_Start.TimeValue).ToString("yyy/MM/dd") + "至" + Convert.ToDateTime(dateEdit_End.TimeValue).ToString("yyy/MM/dd") + " 脑室外引流的比例"; } else { chartTitle1.Text = " 脑室外引流的比例"; } chartControl_Patient.Titles.Add(chartTitle1); Series seriesDeath = new Series("死亡率", ViewType.Pie3D); seriesDeath.ValueDataMembers[0] = "Value"; seriesDeath.ArgumentDataMember = "Name"; seriesDeath.DataSource = CreateChartData("未死亡人数", "死亡人数", DT == null ? 0 : DT.Rows.Count, deathRateDT == null ? 0 : deathRateDT.Rows.Count); chartControl_Patient.Series.Add(seriesDeath); seriesDeath.LegendTextPattern = "{A}:{V}"; seriesDeath.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;//显示标注标签 ChartTitle chartTitle1Death = new ChartTitle(); chartTitle1Death.Text = "死亡率"; chartControl_Patient.Titles.Add(chartTitle1Death); } /// /// 与华法林治疗相关的颅内出血率;INR升高(INR>1.4)患者从入院到给予促凝血治疗后INR达标的平均时间 /// public void WarfarinReport() { chartControl_Patient.Series.Clear(); chartControl_Patient.Titles.Clear(); DataTable deathRateDT = new DataTable(); DataTable DT = new DataTable(); DataTable decompressiveCraniectomyDT = new DataTable(); //没有所有院区权限 只获取当前院区数据 if (!PublicHelp.IsHaveAllDistrictRight(Information.User.ID)) { deathRateDT = DBHelpClass.Get("api/service/T_Service_EMR_StrokeDiagnosis/GetModelByReport?where=DeleteFlag=0 and ThrombolyticComplications=0 and ComplicationsType=1 and PatientID in(select PatientID from T_Service_EMR_Hospitalization where WarfarinAnticoagulant = 0 and DeleteFlag = 0) and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid = '" + Information.Hospital.GUID + "')"); DT = DBHelpClass.Get("api/service/T_Service_EMR_StrokeDiagnosis/GetModelByReport?where=DeleteFlag=0 and ThrombolyticComplications=0 and ComplicationsType!=1 and PatientID in(select PatientID from T_Service_EMR_Hospitalization where WarfarinAnticoagulant = 0 and DeleteFlag = 0) and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid = '" + Information.Hospital.GUID + "')"); decompressiveCraniectomyDT = DBHelpClass.Get("api/service/T_Service_EMR_Hospitalization/GetModelByReport?where= WarfarinAnticoagulant=0 and PatientGuid in (select GUID from T_Service_Patient where HospitalGuid = '" + Information.Hospital.GUID + "')"); } else { deathRateDT = DBHelpClass.Get("api/service/T_Service_EMR_StrokeDiagnosis/GetModelByReport?where=DeleteFlag=0 and ThrombolyticComplications=0 and ComplicationsType=1 and PatientID in(select PatientID from T_Service_EMR_Hospitalization where WarfarinAnticoagulant = 0 and DeleteFlag = 0)"); DT = DBHelpClass.Get("api/service/T_Service_EMR_StrokeDiagnosis/GetModelByReport?where=DeleteFlag=0 and ThrombolyticComplications=0 and ComplicationsType!=1 and PatientID in(select PatientID from T_Service_EMR_Hospitalization where WarfarinAnticoagulant = 0 and DeleteFlag = 0)"); decompressiveCraniectomyDT = DBHelpClass.Get("api/service/T_Service_EMR_Hospitalization/GetModelByReport?where= WarfarinAnticoagulant=0"); } Series series = new Series(" 华法林治疗相关的颅内出血率", ViewType.Pie3D); series.ValueDataMembers[0] = "Value"; series.ArgumentDataMember = "Name"; series.DataSource = CreateChartData("华法林治疗未颅内出血人数", "华法林治疗颅内出血人数", DT == null ? 0 : DT.Rows.Count, decompressiveCraniectomyDT == null ? 0 : decompressiveCraniectomyDT.Rows.Count); chartControl_Patient.Series.Add(series); series.LegendTextPattern = "{A}:{V}"; series.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;//显示标注标签 ChartTitle chartTitle1 = new ChartTitle(); if (!string.IsNullOrEmpty(dateEdit_Start.TimeValue) && !string.IsNullOrEmpty(dateEdit_End.TimeValue)) { chartTitle1.Text = Convert.ToDateTime(dateEdit_Start.TimeValue).ToString("yyy/MM/dd") + "至" + Convert.ToDateTime(dateEdit_End.TimeValue).ToString("yyy/MM/dd") + " 华法林治疗相关的颅内出血率"; } else { chartTitle1.Text = " 华法林治疗相关的颅内出血率"; } chartControl_Patient.Titles.Add(chartTitle1); } private DataTable CreateChartDataForMulti(string countName, string denominatorName, string moleculeName, int denominator, int molecule, int multiRow) { DataTable data = new DataTable("table1"); data.Columns.Add("Name", typeof(string)); data.Columns.Add("Value", typeof(int)); data.Rows.Add(countName, denominator - molecule - multiRow); data.Rows.Add(denominatorName, molecule); data.Rows.Add(moleculeName, multiRow); return data; } /// /// 创建统计数据源 /// /// /// /// /// /// private DataTable CreateChartData(string denominatorName, string moleculeName, int denominator, int molecule) { DataTable data = new DataTable("table1"); data.Columns.Add("Name", typeof(string)); data.Columns.Add("Value", typeof(int)); data.Rows.Add(denominatorName, denominator - molecule); data.Rows.Add(moleculeName, molecule); return data; } } }