StableVersion4.3/HL_ChestPain_Statistics/Form_ChestPain_Statistics_R...

107 lines
4.4 KiB
C#
Raw Permalink 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_Report07 : Form
{
string dateEdit_start = "";
string dateEdit_end = "";
string screen = "";
ReprotModel reprotModel = new ReprotModel();
public Form_ChestPain_Statistics_Report07(string startTime, string endTime, string _screen)
{
dateEdit_start = startTime;
dateEdit_end = endTime;
screen = _screen;
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/GetReport?startTime=" + dateEdit_start + "&endTime=" + dateEdit_end + "&reportName=ChestPain_Report07");
reprotModel = JsonConvert.DeserializeObject<ReprotModel>(itemJson);
DataTable data = new DataTable("table1");
data.Columns.Add("月份", typeof(string));
data.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["月份"] = item.;
dataRow["百分比"] = Math.Round(Convert.ToDouble(item.) / 100, 2);
data.Rows.Add(dataRow);
}
}
chartControl1.Series["实际情况"].ValueDataMembers[0] = "百分比";
chartControl1.Series["实际情况"].ArgumentDataMember = "月份";
chartControl1.Series["实际情况"].DataSource = data;
gridControl1.DataSource = reprotModel.reprotMonths;
}
catch (Exception ex)
{
PublicClass.WriteErrorLog(Text, "在再灌注时间窗(12小时)以内到达的STEMI患者早期再灌注治疗比列" + 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);
//}
}
}
}
}