175 lines
5.7 KiB
C#
175 lines
5.7 KiB
C#
using DevExpress.XtraCharts;
|
|
using DevExpress.XtraEditors;
|
|
using HL_FristAidPlatform_Public;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace SC_FristAidPlatform_ChestPainUnit
|
|
{
|
|
public partial class ChestPainUnitTroponinAVG : XtraForm
|
|
{
|
|
|
|
public int flag;
|
|
|
|
public string startTime = "";
|
|
public string endTime = "";
|
|
public ChestPainUnitTroponinAVG()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void ChestPainUnitTroponinAVG_Load(object sender, EventArgs e)
|
|
{
|
|
timeControl1.TimeValue = DateTime.Now.AddMonths(-12).ToString("yyyy-MM-dd");
|
|
timeControl2.TimeValue = DateTime.Now.ToString("yyyy-MM-dd");
|
|
GetTroponinAVG();
|
|
}
|
|
|
|
private void simpleButton1_Click(object sender, EventArgs e)
|
|
{
|
|
GetTroponinAVG();
|
|
}
|
|
|
|
|
|
public void GetTroponinAVG()
|
|
{
|
|
try
|
|
{
|
|
chartControl1.Series.Clear();
|
|
chartControl1.Titles.Clear();
|
|
ChartTitle titles = new ChartTitle();
|
|
titles.Text = "肌钙蛋白抽血完成至出报告平时耗时统计";
|
|
titles.TextColor = Color.FromArgb(23, 35, 61);
|
|
titles.Indent = 1;
|
|
titles.Font = new Font("微软雅黑", 16, FontStyle.Regular);
|
|
titles.Dock = ChartTitleDockStyle.Top;
|
|
titles.Indent = 0;
|
|
titles.Alignment = StringAlignment.Center;
|
|
chartControl1.Titles.Add(titles);
|
|
List<DateTimeAVGModel> lst = DBHelpClass.GetList<DateTimeAVGModel>(string.Format("api/service/ChestPainUnit/GetTroponinAVG?hospitalGuid={0}&systemId={1}&startTime={2}&endTime={3}", Information.Hospital.GUID, long.Parse(PublicClassForDataBase.Config10008), timeControl1.TimeValue, timeControl2.TimeValue));
|
|
gridControl1.DataSource = lst;
|
|
chartControl1.Series.Clear();
|
|
Series series1 = new Series("平均耗时", ViewType.Spline);
|
|
if (flag == 1)
|
|
series1 = new Series("平均耗时", ViewType.Bar);
|
|
series1.Points.Clear();
|
|
|
|
if (lst != null && lst.Count > 0)
|
|
{
|
|
for (int i = 0; i < lst.Count; i++)
|
|
{
|
|
series1.Points.Add(new SeriesPoint(lst[i].Month, lst[i].AVGTime));
|
|
}
|
|
chartControl1.Series.AddRange(series1);
|
|
XYDiagram xyDia = chartControl1.Diagram as XYDiagram;
|
|
xyDia.AxisX.DateTimeScaleOptions.ScaleMode = ScaleMode.Manual;
|
|
xyDia.AxisX.DateTimeScaleOptions.MeasureUnit = DateTimeMeasureUnit.Month;
|
|
((XYDiagram)(chartControl1.Diagram)).EnableAxisXScrolling = true;//启用横轴滚动条
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
throw ex;
|
|
}
|
|
}
|
|
private void simpleButton_ThisMonth_Click(object sender, EventArgs e)
|
|
{
|
|
timeControl1.TimeValue = DateTime.Now.AddMonths(-2).ToString("yyyy-MM-dd");
|
|
timeControl2.TimeValue = DateTime.Now.ToString("yyyy-MM-dd");
|
|
GetTroponinAVG();
|
|
}
|
|
|
|
private void simpleButton2_Click(object sender, EventArgs e)
|
|
{
|
|
timeControl1.TimeValue = DateTime.Now.AddMonths(-5).ToString("yyyy-MM-dd");
|
|
timeControl2.TimeValue = DateTime.Now.ToString("yyyy-MM-dd");
|
|
GetTroponinAVG();
|
|
}
|
|
|
|
private void simpleButton3_Click(object sender, EventArgs e)
|
|
{
|
|
timeControl1.TimeValue = DateTime.Now.AddMonths(-11).ToString("yyyy-MM-dd");
|
|
timeControl2.TimeValue = DateTime.Now.ToString("yyyy-MM-dd");
|
|
GetTroponinAVG();
|
|
}
|
|
|
|
private void simpleButton_all_Click(object sender, EventArgs e)
|
|
{
|
|
timeControl1.TimeValue = "1970-01-01";
|
|
timeControl2.TimeValue = DateTime.Now.ToString("yyyy-MM-dd");
|
|
GetTroponinAVG();
|
|
}
|
|
|
|
private void radioButton1_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
flag = 0;
|
|
GetTroponinAVG();
|
|
}
|
|
|
|
private void radioButton2_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
flag = 1;
|
|
GetTroponinAVG();
|
|
}
|
|
|
|
public class DateTimeAVGModel
|
|
{
|
|
/// <summary>
|
|
/// 月份
|
|
/// </summary>
|
|
public string Month { get; set; }
|
|
|
|
/// <summary>
|
|
/// 平均用时
|
|
/// </summary>
|
|
public int AVGTime { get; set; }
|
|
|
|
/// <summary>
|
|
/// 质控集合
|
|
/// </summary>
|
|
public List<QCReportModel> QCLst { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 质控报表模型
|
|
/// </summary>
|
|
public class QCReportModel
|
|
{
|
|
/// <summary>
|
|
/// 月份
|
|
/// </summary>
|
|
public string Month { get; set; }
|
|
|
|
/// <summary>
|
|
/// 平均耗时
|
|
/// </summary>
|
|
public string AVGTime { get; set; }
|
|
|
|
/// <summary>
|
|
/// 最大值
|
|
/// </summary>
|
|
public string MaxMum { get; set; }
|
|
|
|
/// <summary>
|
|
/// 最小值
|
|
/// </summary>
|
|
public string MinMum { get; set; }
|
|
|
|
/// <summary>
|
|
/// 合格个数
|
|
/// </summary>
|
|
public string QualifiedCount { get; set; }
|
|
}
|
|
|
|
}
|
|
}
|