StableVersion4.3/HL_DynamicElectrocardiogram/Form_DynamicElectrocardiogr...

125 lines
5.2 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 DevExpress.XtraEditors;
using HL_FristAidPlatform_DTO;
using HL_FristAidPlatform_Public;
using Newtonsoft.Json;
using System;
using System.Data;
using System.Reflection;
using System.Windows.Forms;
namespace HL_FristAidPlatform_DynamicElectrocardiogram
{
public partial class Form_DynamicElectrocardiogramMain : XtraForm
{
#region 变量
/// <summary>
/// 合同号
/// </summary>
private string Cur_WardshipId = string.Empty;
/// <summary>
/// 当前患者姓名
/// </summary>
private string Cur_PatientName = string.Empty;
/// <summary>
/// 当前患者性别
/// </summary>
private string Cur_PatientGender = string.Empty;
/// <summary>
/// 当前患者年龄
/// </summary>
private string Cur_PatientAge = string.Empty;
#endregion
public Form_DynamicElectrocardiogramMain()
{
InitializeComponent();
}
/// <summary>
/// 窗体加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Form_DynamicElectrocardiogramMain_Load(object sender, EventArgs e)
{
BindList();
}
/// <summary>
/// 绑定设备列表
/// </summary>
private void BindList()
{
try
{
#region 绑定在线心电设备
DataTable dataTable = PublicHelp.BindEquipmentNumber();
DataTable Cur_PatientDT = new DataTable();
if (dataTable != null && dataTable.Rows.Count > 0)
{
DataRow[] rowSelect = dataTable.Select("useStatus=1");
if (rowSelect.Length > 0)
{
labelControl_Info.Visible = false;
foreach (DataRow item in rowSelect)
{
string URL = string.Format("api/service/T_Service_Patient/GetModelByReport?where=GUID=(select top 1 GUID " +
"from T_Service_Patient where EqmtNo = '{0}' order by ID desc)", item["eqmtNo"]);
Cur_PatientDT = DBHelpClass.Get(URL);
if (Cur_PatientDT != null && Cur_PatientDT.Rows.Count > 0)
{
Cur_PatientName = Cur_PatientDT.Rows[0]["Name"].ToString();
Cur_PatientGender = Cur_PatientDT.Rows[0]["Gender"].ToString();
Cur_PatientAge = Cur_PatientDT.Rows[0]["Age"].ToString();
Cur_WardshipId = Cur_PatientDT.Rows[0]["WardshipId"].ToString();
}
Panel panel = new Panel();
panel.Height = 200;
panel.Width = 300;
panel.Visible = true;
flowLayoutPanel1.Controls.Add(panel);
PatientInfo patientInfo = new PatientInfo();
patientInfo.patientName = Cur_PatientName;
patientInfo.patientAge = Cur_PatientAge;
patientInfo.patientSex = Cur_PatientGender == "1" ? "男" : "女";
ECGShowParameter parameter = new ECGShowParameter();
parameter.height = panel.Height.ToString();
parameter.width = panel.Width.ToString();
parameter.patientFlag = "1";
parameter.patientInfo = patientInfo;
parameter.wardNo = Cur_WardshipId;
parameter.orgCode = Information.Hospital.Ecg_OrgCode;
string paras = JsonConvert.SerializeObject(parameter);
string dllPath = string.Format(Application.StartupPath + "\\ECG\\Hwyl.ECG_New.dll", System.Environment.CurrentDirectory);//dll组件路径
Assembly pAss = Assembly.LoadFrom(dllPath);//加载组件
Type pType = pAss.GetType("Hwyl.ECG_New.ECGViewControl");//获得类ECG_New命名空间ECGViewControl类名
MethodInfo pMtInfo = pType.GetMethod("ECGViewControl");//获得方法ECGViewControl方法名
object o = Activator.CreateInstance(pType, paras);//创建类实例
panel.Controls.Add((Control)o);
}
}
else
{
labelControl_Info.Text = "暂时没有正在使用的设备,请确认!";
labelControl_Info.Visible = true;
}
}
else
{
labelControl_Info.Text = "当前院区未绑定任何设备,请确认!";
labelControl_Info.Visible = true;
}
#endregion
}
catch (Exception ex)
{
PublicClass.WriteErrorLog(Text, "窗体加载:\r\n" + ex);
}
}
}
}