StableVersion4.3/HL_ChestPain_Statistics/Form_ChestPain_Statistics_R...

117 lines
4.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using HL_FristAidPlatform_DTO;
using HL_FristAidPlatform_Public;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Windows.Forms;
namespace HL_FristAidPlatform_ChestPain_Statistics
{
public partial class Form_ChestPain_Statistics_Report04 : Form
{
string dateEdit_start = "";
string dateEdit_end = "";
ReprotModel reprotModel = new ReprotModel();
public Form_ChestPain_Statistics_Report04(string startTime, string endTime)
{
dateEdit_start = startTime;
dateEdit_end = endTime;
InitializeComponent();
}
private void Form_ChestPain_Statistics_Report01_Load(object sender, EventArgs e)
{
Report();
}
/// <summary>
/// STEMI患者首次医疗接触至双重抗血小板治疗比例、时间≤10分钟比例
/// </summary>
/// <param name="name"></param>
/// <param name="TimeAxisID"></param>
public void Report()
{
try
{
var itemJson = DBHelpClass.GetModel("api/service/T_Service_ChestPain_Prehospital/GetECGDiagnosisReport?startTime=" + dateEdit_start + "&endTime=" + dateEdit_end);
reprotModel = JsonConvert.DeserializeObject<ReprotModel>(itemJson);
DataTable data = new DataTable("table1");
data.Columns.Add("月份", typeof(string));
data.Columns.Add("平均时间", typeof(int));
DataTable data1 = new DataTable("table2");
data1.Columns.Add("月份", typeof(string));
data1.Columns.Add("百分比", typeof(float));
List<ReprotMonth> reprotMonths = new List<ReprotMonth>();
reprotMonths = reprotModel.reprotMonths;
if (reprotMonths != null)
{
foreach (ReprotMonth item in reprotMonths)
{
DataRow dataRow = data.NewRow();
DataRow dataRow1 = data1.NewRow();
dataRow["月份"] = item.;
dataRow["平均时间"] = item.;
dataRow1["月份"] = item.;
dataRow1["百分比"] = Math.Round(Convert.ToDouble(item.) / 100, 2);
data.Rows.Add(dataRow);
data1.Rows.Add(dataRow1);
}
}
chartControl1.Series["实际情况"].ValueDataMembers[0] = "平均时间";
chartControl1.Series["实际情况"].ArgumentDataMember = "月份";
chartControl1.Series["实际情况"].DataSource = data;
chartControl2.Series["实际情况"].ValueDataMembers[0] = "百分比";
chartControl2.Series["实际情况"].ArgumentDataMember = "月份";
chartControl2.Series["实际情况"].DataSource = data1;
gridControl1.DataSource = reprotModel.reprotMonths;
}
catch (Exception ex)
{
PublicClass.WriteErrorLog(Text, "所有患者从首次医疗接触到首份心电图时间" + ex);
}
}
private void gridControl1_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (gridView1.DataSource != null)
{
gridControl2.Visible = true;
int selectRow = gridView1.GetSelectedRows()[0];
string date = gridView1.GetRowCellValue(selectRow, "月份").ToString();
if (!string.IsNullOrEmpty(date) && reprotModel.reportDetails != null)
{
var query = reprotModel.reportDetails.Where(details => details. == date);
gridControl2.DataSource = query;
}
}
}
private void gridControl2_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (gridView2.DataSource != null)
{
//int selectRow = gridView2.GetSelectedRows()[0];
//long PatientID = PublicClass.ToInt64(gridView2.GetRowCellValue(selectRow, "ID").ToString(), 0);
//string PatientGuid = gridView2.GetRowCellValue(selectRow, "GUID").ToString();
//string HospitalGuid = gridView2.GetRowCellValue(selectRow, "HospitalGuid").ToString();
//if (PatientID > 0)
//{
// Form_ChestPain_PatientMain detail = new Form_ChestPain_PatientMain(PatientID, PatientGuid, HospitalGuid, Enumerate.PatientMainState.急救信息);
// detail.ShowDialog();
// //查询
// simpleButton_Search_Click(null, null);
// //定位
// PublicClass.LocationForGridView(gridView2, PatientID.ToString(),0);
//}
}
}
}
}