修改一些BUG
This commit is contained in:
parent
be31f2688f
commit
8e7a6b281f
28
App.config
28
App.config
@ -6,8 +6,8 @@
|
||||
<appSettings>
|
||||
<!-- 当前显示 1 超声 2病理-->
|
||||
<add key="type" value="1"/>
|
||||
<!-- 请求接口地址 https://pacs.gw12320.com/admin http://114.55.171.231:48080-->
|
||||
<add key="URL" value="http://114.55.171.231:48080"/>
|
||||
<!-- 请求接口地址 https://pacs.gw12320.com/admin http://114.55.171.231:48080 http://10.55.253.199:8075-->
|
||||
<add key="URL" value="https://pacs.gw12320.com/admin"/>
|
||||
<!--上传前缀 也就是图片或者视频的访问地址 /video-->
|
||||
<add key="path" value="/video"/>
|
||||
<!--FTP -->
|
||||
@ -18,26 +18,34 @@
|
||||
|
||||
<!--当前上传文件模式 0:接口 1:FTP -->
|
||||
<add key="model" value="0"/>
|
||||
<!--接口模式上传文件存放路径 D:\FLYPACS\ftp C:\work\pacs -->
|
||||
<add key="filepath" value="C:\work\pacs"/>
|
||||
<!--接口模式上传文件存放路径 D:\FLYPACS\ftp C:\work\pacs D:\PACS\usfiles -->
|
||||
<add key="filepath" value="D:\FLYPACS\ftp"/>
|
||||
|
||||
<!--病理截图存放路径 -->
|
||||
<add key="blpath" value="D:\工作\病理截图"/>
|
||||
<!--病理截图快捷键 -->
|
||||
<add key="strkey" value="B"/>
|
||||
<add key="strkey" value="BBBBBB"/>
|
||||
<!--病理文件访问前缀-->
|
||||
<add key="blprefix" value="https://114.55.171.231:48082/"/>
|
||||
<!--区域截图设置默认值-->
|
||||
<add key="xywh" value="0,10,200,200"/>
|
||||
|
||||
<!--获取体检患者信息接口地址-->
|
||||
<add key="InspectUrl" value="https://pacs.gw12320.com/adminInspect"/>
|
||||
<!--是否开启体检编号扫码 0 否 1 是-->
|
||||
<add key="isInspect" value="1"/>
|
||||
|
||||
<!--医院名称 新增患者需要 5fd5a125-89a8-bbf7-5b4f-bec7467074c2-->
|
||||
<add key="yymc" value="土贵乌拉乡卫生院"/>
|
||||
<add key="yycode" value="5fd5a125-89a8-bbf7-5b4f-bec7467074c2"/>
|
||||
<add key="yymc" value="乌兰察布第四医院"/>
|
||||
<add key="yycode" value="610425101001"/>
|
||||
|
||||
<!--HIS获取患者相关 是否读取HIS患者 0 是 1否-->
|
||||
<add key="ishisinfo" value="1"/>
|
||||
|
||||
<!--HIS获取患者相关-->
|
||||
<add key="hisGetTokenUrl" value="https://wlcbhis.gw12320.com:8443/his/web/api/pacs/getPacsToken"/>
|
||||
<add key="hisGetDataUrl" value="https://wlcbhis.gw12320.com:8443/his/web/api/pacs/getpacsdata"/>
|
||||
<add key="inHisCode" value="150926461008697"/>
|
||||
<add key="hisGetTokenUrl" value="http://10.55.253.199:8443/api/pacs/getPacsToken"/>
|
||||
<add key="hisGetDataUrl" value="http://10.55.253.199:8443/api/pacs/getpacsdata"/>
|
||||
<add key="inHisCode" value="610425101000"/>
|
||||
<add key="hisAppkey" value="7653571505643966826"/>
|
||||
<add key="appsecret" value="z8SVG1NBFY9d74LM"/>
|
||||
</appSettings>
|
||||
|
@ -23,5 +23,7 @@ namespace videoGather
|
||||
public string orgId { get; set; }
|
||||
public string orgName { get; set; }
|
||||
public string regId { get; set; }
|
||||
|
||||
public string sfz { get; set; }
|
||||
}
|
||||
}
|
||||
|
24
InfoForm.Designer.cs
generated
24
InfoForm.Designer.cs
generated
@ -46,13 +46,13 @@
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.datekaifangsj = new System.Windows.Forms.DateTimePicker();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.textexamItemName = new System.Windows.Forms.TextBox();
|
||||
this.textexamItemcode = new System.Windows.Forms.TextBox();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
this.button4 = new System.Windows.Forms.Button();
|
||||
this.button5 = new System.Windows.Forms.Button();
|
||||
this.textexamItemName = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
@ -139,6 +139,7 @@
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label4.ForeColor = System.Drawing.Color.Red;
|
||||
this.label4.Location = new System.Drawing.Point(535, 86);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(62, 21);
|
||||
@ -237,15 +238,6 @@
|
||||
this.label9.TabIndex = 18;
|
||||
this.label9.Text = "检查名称:";
|
||||
//
|
||||
// textexamItemName
|
||||
//
|
||||
this.textexamItemName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.textexamItemName.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
this.textexamItemName.Location = new System.Drawing.Point(603, 139);
|
||||
this.textexamItemName.Name = "textexamItemName";
|
||||
this.textexamItemName.Size = new System.Drawing.Size(169, 29);
|
||||
this.textexamItemName.TabIndex = 19;
|
||||
//
|
||||
// textexamItemcode
|
||||
//
|
||||
this.textexamItemcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
@ -317,18 +309,26 @@
|
||||
this.button5.UseVisualStyleBackColor = true;
|
||||
this.button5.Click += new System.EventHandler(this.button5_Click);
|
||||
//
|
||||
// textexamItemName
|
||||
//
|
||||
this.textexamItemName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.textexamItemName.Location = new System.Drawing.Point(603, 139);
|
||||
this.textexamItemName.Name = "textexamItemName";
|
||||
this.textexamItemName.Size = new System.Drawing.Size(169, 29);
|
||||
this.textexamItemName.TabIndex = 26;
|
||||
//
|
||||
// InfoForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 680);
|
||||
this.Controls.Add(this.textexamItemName);
|
||||
this.Controls.Add(this.button5);
|
||||
this.Controls.Add(this.button4);
|
||||
this.Controls.Add(this.button3);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.textexamItemcode);
|
||||
this.Controls.Add(this.label10);
|
||||
this.Controls.Add(this.textexamItemName);
|
||||
this.Controls.Add(this.label9);
|
||||
this.Controls.Add(this.datekaifangsj);
|
||||
this.Controls.Add(this.label8);
|
||||
@ -377,12 +377,12 @@
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.DateTimePicker datekaifangsj;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.TextBox textexamItemName;
|
||||
private System.Windows.Forms.TextBox textexamItemcode;
|
||||
private System.Windows.Forms.Label label10;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button3;
|
||||
private System.Windows.Forms.Button button4;
|
||||
private System.Windows.Forms.Button button5;
|
||||
private System.Windows.Forms.TextBox textexamItemName;
|
||||
}
|
||||
}
|
@ -92,6 +92,7 @@ namespace videoGather
|
||||
if (string.IsNullOrEmpty(textjianchaid.Text.Trim()) ||
|
||||
string.IsNullOrEmpty(txt_jianchabh.Text.Trim()) ||
|
||||
string.IsNullOrEmpty(txtname.Text.Trim()) ||
|
||||
string.IsNullOrEmpty(textsfz.Text.Trim()) ||
|
||||
string.IsNullOrEmpty(textexamItemName.Text.Trim()) ||
|
||||
string.IsNullOrEmpty(textexamItemcode.Text.Trim()))
|
||||
{
|
||||
|
29
RootObject.cs
Normal file
29
RootObject.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace videoGather
|
||||
{
|
||||
internal class RootObject
|
||||
{
|
||||
public int code { get; set; }
|
||||
public Data data { get; set; }
|
||||
public string msg { get; set; }
|
||||
public class Data
|
||||
{
|
||||
public string jianchaid { get; set; }
|
||||
public string name { get; set; }
|
||||
public string jianchabh { get; set; }
|
||||
public string birthdate { get; set; }
|
||||
public string age { get; set; }
|
||||
public string sex { get; set; }
|
||||
public object yiyuanname { get; set; }
|
||||
public object yiyuancode { get; set; }
|
||||
public string kaifangsj { get; set; }
|
||||
public string examItemName { get; set; }
|
||||
public string examItemCode { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
40
video.Designer.cs
generated
40
video.Designer.cs
generated
@ -34,6 +34,8 @@ namespace videoGather
|
||||
this.btn_Capture = new System.Windows.Forms.Button();
|
||||
this.btn_Close = new System.Windows.Forms.Button();
|
||||
this.gb_ButtonBox = new System.Windows.Forms.GroupBox();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.button6 = new System.Windows.Forms.Button();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.btn_Connect = new System.Windows.Forms.Button();
|
||||
@ -116,6 +118,8 @@ namespace videoGather
|
||||
//
|
||||
// gb_ButtonBox
|
||||
//
|
||||
this.gb_ButtonBox.Controls.Add(this.textBox1);
|
||||
this.gb_ButtonBox.Controls.Add(this.label7);
|
||||
this.gb_ButtonBox.Controls.Add(this.button6);
|
||||
this.gb_ButtonBox.Controls.Add(this.label3);
|
||||
this.gb_ButtonBox.Controls.Add(this.btn_Connect);
|
||||
@ -133,16 +137,34 @@ namespace videoGather
|
||||
this.gb_ButtonBox.Controls.Add(this.cb_CameraSelect);
|
||||
this.gb_ButtonBox.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.gb_ButtonBox.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.gb_ButtonBox.Location = new System.Drawing.Point(3, 157);
|
||||
this.gb_ButtonBox.Location = new System.Drawing.Point(3, 170);
|
||||
this.gb_ButtonBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.gb_ButtonBox.Name = "gb_ButtonBox";
|
||||
this.gb_ButtonBox.Padding = new System.Windows.Forms.Padding(2);
|
||||
this.gb_ButtonBox.Size = new System.Drawing.Size(556, 204);
|
||||
this.gb_ButtonBox.Size = new System.Drawing.Size(556, 235);
|
||||
this.gb_ButtonBox.TabIndex = 16;
|
||||
this.gb_ButtonBox.TabStop = false;
|
||||
this.gb_ButtonBox.Text = "功能区";
|
||||
this.gb_ButtonBox.Enter += new System.EventHandler(this.gb_ButtonBox_Enter);
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(123, 175);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(183, 26);
|
||||
this.textBox1.TabIndex = 31;
|
||||
this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown);
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(11, 180);
|
||||
this.label7.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(119, 16);
|
||||
this.label7.TabIndex = 32;
|
||||
this.label7.Text = "检查编号扫码:";
|
||||
//
|
||||
// button6
|
||||
//
|
||||
this.button6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
@ -161,7 +183,7 @@ namespace videoGather
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label3.ForeColor = System.Drawing.Color.Red;
|
||||
this.label3.Location = new System.Drawing.Point(2, 182);
|
||||
this.label3.Location = new System.Drawing.Point(2, 213);
|
||||
this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(109, 16);
|
||||
@ -279,6 +301,7 @@ namespace videoGather
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.AutoSize = true;
|
||||
this.groupBox2.Controls.Add(this.button5);
|
||||
this.groupBox2.Controls.Add(this.txt_h);
|
||||
this.groupBox2.Controls.Add(this.lab_h);
|
||||
@ -297,7 +320,7 @@ namespace videoGather
|
||||
this.groupBox2.Font = new System.Drawing.Font("宋体", 12F);
|
||||
this.groupBox2.Location = new System.Drawing.Point(3, 17);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(556, 140);
|
||||
this.groupBox2.Size = new System.Drawing.Size(556, 153);
|
||||
this.groupBox2.TabIndex = 18;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "病理";
|
||||
@ -452,11 +475,11 @@ namespace videoGather
|
||||
this.groupBox1.Controls.Add(this.dGVPatient);
|
||||
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.groupBox1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.groupBox1.Location = new System.Drawing.Point(3, 361);
|
||||
this.groupBox1.Location = new System.Drawing.Point(3, 405);
|
||||
this.groupBox1.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Padding = new System.Windows.Forms.Padding(2);
|
||||
this.groupBox1.Size = new System.Drawing.Size(556, 630);
|
||||
this.groupBox1.Size = new System.Drawing.Size(556, 586);
|
||||
this.groupBox1.TabIndex = 19;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "患者信息";
|
||||
@ -477,7 +500,7 @@ namespace videoGather
|
||||
this.dGVPatient.ReadOnly = true;
|
||||
this.dGVPatient.RowTemplate.Height = 23;
|
||||
this.dGVPatient.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.dGVPatient.Size = new System.Drawing.Size(552, 607);
|
||||
this.dGVPatient.Size = new System.Drawing.Size(552, 563);
|
||||
this.dGVPatient.TabIndex = 0;
|
||||
this.dGVPatient.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dGVPatient_CellDoubleClick);
|
||||
//
|
||||
@ -577,6 +600,7 @@ namespace videoGather
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox3.PerformLayout();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dGVPatient)).EndInit();
|
||||
this.gb_CameraPanel.ResumeLayout(false);
|
||||
@ -628,6 +652,8 @@ namespace videoGather
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Button button5;
|
||||
private System.Windows.Forms.Button button6;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.Label label7;
|
||||
}
|
||||
}
|
||||
|
||||
|
301
video.cs
301
video.cs
@ -24,8 +24,10 @@ using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Shapes;
|
||||
using System.Xml.Linq;
|
||||
using static AForge.Imaging.Filters.HitAndMiss;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
|
||||
@ -88,6 +90,11 @@ namespace videoGather
|
||||
/// </summary>
|
||||
private string _url = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 是否读取HIS信息
|
||||
/// </summary>
|
||||
private string _ishisinfo = string.Empty;
|
||||
|
||||
private string _path = string.Empty;
|
||||
/// <summary>
|
||||
/// 当前类型
|
||||
@ -114,6 +121,14 @@ namespace videoGather
|
||||
/// 文件上传模式
|
||||
/// </summary>
|
||||
private string _model = string.Empty;
|
||||
/// <summary>
|
||||
/// 体检患者信息地址
|
||||
/// </summary>
|
||||
private string _InspectUrl = string.Empty;
|
||||
/// <summary>
|
||||
/// 是否开启体检编码扫码
|
||||
/// </summary>
|
||||
private string _isInspect = string.Empty;
|
||||
//超声存放文件访问地址
|
||||
ArrayList imagearray = new ArrayList();
|
||||
/// <summary>
|
||||
@ -140,6 +155,8 @@ namespace videoGather
|
||||
InitCamera();
|
||||
InitCameraSelect();
|
||||
//读取配置信息
|
||||
_isInspect = ConfigurationManager.AppSettings["isInspect"];
|
||||
_InspectUrl = ConfigurationManager.AppSettings["InspectUrl"];
|
||||
_url = ConfigurationManager.AppSettings["URL"];
|
||||
_path = ConfigurationManager.AppSettings["path"];
|
||||
_type = ConfigurationManager.AppSettings["type"];
|
||||
@ -148,6 +165,7 @@ namespace videoGather
|
||||
_blprefix = ConfigurationManager.AppSettings["blprefix"];
|
||||
_xywh = ConfigurationManager.AppSettings["xywh"];
|
||||
_model = ConfigurationManager.AppSettings["model"];
|
||||
_ishisinfo = ConfigurationManager.AppSettings["ishisinfo"];
|
||||
if (_type == "1")
|
||||
{
|
||||
|
||||
@ -170,7 +188,16 @@ namespace videoGather
|
||||
txt_h.Text = _xywh.Split(',')[3];
|
||||
}
|
||||
this.btn_Capture.Enabled = false;
|
||||
|
||||
if (_isInspect == "1")
|
||||
{
|
||||
label7.Visible = true;
|
||||
textBox1.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
label7.Visible = false;
|
||||
textBox1.Visible = false;
|
||||
}
|
||||
|
||||
//秒表
|
||||
timer_count = new System.Timers.Timer(); //实例化Timer类,设置间隔时间为1000毫秒;
|
||||
@ -179,8 +206,52 @@ namespace videoGather
|
||||
timer_count.Interval = 1000;
|
||||
HookStart();
|
||||
btn_Connect_Click(null, null);
|
||||
GetHisInfo();
|
||||
if (_ishisinfo == "0")
|
||||
{
|
||||
button1.Visible = true;
|
||||
GetHisInfo();
|
||||
}
|
||||
else
|
||||
{
|
||||
button1.Visible = false;
|
||||
}
|
||||
label4.Focus();
|
||||
// 添加对窗口大小改变事件的订阅
|
||||
this.Resize += new EventHandler(Form1_Resize);
|
||||
}
|
||||
|
||||
private void Form1_Resize(object sender, EventArgs e)
|
||||
{
|
||||
//// 检查视频捕获是否已初始化
|
||||
//if (videoCapture != null && videoCapture.IsRunning)
|
||||
//{
|
||||
// // 停止并重新启动视频捕获,确保视频帧能够正确显示
|
||||
// videoCapture.SignalToStop();
|
||||
// videoCapture.WaitForStop();
|
||||
// videoCapture.Start();
|
||||
//}
|
||||
|
||||
// 检查视频捕获是否已初始化
|
||||
if (videoCapture != null)
|
||||
{
|
||||
if (this.WindowState == FormWindowState.Minimized)
|
||||
{
|
||||
// 窗口最小化时停止视频捕获
|
||||
if (videoCapture.IsRunning)
|
||||
{
|
||||
videoCapture.SignalToStop();
|
||||
videoCapture.WaitForStop();
|
||||
}
|
||||
}
|
||||
else if (this.WindowState == FormWindowState.Maximized || this.WindowState == FormWindowState.Normal)
|
||||
{
|
||||
// 窗口最大化或恢复正常大小时重新启动视频捕获
|
||||
if (!videoCapture.IsRunning)
|
||||
{
|
||||
videoCapture.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 窗口关闭时
|
||||
@ -293,20 +364,37 @@ namespace videoGather
|
||||
/// <param name="e"></param>
|
||||
private void btn_Capture_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (videoCapture == null)
|
||||
try
|
||||
{
|
||||
MessageBox.Show("设备未连接");
|
||||
return;
|
||||
if (videoCapture == null)
|
||||
{
|
||||
MessageBox.Show("设备未连接");
|
||||
return;
|
||||
}
|
||||
imgMap = this.vsp_Panel.GetCurrentVideoFrame();
|
||||
if (imgMap == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var saveName = $"{filePath}{$"{DateTime.Now.ToString("yyyyMMddhhmmssffff")}"}.jpg";
|
||||
imgMap.Save(saveName);
|
||||
imagearray.Add(saveName);
|
||||
// 使用 Invoke 方法确保在UI线程上更新标签的文本
|
||||
if (label1.InvokeRequired)
|
||||
{
|
||||
label1.Invoke(new Action(() => label1.Text = imagearray.Count.ToString()));
|
||||
}
|
||||
else
|
||||
{
|
||||
label1.Text = imagearray.Count.ToString();
|
||||
}
|
||||
label1.Refresh();
|
||||
}
|
||||
imgMap = this.vsp_Panel.GetCurrentVideoFrame();
|
||||
if (imgMap == null)
|
||||
catch (Exception ex)
|
||||
{
|
||||
return;
|
||||
MessageBox.Show(ex.Message+ex.StackTrace);
|
||||
}
|
||||
var saveName = $"{filePath}{$"{DateTime.Now.ToString("yyyyMMddhhmmssffff")}"}.jpg";
|
||||
imgMap.Save(saveName);
|
||||
imagearray.Add(saveName);
|
||||
label1.Text = imagearray.Count.ToString();
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存事件
|
||||
@ -525,6 +613,8 @@ namespace videoGather
|
||||
string result = "";
|
||||
try
|
||||
{
|
||||
// 忽略证书验证
|
||||
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;
|
||||
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
|
||||
req.Method = "POST";
|
||||
req.ContentType = "application/json";
|
||||
@ -566,6 +656,8 @@ namespace videoGather
|
||||
string result = "";
|
||||
try
|
||||
{
|
||||
// 忽略证书验证
|
||||
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;
|
||||
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
|
||||
req.Method = "POST";
|
||||
req.ContentType = "application/json";
|
||||
@ -605,6 +697,8 @@ namespace videoGather
|
||||
{
|
||||
try
|
||||
{
|
||||
// 忽略证书验证
|
||||
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;
|
||||
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
|
||||
req.Method = "GET";
|
||||
req.Timeout = 30000;
|
||||
@ -654,6 +748,8 @@ namespace videoGather
|
||||
{
|
||||
try
|
||||
{
|
||||
// 忽略证书验证
|
||||
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;
|
||||
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
|
||||
req.Method = "GET";
|
||||
req.Timeout = 30000;
|
||||
@ -698,51 +794,59 @@ namespace videoGather
|
||||
/// </summary>
|
||||
public void GetHisInfo()
|
||||
{
|
||||
//存放绑定界面的患者数据 一个患者有多个检查 按照检查拆分 一个检查一条数据
|
||||
List<HisInfo> hisInfos = new List<HisInfo>();
|
||||
//获取福乐云HIS接口的token
|
||||
string hisToken = getHisToken(ConfigurationManager.AppSettings["hisGetTokenUrl"], ConfigurationManager.AppSettings["hisAppkey"], ConfigurationManager.AppSettings["appsecret"]);
|
||||
|
||||
//获取当天的患者信息
|
||||
FlyHisEcgDataModel FHEDM = GetHisEcgData(ConfigurationManager.AppSettings["hisGetDataUrl"], ConfigurationManager.AppSettings["inHisCode"], DateTime.Now.ToString("yyyy-MM-dd"), hisToken);//
|
||||
if (FHEDM != null)
|
||||
try
|
||||
{
|
||||
foreach (patientInfo item in FHEDM.rows)
|
||||
{
|
||||
foreach (projectsInfo projectsInfo in item.projects)
|
||||
{
|
||||
if (projectsInfo.category == "US")
|
||||
{
|
||||
HisInfo info = new HisInfo();
|
||||
info.jianchaid = item.jianchaid;
|
||||
info.name = item.name;
|
||||
info.jianchabh = item.jianchabh;
|
||||
info.sfz = item.sfz;
|
||||
info.birthdate = item.birthdate;
|
||||
info.age = item.age;
|
||||
info.sex = item.sex;
|
||||
info.yiyuanname = item.yiyuanname;
|
||||
info.yiyuanid = item.yiyuanid;
|
||||
info.yiyuancode = item.yiyuancode;
|
||||
info.kaifangsj = item.kaifangsj;
|
||||
info.departmentCode = item.departmentCode;
|
||||
info.departmentName = item.departmentName;
|
||||
info.resDoctorName = item.resDoctorName;
|
||||
info.resDoctorCode = item.resDoctorCode;
|
||||
info.nation = item.nation;
|
||||
info.patientCode = item.patientCode;
|
||||
info.visitType = item.visitType;
|
||||
info.jianchamingcheng = projectsInfo.jianchamingcheng;
|
||||
info.nhbm = projectsInfo.nhbm;
|
||||
info.category = projectsInfo.category;
|
||||
hisInfos.Add(info);
|
||||
}
|
||||
//存放绑定界面的患者数据 一个患者有多个检查 按照检查拆分 一个检查一条数据
|
||||
List<HisInfo> hisInfos = new List<HisInfo>();
|
||||
//获取福乐云HIS接口的token
|
||||
string hisToken = getHisToken(ConfigurationManager.AppSettings["hisGetTokenUrl"], ConfigurationManager.AppSettings["hisAppkey"], ConfigurationManager.AppSettings["appsecret"]);
|
||||
|
||||
//获取当天的患者信息
|
||||
FlyHisEcgDataModel FHEDM = GetHisEcgData(ConfigurationManager.AppSettings["hisGetDataUrl"], ConfigurationManager.AppSettings["inHisCode"], DateTime.Now.ToString("yyyy-MM-dd"), hisToken);//
|
||||
if (FHEDM != null)
|
||||
{
|
||||
foreach (patientInfo item in FHEDM.rows)
|
||||
{
|
||||
foreach (projectsInfo projectsInfo in item.projects)
|
||||
{
|
||||
if (projectsInfo.category == "US")
|
||||
{
|
||||
HisInfo info = new HisInfo();
|
||||
info.jianchaid = item.jianchaid;
|
||||
info.name = item.name;
|
||||
info.jianchabh = item.jianchabh;
|
||||
info.sfz = item.sfz;
|
||||
info.birthdate = item.birthdate;
|
||||
info.age = item.age;
|
||||
info.sex = item.sex;
|
||||
info.yiyuanname = item.yiyuanname;
|
||||
info.yiyuanid = item.yiyuanid;
|
||||
info.yiyuancode = item.yiyuancode;
|
||||
info.kaifangsj = item.kaifangsj;
|
||||
info.departmentCode = item.departmentCode;
|
||||
info.departmentName = item.departmentName;
|
||||
info.resDoctorName = item.resDoctorName;
|
||||
info.resDoctorCode = item.resDoctorCode;
|
||||
info.nation = item.nation;
|
||||
info.patientCode = item.patientCode;
|
||||
info.visitType = item.visitType;
|
||||
info.jianchamingcheng = projectsInfo.jianchamingcheng;
|
||||
info.nhbm = projectsInfo.nhbm;
|
||||
info.category = projectsInfo.category;
|
||||
hisInfos.Add(info);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
dGVPatient.DataSource = hisInfos;
|
||||
rowhisinfo = null;
|
||||
}
|
||||
dGVPatient.DataSource = hisInfos;
|
||||
rowhisinfo = null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show("获取接口数据失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -791,6 +895,8 @@ namespace videoGather
|
||||
/// <returns></returns>
|
||||
public string PostFile3(string url, Dictionary<string, object> items)
|
||||
{
|
||||
// 忽略证书验证
|
||||
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;
|
||||
string boundary = DateTime.Now.Ticks.ToString("x");
|
||||
HttpWebRequest request = null;
|
||||
//如果是发送HTTPS请求
|
||||
@ -1221,11 +1327,11 @@ namespace videoGather
|
||||
{
|
||||
string keyString = key.ToString();
|
||||
// MessageBox.Show(keyString);
|
||||
|
||||
if (keyString == strkey)
|
||||
{
|
||||
SaveImageDcm();
|
||||
}
|
||||
//不是病理的 暂时不需要先注释了
|
||||
//if (keyString == strkey)
|
||||
//{
|
||||
// SaveImageDcm();
|
||||
//}
|
||||
switch (keyString)
|
||||
{
|
||||
case "F6":
|
||||
@ -1513,10 +1619,11 @@ namespace videoGather
|
||||
List<ExamRecord> Record = new List<ExamRecord>();
|
||||
|
||||
ExamRecord examRecord = new ExamRecord();
|
||||
examRecord.examId = rowhisinfo.jianchabh + "_" + GetRandomNumber(1, 100);
|
||||
examRecord.examId = _isInspect == "1" ? rowhisinfo.jianchabh : rowhisinfo.jianchabh + "_" + GetRandomNumber(1, 100);
|
||||
examRecord.sfz = rowhisinfo.sfz;
|
||||
examRecord.pname = rowhisinfo.name;
|
||||
examRecord.gender = rowhisinfo.sex;
|
||||
examRecord.birthday = GetTimestampFromBirthdate(rowhisinfo.birthdate).ToString();
|
||||
examRecord.birthday = GetTimestampFromBirthdate(rowhisinfo.birthdate).ToString();
|
||||
examRecord.deviceType = "US";//rowhisinfo.category
|
||||
examRecord.deviceName = "彩超";
|
||||
examRecord.seDc = "1/1";
|
||||
@ -1578,7 +1685,7 @@ namespace videoGather
|
||||
// 将指定的出生日期转换为Unix时间戳(毫秒)
|
||||
public static long GetTimestampFromBirthdate(string birthdate)
|
||||
{
|
||||
|
||||
|
||||
// 尝试解析日期字符串
|
||||
DateTime birthDateTime;
|
||||
if (DateTime.TryParseExact(birthdate, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out birthDateTime))
|
||||
@ -1597,17 +1704,17 @@ namespace videoGather
|
||||
}
|
||||
|
||||
public static long GetTimestampFromdate(string birthdate)
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
// 尝试解析日期字符串
|
||||
DateTime birthDateTime;
|
||||
if (DateTime.TryParseExact(birthdate, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.None, out birthDateTime))
|
||||
{
|
||||
|
||||
|
||||
// 将本地时间转换为UTC时间
|
||||
DateTime birthDateTimeUtc = birthDateTime.ToUniversalTime();
|
||||
// 计算时间戳
|
||||
return (long)birthDateTimeUtc.Subtract(new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds;
|
||||
return (long)birthDateTimeUtc.Subtract(new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1723,12 +1830,76 @@ namespace videoGather
|
||||
if (infoForm.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
//先赋空再绑定
|
||||
dGVPatient.DataSource=null;
|
||||
dGVPatient.DataSource = null;
|
||||
hisInfos.Add(infoForm.info);
|
||||
dGVPatient.DataSource = hisInfos;
|
||||
rowhisinfo = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void textBox1_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(textBox1.Text.Trim()))
|
||||
{
|
||||
MessageBox.Show("请输入体检编号");
|
||||
textBox1.Text = "";
|
||||
return;
|
||||
}
|
||||
string result = Get(_InspectUrl + "/admin-api/inspect/patient/getUSPatientInfo?medicalSn=" + textBox1.Text.Trim() + "");
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
{
|
||||
RootObject msgInfo = JsonConvert.DeserializeObject<RootObject>(result);
|
||||
if (msgInfo != null)
|
||||
{
|
||||
if (msgInfo.data != null)
|
||||
{
|
||||
HisInfo info = new HisInfo();
|
||||
info.jianchaid = msgInfo.data.jianchaid;
|
||||
info.name = msgInfo.data.name;
|
||||
info.jianchabh = msgInfo.data.jianchabh;
|
||||
info.birthdate = msgInfo.data.birthdate;
|
||||
info.age = string.IsNullOrEmpty(msgInfo.data.age) ? 0 : int.Parse(msgInfo.data.age);
|
||||
info.sex = msgInfo.data.sex;
|
||||
info.yiyuanname = ConfigurationManager.AppSettings["yymc"];
|
||||
info.yiyuancode = ConfigurationManager.AppSettings["yycode"];
|
||||
info.kaifangsj = msgInfo.data.kaifangsj;
|
||||
info.jianchamingcheng = msgInfo.data.examItemName;
|
||||
info.nhbm = msgInfo.data.examItemCode;
|
||||
|
||||
//先赋空再绑定
|
||||
dGVPatient.DataSource = null;
|
||||
hisInfos.Add(info);
|
||||
dGVPatient.DataSource = hisInfos;
|
||||
textBox1.Text = "";
|
||||
rowhisinfo = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("未找到该患者信息");
|
||||
textBox1.Text = "";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("未找到该患者信息");
|
||||
textBox1.Text = "";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
textBox1.Text = "";
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -46,6 +46,7 @@
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
@ -126,6 +127,7 @@
|
||||
<Compile Include="ProcessForm.Designer.cs">
|
||||
<DependentUpon>ProcessForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RootObject.cs" />
|
||||
<Compile Include="SaveFile.cs" />
|
||||
<Compile Include="Series.cs" />
|
||||
<Compile Include="StudyInfo.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user